Commit 7bdfaed6 authored by Jan Möbius's avatar Jan Möbius

Skeleton for Toolbar View Mode implementation

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7234 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a5aee3b3
...@@ -79,7 +79,7 @@ class ViewModeInterface { ...@@ -79,7 +79,7 @@ class ViewModeInterface {
signals : signals :
/** \brief Defines a new ViewMode for the Toolboxes /** \brief Defines a ViewMode for the Toolboxes
* *
* With this function you can define a set of toolboxes which should be visible * With this function you can define a set of toolboxes which should be visible
* for the specified view mode. * for the specified view mode.
...@@ -87,7 +87,17 @@ class ViewModeInterface { ...@@ -87,7 +87,17 @@ class ViewModeInterface {
* @param _mode name of the ViewMode * @param _mode name of the ViewMode
* @param _usedWidgets list of used Widgets names * @param _usedWidgets list of used Widgets names
*/ */
virtual void defineViewModeToolboxes(QString& /*_mode*/, QStringList& /*_usedWidgets*/){}; virtual void defineViewModeToolboxes(QString /*_mode*/, QStringList /*_usedWidgets*/){};
/** \brief Defines a ViewMode for the Toolbars
*
* With this function you can define a set of toolbars which should be visible
* for the specified view mode.
*
* @param _mode name of the ViewMode
* @param _usedWidgets list of used toolbars
*/
virtual void defineViewModeToolbars(QString /*_mode*/, QStringList /*_usedToolbars*/){};
}; };
......
...@@ -617,11 +617,14 @@ void Core::loadPlugin(QString filename, bool silent){ ...@@ -617,11 +617,14 @@ void Core::loadPlugin(QString filename, bool silent){
if ( viewModePlugin && OpenFlipper::Options::gui() ) { if ( viewModePlugin && OpenFlipper::Options::gui() ) {
supported = supported + "ViewMode "; supported = supported + "ViewMode ";
std::cerr << "Defined by " << info.name.toStdString() << std::endl;;
if ( checkSignal(plugin, "defineViewModeToolboxes(QString,QStringList)")) if ( checkSignal(plugin, "defineViewModeToolboxes(QString,QStringList)"))
connect(plugin, SIGNAL( defineViewModeToolboxes(QString, QStringList) ), connect(plugin, SIGNAL( defineViewModeToolboxes(QString, QStringList) ),
coreWidget_, SLOT( slotAddViewModeToolboxes(QString, QStringList) ),Qt::DirectConnection ); coreWidget_, SLOT( slotAddViewModeToolboxes(QString, QStringList) ),Qt::DirectConnection );
if ( checkSignal(plugin, "defineViewModeToolbars(QString,QStringList)"))
connect(plugin, SIGNAL( defineViewModeToolbars(QString, QStringList) ),
coreWidget_, SLOT( slotAddViewModeToolbars(QString, QStringList) ),Qt::DirectConnection );
} }
//Check if the plugin supports Options-Interface //Check if the plugin supports Options-Interface
......
...@@ -393,11 +393,17 @@ public: ...@@ -393,11 +393,17 @@ public:
/// init ViewModes that were loaded via ini-file /// init ViewModes that were loaded via ini-file
void initViewModes( ); void initViewModes( );
/// Add a new ViewMode (non-userdefined viewMode) /// Add or change Toolboxes for a ViewMode (non-userdefined viewMode)
void slotAddViewModeToolboxes(QString _mode, QStringList _usedWidgets); void slotAddViewModeToolboxes(QString _mode, QStringList _usedWidgets);
/// Add a new ViewMode (_custom == userdefined viewMode) /// Add or change Toolboxes for a ViewMode (_custom == userdefined viewMode)
void slotAddViewModeToolboxes(QString _mode, bool _custom, QStringList _usedWidgets); void slotAddViewModeToolboxes(QString _mode, bool _custom, QStringList _usedWidgets);
/// Add or change Toolbars for a ViewMode (non-userdefined viewMode)
void slotAddViewModeToolbars(QString _mode, QStringList _usedToolbars);
/// Add or change Toolbars for a ViewMode (_custom == userdefined viewMode)
void slotAddViewModeToolbars(QString _mode, bool _custom, QStringList _usedToolbars);
/// Slot for Changing visible toolWidgets /// Slot for Changing visible toolWidgets
void slotChangeView(QString _mode, QStringList _toolWidgets); void slotChangeView(QString _mode, QStringList _toolWidgets);
......
...@@ -86,12 +86,10 @@ void CoreWidget::initViewModes(){ ...@@ -86,12 +86,10 @@ void CoreWidget::initViewModes(){
} }
/// Add a new viewMode (non-custom)
void CoreWidget::slotAddViewModeToolboxes(QString _mode, QStringList _usedWidgets){ void CoreWidget::slotAddViewModeToolboxes(QString _mode, QStringList _usedWidgets){
slotAddViewModeToolboxes(_mode, false, _usedWidgets); slotAddViewModeToolboxes(_mode, false, _usedWidgets);
} }
/// Add a new viewMode
void CoreWidget::slotAddViewModeToolboxes(QString _mode, bool _custom, QStringList _usedWidgets){ void CoreWidget::slotAddViewModeToolboxes(QString _mode, bool _custom, QStringList _usedWidgets){
ViewMode* vm = new ViewMode(); ViewMode* vm = new ViewMode();
vm->name = _mode; vm->name = _mode;
...@@ -112,6 +110,14 @@ void CoreWidget::slotAddViewModeToolboxes(QString _mode, bool _custom, QStringLi ...@@ -112,6 +110,14 @@ void CoreWidget::slotAddViewModeToolboxes(QString _mode, bool _custom, QStringLi
initViewModes(); initViewModes();
} }
void CoreWidget::slotAddViewModeToolbars(QString _mode, QStringList _usedToolbars) {
slotAddViewModeToolbars(_mode,false,_usedToolbars);
}
void CoreWidget::slotAddViewModeToolbars(QString _mode, bool _custom, QStringList _usedToolbars) {
std::cerr << "Todo: Implement Toolbar View Modes" << std::endl;
}
/// Remove a viewMode /// Remove a viewMode
void CoreWidget::slotRemoveViewMode(QString _name){ void CoreWidget::slotRemoveViewMode(QString _name){
for (int i=0; i < viewModes_.size(); i++) for (int i=0; i < viewModes_.size(); i++)
......
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