Commit 809c2ad3 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[FIX] now the uppermost element of the module tree should be selected even

if we need the datasetbrowser to exist for the permanent toolbar
parent 1a9f60ae
......@@ -98,7 +98,6 @@ void WMainWindow::setupGUI()
setWindowIcon( m_iconManager.getIcon( "logo" ) );
setWindowTitle( QApplication::translate( "MainWindow", "OpenWalnut (development version)", 0, QApplication::UnicodeUTF8 ) );
setupPermanentToolBar();
// the dataset browser instance is needed for the menu
m_datasetBrowser = new WQtDatasetBrowser( this );
......@@ -106,6 +105,12 @@ void WMainWindow::setupGUI()
addDockWidget( Qt::RightDockWidgetArea, m_datasetBrowser );
m_datasetBrowser->addSubject( "Default Subject" );
setupPermanentToolBar();
// we want the upper most tree item to be selected. This helps to make the always compatible modules
// show up in the tool bar from the beginning. And ... it doesn't hurt.
m_datasetBrowser->selectUpperMostEntry();
// set the size of the dsb according to config file
int dsbWidth = 250;
if( WPreferences::getPreference( "qt4gui.dsbWidth", &dsbWidth ) )
......
......@@ -149,10 +149,6 @@ WQtDatasetBrowser::WQtDatasetBrowser( WMainWindow* parent )
QShortcut* shortcut = new QShortcut( QKeySequence( Qt::Key_Delete ), m_roiTreeWidget );
connect( shortcut, SIGNAL( activated() ), this, SLOT( deleteROITreeItem() ) );
// we want the upper most tree item to be selected. This helps to make the always compatible modules
// show up in the tool bar from the beginning. And ... it doesn't hurt.
m_tiModules->setSelected( true );
}
WQtDatasetBrowser::~WQtDatasetBrowser()
......@@ -1032,3 +1028,8 @@ void WQtDatasetBrowser::deleteROITreeItem()
}
WKernel::getRunningKernel()->getRoiManager()->setSelectedRoi( getFirstRoiInSelectedBranch() );
}
void WQtDatasetBrowser::selectUpperMostEntry()
{
m_tiModules->setSelected( true );
}
......@@ -162,6 +162,11 @@ public:
*/
void addToolbar( QToolBar* tb );
/**
* Selects the uppermost entry in the module tree.
*/
void selectUpperMostEntry();
protected:
/**
......
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