0000502: Help -> "Python Manuals" displays missing file dialog(windows) / does nothing(ubuntu)

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5333 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer 2011-12-21 15:24:19 +00:00
parent 7f41cb84d5
commit aab04bd85e
4 changed files with 1 additions and 40 deletions

View File

@ -440,42 +440,6 @@ void StdCmdOnlineHelp::activated(int iMsg)
Gui::getMainWindow()->showDocumentation();
}
//===========================================================================
// Std_OnlineHelpPython
//===========================================================================
DEF_STD_CMD(StdCmdOnlineHelpPython);
StdCmdOnlineHelpPython::StdCmdOnlineHelpPython()
:Command("Std_OnlineHelpPython")
{
sGroup = QT_TR_NOOP("Help");
sMenuText = QT_TR_NOOP("Python Manuals");
sToolTipText = QT_TR_NOOP("Show the Python documentation");
sWhatsThis = "Std_OnlineHelpPython";
sStatusTip = QT_TR_NOOP("Show the Python documentation");
sPixmap = "python";
eType = 0;
}
void StdCmdOnlineHelpPython::activated(int iMsg)
{
std::string url = App::Application::getHelpDir() + "Python25.chm";
#if QT_VERSION >= 0x040200
bool ok = QDesktopServices::openUrl(QString::fromUtf8(url.c_str()));
#elif defined(Q_WS_WIN)
std::wstring wstr = Base::FileInfo(url).toStdWString();
bool ok = (reinterpret_cast<int>(ShellExecuteW(NULL, NULL, wstr.c_str(), NULL,
NULL, SW_SHOWNORMAL)) > 32);
#else
#endif
if (!ok) {
QMessageBox::critical(getMainWindow(), QObject::tr("File not found"),
QObject::tr("Cannot open file %1").arg(QString::fromUtf8(url.c_str())));
}
}
//===========================================================================
// Std_OnlineHelpWebsite
//===========================================================================
@ -619,7 +583,6 @@ void CreateStdCommands(void)
rcCmdMgr.addCommand(new StdCmdWhatsThis());
rcCmdMgr.addCommand(new StdCmdPythonHelp());
rcCmdMgr.addCommand(new StdCmdOnlineHelp());
rcCmdMgr.addCommand(new StdCmdOnlineHelpPython());
rcCmdMgr.addCommand(new StdCmdOnlineHelpWebsite());
rcCmdMgr.addCommand(new StdCmdFreeCADWebsite());
rcCmdMgr.addCommand(new StdCmdPythonWebsite());

View File

@ -513,7 +513,7 @@ MenuItem* StdWorkbench::setupMenuBar() const
MenuItem* help = new MenuItem( menuBar );
help->setCommand("&Help");
*help << "Std_OnlineHelp" << "Std_OnlineHelpPython" << "Std_PythonHelp"
*help << "Std_OnlineHelp" << "Std_PythonHelp"
<< helpWebsites << "Separator" << "Std_About"
<< "Std_AboutQt" << "Separator" << "Std_WhatsThis";

View File

@ -398,7 +398,6 @@ Gui::MenuItem* Workbench::setupMenuBar() const
Gui::MenuItem* help = new Gui::MenuItem( menuBar );
help->setCommand("&Help");
*help << "Std_OnlineHelp"
<< "Std_OnlineHelpPython"
<< "Std_PythonHelp"
<< helpWebsites
<< "Separator"

View File

@ -303,7 +303,6 @@ Gui::MenuItem* Workbench::setupMenuBar() const
// Gui::MenuItem* help = new Gui::MenuItem( menuBar );
// help->setCommand("&Help");
// *help << "Std_OnlineHelp"
// << "Std_OnlineHelpPython"
// << "Std_PythonHelp"
// << helpWebsites
// << "Separator"