Skip to content

Commit

Permalink
Some minor cleaning up with regards to menu actions to be added to Op…
Browse files Browse the repository at this point in the history
…enCOR (#1311).
  • Loading branch information
agarny committed Oct 16, 2017
1 parent 0df24e3 commit fdcd0d4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
13 changes: 4 additions & 9 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,15 +509,10 @@ void MainWindow::initializeGuiPlugin(Plugin *pPlugin)
menu = mGui->menuTools;

if (menu) {
QAction *beforeAction = (menu == mGui->menuTools)?
menu->actions()[2]:
menu->actions().first();
QAction *action = guiMenuActions[i].action();

if (action)
menu->insertAction(beforeAction, action);
else
menu->insertSeparator(beforeAction);
menu->insertAction((menu == mGui->menuTools)?
menu->actions()[2]:
menu->actions().first(),
guiMenuActions[i].action());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/guiinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class MenuAction
Tools
};

explicit MenuAction(const Type &pType, QAction *pAction = 0);
explicit MenuAction(const Type &pType, QAction *pAction);

Type type() const;
QAction * action() const;
Expand Down
12 changes: 6 additions & 6 deletions src/plugins/miscellaneous/Core/src/coreplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,21 +256,21 @@ Gui::MenuActions CorePlugin::guiMenuActions() const
<< Gui::MenuAction(Gui::MenuAction::File, mFileOpenRemoteAction)
<< Gui::MenuAction(Gui::MenuAction::File, mFileOpenReloadSeparator)
<< Gui::MenuAction(Gui::MenuAction::File, mFileReloadAction)
<< Gui::MenuAction(Gui::MenuAction::File)
<< Gui::MenuAction(Gui::MenuAction::File, Core::newSeparator(Core::mainWindow()))
<< Gui::MenuAction(Gui::MenuAction::File, mFileDuplicateAction)
<< Gui::MenuAction(Gui::MenuAction::File)
<< Gui::MenuAction(Gui::MenuAction::File, Core::newSeparator(Core::mainWindow()))
<< Gui::MenuAction(Gui::MenuAction::File, mFileLockedAction)
<< Gui::MenuAction(Gui::MenuAction::File)
<< Gui::MenuAction(Gui::MenuAction::File, Core::newSeparator(Core::mainWindow()))
<< Gui::MenuAction(Gui::MenuAction::File, mFileSaveAction)
<< Gui::MenuAction(Gui::MenuAction::File, mFileSaveAsAction)
<< Gui::MenuAction(Gui::MenuAction::File, mFileSaveAllAction)
<< Gui::MenuAction(Gui::MenuAction::File)
<< Gui::MenuAction(Gui::MenuAction::File, Core::newSeparator(Core::mainWindow()))
<< Gui::MenuAction(Gui::MenuAction::File, mFilePreviousAction)
<< Gui::MenuAction(Gui::MenuAction::File, mFileNextAction)
<< Gui::MenuAction(Gui::MenuAction::File)
<< Gui::MenuAction(Gui::MenuAction::File, Core::newSeparator(Core::mainWindow()))
<< Gui::MenuAction(Gui::MenuAction::File, mFileCloseAction)
<< Gui::MenuAction(Gui::MenuAction::File, mFileCloseAllAction)
<< Gui::MenuAction(Gui::MenuAction::File);
<< Gui::MenuAction(Gui::MenuAction::File, Core::newSeparator(Core::mainWindow()));
}

//==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tools/CellMLTools/src/cellmltoolsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Gui::MenuActions CellMLToolsPlugin::guiMenuActions() const
// Return our menu actions

return Gui::MenuActions() << Gui::MenuAction(Gui::MenuAction::Tools, mCellmlFileExportToMenu->menuAction())
<< Gui::MenuAction(Gui::MenuAction::Tools);
<< Gui::MenuAction(Gui::MenuAction::Tools, Core::newSeparator(Core::mainWindow()));
}

//==============================================================================
Expand Down

0 comments on commit fdcd0d4

Please sign in to comment.