From e48aae7870d2dda567f98f9b8cc9192c24cb73c5 Mon Sep 17 00:00:00 2001 From: dankers Date: Wed, 14 Jul 2010 20:09:09 +0000 Subject: [PATCH] Add help to the help menu, does the same action as about plugins currently as a place holder. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1098 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/coreplugin/core.qrc | 1 + ground/src/plugins/coreplugin/coreconstants.h | 2 + .../coreplugin/images/openpiloticon.png | Bin 0 -> 510 bytes ground/src/plugins/coreplugin/mainwindow.cpp | 51 +++++++++++------- 4 files changed, 36 insertions(+), 18 deletions(-) create mode 100644 ground/src/plugins/coreplugin/images/openpiloticon.png diff --git a/ground/src/plugins/coreplugin/core.qrc b/ground/src/plugins/coreplugin/core.qrc index 648e2d541..bafb22e05 100644 --- a/ground/src/plugins/coreplugin/core.qrc +++ b/ground/src/plugins/coreplugin/core.qrc @@ -48,5 +48,6 @@ images/exiticon.png images/optionsicon.png images/helpicon.png + images/openpiloticon.png diff --git a/ground/src/plugins/coreplugin/coreconstants.h b/ground/src/plugins/coreplugin/coreconstants.h index 1ee0d19d4..665b79dbf 100644 --- a/ground/src/plugins/coreplugin/coreconstants.h +++ b/ground/src/plugins/coreplugin/coreconstants.h @@ -216,6 +216,8 @@ const char * const ICON_INFO = ":/core/images/infoicon.png"; const char * const ICON_EXIT = ":/core/images/exiticon.png"; const char * const ICON_OPTIONS = ":/core/images/optionsicon.png"; const char * const ICON_HELP = ":/core/images/helpicon.png"; +const char * const ICON_OPENPILOT = ":/core/images/openpiloticon.png"; + // wizard kind const char * const WIZARD_TYPE_FILE = "GCS::WizardType::File"; diff --git a/ground/src/plugins/coreplugin/images/openpiloticon.png b/ground/src/plugins/coreplugin/images/openpiloticon.png new file mode 100644 index 0000000000000000000000000000000000000000..44e57839ab2f147e9b40ffc1edc0b3ea193f84c7 GIT binary patch literal 510 zcmVFGbG97on=s|Ifg{j7^?{mEq&$2zEV220WmA?e_!MpZ~YVB`?g) z@DQ&78!!CIoqOcZBwX@3QcU~s8u04VU#XNuKOZyTh>2h$=61XWfI!LW??-RF{BMOW z4otmwlB`(@2^z5e+|R=K$Nu&qi?J~?d|95#F2Ksd{Fk5s&p-T;OJDNqKC(A7Bp45O zg>c$|*aQs#fufb)Pu_X`-wek0)no2UwPP$_fgivAvLCzqFL>v*KU{f^tox;fSnh(v0Y6c!7W5y{x&QzG07*qoM6N<$f|5V@ AQ2+n{ literal 0 HcmV?d00001 diff --git a/ground/src/plugins/coreplugin/mainwindow.cpp b/ground/src/plugins/coreplugin/mainwindow.cpp index 337e3ab6c..18b66dea6 100644 --- a/ground/src/plugins/coreplugin/mainwindow.cpp +++ b/ground/src/plugins/coreplugin/mainwindow.cpp @@ -472,6 +472,9 @@ void MainWindow::registerDefaultActions() cmd = createSeparator(am, this, QLatin1String("QtCreator.Tools.Sep.Options"), m_globalContext); mtools->addAction(cmd, Constants::G_DEFAULT_THREE); + // Help menu separators + + // Return to editor shortcut: Note this requires Qt to fix up // handling of shortcut overrides in menus, item views, combos.... m_focusToEditor = new QShortcut(this); @@ -623,24 +626,10 @@ void MainWindow::registerDefaultActions() connect(m_toggleFullScreenAction, SIGNAL(triggered(bool)), this, SLOT(setFullScreen(bool))); #endif - // About GCS Action -#ifdef Q_WS_MAC - tmpaction = new QAction(QIcon(Constants::ICON_INFO), tr("About &OpenPilot GCS"), this); // it's convention not to add dots to the about menu -#else - tmpaction = new QAction(QIcon(Constants::ICON_INFO), tr("About &OpenPilot GCS..."), this); -#endif - cmd = am->registerAction(tmpaction, Constants::ABOUT_OPENPILOTGCS, m_globalContext); - mhelp->addAction(cmd, Constants::G_HELP_ABOUT); - tmpaction->setEnabled(true); -#ifdef Q_WS_MAC - cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); -#endif - connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutOpenPilogGCS())); - - //About Plugins Action - tmpaction = new QAction(QIcon(Constants::ICON_INFO), tr("About &Plugins..."), this); - cmd = am->registerAction(tmpaction, Constants::ABOUT_PLUGINS, m_globalContext); - mhelp->addAction(cmd, Constants::G_HELP_ABOUT); + //Help Action + tmpaction = new QAction(QIcon(Constants::ICON_HELP), tr("&Help..."), this); + cmd = am->registerAction(tmpaction, Constants::G_HELP_HELP, m_globalContext); + mhelp->addAction(cmd, Constants::G_HELP_HELP); tmpaction->setEnabled(true); #ifdef Q_WS_MAC cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); @@ -654,6 +643,32 @@ void MainWindow::registerDefaultActions() cmd = am->registerAction(tmpaction, QLatin1String("QtCreator.Help.Sep.About"), m_globalContext); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); #endif + + //About Plugins Action + tmpaction = new QAction(QIcon(Constants::ICON_INFO), tr("About &Plugins..."), this); + cmd = am->registerAction(tmpaction, Constants::ABOUT_PLUGINS, m_globalContext); + mhelp->addAction(cmd, Constants::G_HELP_ABOUT); + tmpaction->setEnabled(true); +#ifdef Q_WS_MAC + cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); +#endif + connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutPlugins())); + + // About GCS Action +#ifdef Q_WS_MAC + tmpaction = new QAction(QIcon(Constants::ICON_OPENPILOT), tr("About &OpenPilot GCS"), this); // it's convention not to add dots to the about menu +#else + tmpaction = new QAction(QIcon(Constants::ICON_OPENPILOT), tr("About &OpenPilot GCS..."), this); +#endif + cmd = am->registerAction(tmpaction, Constants::ABOUT_OPENPILOTGCS, m_globalContext); + mhelp->addAction(cmd, Constants::G_HELP_ABOUT); + tmpaction->setEnabled(true); +#ifdef Q_WS_MAC + cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); +#endif + connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutOpenPilogGCS())); + + } void MainWindow::newFile()