diff --git a/BasePlugin/ViewModeInterface.hh b/BasePlugin/ViewModeInterface.hh index 562ffc20c7d444fa6cc3dcb4ae4003635a3fac22..0187eafa06da6b9840c1850a5b5185a0e0f2d103 100644 --- a/BasePlugin/ViewModeInterface.hh +++ b/BasePlugin/ViewModeInterface.hh @@ -98,6 +98,15 @@ class ViewModeInterface { * @param _usedWidgets list of used toolbars */ virtual void defineViewModeToolbars(QString /*_mode*/, QStringList /*_usedToolbars*/){}; + + /** \brief Defines an Icon for a ViewMode + * + * With this function you can define an Icon associated with this view mode + * + * @param _mode name of the ViewMode + * @param _iconName Name of the Icon used for this view mode + */ + virtual void defineViewModeIcon(QString /*_mode*/, QString /*_iconName*/){}; }; diff --git a/Core/PluginInfo.hh b/Core/PluginInfo.hh index b700f8dab7817599781b1b88adf9f086232c6881..aaef541649d34e56ba7574747718afae34cd2c36 100644 --- a/Core/PluginInfo.hh +++ b/Core/PluginInfo.hh @@ -81,7 +81,8 @@ class PluginInfo{ rpcFunctions.clear(); slotInfos.clear(); keys.clear(); - widgets.clear(); + toolboxWidgets.clear(); + toolbars.clear(); optionsWidget = 0; } @@ -97,7 +98,8 @@ class PluginInfo{ rpcFunctions = _i.rpcFunctions; slotInfos = _i.slotInfos; keys = _i.keys; - widgets = _i.widgets; + toolboxWidgets = _i.toolboxWidgets; + toolbars = _i.toolbars; optionsWidget = _i.optionsWidget; } @@ -128,8 +130,11 @@ class PluginInfo{ /// List of registered keys with description QList< KeyBinding > keys; - /// Pointer to plugins toolbar widget (if available) - std::vector< std::pair< QString , QWidget* > > widgets; + /// Pointer to plugins toolbox widget (if available) + std::vector< std::pair< QString , QWidget* > > toolboxWidgets; + + /// Pointer to plugins toolbox widget (if available) + std::vector< std::pair< QString , QToolBar* > > toolbars; /// Pointer to plugins options widget (if available) QWidget* optionsWidget; diff --git a/Core/PluginLoader.cc b/Core/PluginLoader.cc index 317f27c8b6819ebda245564ca699412b1bd7e403..673622ab1251efa4b7e52fc3c6b81722a75db9c5 100644 --- a/Core/PluginLoader.cc +++ b/Core/PluginLoader.cc @@ -312,10 +312,10 @@ void Core::unloadPlugin(QString name){ name_nospace.remove(" "); if ( coreWidget_->viewModes_[0]->visibleToolboxes.contains(name_nospace) ) coreWidget_->viewModes_[0]->visibleToolboxes.removeAt(coreWidget_->viewModes_[0]->visibleToolboxes.indexOf(name_nospace)); - for ( uint j = 0 ; j < plugins[i].widgets.size() ; ++j ) - if (plugins[i].widgets[j].second ){ - plugins[i].widgets[j].second->setVisible(false); - delete plugins[i].widgets[j].second; + for ( uint j = 0 ; j < plugins[i].toolboxWidgets.size() ; ++j ) + if (plugins[i].toolboxWidgets[j].second ){ + plugins[i].toolboxWidgets[j].second->setVisible(false); + delete plugins[i].toolboxWidgets[j].second; } plugins.erase(plugins.begin() + i); @@ -595,12 +595,12 @@ void Core::loadPlugin(QString filename, bool silent){ QWidget* widget = 0; if ( toolboxPlugin->initializeToolbox( widget ) ) { - info.widgets.push_back( std::pair< QString,QWidget* >( info.name , widget) ); + info.toolboxWidgets.push_back( std::pair< QString,QWidget* >( info.name , widget) ); // add widget name to viewMode 'all' if ( !viewModes_[0]->visibleToolboxes.contains(info.name) ){ - viewModes_[0]->visibleToolboxes << info.name; - viewModes_[0]->visibleToolboxes.sort(); + viewModes_[0]->visibleToolboxes << info.name; + viewModes_[0]->visibleToolboxes.sort(); } } @@ -625,6 +625,10 @@ void Core::loadPlugin(QString filename, bool silent){ connect(plugin, SIGNAL( defineViewModeToolbars(QString, QStringList) ), coreWidget_, SLOT( slotAddViewModeToolbars(QString, QStringList) ),Qt::DirectConnection ); + if ( checkSignal(plugin, "defineViewModeIcon(QString,QString)")) + connect(plugin, SIGNAL( defineViewModeIcon(QString, QString) ), + coreWidget_, SLOT( slotSetViewModeIcon(QString, QString) ),Qt::DirectConnection ); + } //Check if the plugin supports Options-Interface @@ -658,6 +662,7 @@ void Core::loadPlugin(QString filename, bool silent){ if ( checkSignal(plugin,"getToolBar(QString,QToolBar*&)") ) connect(plugin,SIGNAL(getToolBar(QString,QToolBar*&)), coreWidget_,SLOT(getToolBar(QString,QToolBar*&)),Qt::DirectConnection); + } //Check if the plugin supports StatusBar-Interface diff --git a/Core/optionHandling.cc b/Core/optionHandling.cc index 03a1361a1555f2a01a588036ae4363daccd55333..88642e2c963be92a55f60abc1fc83ff2fa54abff 100644 --- a/Core/optionHandling.cc +++ b/Core/optionHandling.cc @@ -72,12 +72,12 @@ void Core::applyOptions(){ //Set default Viewmode if (OpenFlipper::Options::defaultToolboxMode() != "") - coreWidget_->slotChangeView(OpenFlipper::Options::defaultToolboxMode(), QStringList()); + coreWidget_->slotChangeView(OpenFlipper::Options::defaultToolboxMode(), QStringList(), QStringList()); //Set Fullscreen if ( OpenFlipper::Options::fullScreen() ) coreWidget_->setWindowState( coreWidget_->windowState() | Qt::WindowFullScreen); else - coreWidget_->setWindowState( (coreWidget_->windowState() | Qt::WindowFullScreen) ^ Qt::WindowFullScreen); + coreWidget_->setWindowState( (coreWidget_->windowState() | Qt::WindowFullScreen) ^ Qt::WindowFullScreen); // Logger coreWidget_->showLogger( OpenFlipper::Options::loggerState() ); diff --git a/Core/scripting.cc b/Core/scripting.cc index 1eeaf5bfd3b8f8c2629a3a177e6b44de13e83e9b..5c917902fb2110be7bca896ebebd0a43d0357d4a 100644 --- a/Core/scripting.cc +++ b/Core/scripting.cc @@ -173,7 +173,7 @@ void Core::addToolbox(QString _name ,QWidget* _widget) { } } - plugins[id].widgets.push_back( std::pair< QString,QWidget* >( _name , _widget) ); + plugins[id].toolboxWidgets.push_back( std::pair< QString,QWidget* >( _name , _widget) ); // add widget name to viewMode 'all' if ( !viewModes_[0]->visibleToolboxes.contains(_name) ){ diff --git a/widgets/coreWidget/CoreWidget.hh b/widgets/coreWidget/CoreWidget.hh index dd1503e669562b56cc75dbe6d69b6e62bb2ecb88..da3382f9390e1dda5a3cedbea48e966d97f30e73 100644 --- a/widgets/coreWidget/CoreWidget.hh +++ b/widgets/coreWidget/CoreWidget.hh @@ -106,6 +106,10 @@ struct ViewMode{ /// Name of the View Mode QString name; + /// Icon of the View Mode + /// TODO Specify size for Icons + QString icon; + /// Is this a user defined custom view mode or a plugin generated one bool custom; @@ -404,9 +408,15 @@ public: /// Add or change Toolbars for a ViewMode (_custom == userdefined viewMode) void slotAddViewModeToolbars(QString _mode, bool _custom, QStringList _usedToolbars); + + /// Completly configure a view mode ( set toolbars, toolboxes ... ) + void slotAddViewModeComplete(QString _mode , bool _custom, QStringList _toolboxes, QStringList _toolbars); + + /// Sets the Icon for a given View Mode + void slotSetViewModeIcon(QString _mode, QString _iconName); /// Slot for Changing visible toolWidgets - void slotChangeView(QString _mode, QStringList _toolWidgets); + void slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars); private slots: /// Remove viewMode diff --git a/widgets/coreWidget/CoreWidgetToolbar.cc b/widgets/coreWidget/CoreWidgetToolbar.cc index 5f5531e223873d8506c7c098239eb19e4fa958a6..de004ab43ce08dbc3891e8af5f2f4ab6a523dbd1 100644 --- a/widgets/coreWidget/CoreWidgetToolbar.cc +++ b/widgets/coreWidget/CoreWidgetToolbar.cc @@ -72,6 +72,13 @@ void CoreWidget::slotAddToolbar(QToolBar* _toolbar) { _toolbar->setObjectName( _toolbar->windowTitle() ); toolbars_.push_back( _toolbar ); addToolBar( _toolbar ); + + // add widget name to viewMode 'all' + if ( !viewModes_[0]->visibleToolbars.contains( _toolbar->windowTitle() ) ){ + viewModes_[0]->visibleToolbars << _toolbar->windowTitle(); + viewModes_[0]->visibleToolbars.sort(); + } + } void CoreWidget::getToolBar( QString _name, QToolBar*& _toolbar) { diff --git a/widgets/coreWidget/viewMode.cc b/widgets/coreWidget/viewMode.cc index 44e33f087e2da5f38fac5f63df528c686ca00722..545c6c8054308cf263d3aba4a7a1b5f51a95d59e 100644 --- a/widgets/coreWidget/viewMode.cc +++ b/widgets/coreWidget/viewMode.cc @@ -91,22 +91,40 @@ void CoreWidget::slotAddViewModeToolboxes(QString _mode, QStringList _usedWidget } void CoreWidget::slotAddViewModeToolboxes(QString _mode, bool _custom, QStringList _usedWidgets){ - ViewMode* vm = new ViewMode(); - vm->name = _mode; - vm->custom = _custom; - vm->visibleToolboxes = _usedWidgets; - if (_custom) - viewModes_.push_back(vm); - else{ - //insert before custom viewModes - int i = viewModes_.size(); - for (int k=0; k < viewModes_.size(); k++) - if (viewModes_[k]->custom == true){ - i = k; - break; - } - viewModes_.insert(i,vm); + int id = -1; + + // Check if it already exists + for ( int i = 0 ; i < viewModes_.size(); i++) { + if ( viewModes_[i]->name == _mode ) { + id = i; + break; + } + } + + ViewMode* vm = 0; + if ( id == -1 ) { + vm = new ViewMode(); + vm->name = _mode; + vm->custom = _custom; + + if (_custom) { + viewModes_.push_back(vm); + } else { + //insert before custom viewModes + int i = viewModes_.size(); + for (int k=0; k < viewModes_.size(); k++) + if (viewModes_[k]->custom == true){ + i = k; + break; + } + viewModes_.insert(i,vm); + } + } else { + vm = viewModes_[id]; } + + vm->visibleToolboxes = _usedWidgets; + initViewModes(); } @@ -115,7 +133,46 @@ void CoreWidget::slotAddViewModeToolbars(QString _mode, QStringList _usedToolbar } void CoreWidget::slotAddViewModeToolbars(QString _mode, bool _custom, QStringList _usedToolbars) { - std::cerr << "Todo: Implement Toolbar View Modes" << std::endl; + int id = -1; + + // Check if it already exists + for ( int i = 0 ; i < viewModes_.size(); i++) { + if ( viewModes_[i]->name == _mode ) { + id = i; + break; + } + } + + ViewMode* vm = 0; + if ( id == -1 ) { + vm = new ViewMode(); + vm->name = _mode; + vm->custom = _custom; + + if (_custom) { + viewModes_.push_back(vm); + } else { + //insert before custom viewModes + int i = viewModes_.size(); + for (int k=0; k < viewModes_.size(); k++) + if (viewModes_[k]->custom == true){ + i = k; + break; + } + viewModes_.insert(i,vm); + } + } else { + vm = viewModes_[id]; + } + + vm->visibleToolbars = _usedToolbars; + + initViewModes(); +} + +/// Sets the Icon for a given View Mode +void CoreWidget::slotSetViewModeIcon(QString _mode, QString _iconName) { + std::cerr << "Todo: Implement slotSetViewModeIcon" << std::endl; } /// Remove a viewMode @@ -143,9 +200,13 @@ void CoreWidget::slotSetViewMode( QAction* action){ /// Slot for setting the viewMode from menu void CoreWidget::setViewMode( QString _mode ){ - slotChangeView(_mode, QStringList()); + slotChangeView(_mode, QStringList(), QStringList()); } +void CoreWidget::slotAddViewModeComplete(QString _mode , bool _custom, QStringList _toolboxes, QStringList _toolbars) { + slotAddViewModeToolbars(_mode,_custom,_toolbars); + slotAddViewModeToolboxes(_mode,_custom,_toolboxes); +} /// show dialog for changing ViewMode void CoreWidget::slotViewModeDialog(){ @@ -154,32 +215,36 @@ void CoreWidget::slotViewModeDialog(){ if ( !widget ){ widget = new viewModeWidget(viewModes_); widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() ); - connect(widget, SIGNAL(changeView(QString, QStringList)), this, SLOT(slotChangeView(QString, QStringList)) ); - connect(widget, SIGNAL(saveMode(QString, bool, QStringList)), this, SLOT(slotAddViewModeToolboxes(QString, bool, QStringList)) ); + connect(widget, SIGNAL(changeView(QString, QStringList, QStringList)), this, SLOT(slotChangeView(QString, QStringList, QStringList)) ); + connect(widget, SIGNAL(saveMode(QString, bool, QStringList, QStringList)), this, SLOT(slotAddViewModeComplete(QString, bool, QStringList, QStringList)) ); connect(widget, SIGNAL(removeMode(QString)), this, SLOT(slotRemoveViewMode(QString)) ); } widget->show( OpenFlipper::Options::defaultToolboxMode() ); } /// Slot for Changing visible toolWidgets -void CoreWidget::slotChangeView(QString _mode, QStringList _toolWidgets){ +void CoreWidget::slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars ){ //try to find Widgets if they aren't given - if (_mode != "" && _toolWidgets.size() == 0) + if (_mode != "" && _toolboxWidgets.size() == 0) for (int i=0; i < viewModes_.size(); i++) if (viewModes_[i]->name == _mode) - _toolWidgets = viewModes_[i]->visibleToolboxes; + _toolboxWidgets = viewModes_[i]->visibleToolboxes; // remove all toolbox entries toolBox_->clear (); //find all widgets that should be visible - for (int i=0; i < _toolWidgets.size(); i++) + for (int i=0; i < _toolboxWidgets.size(); i++) for (uint p=0; p < plugins_.size(); p++){ - for ( uint j = 0 ; j < plugins_[p].widgets.size(); ++j ) - if (_toolWidgets[i] == plugins_[p].widgets[j].first ) - toolBox_->addItem (plugins_[p].widgets[j].second, plugins_[p].widgets[j].first); + for ( uint j = 0 ; j < plugins_[p].toolboxWidgets.size(); ++j ) + if (_toolboxWidgets[i] == plugins_[p].toolboxWidgets[j].first ) + toolBox_->addItem (plugins_[p].toolboxWidgets[j].second, plugins_[p].toolboxWidgets[j].first); } + + + + std::cerr << "TODO: Use toolbars from View Mode! " << std::endl; if (_mode != "") OpenFlipper::Options::defaultToolboxMode(_mode); diff --git a/widgets/viewModeWidget/viewMode.ui b/widgets/viewModeWidget/viewMode.ui index 0e4bb1bf1309b6302f0ffa7d79af31747908240e..5a3892845a7c195f29d92169974115007dc3e4df 100644 --- a/widgets/viewModeWidget/viewMode.ui +++ b/widgets/viewModeWidget/viewMode.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>777</width> - <height>600</height> + <width>703</width> + <height>724</height> </rect> </property> <property name="windowTitle"> @@ -49,11 +49,29 @@ </widget> </item> <item> - <widget class="QPushButton" name="removeButton"> - <property name="text"> - <string>Remove Mode</string> - </property> - </widget> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QPushButton" name="removeButton"> + <property name="text"> + <string>Remove Mode</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="copyButton"> + <property name="text"> + <string>Copy Mode</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="addButton"> + <property name="text"> + <string>Add Mode</string> + </property> + </widget> + </item> + </layout> </item> </layout> </widget> @@ -67,64 +85,90 @@ <attribute name="title"> <string>Toolboxes</string> </attribute> - <layout class="QGridLayout" name="gridLayout"> - <item row="1" column="0" colspan="2"> - <layout class="QHBoxLayout" name="_10"> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QPushButton" name="cancelButton"> - <property name="text"> - <string>&Cancel</string> + <widget class="QGroupBox" name="groupBox_3"> + <property name="title"> + <string>Used</string> </property> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <item> + <layout class="QGridLayout" name="_7"> + <item row="0" column="0"> + <widget class="QListWidget" name="toolboxList"> + <property name="showDropIndicator" stdset="0"> + <bool>false</bool> + </property> + <property name="dragDropOverwriteMode"> + <bool>false</bool> + </property> + <property name="dragDropMode"> + <enum>QAbstractItemView::NoDragDrop</enum> + </property> + <property name="selectionMode"> + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + <property name="movement"> + <enum>QListView::Static</enum> + </property> + <property name="sortingEnabled"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="0" column="1"> + <layout class="QVBoxLayout" name="_8"> + <item> + <spacer> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QToolButton" name="upButton"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="downButton"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </item> + </layout> </widget> </item> <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="okButton"> - <property name="text"> - <string>&Ok</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="0" column="0"> - <layout class="QGridLayout" name="_7"> - <item row="0" column="0"> - <widget class="QListWidget" name="toolboxList"> - <property name="showDropIndicator" stdset="0"> - <bool>false</bool> - </property> - <property name="dragDropOverwriteMode"> - <bool>false</bool> - </property> - <property name="dragDropMode"> - <enum>QAbstractItemView::NoDragDrop</enum> - </property> - <property name="selectionMode"> - <enum>QAbstractItemView::ExtendedSelection</enum> - </property> - <property name="movement"> - <enum>QListView::Static</enum> - </property> - <property name="sortingEnabled"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="0" column="1"> - <layout class="QVBoxLayout" name="_8"> + <layout class="QVBoxLayout" name="_11"> <item> <spacer> <property name="orientation"> @@ -139,21 +183,14 @@ </spacer> </item> <item> - <widget class="QToolButton" name="upButton"> + <widget class="QToolButton" name="rightArrowToolbox"> <property name="text"> <string/> </property> </widget> </item> <item> - <widget class="QToolButton" name="removeWidgetButton"> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="downButton"> + <widget class="QToolButton" name="leftArrowToolbox"> <property name="text"> <string/> </property> @@ -174,37 +211,168 @@ </item> </layout> </item> - <item row="1" column="0"> - <widget class="QPushButton" name="saveButton"> - <property name="text"> - <string>Save Configuration</string> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>Available</string> </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QListWidget" name="availableToolboxes"> + <property name="selectionMode"> + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + <property name="sortingEnabled"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> </widget> </item> </layout> </item> - <item row="0" column="1"> - <widget class="QGroupBox" name="groupBox"> - <property name="minimumSize"> - <size> - <width>300</width> - <height>0</height> - </size> - </property> - <property name="title"> - <string>Widget</string> - </property> - </widget> - </item> </layout> </widget> <widget class="QWidget" name="tab_2"> <attribute name="title"> <string>Toolbars</string> </attribute> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QGroupBox" name="groupBox_4"> + <property name="title"> + <string>Used</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <item> + <widget class="QListWidget" name="toolbarList"> + <property name="selectionMode"> + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="_9"> + <item> + <spacer> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QToolButton" name="rightArrowToolbar"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="leftArrowToolbar"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QGroupBox" name="groupBox_5"> + <property name="title"> + <string>Available</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <item> + <widget class="QListWidget" name="availableToolbars"> + <property name="selectionMode"> + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + <property name="sortingEnabled"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> </widget> </widget> </item> + <item> + <layout class="QHBoxLayout" name="_10"> + <item> + <widget class="QPushButton" name="cancelButton"> + <property name="text"> + <string>&Cancel</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="saveButton"> + <property name="text"> + <string>Save Configuration</string> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="okButton"> + <property name="text"> + <string>&Ok</string> + </property> + </widget> + </item> + </layout> + </item> </layout> </widget> <resources/> diff --git a/widgets/viewModeWidget/viewModeWidget.cc b/widgets/viewModeWidget/viewModeWidget.cc index 878b9e84f7f6e01522a7eb931c7162256e732cd2..f2f7345f77354626bdc46c5d9c1816a5c45cf556 100644 --- a/widgets/viewModeWidget/viewModeWidget.cc +++ b/widgets/viewModeWidget/viewModeWidget.cc @@ -58,33 +58,264 @@ viewModeWidget::viewModeWidget(const QVector< ViewMode* >& _modes, QWidget *_par setupUi(this); - - connect(viewModeList ,SIGNAL(customContextMenuRequested ( const QPoint & ) ), - this,SLOT(slotModeContextMenu ( const QPoint & ) )); - connect(toolboxList ,SIGNAL(customContextMenuRequested ( const QPoint & ) ), - this,SLOT(slotToolContextMenu ( const QPoint & ) )); - - viewModeList->setContextMenuPolicy(Qt::CustomContextMenu); - toolboxList->setContextMenuPolicy(Qt::CustomContextMenu); - connect(viewModeList, SIGNAL(itemSelectionChanged()), this, SLOT(slotSetToolWidgets())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(close())); - connect(okButton, SIGNAL(clicked()), this, SLOT(slotChangeView())); + connect(saveButton, SIGNAL(clicked()), this, SLOT(slotSaveMode())); connect(removeButton, SIGNAL(clicked()), this, SLOT(slotRemoveMode())); connect(viewModeList, SIGNAL(currentTextChanged (QString)), this, SLOT(slotModeChanged(QString)) ); connect(viewModeList, SIGNAL(clicked (QModelIndex)), this, SLOT(slotModeClicked(QModelIndex)) ); - connect(upButton, SIGNAL(clicked()), this, SLOT(slotMoveUp()) ); - connect(downButton, SIGNAL(clicked()), this, SLOT(slotMoveDown()) ); - connect(removeWidgetButton, SIGNAL(clicked()), this, SLOT(slotRemoveWidget()) ); - // load icons for tool buttons + + + + + // View Mode List context Menu + viewModeList->setContextMenuPolicy(Qt::CustomContextMenu); + connect(viewModeList ,SIGNAL(customContextMenuRequested ( const QPoint & ) ), + this ,SLOT(slotModeContextMenu ( const QPoint & ) )); + + + // Context Menus Toolbars + toolbarList->setContextMenuPolicy(Qt::CustomContextMenu); + availableToolbars->setContextMenuPolicy(Qt::CustomContextMenu); + connect(toolbarList ,SIGNAL(customContextMenuRequested ( const QPoint & ) ), + this ,SLOT(slotUsedToolbarContextMenu ( const QPoint & ) )); + connect(availableToolbars ,SIGNAL(customContextMenuRequested ( const QPoint & ) ), + this ,SLOT(slotAvailableToolbarContextMenu ( const QPoint & ) )); + + + // Context Menus Toolboxes + toolboxList->setContextMenuPolicy(Qt::CustomContextMenu); + availableToolboxes->setContextMenuPolicy(Qt::CustomContextMenu); + connect(toolboxList ,SIGNAL(customContextMenuRequested ( const QPoint & ) ), + this ,SLOT(slotUsedToolboxContextMenu ( const QPoint & ) )); + connect(availableToolboxes ,SIGNAL(customContextMenuRequested ( const QPoint & ) ), + this ,SLOT(slotAvailableToolboxContextMenu ( const QPoint & ) )); + + + // Toolbar Buttons to add remove toolbars to the given Mode + connect(rightArrowToolbar, SIGNAL(clicked()), this, SLOT(slotRightArrowToolbar()) ); + rightArrowToolbar->setIcon( QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "arrow-right.png" ) ); + connect(leftArrowToolbar, SIGNAL(clicked()), this, SLOT(slotLeftArrowToolbar()) ); + leftArrowToolbar->setIcon( QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "arrow-left.png" ) ); + + + // Toolbar Buttons to add remove toolbars to the given Mode + connect(rightArrowToolbox, SIGNAL(clicked()), this, SLOT(slotRightArrowToolbox()) ); + rightArrowToolbox->setIcon( QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "arrow-right.png" ) ); + connect(leftArrowToolbox, SIGNAL(clicked()), this, SLOT(slotLeftArrowToolbox()) ); + leftArrowToolbox->setIcon( QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "arrow-left.png" ) ); + + connect(upButton, SIGNAL(clicked()), this, SLOT(slotMoveUp()) ); upButton->setIcon( QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "arrow-up.png" ) ); - removeWidgetButton->setIcon( QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "edit-delete.png" ) ); + connect(downButton, SIGNAL(clicked()), this, SLOT(slotMoveDown()) ); downButton->setIcon( QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "arrow-down.png" ) ); + + + // Geeral Buttons + // Apply currently configured Mode + connect(okButton, SIGNAL(clicked()), this, SLOT(slotChangeView())); +} + + +// ======================================================================================================= +// View Mode button slots +// ======================================================================================================= +void viewModeWidget::slotRemoveMode(){ + emit removeMode( viewModeList->currentItem()->text() ); + QListWidgetItem* item = viewModeList->takeItem( viewModeList->currentRow() ); + delete item; +} + +// ======================================================================================================= +// View Mode Context Menu +// ======================================================================================================= +void viewModeWidget::slotModeContextMenu ( const QPoint & _pos ){ + + if (viewModeList->itemAt(_pos)){ + + QMenu menu(0); + + menu.addAction(tr("Remove Mode"), this, SLOT ( slotRemoveMode() )); + + //check if mode is custom e.g. that it can be removed + for (int i=0; i < modes_.size(); i++) + if (modes_[i]->name == viewModeList->currentItem()->text()){ + menu.actions()[0]->setEnabled(modes_[i]->custom); + break; + } + + menu.exec(viewModeList->mapToGlobal( _pos) ); + } +} + +// ======================================================================================================= +// ToolBox and ToolBar Lists update functions +// ======================================================================================================= +void viewModeWidget::slotSetToolWidgets(){ + toolboxList->clear(); + toolbarList->clear(); + availableToolboxes->clear(); + availableToolbars->clear(); + + QStringList toolboxes; + QStringList toolbars; + + //iterate over all selected modes + for (int m=0; m < viewModeList->selectedItems().size(); m++) + + // find mode in modeVector modes_ + for (int i=0; i < modes_.size(); i++) + if ( modes_[i]->name == (viewModeList->selectedItems()[m])->text() ) { + toolboxes = modes_[i]->visibleToolboxes; + toolbars = modes_[i]->visibleToolbars; + toolboxList->addItems(toolboxes); //add corresponding widgets + toolbarList->addItems(toolbars); + break; + } + + + if ( !modes_.empty() ) { + QStringList allToolboxes = modes_[0]->visibleToolboxes; + QStringList allToolbars = modes_[0]->visibleToolbars; + + QStringList availableToolboxList; + QStringList availableToolbarList; + + for ( int i = 0; i < allToolboxes.size(); ++i ) { + if ( ! toolboxes.contains(allToolboxes[i]) ) + availableToolboxList.push_back(allToolboxes[i]); + } + + for ( int i = 0; i < allToolbars.size(); ++i ) { + if ( ! toolbars.contains(allToolbars[i]) ) + availableToolbarList.push_back(allToolbars[i]); + } + + availableToolboxes->addItems(availableToolboxList); + availableToolbars->addItems(availableToolbarList); + + } else { + std::cerr << "Mode not found!" << std::endl; + } + } + +// ======================================================================================================= +// ToolBar Context Menus Buttons +// ======================================================================================================= + +/// opens custom context menu in used toolbox-List +void viewModeWidget::slotUsedToolbarContextMenu ( const QPoint & _pos ){ + + if (toolboxList->itemAt(_pos)){ + + QMenu menu(0); + + if ( toolbarList->selectedItems().count() != 0 ) + menu.addAction(tr("Remove"), this, SLOT ( slotRightArrowToolbar() )); + + menu.exec(toolbarList->mapToGlobal( _pos) ); + } +} + +/// opens custom context menu in available toolbox-List +void viewModeWidget::slotAvailableToolbarContextMenu ( const QPoint & _pos ){ + + if (availableToolbars->itemAt(_pos)){ + + QMenu menu(0); + + if ( availableToolbars->selectedItems().count() != 0 ) + menu.addAction(tr("Add"), this, SLOT ( slotLeftArrowToolbar() )); + + menu.exec(availableToolbars->mapToGlobal( _pos) ); + } +} + +// ======================================================================================================= +// ToolBox Context Menus Buttons +// ======================================================================================================= + +/// opens custom context menu in used toolbox-List +void viewModeWidget::slotUsedToolboxContextMenu ( const QPoint & _pos ){ + + if (toolboxList->itemAt(_pos)){ + + QMenu menu(0); + + if (toolboxList->selectedItems().count() == 1){ + menu.addAction(tr("Move up"), this, SLOT ( slotMoveUp() )); + menu.addAction(tr("Move down"), this, SLOT ( slotMoveDown() )); + menu.addSeparator(); + } + + if ( toolboxList->selectedItems().count() != 0 ) + menu.addAction(tr("Remove"), this, SLOT ( slotRightArrowToolbox() )); + + menu.exec(toolboxList->mapToGlobal( _pos) ); + } +} + +/// opens custom context menu in available toolbox-List +void viewModeWidget::slotAvailableToolboxContextMenu ( const QPoint & _pos ){ + + if (availableToolboxes->itemAt(_pos)){ + + QMenu menu(0); + + if ( availableToolboxes->selectedItems().count() != 0 ) + menu.addAction(tr("Add"), this, SLOT ( slotLeftArrowToolbox() )); + + menu.exec(availableToolboxes->mapToGlobal( _pos) ); + } +} + + +// ======================================================================================================= +// ToolBar Buttons +// ======================================================================================================= + +void viewModeWidget::slotRightArrowToolbar() { + QList<QListWidgetItem *> selectedItems = toolbarList->selectedItems (); + for ( int i = 0 ; i < selectedItems.size(); ++i ) + availableToolbars->addItem(selectedItems[i]->text()); + + qDeleteAll(selectedItems); +} + +void viewModeWidget::slotLeftArrowToolbar() { + QList<QListWidgetItem *> selectedItems = availableToolbars->selectedItems (); + for ( int i = 0 ; i < selectedItems.size(); ++i ) + toolbarList->addItem(selectedItems[i]->text()); + + qDeleteAll(selectedItems); +} + +// ======================================================================================================= +// ToolBox Buttons +// ======================================================================================================= + +void viewModeWidget::slotRightArrowToolbox() { + QList<QListWidgetItem *> selectedItems = toolboxList->selectedItems (); + for ( int i = 0 ; i < selectedItems.size(); ++i ) + availableToolboxes->addItem(selectedItems[i]->text()); + + qDeleteAll(selectedItems); +} + +void viewModeWidget::slotLeftArrowToolbox() { + QList<QListWidgetItem *> selectedItems = availableToolboxes->selectedItems (); + for ( int i = 0 ; i < selectedItems.size(); ++i ) + toolboxList->addItem(selectedItems[i]->text()); + + qDeleteAll(selectedItems); +} + + /// Move Widget up in the list void viewModeWidget::slotMoveUp(){ if (toolboxList->selectedItems().count() == 1){ @@ -95,7 +326,7 @@ void viewModeWidget::slotMoveUp(){ QStringList widgets; for (int i=0; i < toolboxList->count(); i++) widgets << toolboxList->item(i)->text(); - + //reorder items QString last = widgets[0]; for (int i=1; i < widgets.size(); i++){ @@ -123,7 +354,7 @@ void viewModeWidget::slotMoveDown(){ QStringList widgets; for (int i=0; i < toolboxList->count(); i++) widgets << toolboxList->item(i)->text(); - + //reorder items QString last = widgets[widgets.size()-1]; for (int i=widgets.size()-2; i >= 0; i--){ @@ -141,131 +372,134 @@ void viewModeWidget::slotMoveDown(){ } } -/// remove Widget form the list -void viewModeWidget::slotRemoveWidget(){ - qDeleteAll(toolboxList->selectedItems()); -} -/// Slot for updating removeButton when new mode is selected -void viewModeWidget::slotModeClicked(QModelIndex /*_id*/){ - slotModeChanged(QString()); + +// ======================================================================================================= +// External communication +// ======================================================================================================= + +/// Slot for changing View and closing widget +void viewModeWidget::slotChangeView(){ + //get toolboxes + QStringList toolboxes; + for (int i=0; i < toolboxList->count(); i++) + toolboxes << toolboxList->item(i)->text(); + + //get toolbars + QStringList toolbars; + for (int i=0; i < toolbarList->count(); i++) + toolbars << toolbarList->item(i)->text(); + + //get mode + QString mode = ""; + if (viewModeList->selectedItems().size() > 0) + mode = viewModeList->selectedItems()[0]->text(); + + std::cerr << "TODO: Ask for Save" << std::endl; + emit changeView(mode,toolboxes,toolbars); + close(); } -/// Slot for updating removeButton when new mode is selected -void viewModeWidget::slotModeChanged(QString /*_mode*/){ - //check if mode is custom e.g. that it can be removed - if (viewModeList->selectedItems().count() > 0){ +/// Slot for saving current List of Widgets as custom mode +void viewModeWidget::slotSaveMode(){ + // Search for current mode vector + int id = -1; + if ( viewModeList->selectedItems().count() > 0) for (int i=0; i < modes_.size(); i++) if (modes_[i]->name == viewModeList->currentItem()->text()){ - removeButton->setEnabled(modes_[i]->custom); + id = i; break; } + + if ( id == -1 ) { + std::cerr << "Moded Not found in slotSaveMode" << std::endl; + return; } -} + + // Get Toolboxes + QStringList toolboxes; + for (int i=0; i < toolboxList->count(); i++) + toolboxes << toolboxList->item(i)->text(); + + // Get Toolbars + QStringList toolbars; + for (int i=0; i < toolbarList->count(); i++) + toolbars << toolbarList->item(i)->text(); + + bool createNewMode = false; + + QString message = tr("You cannot change predefined modes.\n" + "Please enter a new Name for the mode."); + + // Check if we want to create a new node. + if ( ! modes_[id]->custom ) { + createNewMode = true; + + } else { + int ret = QMessageBox::warning(this, + tr("View Mode exists"), + tr("View Mode already exists. Do you want to overwrite it?"), + QMessageBox::Yes|QMessageBox::No, + QMessageBox::No); + if (ret == QMessageBox::No) { + message = tr("New name for view mode:"); + createNewMode = true; + } + } + + + if ( createNewMode ) { + + //ask for a name for the new viewmode as it is not a custom one + bool ok; + QString name = QInputDialog::getText(this, tr("Save view Mode"), + message, QLineEdit::Normal, + "", &ok); + + //Remove Spaces from name + if (!ok || name.isEmpty()) { + std::cerr << "Illegal or no name given!" << std::endl; + return; + } + + //check if name already exists + for (int i=0; i < modes_.size(); i++) + if (modes_[i]->name == name){ + QMessageBox::warning(this, tr("Save View Mode"), tr("Cannot Save ViewMode. Name already taken by a different mode."), QMessageBox::Ok); + return; + } + + emit saveMode(name, true, toolboxes, toolbars); + show(name); + } else { + emit saveMode(modes_[id]->name, true, toolboxes, toolbars); + show(modes_[id]->name); + } + +} + -/// opens custom context menu in Mode-List -void viewModeWidget::slotModeContextMenu ( const QPoint & _pos ){ - if (viewModeList->itemAt(_pos)){ - QMenu menu(0); - menu.addAction(tr("Remove Mode"), this, SLOT ( slotRemoveMode() )); - //check if mode is custom e.g. that it can be removed - for (int i=0; i < modes_.size(); i++) - if (modes_[i]->name == viewModeList->currentItem()->text()){ - menu.actions()[0]->setEnabled(modes_[i]->custom); - break; - } - menu.exec(viewModeList->mapToGlobal( _pos) ); - } -} -/// opens custom context menu in tool-List -void viewModeWidget::slotToolContextMenu ( const QPoint & _pos ){ - if (toolboxList->itemAt(_pos)){ - QMenu menu(0); - if (toolboxList->selectedItems().count() == 1){ - menu.addAction(tr("Move up"), this, SLOT ( slotMoveUp() )); - menu.addAction(tr("Move down"), this, SLOT ( slotMoveDown() )); - menu.addSeparator(); - } - menu.addAction(tr("Remove Widget"), this, SLOT ( slotRemoveWidget() )); - menu.exec(toolboxList->mapToGlobal( _pos) ); - } -} -/// Slot for removing custom modes -void viewModeWidget::slotRemoveMode(){ - emit removeMode( viewModeList->currentItem()->text() ); - QListWidgetItem* item = viewModeList->takeItem( viewModeList->currentRow() ); - delete item; -} -/// Slot for updating ToolWidget-List depending on the selected Mode -void viewModeWidget::slotSetToolWidgets(){ - toolboxList->clear(); - //iterate over all selected modes - for (int m=0; m < viewModeList->selectedItems().size(); m++) - // find mode in modeVector modes_ - for (int i=0; i < modes_.size(); i++) - if ( modes_[i]->name == (viewModeList->selectedItems()[m])->text() ) - toolboxList->addItems(modes_[i]->visibleToolboxes); //add corresponding widgets -} -/// Slot for changing View and closing widget -void viewModeWidget::slotChangeView(){ - //get widgets - QStringList widgets; - for (int i=0; i < toolboxList->count(); i++) - widgets << toolboxList->item(i)->text(); - //get mode - QString mode = ""; - if (viewModeList->selectedItems().size() > 0) - mode = viewModeList->selectedItems()[0]->text(); - emit changeView(mode,widgets); - close(); -} -/// Slot for saving current List of Widgets as custom mode -void viewModeWidget::slotSaveMode(){ - if (toolboxList->count() == 0) return; - //ask for a name for the new viewmode - bool ok; - QString name = QInputDialog::getText(this, tr("Change View Mode"), - tr("Enter a name for the new ViewMode:"), QLineEdit::Normal, - "", &ok); - //Remove Spaces from name - name.remove(" "); - - if (!ok || name.isEmpty()) return; - - //check if name already exists - for (int i=0; i < modes_.size(); i++) - if (modes_[i]->name == name){ - QMessageBox::warning(this, tr("Change View Mode"), tr("Cannot Save ViewMode. Name already taken by a different mode."), - QMessageBox::Ok); - return; - } - QStringList widgets; - for (int i=0; i < toolboxList->count(); i++) - widgets << toolboxList->item(i)->text(); - emit saveMode(name, true, widgets); - show(name); -} /// overloaded show function void viewModeWidget::show(QString _lastMode){ QDialog::show(); - + //fill viewModeList viewModeList->clear(); for (int i=0; i < modes_.size(); i++){ @@ -274,20 +508,54 @@ void viewModeWidget::show(QString _lastMode){ item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); item->setIcon(QIcon(OpenFlipper::Options::iconDirStr() + QDir::separator () + "Unknown.png")); item->setText(modes_[i]->name); - + if (modes_[i]->custom) viewModeList->item(i)->setForeground( QBrush(QColor(0,0,150) ) ); else viewModeList->item(i)->setForeground( QBrush(QColor(0,0,0) ) ); } - + //select given mode viewModeList->setCurrentRow(0); - + for (int i=0; i < viewModeList->count(); i++) if (viewModeList->item(i)->text() == _lastMode) viewModeList->setCurrentRow(i); + + removeButton->setEnabled(false); +} + - removeButton->setEnabled(false); +/// Slot for updating removeButton when new mode is selected +void viewModeWidget::slotModeClicked(QModelIndex /*_id*/){ + slotModeChanged(QString()); } +/// Slot for updating removeButton when new mode is selected +void viewModeWidget::slotModeChanged(QString /*_mode*/){ + //check if mode is custom e.g. that it can be removed + if (viewModeList->selectedItems().count() > 0){ + for (int i=0; i < modes_.size(); i++) + if (modes_[i]->name == viewModeList->currentItem()->text()){ + removeButton->setEnabled(modes_[i]->custom); + break; + } + } +} + + + + + + + + + + + + + + + + + diff --git a/widgets/viewModeWidget/viewModeWidget.hh b/widgets/viewModeWidget/viewModeWidget.hh index 2de4c60194dae4d9c9f6ee89546c9fb9d15a6db3..5531348e367617c8ad36f8669c75eecf998a1da5 100644 --- a/widgets/viewModeWidget/viewModeWidget.hh +++ b/widgets/viewModeWidget/viewModeWidget.hh @@ -56,27 +56,144 @@ class viewModeWidget : public QDialog, public Ui::viewMode { Q_OBJECT private: + // Vector holding list of all available modes const QVector< ViewMode* >& modes_; public: viewModeWidget(const QVector< ViewMode* >& _modes, QWidget *parent = 0 ); void show(QString _lastMode); - signals: - void saveMode(QString _name, bool _custom, QStringList _toolWidgets); - void removeMode(QString _name); - void changeView(QString _mode, QStringList _toolWidgets); private slots: - void slotMoveUp(); - void slotMoveDown(); - void slotRemoveWidget(); - void slotRemoveMode(); - void slotChangeView(); + void slotModeChanged(QString _mode); void slotModeClicked(QModelIndex _id); - void slotSaveMode(); - void slotSetToolWidgets(); - /// Context Menus - void slotModeContextMenu ( const QPoint & _pos ); - void slotToolContextMenu ( const QPoint & _pos ); + + + // ============================================ + // ViewMode Buttons + // ============================================ + /** \brief Button slot to remove the selected view mode + * + * This slot removes the currently selected view mode + */ + void slotRemoveMode(); + + + // ============================================ + // ViewMode Context Menu + // ============================================ + /** \brief Context Menu View Modes + * + * This slot shows the used toolbar Context Menu + */ + void slotModeContextMenu ( const QPoint & _pos ); + + // ============================================ + // ToolBox and ToolBar Lists update functions + // ============================================ + /** \brief Update list views + * + * This slot updates all list views depending on the currently selected view mode + */ + void slotSetToolWidgets(); + + // ============================================ + // ToolBar Views Context Menu + // ============================================ + /** \brief Context Menu Used Toolbars + * + * This slot shows the used toolbar Context Menu + */ + void slotUsedToolbarContextMenu ( const QPoint & _pos ); + + /** \brief Context Menu Available Toolbars + * + * This slot shows the available toolbar Context Menu + */ + void slotAvailableToolbarContextMenu ( const QPoint & _pos ); + + // ============================================ + // ToolBox Views Context Menu + // ============================================ + /** \brief Context Menu Used Toolboxes + * + * This slot shows the used toolbox Context Menu + */ + void slotUsedToolboxContextMenu ( const QPoint & _pos ); + + /** \brief Context Menu Available Toolboxes + * + * This slot shows the available toolbox Context Menu + */ + void slotAvailableToolboxContextMenu ( const QPoint & _pos ); + + + // ============================================ + // ToolBar Buttons + // ============================================ + /** \brief remove Toolbars from Mode + * + * This slot removes the selected toolbars from the current view Mode + */ + void slotRightArrowToolbar(); + + /** \brief add Toolbars to Mode + * + * This slot adds the selected toolbars to the current view Mode + */ + void slotLeftArrowToolbar(); + + // ============================================ + //ToolBox Buttons + // ============================================ + /** \brief remove Toolboxes from Mode + * + * This slot removes the selected widgets from the current view Mode + */ + void slotRightArrowToolbox(); + + /** \brief add Toolboxes to Mode + * + * This slot adds the selected widgets to the current view Mode + */ + void slotLeftArrowToolbox(); + + /** \brief Move Toolbox up + * + * This slot moves the widget upward in the list of used modes + */ + void slotMoveUp(); + + /** \brief Move Toolbox down + * + * This slot moves the widget downward in the list of used modes + */ + void slotMoveDown(); + + + // ============================================ + // External Communication + // ============================================ + + private slots: + /// Slot for changing the current view to currently configured one + void slotChangeView(); + + /** \brief Save the current view mode configuration + * + * Takes the given configuration and saves the mode + */ + void slotSaveMode(); + + signals: + /// Changes the view mode to the currently configured one + void changeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars); + + /// saves the given mode + void saveMode(QString _name, bool _custom, QStringList _toolboxWidgets, QStringList _toolbars); + + /// This signal is emitted to remove a mode + void removeMode(QString _name); + + }; #endif //VIEWMODEWIDGET_HH