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:
parent
7f41cb84d5
commit
aab04bd85e
|
@ -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());
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user