@@ -133,15 +133,27 @@ MainWindow::MainWindow()
133133 : m_settings(QString::fromLatin1(" Doxygen.org" ), QString::fromLatin1(" Doxywizard" ))
134134{
135135 QMenu *file = menuBar ()->addMenu (tr (" File" ));
136- file->addAction (tr (" Open..." ),
137- this , SLOT (openConfig ()), QKeySequence{ Qt::CTRL | Qt::Key_O });
136+ {
137+ QAction *a = file->addAction (tr (" Open..." ));
138+ a->setShortcut (QKeySequence{ Qt::CTRL | Qt::Key_O });
139+ connect (a, SIGNAL (triggered ()), this , SLOT (openConfig ()));
140+ }
138141 m_recentMenu = file->addMenu (tr (" Open recent" ));
139- file->addAction (tr (" Save" ),
140- this , SLOT (saveConfig ()), QKeySequence{ Qt::CTRL | Qt::Key_S });
141- file->addAction (tr (" Save as..." ),
142- this , SLOT (saveConfigAs ()), QKeySequence{ Qt::SHIFT | Qt::CTRL | Qt::Key_S });
143- file->addAction (tr (" Quit" ),
144- this , SLOT (quit ()), QKeySequence{ Qt::CTRL | Qt::Key_Q });
142+ {
143+ QAction *a = file->addAction (tr (" Save" ));
144+ a->setShortcut (QKeySequence{ Qt::CTRL | Qt::Key_S });
145+ connect (a, SIGNAL (triggered ()), this , SLOT (saveConfig ()));
146+ }
147+ {
148+ QAction *a = file->addAction (tr (" Save as..." ));
149+ a->setShortcut (QKeySequence{ Qt::SHIFT | Qt::CTRL | Qt::Key_S });
150+ connect (a, SIGNAL (triggered ()), this , SLOT (saveConfigAs ()));
151+ }
152+ {
153+ QAction *a = file->addAction (tr (" Quit" ));
154+ a->setShortcut (QKeySequence{ Qt::CTRL | Qt::Key_Q });
155+ connect (a, SIGNAL (triggered ()), this , SLOT (quit ()));
156+ }
145157
146158 QMenu *settings = menuBar ()->addMenu (tr (" Settings" ));
147159 m_resetDefault = settings->addAction (tr (" Reset to factory defaults" ),
@@ -158,13 +170,17 @@ MainWindow::MainWindow()
158170 m_clearRecent = settings->addAction (tr (" Clear recent list" ),
159171 this ,SLOT (clearRecent ()));
160172 settings->addSeparator ();
161- m_runMenu = settings->addAction (tr (" Run doxygen" ),
162- this , SLOT (runDoxygenMenu ()), QKeySequence{ Qt::CTRL | Qt::Key_R });
173+ m_runMenu = settings->addAction (tr (" Run doxygen" ));
174+ m_runMenu->setShortcut (QKeySequence{ Qt::CTRL | Qt::Key_R });
175+ connect (m_runMenu, SIGNAL (triggered ()), this , SLOT (runDoxygenMenu ()));
163176 m_runMenu->setEnabled (false );
164177
165178 QMenu *help = menuBar ()->addMenu (tr (" Help" ));
166- help->addAction (tr (" Online manual" ),
167- this , SLOT (manual ()), Qt::Key_F1);
179+ {
180+ QAction *a = help->addAction (tr (" Online manual" ));
181+ a->setShortcut (Qt::Key_F1);
182+ connect (a, SIGNAL (triggered ()), this , SLOT (manual ()));
183+ }
168184 help->addAction (tr (" About" ),
169185 this , SLOT (about ()) );
170186
@@ -652,7 +668,7 @@ void MainWindow::runDoxygen()
652668 if (!m_running)
653669 {
654670 QString doxygenPath;
655- #if defined(Q_OS_MACX )
671+ #if defined(Q_OS_MACOS )
656672 doxygenPath = qApp->applicationDirPath ()+QString::fromLatin1 (" /../Resources/" );
657673 qDebug () << " Doxygen path: " << doxygenPath;
658674 if ( !QFile (doxygenPath + QString::fromLatin1 (" doxygen" )).exists () )
0 commit comments