Commit c7d015d0 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[ADD] - added project load shortcut.

parent 83975c12
......@@ -215,12 +215,14 @@ void WMainWindow::setupGUI()
m_iconManager.addIcon( std::string( "coronal icon" ), cor_xpm );
m_iconManager.addIcon( std::string( "sagittal icon" ), sag_xpm );
m_loadButton = new QAction( m_iconManager.getIcon( "load" ), "Load", m_permanentToolBar );
m_loadButton = new QAction( m_iconManager.getIcon( "load" ), "Load Dataset", m_permanentToolBar );
m_loadButton->setShortcut( QKeySequence( QKeySequence::Open ) );
QAction* roiButton = new QAction( m_iconManager.getIcon( "ROI icon" ), "ROI", m_permanentToolBar );
QAction* resetButton = new QAction( m_iconManager.getIcon( "view" ), "Reset", m_permanentToolBar );
resetButton->setShortcut( QKeySequence( Qt::Key_Escape ) );
QAction* projectLoadButton = new QAction( m_iconManager.getIcon( "loadProject" ), "Load Project", m_permanentToolBar );
QAction* projectSaveButton = new QAction( m_iconManager.getIcon( "saveProject" ), "Save Project", m_permanentToolBar );
projectLoadButton->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_O ) );
connect( m_loadButton, SIGNAL( triggered( bool ) ), this, SLOT( openLoadDialog() ) );
connect( resetButton, SIGNAL( triggered( bool ) ), m_mainGLWidget.get(), SLOT( reset() ) );
......@@ -251,9 +253,9 @@ void WMainWindow::setupGUI()
QMenu* fileMenu = m_menuBar->addMenu( "File" );
fileMenu->addAction( m_iconManager.getIcon( "load" ), "Load Dataset", this, SLOT( openLoadDialog() ), QKeySequence( QKeySequence::Open ) );
fileMenu->addAction( m_loadButton );
fileMenu->addSeparator();
fileMenu->addAction( m_iconManager.getIcon( "loadProject" ), "Load Project", this, SLOT( projectLoad() ) );
fileMenu->addAction( projectLoadButton );
QMenu* saveMenu = fileMenu->addMenu( m_iconManager.getIcon( "saveProject" ), "Save Project" );
saveMenu->addAction( "Save Project", this, SLOT( projectSaveAll() ), QKeySequence::Save );
saveMenu->addAction( "Save Modules Only", this, SLOT( projectSaveModuleOnly() ) );
......@@ -261,9 +263,7 @@ void WMainWindow::setupGUI()
saveMenu->addAction( "Save ROIs Only", this, SLOT( projectSaveROIOnly() ) );
projectSaveButton->setMenu( saveMenu );
// TODO(all): If all distributions provide a newer QT version we should use QKeySequence::Quit here
//fileMenu->addAction( m_iconManager.getIcon( "quit" ), "Quit", this, SLOT( close() ), QKeySequence( QKeySequence::Quit ) );
fileMenu->addAction( m_iconManager.getIcon( "quit" ), "Quit", this, SLOT( close() ), QKeySequence( Qt::CTRL + Qt::Key_Q ) );
fileMenu->addAction( m_iconManager.getIcon( "quit" ), "Quit", this, SLOT( close() ), QKeySequence( QKeySequence::Quit ) );
// This QAction stuff is quite ugly and complicated some times ... There is no nice constructor which takes name, slot keysequence and so on
// directly -> set shortcuts, and some further properties using QAction's interface
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment