Commit c6c4e55d authored by Jan Möbius's avatar Jan Möbius

Marlin:

ViewMode extended to include context menus

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8860 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 6b563bcf
......@@ -99,6 +99,16 @@ class ViewModeInterface {
*/
virtual void defineViewModeToolbars(QString /*_mode*/, QStringList /*_usedToolbars*/){};
/** \brief Defines a ViewMode for the Toolbars
*
* With this function you can define a set of context menus which should be visible
* for the specified view mode.
*
* @param _mode name of the ViewMode
* @param _usedWidgets list of used context menus
*/
virtual void defineViewModeContextMenus(QString /*_mode*/, QStringList /*_usedContextMenus*/){};
/** \brief Defines an Icon for a ViewMode
*
* With this function you can define an Icon associated with this view mode
......
......@@ -500,8 +500,8 @@ Core::init() {
//get keyAssignments from config files
restoreKeyBindings();
if ( OpenFlipper::Options::defaultToolboxMode( ) != "" )
coreWidget_->setViewMode( OpenFlipper::Options::defaultToolboxMode() );
if ( OpenFlipper::Options::currentViewMode( ) != "" )
coreWidget_->setViewMode( OpenFlipper::Options::currentViewMode() );
else
coreWidget_->setViewMode("All");
......
......@@ -441,6 +441,13 @@ public slots:
@param _toolboxList ; seperated list of toolbars in the view mode
*/
void addViewModeToolbars(QString _modeName, QString _toolbarList);
/** \brief Scripting function to set context menus in a view mode
@param _modeName Name of the View Mode
@param _toolboxList ; seperated list of context menus in the view mode
*/
void addViewModeContextMenus(QString _modeName, QString _contextMenuList);
/** @} */
......
......@@ -77,8 +77,6 @@ void Core::readApplicationOptions(INIFile& _ini) {
// Parse standard options
if ( _ini.section_exists("Options") ) {
// TODO: Load View Mode Toolbars and Context Menu Items
// load ViewModes
int viewModeCount;
if (_ini.get_entry(viewModeCount,"Options","ViewModeCount") )
......@@ -86,26 +84,31 @@ void Core::readApplicationOptions(INIFile& _ini) {
QString entryToolbars;
QString entryToolboxes;
QString entryContextMenus;
QString entryIcon;
QString keyToolbars = "ViewModeToolbars" + QString::number(i);
QString keyToolboxes = "ViewModeToolboxes" + QString::number(i);
QString keyIcon = "ViewModeIcon" + QString::number(i);
QString keyToolbars = "ViewModeToolbars" + QString::number(i);
QString keyToolboxes = "ViewModeToolboxes" + QString::number(i);
QString keyContextMenus = "ViewModeContextMenus" + QString::number(i);
QString keyIcon = "ViewModeIcon" + QString::number(i);
// Read the entries
if ( !_ini.get_entry( entryToolbars , "Options" , keyToolbars ) ) continue;
if ( !_ini.get_entry( entryToolboxes , "Options" , keyToolboxes ) ) continue;
if ( !_ini.get_entry( entryIcon , "Options" , keyIcon ) ) continue;
if ( !_ini.get_entry( entryToolbars , "Options" , keyToolbars ) ) continue;
if ( !_ini.get_entry( entryToolboxes , "Options" , keyToolboxes ) ) continue;
if ( !_ini.get_entry( entryContextMenus , "Options" , keyContextMenus ) ) continue;
if ( !_ini.get_entry( entryIcon , "Options" , keyIcon ) ) continue;
QStringList toolBars = entryToolbars.split(";");
QStringList toolBoxes = entryToolboxes.split(";");
QStringList toolBars = entryToolbars.split(";");
QStringList toolBoxes = entryToolboxes.split(";");
QStringList contextMenus = entryContextMenus.split(";");
// Get Mode name ( prepended to all toolbox/toolbar lists
// Get Mode name ( prepended to all toolbox/toolbar/context menu lists )
QString mode = toolBoxes.first();
// Remove leading Modes
toolBoxes.removeFirst();
toolBars.removeFirst();
contextMenus.removeFirst();
// Check if the mode already exists
bool found = false;
......@@ -117,9 +120,10 @@ void Core::readApplicationOptions(INIFile& _ini) {
ViewMode* vm = new ViewMode();
vm->name = mode;
vm->custom = true;
vm->visibleToolbars = toolBars;
vm->visibleToolboxes = toolBoxes;
vm->icon = entryIcon;
vm->visibleToolbars = toolBars;
vm->visibleToolboxes = toolBoxes;
vm->visibleContextMenus = contextMenus;
vm->icon = entryIcon;
viewModes_.push_back(vm);
}
......@@ -218,9 +222,9 @@ void Core::readApplicationOptions(INIFile& _ini) {
//============================================================================
// Load the setting for the default Toolbox mode
//============================================================================
QString toolboxMode = false;
if ( _ini.get_entry( toolboxMode, "Options" , "DefaultToolboxMode") )
OpenFlipper::Options::defaultToolboxMode(toolboxMode);
QString viewmode = false;
if ( _ini.get_entry( viewmode, "Options" , "CurrentViewMode") )
OpenFlipper::Options::currentViewMode(viewmode);
//============================================================================
// Load the setting for the translation language
......@@ -383,10 +387,10 @@ void Core::writeApplicationOptions(INIFile& _ini) {
_ini.add_entry( "Options" , key , type );
}
// TODO: Save View Mode Toolbars and Context Menu Items
// save ViewModes
QVector< QString > toolboxes;
QVector< QString > toolbars;
QVector< QString > contextmenus;
QVector< QString > icons;
if ( OpenFlipper::Options::gui() )
......@@ -410,17 +414,25 @@ void Core::writeApplicationOptions(INIFile& _ini) {
entryToolbars += ";" + coreWidget_->viewModes_[i]->visibleToolbars[j];
toolbars.push_back(entryToolbars);
QString entryContextMenus = coreWidget_->viewModes_[i]->name;
icons.push_back(coreWidget_->viewModes_[i]->icon);
//store widgets
for (int j=0; j < coreWidget_->viewModes_[i]->visibleContextMenus.size(); j++)
entryContextMenus += ";" + coreWidget_->viewModes_[i]->visibleContextMenus[j];
contextmenus.push_back(entryContextMenus);
icons.push_back(coreWidget_->viewModes_[i]->icon);
}
//save viewmodes to ini
_ini.add_entry("Options","ViewModeCount" ,toolboxes.size());
for (int i=0; i < toolboxes.size(); i++) {
_ini.add_entry("Options","ViewModeToolboxes" + QString::number(i) ,toolboxes[i]);
_ini.add_entry("Options","ViewModeToolbars" + QString::number(i) ,toolbars[i] );
_ini.add_entry("Options","ViewModeIcon" + QString::number(i) ,icons[i] );
_ini.add_entry("Options","ViewModeToolboxes" + QString::number(i) ,toolboxes[i]);
_ini.add_entry("Options","ViewModeToolbars" + QString::number(i) ,toolbars[i] );
_ini.add_entry("Options","ViewModeContextMenus" + QString::number(i) ,contextmenus[i] );
_ini.add_entry("Options","ViewModeIcon" + QString::number(i) ,icons[i] );
}
//save KeyBindings
......@@ -430,8 +442,8 @@ void Core::writeApplicationOptions(INIFile& _ini) {
//write default dataType to INI
_ini.add_entry( "Options" , "default_DataType" , OpenFlipper::Options::lastDataType() );
//write default ToolboxMode
_ini.add_entry("Options","DefaultToolboxMode",OpenFlipper::Options::defaultToolboxMode() );
//write current ViewMode
_ini.add_entry("Options","CurrentViewMode",OpenFlipper::Options::currentViewMode() );
//============================================================================
// Debugging
......
......@@ -83,6 +83,7 @@ class PluginInfo{
keys.clear();
toolboxWidgets.clear();
toolbars.clear();
contextMenus.clear();
optionsWidget = 0;
}
......@@ -100,6 +101,7 @@ class PluginInfo{
keys = _i.keys;
toolboxWidgets = _i.toolboxWidgets;
toolbars = _i.toolbars;
contextMenus = _i.contextMenus;
optionsWidget = _i.optionsWidget;
}
......@@ -133,8 +135,11 @@ class PluginInfo{
/// Pointer to plugins toolbox widget (if available)
std::vector< std::pair< QString , QWidget* > > toolboxWidgets;
/// Pointer to plugins toolbox widget (if available)
/// Pointer to plugins toolbars (if available)
std::vector< std::pair< QString , QToolBar* > > toolbars;
/// Pointer to plugins context menus (if available)
std::vector< std::pair< QString , QAction* > > contextMenus;
/// Pointer to plugins options widget (if available)
QWidget* optionsWidget;
......
......@@ -732,7 +732,11 @@ void Core::loadPlugin(QString filename, bool silent, QObject* _plugin){
if ( checkSignal(plugin, "defineViewModeToolbars(QString,QStringList)"))
connect(plugin, SIGNAL( defineViewModeToolbars(QString, QStringList) ),
coreWidget_, SLOT( slotAddViewModeToolbars(QString, QStringList) ),Qt::DirectConnection );
coreWidget_, SLOT( slotAddViewModeToolbars(QString, QStringList) ),Qt::DirectConnection );
if ( checkSignal(plugin, "defineViewModeContextMenus(QString,QStringList)"))
connect(plugin, SIGNAL( defineViewModeContextMenus(QString, QStringList) ),
coreWidget_, SLOT( slotAddViewModeContextMenus(QString, QStringList) ),Qt::DirectConnection );
if ( checkSignal(plugin, "defineViewModeIcon(QString,QString)"))
connect(plugin, SIGNAL( defineViewModeIcon(QString, QString) ),
......
......@@ -74,8 +74,8 @@ void Core::applyOptions(){
coreWidget_->initViewModes();
//Set default Viewmode
if (OpenFlipper::Options::defaultToolboxMode() != "")
coreWidget_->slotChangeView(OpenFlipper::Options::defaultToolboxMode(), QStringList(), QStringList());
if (OpenFlipper::Options::currentViewMode() != "")
coreWidget_->slotChangeView(OpenFlipper::Options::currentViewMode(), QStringList(), QStringList(), QStringList());
//Set Fullscreen
if ( OpenFlipperSettings().value("Core/Gui/fullscreen",false).toBool() )
coreWidget_->setWindowState( coreWidget_->windowState() | Qt::WindowFullScreen);
......
......@@ -166,6 +166,14 @@ void Core::addViewModeToolbars(QString _modeName, QString _toolbarList) {
//-----------------------------------------------------------------------------
void Core::addViewModeContextMenus(QString _modeName, QString _contextMenuList) {
QStringList list = _contextMenuList.split(";");
coreWidget_->slotAddViewModeContextMenus(_modeName,list);
}
//-----------------------------------------------------------------------------
void Core::addToolbox(QString _name ,QWidget* _widget) {
int id = -1;
......@@ -201,7 +209,7 @@ void Core::addToolbox(QString _name ,QWidget* _widget) {
viewModes_[0]->visibleToolboxes.sort();
}
setViewMode( OpenFlipper::Options::defaultToolboxMode() );
setViewMode( OpenFlipper::Options::currentViewMode() );
}
//=============================================================================
......
......@@ -162,7 +162,8 @@ static bool drawModesInContextMenu_ = true;
/// Set if a grid should be drawn in every viewer
static bool gridVisible_ = false;
static QString defaultToolboxMode_ = "";
/// Current view mode
static QString currentViewMode_ = "";
static QString title_ = "OpenFlipper v?";
......@@ -538,14 +539,14 @@ LoggerState loggerState( ) {
return static_cast<OpenFlipper::Options::LoggerState> (OpenFlipperSettings().value("Core/Gui/LogWindow/LogWindowMode",0).toInt() );
}
/// Which mode should be the default for the toolbar?
QString defaultToolboxMode( ) {
return defaultToolboxMode_;
/// Which mode should is currently selected?
QString currentViewMode( ) {
return currentViewMode_;
}
/// Which mode should be the default for the toolbar?
void defaultToolboxMode( QString _mode ) {
defaultToolboxMode_ = _mode;
/// Which view mode is currently selected?
void currentViewMode( QString _mode ) {
currentViewMode_ = _mode;
}
......
......@@ -507,13 +507,13 @@ QString helpDirStr();
DLLEXPORT
LoggerState loggerState( );
/// Which mode should be the default for the toolbar?
/// Which view mode is currently selected?
DLLEXPORT
QString defaultToolboxMode( );
QString currentViewMode( );
/// Which mode should be the default for the toolbar?
/// Which view mode is currently selected?
DLLEXPORT
void defaultToolboxMode( QString _mode );
void currentViewMode( QString _mode );
/// Titel of the main window
DLLEXPORT
......
......@@ -469,12 +469,29 @@ bool CoreWidget::addContextMenus( QMenu* _menu , ContextMenuType _type , int _id
}
//find the currently selected view mode
int id = -1;
for (int i=0; i<viewModes_.size(); i++) {
if (viewModes_[i]->name == OpenFlipper::Options::currentViewMode()) {
id = i;
break;
}
}
/// \todo Sort the menu entries by the order given in visibleContextMenus
//first add all menus
QMapIterator<QString, QAction*> it(menuMap);
QStringList visible = viewModes_[id]->visibleContextMenus;
visible.replaceInStrings(QRegExp(".*>"), "");
for (int i=0; i < visible.size(); i++)
std::cout << visible.at(i).toStdString() << std::endl;
while (it.hasNext()) {
it.next();
_menu->addAction( it.value() );
if (visible.contains(it.key())) {
_menu->addAction( it.value() );
}
}
_menu->addSeparator();
......@@ -484,7 +501,9 @@ bool CoreWidget::addContextMenus( QMenu* _menu , ContextMenuType _type , int _id
while (it2.hasNext()) {
it2.next();
_menu->addAction( it2.value() );
if (visible.contains(it2.key())) {
_menu->addAction( it2.value() );
}
}
return added;
......@@ -586,7 +605,8 @@ void CoreWidget::slotAddContextItem(QAction* _entry, ContextMenuType _type) {
info.action = _entry;
info.type = _type;
contextMenus_.push_back(info);
contextMenus_.push_back(info);
slotAddContextItemToViewMode(_entry);
}
void CoreWidget::slotAddContextItem( QAction* _entry , DataType _dataType ,ContextMenuType _type ) {
......@@ -596,6 +616,44 @@ void CoreWidget::slotAddContextItem( QAction* _entry , DataType _dataType ,Conte
info.type = _type;
contextMenus_.push_back(info);
slotAddContextItemToViewMode(_entry);
}
void CoreWidget::slotAddContextItemToViewMode( QAction* _entry ) {
int id = -1;
// Find the plugin which added this Context Menu
for ( uint i = 0 ; i < plugins_.size(); ++i ) {
if ( plugins_[i].plugin == sender() ) {
id = i;
break;
}
}
// Find the scripting plugin because we assign this context menu to it as we did not find the original sender
if ( id == -1 ) {
for ( uint i = 0 ; i < plugins_.size(); ++i ) {
if ( plugins_[i].name == "Scripting" ) {
id = i;
break;
}
}
if ( id == -1 ) {
std::cerr << "Unknown sender plugin when adding Context Menu!" << std::endl;
return;
}
}
plugins_[id].contextMenus.push_back( std::pair< QString,QAction* >( plugins_[id].name + "->" + _entry->text(), _entry) );
// add widget name to viewMode 'all'
if ( !viewModes_[0]->visibleContextMenus.contains(plugins_[id].name + "->" + _entry->text()) ){
viewModes_[0]->visibleContextMenus << plugins_[id].name + "->" + _entry->text();
viewModes_[0]->visibleContextMenus.sort();
}
setViewMode( OpenFlipper::Options::currentViewMode() );
}
void CoreWidget::slotUpdateViewerDrawMenu() {
......
......@@ -609,7 +609,7 @@ CoreWidget::toggleFullscreen() {
setWindowState( windowState() ^ Qt::WindowFullScreen);
//show toolbars
setViewMode( OpenFlipper::Options::defaultToolboxMode() );
setViewMode( OpenFlipper::Options::currentViewMode() );
//show the menubar
menuBar()->show();
......@@ -822,10 +822,10 @@ CoreWidget::showToolbox( bool _state ) {
}else{
//reset last ViewMode
if (OpenFlipper::Options::defaultToolboxMode().trimmed() == "")
if (OpenFlipper::Options::currentViewMode().trimmed() == "")
setViewMode("All");
else
setViewMode( OpenFlipper::Options::defaultToolboxMode() );
setViewMode( OpenFlipper::Options::currentViewMode() );
toolBoxArea_->setVisible(true);
}
}
......
......@@ -417,8 +417,14 @@ 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);
/// Add or change Toolbars for a ViewMode (non-userdefined viewMode)
void slotAddViewModeContextMenus(QString _mode, QStringList _usedToolbars);
/// Add or change Toolbars for a ViewMode (_custom == userdefined viewMode)
void slotAddViewModeContextMenus(QString _mode, bool _custom, QStringList _usedToolbars);
/// Completly configure a view mode ( set toolbars, toolboxes, context menus, ... )
void slotAddViewModeComplete(QString _mode , bool _custom, QStringList _toolboxes, QStringList _toolbars, QStringList _contextmenus);
/// Sets the Icon for a given View Mode (non-userdefined viewMode)
void slotSetViewModeIcon(QString _mode, QString _iconName);
......@@ -427,7 +433,7 @@ public:
void slotSetViewModeIcon(QString _mode, bool _custom, QString _iconName);
/// Slot for Changing visible toolWidgets
void slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars);
void slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus);
private slots:
/// Remove viewMode
......@@ -671,6 +677,9 @@ public:
/// called by plugins to add a real context menu item depending on DataType
void slotAddContextItem( QAction* _entry , DataType _dataType ,ContextMenuType type_);
/// called by slotAddContextItem to add the item to the view mode
void slotAddContextItemToViewMode( QAction* _entry );
/// Paste the view to the last active examiner
void slotPasteView( );
......
......@@ -110,6 +110,7 @@ void CoreWidget::slotAddViewModeToolboxes(QString _mode, bool _custom, QStringLi
vm->icon = "Unknown.png";
vm->visibleToolbars = QString("Main Toolbar;Viewer Toolbar").split(";");
vm->visibleContextMenus = viewModes_[0]->visibleContextMenus;
if (_custom) {
viewModes_.push_back(vm);
......@@ -155,6 +156,8 @@ void CoreWidget::slotAddViewModeToolbars(QString _mode, bool _custom, QStringLis
vm->custom = _custom;
vm->icon = "Unknown.png";
vm->visibleContextMenus = viewModes_[0]->visibleContextMenus;
if (_custom) {
viewModes_.push_back(vm);
} else {
......@@ -184,6 +187,53 @@ void CoreWidget::slotAddViewModeToolbars(QString _mode, bool _custom, QStringLis
initViewModes();
}
void CoreWidget::slotAddViewModeContextMenus(QString _mode, QStringList _usedContextMenus){
slotAddViewModeContextMenus(_mode, false, _usedContextMenus);
}
void CoreWidget::slotAddViewModeContextMenus(QString _mode, bool _custom, QStringList _usedContextMenus){
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;
vm->icon = "Unknown.png";
vm->visibleToolbars = QString("Main Toolbar;Viewer Toolbar").split(";");
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->visibleContextMenus = _usedContextMenus;
initViewModes();
}
/// Sets the Icon for a given View Mode
void CoreWidget::slotSetViewModeIcon(QString _mode, QString _iconName) {
slotSetViewModeIcon(_mode,false,_iconName);
......@@ -255,12 +305,13 @@ void CoreWidget::slotSetViewMode( QAction* action){
/// Slot for setting the viewMode from menu
void CoreWidget::setViewMode( QString _mode ){
slotChangeView(_mode, QStringList(), QStringList());
slotChangeView(_mode, QStringList(), QStringList(), QStringList());
}
void CoreWidget::slotAddViewModeComplete(QString _mode , bool _custom, QStringList _toolboxes, QStringList _toolbars) {
void CoreWidget::slotAddViewModeComplete(QString _mode , bool _custom, QStringList _toolboxes, QStringList _toolbars, QStringList _contextmenus) {
slotAddViewModeToolbars(_mode,_custom,_toolbars);
slotAddViewModeToolboxes(_mode,_custom,_toolboxes);
slotAddViewModeContextMenus(_mode,_custom,_contextmenus);
}
/// show dialog for changing ViewMode
......@@ -270,11 +321,11 @@ void CoreWidget::slotViewModeDialog(){
if ( !widget ){
widget = new viewModeWidget(viewModes_);
widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
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(changeView(QString, QStringList, QStringList, QStringList)), this, SLOT(slotChangeView(QString, QStringList, QStringList, QStringList)) );
connect(widget, SIGNAL(saveMode(QString, bool, QStringList, QStringList, QStringList)), this, SLOT(slotAddViewModeComplete(QString, bool, QStringList, QStringList, QStringList)) );
connect(widget, SIGNAL(removeMode(QString)), this, SLOT(slotRemoveViewMode(QString)) );
}
widget->show( OpenFlipper::Options::defaultToolboxMode() );
widget->show( OpenFlipper::Options::currentViewMode() );
}
void CoreWidget::slotViewChangeDialog() {
......@@ -284,12 +335,12 @@ void CoreWidget::slotViewChangeDialog() {
if ( !modeChangeWidget ){
modeChangeWidget = new viewModeChangeWidget(viewModes_, this);
modeChangeWidget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
connect(modeChangeWidget, SIGNAL(changeView(QString, QStringList, QStringList)), this, SLOT(slotChangeView(QString, QStringList, QStringList)) );
connect(modeChangeWidget, SIGNAL(changeView(QString, QStringList, QStringList, QStringList)), this, SLOT(slotChangeView(QString, QStringList, QStringList, QStringList)) );
}
// Make it look like a dialog
modeChangeWidget->setWindowFlags(Qt::Popup);
modeChangeWidget->show( OpenFlipper::Options::defaultToolboxMode() );
modeChangeWidget->show( OpenFlipper::Options::currentViewMode() );
// Move it to the position of the push button
QPoint posButton = vmChangeButton_->mapToGlobal(vmChangeButton_->pos());
......@@ -298,7 +349,7 @@ void CoreWidget::slotViewChangeDialog() {
}
/// Slot for Changing visible toolWidgets
void CoreWidget::slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars ){
void CoreWidget::slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus ){
//try to find Widgets if they aren't given
if (_mode != "" && _toolboxWidgets.size() == 0 && _toolbars.size() == 0)
......@@ -306,6 +357,7 @@ void CoreWidget::slotChangeView(QString _mode, QStringList _toolboxWidgets, QStr
if (viewModes_[i]->name == _mode) {
_toolboxWidgets = viewModes_[i]->visibleToolboxes;
_toolbars = viewModes_[i]->visibleToolbars;
_contextmenus = viewModes_[i]->visibleContextMenus;
}
// Remove all toolbox entries
......@@ -342,7 +394,7 @@ void CoreWidget::slotChangeView(QString _mode, QStringList _toolboxWidgets, QStr
if (_mode != "")
OpenFlipper::Options::defaultToolboxMode(_mode);
OpenFlipper::Options::currentViewMode(_mode);
}
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>755</width>
<width>767</width>
<height>816</height>
</rect>
</property>
......@@ -112,7 +112,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
......@@ -167,14 +167,14 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="upButton">
<widget class="QToolButton" name="upButtonToolbox">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="downButton">
<widget class="QToolButton" name="downButtonToolbox">
<property name="text">
<string/>
</property>
......@@ -353,6 +353,165 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Context Menus</string>
</attribute>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>4</x>
<y>4</y>
<width>729</width>
<height>452</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QGroupBox" name="groupBox_6">
<property name="title">
<string>Visible</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<layout class="QGridLayout" name="_12">
<item row="0" column="0">
<widget class="QListWidget" name="contextMenuList">
<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="_13">
<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="upButtonContextMenu">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="downButtonContextMenu">
<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>