From e20fa209cc56285ffa65fb3c7dde2ae1705c7b6b Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 15 Oct 2014 11:02:41 +0200 Subject: [PATCH 01/15] user settings UI layout improvements --- apps/opencs/view/settings/dialog.cpp | 39 ++++++++++--------- apps/opencs/view/settings/dialog.hpp | 5 ++- apps/opencs/view/settings/frame.cpp | 2 +- .../view/settings/resizeablestackedwidget.cpp | 1 - 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/apps/opencs/view/settings/dialog.cpp b/apps/opencs/view/settings/dialog.cpp index 72a022c9d..9018a454c 100644 --- a/apps/opencs/view/settings/dialog.cpp +++ b/apps/opencs/view/settings/dialog.cpp @@ -1,10 +1,13 @@ #include "dialog.hpp" +#include + #include #include #include #include #include +#include #include "../../model/settings/usersettings.hpp" @@ -12,8 +15,6 @@ #include -#include - #include #include #include @@ -26,6 +27,10 @@ CSVSettings::Dialog::Dialog(QMainWindow *parent) { setWindowTitle(QString::fromUtf8 ("User Settings")); + setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + + setMinimumSize (600, 400); + setupDialog(); connect (mPageListWidget, @@ -39,20 +44,14 @@ void CSVSettings::Dialog::slotChangePage { mStackedWidget->changePage (mPageListWidget->row (cur), mPageListWidget->row (prev)); - - layout()->activate(); - setFixedSize(minimumSizeHint()); } void CSVSettings::Dialog::setupDialog() { - //create central widget with it's layout and immediate children - QWidget *centralWidget = new QGroupBox (this); + QSplitter *centralWidget = new QSplitter (this); + centralWidget->setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - centralWidget->setLayout (new QHBoxLayout()); - centralWidget->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Preferred); setCentralWidget (centralWidget); - setDockOptions (QMainWindow::AllowNestedDocks); buildPageListWidget (centralWidget); buildStackedWidget (centralWidget); @@ -64,37 +63,41 @@ void CSVSettings::Dialog::buildPages() QFontMetrics fm (QApplication::font()); + int maxWidth = 1; + foreach (Page *page, SettingWindow::pages()) { QString pageName = page->objectName(); - int textWidth = fm.width(pageName); + maxWidth = std::max (maxWidth, fm.width(pageName)); new QListWidgetItem (pageName, mPageListWidget); - mPageListWidget->setFixedWidth (textWidth + 50); - mStackedWidget->addWidget (&dynamic_cast(*(page))); + mStackedWidget->addWidget (page); } + mPageListWidget->setMaximumWidth (maxWidth + 50); + resize (mStackedWidget->sizeHint()); } -void CSVSettings::Dialog::buildPageListWidget (QWidget *centralWidget) +void CSVSettings::Dialog::buildPageListWidget (QSplitter *centralWidget) { mPageListWidget = new QListWidget (centralWidget); mPageListWidget->setMinimumWidth(50); - mPageListWidget->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Expanding); + mPageListWidget->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding); mPageListWidget->setSelectionBehavior (QAbstractItemView::SelectItems); - centralWidget->layout()->addWidget(mPageListWidget); + centralWidget->addWidget(mPageListWidget); } -void CSVSettings::Dialog::buildStackedWidget (QWidget *centralWidget) +void CSVSettings::Dialog::buildStackedWidget (QSplitter *centralWidget) { mStackedWidget = new ResizeableStackedWidget (centralWidget); + mStackedWidget->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Expanding); - centralWidget->layout()->addWidget (mStackedWidget); + centralWidget->addWidget (mStackedWidget); } void CSVSettings::Dialog::closeEvent (QCloseEvent *event) diff --git a/apps/opencs/view/settings/dialog.hpp b/apps/opencs/view/settings/dialog.hpp index b0e12c461..cb85bddb9 100644 --- a/apps/opencs/view/settings/dialog.hpp +++ b/apps/opencs/view/settings/dialog.hpp @@ -8,6 +8,7 @@ class QStackedWidget; class QListWidget; class QListWidgetItem; +class QSplitter; namespace CSVSettings { @@ -39,8 +40,8 @@ namespace CSVSettings { private: void buildPages(); - void buildPageListWidget (QWidget *centralWidget); - void buildStackedWidget (QWidget *centralWidget); + void buildPageListWidget (QSplitter *centralWidget); + void buildStackedWidget (QSplitter *centralWidget); public slots: diff --git a/apps/opencs/view/settings/frame.cpp b/apps/opencs/view/settings/frame.cpp index a3df2a993..8e9cf45ff 100644 --- a/apps/opencs/view/settings/frame.cpp +++ b/apps/opencs/view/settings/frame.cpp @@ -39,7 +39,7 @@ void CSVSettings::Frame::hideWidgets() QWidget *widg = static_cast (obj); if (widg->property("sizePolicy").isValid()) - widg->setSizePolicy (QSizePolicy::Ignored, QSizePolicy::Ignored); + widg->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding); } layout()->activate(); diff --git a/apps/opencs/view/settings/resizeablestackedwidget.cpp b/apps/opencs/view/settings/resizeablestackedwidget.cpp index cb127cb76..0e87a2506 100644 --- a/apps/opencs/view/settings/resizeablestackedwidget.cpp +++ b/apps/opencs/view/settings/resizeablestackedwidget.cpp @@ -34,7 +34,6 @@ void CSVSettings::ResizeableStackedWidget::changePage curPage->showWidgets(); layout()->activate(); - setFixedSize(minimumSizeHint()); setCurrentIndex (current); } From 868fdfba51f3bb679b60a0cbe2f0f762948fb44d Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 15 Oct 2014 11:07:40 +0200 Subject: [PATCH 02/15] reclaiming some unused space --- apps/opencs/view/settings/frame.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/opencs/view/settings/frame.cpp b/apps/opencs/view/settings/frame.cpp index 8e9cf45ff..32e094274 100644 --- a/apps/opencs/view/settings/frame.cpp +++ b/apps/opencs/view/settings/frame.cpp @@ -17,7 +17,6 @@ CSVSettings::Frame::Frame (bool isVisible, const QString &title, { // must be Page, not a View setStyleSheet (sInvisibleBoxStyle); - mLayout->setContentsMargins(10, 15, 10, 15); } setLayout (mLayout); From 219fbd427fe1d030a8f4874952f37c74ef2032c1 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 15 Oct 2014 12:13:22 +0200 Subject: [PATCH 03/15] unclutter user settings declarations --- apps/opencs/model/settings/setting.cpp | 22 ++-- apps/opencs/model/settings/setting.hpp | 7 +- apps/opencs/model/settings/usersettings.cpp | 107 ++++++++------------ 3 files changed, 52 insertions(+), 84 deletions(-) diff --git a/apps/opencs/model/settings/setting.cpp b/apps/opencs/model/settings/setting.cpp index 404ec58f7..cf2b8178f 100644 --- a/apps/opencs/model/settings/setting.cpp +++ b/apps/opencs/model/settings/setting.cpp @@ -3,7 +3,7 @@ CSMSettings::Setting::Setting(SettingType typ, const QString &settingName, const QString &pageName) - : mIsEditorSetting (false) + : mIsEditorSetting (true) { buildDefaultSetting(); @@ -290,14 +290,16 @@ CSMSettings::SettingType CSMSettings::Setting::type() const Property_SettingType).at(0).toInt()); } -void CSMSettings::Setting::setMaximum (int value) +void CSMSettings::Setting::setRange (int min, int max) { - setProperty (Property_Maximum, value); + setProperty (Property_Minimum, min); + setProperty (Property_Maximum, max); } -void CSMSettings::Setting::setMaximum (double value) +void CSMSettings::Setting::setRange (double min, double max) { - setProperty (Property_Maximum, value); + setProperty (Property_Minimum, min); + setProperty (Property_Maximum, max); } QString CSMSettings::Setting::maximum() const @@ -305,16 +307,6 @@ QString CSMSettings::Setting::maximum() const return property (Property_Maximum).at(0); } -void CSMSettings::Setting::setMinimum (int value) -{ - setProperty (Property_Minimum, value); -} - -void CSMSettings::Setting::setMinimum (double value) -{ - setProperty (Property_Minimum, value); -} - QString CSMSettings::Setting::minimum() const { return property (Property_Minimum).at(0); diff --git a/apps/opencs/model/settings/setting.hpp b/apps/opencs/model/settings/setting.hpp index 0068fd158..962d0a438 100644 --- a/apps/opencs/model/settings/setting.hpp +++ b/apps/opencs/model/settings/setting.hpp @@ -66,12 +66,11 @@ namespace CSMSettings void setMask (const QString &value); QString mask() const; - void setMaximum (int value); - void setMaximum (double value); + void setRange (int min, int max); + void setRange (double min, double max); + QString maximum() const; - void setMinimum (int value); - void setMinimum (double value); QString minimum() const; void setName (const QString &value); diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 11fdc54f4..76548a48b 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -54,86 +54,41 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() { Setting *numLights = createSetting (Type_SpinBox, section, "num_lights"); numLights->setDefaultValue(8); - numLights->setEditorSetting(true); - numLights->setColumnSpan (1); - numLights->setMinimum (0); - numLights->setMaximum (100); // FIXME: not sure what the max value should be - numLights->setWidgetWidth (10); - numLights->setViewLocation(1, 2); + numLights->setRange (0, 100); Setting *shaders = createSetting (Type_CheckBox, section, "shaders"); - shaders->setDeclaredValues(QStringList() << "true" << "false"); shaders->setDefaultValue("true"); - shaders->setEditorSetting(true); shaders->setSpecialValueText("Enable Shaders"); - shaders->setWidgetWidth(25); - shaders->setColumnSpan (3); - shaders->setStyleSheet ("QGroupBox { border: 0px; }"); - shaders->setViewLocation(2, 1); } section = "Scene"; { Setting *fastFactor = createSetting (Type_SpinBox, section, "fast factor"); fastFactor->setDefaultValue(4); - fastFactor->setEditorSetting(true); - fastFactor->setColumnSpan (1); - fastFactor->setMinimum (1); - fastFactor->setSpecialValueText ("1"); // FIXME: workaround - fastFactor->setMaximum (100); // FIXME: not sure what the max value should be - fastFactor->setWidgetWidth (10); - fastFactor->setViewLocation(1, 2); + fastFactor->setRange (1, 100); Setting *farClipDist = createSetting (Type_DoubleSpinBox, section, "far clip distance"); farClipDist->setDefaultValue(300000); - farClipDist->setEditorSetting(true); - farClipDist->setColumnSpan (1); - farClipDist->setMinimum (0); - farClipDist->setMaximum (1000000); // FIXME: not sure what the max value should be - farClipDist->setWidgetWidth (10); - farClipDist->setViewLocation(2, 2); + farClipDist->setRange (0, 1000000); Setting *timerStart = createSetting (Type_SpinBox, section, "timer start"); timerStart->setDefaultValue(20); - timerStart->setEditorSetting(true); - timerStart->setColumnSpan (1); - timerStart->setMinimum (0); - timerStart->setMaximum (100); // FIXME: not sure what the max value should be - timerStart->setWidgetWidth (10); - timerStart->setViewLocation(3, 2); + timerStart->setRange (1, 100); } section = "SubView"; { Setting *maxSubView = createSetting (Type_SpinBox, section, "max subviews"); maxSubView->setDefaultValue(256); - maxSubView->setEditorSetting(true); - maxSubView->setColumnSpan (1); - maxSubView->setMinimum (1); - maxSubView->setSpecialValueText ("1"); - maxSubView->setMaximum (256); // FIXME: not sure what the max value should be - maxSubView->setWidgetWidth (10); - maxSubView->setViewLocation(1, 2); + maxSubView->setRange (1, 256); Setting *minWidth = createSetting (Type_SpinBox, section, "minimum width"); minWidth->setDefaultValue(325); - minWidth->setEditorSetting(true); - minWidth->setColumnSpan (1); - minWidth->setMinimum (50); - minWidth->setSpecialValueText ("50"); - minWidth->setMaximum (10000); // FIXME: not sure what the max value should be - minWidth->setWidgetWidth (10); - minWidth->setViewLocation(2, 2); + minWidth->setRange (50, 10000); Setting *reuse = createSetting (Type_CheckBox, section, "reuse"); - reuse->setDeclaredValues(QStringList() << "true" << "false"); reuse->setDefaultValue("true"); - reuse->setEditorSetting(true); reuse->setSpecialValueText("Reuse SubView"); - reuse->setWidgetWidth(25); - reuse->setColumnSpan (3); - reuse->setStyleSheet ("QGroupBox { border: 0px; }"); - reuse->setViewLocation(3, 2); } section = "Window Size"; @@ -141,15 +96,9 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() Setting *width = createSetting (Type_LineEdit, section, "Width"); Setting *height = createSetting (Type_LineEdit, section, "Height"); - width->setWidgetWidth (5); - height->setWidgetWidth (8); - width->setDefaultValues (QStringList() << "1024"); height->setDefaultValues (QStringList() << "768"); - width->setEditorSetting (true); - height->setEditorSetting (true); - height->setViewLocation (2,2); width->setViewLocation (2,1); @@ -159,11 +108,12 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() Setting *preDefined = createSetting (Type_ComboBox, section, "Pre-Defined"); + preDefined->setEditorSetting (false); + preDefined->setDeclaredValues (QStringList() << "640 x 480" << "800 x 600" << "1024 x 768" << "1440 x 900"); preDefined->setViewLocation (1, 1); - preDefined->setWidgetWidth (10); preDefined->setColumnSpan (2); preDefined->addProxy (width, @@ -190,9 +140,6 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() rsd->setDeclaredValues (values); ritd->setDeclaredValues (values); - - rsd->setEditorSetting (true); - ritd->setEditorSetting (true); } section = "Video"; @@ -202,8 +149,6 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() << defaultValue << "MSAA 2" << "MSAA 4" << "MSAA 8" << "MSAA 16"; Setting *antialiasing = createSetting (Type_SpinBox, section, "antialiasing"); antialiasing->setDeclaredValues (values); - antialiasing->setEditorSetting (true); - antialiasing->setWidgetWidth(15); } section = "Proxy Selection Test"; @@ -545,7 +490,7 @@ CSMSettings::SettingPageMap CSMSettings::UserSettings::settingPageMap() const } CSMSettings::Setting *CSMSettings::UserSettings::createSetting - (CSMSettings::SettingType typ, const QString &page, const QString &name) + (CSMSettings::SettingType type, const QString &page, const QString &name) { //get list of all settings for the current setting name if (findSetting (page, name)) @@ -555,8 +500,40 @@ CSMSettings::Setting *CSMSettings::UserSettings::createSetting return 0; } - Setting *setting = new Setting (typ, name, page); + Setting *setting = new Setting (type, name, page); + + // set useful defaults + int row = 1; + + if (!mSettings.empty()) + row = mSettings.back()->viewRow()+1; + + int column = 2; + + if (type==Type_CheckBox) + column = 1; + + setting->setViewLocation (row, column); + + int span = 1; + + if (type==Type_CheckBox) + span = 3; + + setting->setColumnSpan (span); + + int width = 10; + + if (type==Type_CheckBox) + width = 40; + + setting->setWidgetWidth (width); + + if (type==Type_CheckBox) + setting->setStyleSheet ("QGroupBox { border: 0px; }"); + if (type==Type_CheckBox) + setting->setDeclaredValues(QStringList() << "true" << "false"); //add declaration to the model mSettings.append (setting); From daf7cab416e24b1e45dbdfd5091671c1aa8a5aeb Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 15 Oct 2014 12:38:17 +0200 Subject: [PATCH 04/15] refactored section handling --- apps/opencs/model/settings/usersettings.cpp | 61 +++++++++------------ apps/opencs/model/settings/usersettings.hpp | 9 ++- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 76548a48b..ad2942eac 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -50,51 +50,51 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() { QString section; - section = "Objects"; + declareSection ("Objects"); { - Setting *numLights = createSetting (Type_SpinBox, section, "num_lights"); + Setting *numLights = createSetting (Type_SpinBox, "num_lights"); numLights->setDefaultValue(8); numLights->setRange (0, 100); - Setting *shaders = createSetting (Type_CheckBox, section, "shaders"); + Setting *shaders = createSetting (Type_CheckBox, "shaders"); shaders->setDefaultValue("true"); shaders->setSpecialValueText("Enable Shaders"); } - section = "Scene"; + declareSection ("Scene"); { - Setting *fastFactor = createSetting (Type_SpinBox, section, "fast factor"); + Setting *fastFactor = createSetting (Type_SpinBox, "fast factor"); fastFactor->setDefaultValue(4); fastFactor->setRange (1, 100); - Setting *farClipDist = createSetting (Type_DoubleSpinBox, section, "far clip distance"); + Setting *farClipDist = createSetting (Type_DoubleSpinBox, "far clip distance"); farClipDist->setDefaultValue(300000); farClipDist->setRange (0, 1000000); - Setting *timerStart = createSetting (Type_SpinBox, section, "timer start"); + Setting *timerStart = createSetting (Type_SpinBox, "timer start"); timerStart->setDefaultValue(20); timerStart->setRange (1, 100); } - section = "SubView"; + declareSection ("SubView"); { - Setting *maxSubView = createSetting (Type_SpinBox, section, "max subviews"); + Setting *maxSubView = createSetting (Type_SpinBox, "max subviews"); maxSubView->setDefaultValue(256); maxSubView->setRange (1, 256); - Setting *minWidth = createSetting (Type_SpinBox, section, "minimum width"); + Setting *minWidth = createSetting (Type_SpinBox, "minimum width"); minWidth->setDefaultValue(325); minWidth->setRange (50, 10000); - Setting *reuse = createSetting (Type_CheckBox, section, "reuse"); + Setting *reuse = createSetting (Type_CheckBox, "reuse"); reuse->setDefaultValue("true"); reuse->setSpecialValueText("Reuse SubView"); } - section = "Window Size"; + declareSection ("Window Size"); { - Setting *width = createSetting (Type_LineEdit, section, "Width"); - Setting *height = createSetting (Type_LineEdit, section, "Height"); + Setting *width = createSetting (Type_LineEdit, "Width"); + Setting *height = createSetting (Type_LineEdit, "Height"); width->setDefaultValues (QStringList() << "1024"); height->setDefaultValues (QStringList() << "768"); @@ -105,8 +105,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() /* *Create the proxy setting for predefined values */ - Setting *preDefined = createSetting (Type_ComboBox, section, - "Pre-Defined"); + Setting *preDefined = createSetting (Type_ComboBox, "Pre-Defined"); preDefined->setEditorSetting (false); @@ -125,33 +124,30 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() ); } - section = "Display Format"; + declareSection ("Display Format"); { QString defaultValue = "Icon and Text"; QStringList values = QStringList() << defaultValue << "Icon Only" << "Text Only"; - Setting *rsd = createSetting (Type_RadioButton, - section, "Record Status Display"); + Setting *rsd = createSetting (Type_RadioButton, "Record Status Display"); - Setting *ritd = createSetting (Type_RadioButton, - section, "Referenceable ID Type Display"); + Setting *ritd = createSetting (Type_RadioButton, "Referenceable ID Type Display"); rsd->setDeclaredValues (values); ritd->setDeclaredValues (values); } - section = "Video"; + declareSection ("Video"); { QString defaultValue = "None"; QStringList values = QStringList() << defaultValue << "MSAA 2" << "MSAA 4" << "MSAA 8" << "MSAA 16"; - Setting *antialiasing = createSetting (Type_SpinBox, section, "antialiasing"); + Setting *antialiasing = createSetting (Type_SpinBox, "antialiasing"); antialiasing->setDeclaredValues (values); } - section = "Proxy Selection Test"; { /****************************************************************** * There are three types of values: @@ -490,17 +486,9 @@ CSMSettings::SettingPageMap CSMSettings::UserSettings::settingPageMap() const } CSMSettings::Setting *CSMSettings::UserSettings::createSetting - (CSMSettings::SettingType type, const QString &page, const QString &name) + (CSMSettings::SettingType type, const QString &name) { - //get list of all settings for the current setting name - if (findSetting (page, name)) - { - qWarning() << "Duplicate declaration encountered: " - << (name + '/' + page); - return 0; - } - - Setting *setting = new Setting (type, name, page); + Setting *setting = new Setting (type, name, mSection); // set useful defaults int row = 1; @@ -541,6 +529,11 @@ CSMSettings::Setting *CSMSettings::UserSettings::createSetting return setting; } +void CSMSettings::UserSettings::declareSection (const QString& page) +{ + mSection = page; +} + QStringList CSMSettings::UserSettings::definitions (const QString &viewKey) const { if (mSettingDefinitions->contains (viewKey)) diff --git a/apps/opencs/model/settings/usersettings.hpp b/apps/opencs/model/settings/usersettings.hpp index 0aabd66e5..ae73ff0a6 100644 --- a/apps/opencs/model/settings/usersettings.hpp +++ b/apps/opencs/model/settings/usersettings.hpp @@ -35,6 +35,7 @@ namespace CSMSettings { QSettings *mSettingDefinitions; QSettings *mSettingCfgDefinitions; QList mSettings; + QString mSection; public: @@ -84,8 +85,12 @@ namespace CSMSettings { void buildSettingModelDefaults(); ///add a new setting to the model and return it - Setting *createSetting (CSMSettings::SettingType typ, - const QString &page, const QString &name); + Setting *createSetting (CSMSettings::SettingType type, const QString &name); + + /// Set the section for createSetting calls. + /// + /// Sections can be declared multiple times. + void declareSection (const QString& page); signals: From 720ba2c0d8a3f281207bd3dbde8f991a75598874 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 15 Oct 2014 13:39:53 +0200 Subject: [PATCH 05/15] split off settings label from internal settings name --- apps/opencs/model/settings/setting.cpp | 15 ++++++-- apps/opencs/model/settings/setting.hpp | 8 +++-- apps/opencs/model/settings/support.hpp | 9 ++--- apps/opencs/model/settings/usersettings.cpp | 39 +++++++++++---------- apps/opencs/model/settings/usersettings.hpp | 3 +- apps/opencs/view/settings/view.cpp | 2 +- 6 files changed, 48 insertions(+), 28 deletions(-) diff --git a/apps/opencs/model/settings/setting.cpp b/apps/opencs/model/settings/setting.cpp index cf2b8178f..374462ac2 100644 --- a/apps/opencs/model/settings/setting.cpp +++ b/apps/opencs/model/settings/setting.cpp @@ -2,8 +2,8 @@ #include "support.hpp" CSMSettings::Setting::Setting(SettingType typ, const QString &settingName, - const QString &pageName) - : mIsEditorSetting (true) + const QString &pageName, const QString& label) +: mIsEditorSetting (true) { buildDefaultSetting(); @@ -17,6 +17,7 @@ CSMSettings::Setting::Setting(SettingType typ, const QString &settingName, setProperty (Property_SettingType, QVariant (settingType).toString()); setProperty (Property_Page, pageName); setProperty (Property_Name, settingName); + setProperty (Property_Label, label.isEmpty() ? settingName : label); } void CSMSettings::Setting::buildDefaultSetting() @@ -364,6 +365,16 @@ bool CSMSettings::Setting::wrapping() const return (property (Property_Wrapping).at(0) == "true"); } +void CSMSettings::Setting::setLabel (const QString& label) +{ + setProperty (Property_Label, label); +} + +QString CSMSettings::Setting::getLabel() const +{ + return property (Property_Label).at (0); +} + void CSMSettings::Setting::setProperty (SettingProperty prop, bool value) { setProperty (prop, QStringList() << QVariant (value).toString()); diff --git a/apps/opencs/model/settings/setting.hpp b/apps/opencs/model/settings/setting.hpp index 962d0a438..bc542dbd0 100644 --- a/apps/opencs/model/settings/setting.hpp +++ b/apps/opencs/model/settings/setting.hpp @@ -29,8 +29,8 @@ namespace CSMSettings public: - explicit Setting(SettingType typ, const QString &settingName, - const QString &pageName); + Setting(SettingType typ, const QString &settingName, + const QString &pageName, const QString& label = ""); void addProxy (const Setting *setting, const QStringList &vals); void addProxy (const Setting *setting, const QList &list); @@ -131,6 +131,10 @@ namespace CSMSettings void setWidgetWidth (int value); int widgetWidth() const; + /// This is the text the user gets to see. + void setLabel (const QString& label); + QString getLabel() const; + ///returns the specified property value QStringList property (SettingProperty prop) const; diff --git a/apps/opencs/model/settings/support.hpp b/apps/opencs/model/settings/support.hpp index 1e122a214..15ad34191 100644 --- a/apps/opencs/model/settings/support.hpp +++ b/apps/opencs/model/settings/support.hpp @@ -36,12 +36,13 @@ namespace CSMSettings Property_TicksAbove = 20, Property_TicksBelow = 21, Property_StyleSheet = 22, + Property_Label = 23, //Stringlists should always be the last items - Property_DefaultValues = 23, - Property_DeclaredValues = 24, - Property_DefinedValues = 25, - Property_Proxies = 26 + Property_DefaultValues = 24, + Property_DeclaredValues = 25, + Property_DefinedValues = 26, + Property_Proxies = 27 }; ///Basic setting widget types. diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index ad2942eac..cb4003afa 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -52,49 +52,49 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() declareSection ("Objects"); { - Setting *numLights = createSetting (Type_SpinBox, "num_lights"); + Setting *numLights = createSetting (Type_SpinBox, "num_lights", "num_lights"); numLights->setDefaultValue(8); numLights->setRange (0, 100); - Setting *shaders = createSetting (Type_CheckBox, "shaders"); + Setting *shaders = createSetting (Type_CheckBox, "shaders", "Enable Shaders"); shaders->setDefaultValue("true"); - shaders->setSpecialValueText("Enable Shaders"); +// shaders->setSpecialValueText("Enable Shaders"); } declareSection ("Scene"); { - Setting *fastFactor = createSetting (Type_SpinBox, "fast factor"); + Setting *fastFactor = createSetting (Type_SpinBox, "fast factor", "fast factor"); fastFactor->setDefaultValue(4); fastFactor->setRange (1, 100); - Setting *farClipDist = createSetting (Type_DoubleSpinBox, "far clip distance"); + Setting *farClipDist = createSetting (Type_DoubleSpinBox, "far clip distance", "far clip distance"); farClipDist->setDefaultValue(300000); farClipDist->setRange (0, 1000000); - Setting *timerStart = createSetting (Type_SpinBox, "timer start"); + Setting *timerStart = createSetting (Type_SpinBox, "timer start", "timer start"); timerStart->setDefaultValue(20); timerStart->setRange (1, 100); } declareSection ("SubView"); { - Setting *maxSubView = createSetting (Type_SpinBox, "max subviews"); + Setting *maxSubView = createSetting (Type_SpinBox, "max subviews", "max subviews"); maxSubView->setDefaultValue(256); maxSubView->setRange (1, 256); - Setting *minWidth = createSetting (Type_SpinBox, "minimum width"); + Setting *minWidth = createSetting (Type_SpinBox, "minimum width", "minimum width"); minWidth->setDefaultValue(325); minWidth->setRange (50, 10000); - Setting *reuse = createSetting (Type_CheckBox, "reuse"); + Setting *reuse = createSetting (Type_CheckBox, "reuse", "Reuse SubView"); reuse->setDefaultValue("true"); - reuse->setSpecialValueText("Reuse SubView"); +// reuse->setSpecialValueText("Reuse SubView"); } declareSection ("Window Size"); { - Setting *width = createSetting (Type_LineEdit, "Width"); - Setting *height = createSetting (Type_LineEdit, "Height"); + Setting *width = createSetting (Type_LineEdit, "Width", "Width"); + Setting *height = createSetting (Type_LineEdit, "Height", "Height"); width->setDefaultValues (QStringList() << "1024"); height->setDefaultValues (QStringList() << "768"); @@ -105,7 +105,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() /* *Create the proxy setting for predefined values */ - Setting *preDefined = createSetting (Type_ComboBox, "Pre-Defined"); + Setting *preDefined = createSetting (Type_ComboBox, "Pre-Defined", "Pre-Defined"); preDefined->setEditorSetting (false); @@ -131,9 +131,9 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() QStringList values = QStringList() << defaultValue << "Icon Only" << "Text Only"; - Setting *rsd = createSetting (Type_RadioButton, "Record Status Display"); + Setting *rsd = createSetting (Type_RadioButton, "Record Status Display", "Record Status Display"); - Setting *ritd = createSetting (Type_RadioButton, "Referenceable ID Type Display"); + Setting *ritd = createSetting (Type_RadioButton, "Referenceable ID Type Display", "Referenceable ID Type Display"); rsd->setDeclaredValues (values); ritd->setDeclaredValues (values); @@ -144,7 +144,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() QString defaultValue = "None"; QStringList values = QStringList() << defaultValue << "MSAA 2" << "MSAA 4" << "MSAA 8" << "MSAA 16"; - Setting *antialiasing = createSetting (Type_SpinBox, "antialiasing"); + Setting *antialiasing = createSetting (Type_SpinBox, "antialiasing", "antialiasing"); antialiasing->setDeclaredValues (values); } @@ -486,9 +486,9 @@ CSMSettings::SettingPageMap CSMSettings::UserSettings::settingPageMap() const } CSMSettings::Setting *CSMSettings::UserSettings::createSetting - (CSMSettings::SettingType type, const QString &name) + (CSMSettings::SettingType type, const QString &name, const QString& label) { - Setting *setting = new Setting (type, name, mSection); + Setting *setting = new Setting (type, name, mSection, label); // set useful defaults int row = 1; @@ -523,6 +523,9 @@ CSMSettings::Setting *CSMSettings::UserSettings::createSetting if (type==Type_CheckBox) setting->setDeclaredValues(QStringList() << "true" << "false"); + if (type==Type_CheckBox) + setting->setSpecialValueText (setting->getLabel()); + //add declaration to the model mSettings.append (setting); diff --git a/apps/opencs/model/settings/usersettings.hpp b/apps/opencs/model/settings/usersettings.hpp index ae73ff0a6..9629f6cb5 100644 --- a/apps/opencs/model/settings/usersettings.hpp +++ b/apps/opencs/model/settings/usersettings.hpp @@ -85,7 +85,8 @@ namespace CSMSettings { void buildSettingModelDefaults(); ///add a new setting to the model and return it - Setting *createSetting (CSMSettings::SettingType type, const QString &name); + Setting *createSetting (CSMSettings::SettingType type, const QString &name, + const QString& label); /// Set the section for createSetting calls. /// diff --git a/apps/opencs/view/settings/view.cpp b/apps/opencs/view/settings/view.cpp index f95bb5c03..dbe2244a6 100644 --- a/apps/opencs/view/settings/view.cpp +++ b/apps/opencs/view/settings/view.cpp @@ -17,7 +17,7 @@ CSVSettings::View::View(CSMSettings::Setting *setting, mIsMultiValue (setting->isMultiValue()), mViewKey (setting->page() + '/' + setting->name()), mSerializable (setting->serializable()), - Frame(true, setting->name(), parent) + Frame(true, setting->getLabel(), parent) { setObjectName (setting->name()); buildView(); From c94c1adaf34d3b5b4afd8319a64b0427d4e062da Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 16 Oct 2014 13:48:07 +0200 Subject: [PATCH 06/15] split off settings page label from internal section name --- apps/opencs/model/settings/usersettings.cpp | 34 +++++++++++++++------ apps/opencs/model/settings/usersettings.hpp | 9 ++++-- apps/opencs/view/settings/dialog.cpp | 6 ++-- apps/opencs/view/settings/page.cpp | 12 +++++--- apps/opencs/view/settings/page.hpp | 8 +++-- apps/opencs/view/settings/settingwindow.cpp | 4 +-- 6 files changed, 48 insertions(+), 25 deletions(-) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index cb4003afa..3729ed6cc 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -50,7 +50,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() { QString section; - declareSection ("Objects"); + declareSection ("Objects", "Objects"); { Setting *numLights = createSetting (Type_SpinBox, "num_lights", "num_lights"); numLights->setDefaultValue(8); @@ -58,10 +58,9 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() Setting *shaders = createSetting (Type_CheckBox, "shaders", "Enable Shaders"); shaders->setDefaultValue("true"); -// shaders->setSpecialValueText("Enable Shaders"); } - declareSection ("Scene"); + declareSection ("Scene", "Scene"); { Setting *fastFactor = createSetting (Type_SpinBox, "fast factor", "fast factor"); fastFactor->setDefaultValue(4); @@ -76,7 +75,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() timerStart->setRange (1, 100); } - declareSection ("SubView"); + declareSection ("SubView", "SubView"); { Setting *maxSubView = createSetting (Type_SpinBox, "max subviews", "max subviews"); maxSubView->setDefaultValue(256); @@ -91,7 +90,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() // reuse->setSpecialValueText("Reuse SubView"); } - declareSection ("Window Size"); + declareSection ("Window Size", "Window Size"); { Setting *width = createSetting (Type_LineEdit, "Width", "Width"); Setting *height = createSetting (Type_LineEdit, "Height", "Height"); @@ -124,7 +123,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() ); } - declareSection ("Display Format"); + declareSection ("Display Format", "Display Format"); { QString defaultValue = "Icon and Text"; @@ -139,7 +138,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() ritd->setDeclaredValues (values); } - declareSection ("Video"); + declareSection ("Video", "Video"); { QString defaultValue = "None"; QStringList values = QStringList() @@ -480,7 +479,23 @@ CSMSettings::SettingPageMap CSMSettings::UserSettings::settingPageMap() const SettingPageMap pageMap; foreach (Setting *setting, mSettings) - pageMap[setting->page()].append (setting); + { + SettingPageMap::iterator iter = pageMap.find (setting->page()); + + if (iter==pageMap.end()) + { + QPair > value; + + std::map::const_iterator iter2 = + mSectionLabels.find (setting->page()); + + value.first = iter2!=mSectionLabels.end() ? iter2->second : ""; + + iter = pageMap.insert (setting->page(), value); + } + + iter->second.append (setting); + } return pageMap; } @@ -532,9 +547,10 @@ CSMSettings::Setting *CSMSettings::UserSettings::createSetting return setting; } -void CSMSettings::UserSettings::declareSection (const QString& page) +void CSMSettings::UserSettings::declareSection (const QString& page, const QString& label) { mSection = page; + mSectionLabels[page] = label; } QStringList CSMSettings::UserSettings::definitions (const QString &viewKey) const diff --git a/apps/opencs/model/settings/usersettings.hpp b/apps/opencs/model/settings/usersettings.hpp index 9629f6cb5..ef5c61438 100644 --- a/apps/opencs/model/settings/usersettings.hpp +++ b/apps/opencs/model/settings/usersettings.hpp @@ -1,10 +1,13 @@ #ifndef USERSETTINGS_HPP #define USERSETTINGS_HPP +#include + #include #include #include #include +#include #include #include "support.hpp" @@ -22,7 +25,7 @@ class QSettings; namespace CSMSettings { class Setting; - typedef QMap > SettingPageMap; + typedef QMap > > SettingPageMap; class UserSettings: public QObject { @@ -36,7 +39,7 @@ namespace CSMSettings { QSettings *mSettingCfgDefinitions; QList mSettings; QString mSection; - + std::map mSectionLabels; public: @@ -91,7 +94,7 @@ namespace CSMSettings { /// Set the section for createSetting calls. /// /// Sections can be declared multiple times. - void declareSection (const QString& page); + void declareSection (const QString& page, const QString& label); signals: diff --git a/apps/opencs/view/settings/dialog.cpp b/apps/opencs/view/settings/dialog.cpp index 9018a454c..e66da8571 100644 --- a/apps/opencs/view/settings/dialog.cpp +++ b/apps/opencs/view/settings/dialog.cpp @@ -67,11 +67,9 @@ void CSVSettings::Dialog::buildPages() foreach (Page *page, SettingWindow::pages()) { - QString pageName = page->objectName(); + maxWidth = std::max (maxWidth, fm.width(page->getLabel())); - maxWidth = std::max (maxWidth, fm.width(pageName)); - - new QListWidgetItem (pageName, mPageListWidget); + new QListWidgetItem (page->getLabel(), mPageListWidget); mStackedWidget->addWidget (page); } diff --git a/apps/opencs/view/settings/page.cpp b/apps/opencs/view/settings/page.cpp index ed4cdd6bc..e846840b8 100644 --- a/apps/opencs/view/settings/page.cpp +++ b/apps/opencs/view/settings/page.cpp @@ -17,10 +17,9 @@ QMap CSVSettings::Page::mViewFactories; -CSVSettings::Page::Page(const QString &pageName, - QList settingList, - SettingWindow *parent) : - mParent(parent), mIsEditorPage (false), Frame(false, "", parent) +CSVSettings::Page::Page (const QString &pageName, QList settingList, + SettingWindow *parent, const QString& label) +: mParent(parent), mIsEditorPage (false), Frame(false, "", parent), mLabel (label) { setObjectName (pageName); @@ -104,3 +103,8 @@ void CSVSettings::Page::buildFactories() mViewFactories[ViewType_List] = new ListViewFactory (this); mViewFactories[ViewType_Range] = new RangeViewFactory (this); } + +QString CSVSettings::Page::getLabel() const +{ + return mLabel; +} diff --git a/apps/opencs/view/settings/page.hpp b/apps/opencs/view/settings/page.hpp index 877d4bef8..caf2eec3f 100644 --- a/apps/opencs/view/settings/page.hpp +++ b/apps/opencs/view/settings/page.hpp @@ -25,11 +25,11 @@ namespace CSVSettings SettingWindow *mParent; static QMap mViewFactories; bool mIsEditorPage; + QString mLabel; public: - explicit Page(const QString &pageName, - QList settingList, - SettingWindow *parent); + Page (const QString &pageName, QList settingList, + SettingWindow *parent, const QString& label); ///Creates a new view based on the passed setting and adds it to ///the page. @@ -42,6 +42,8 @@ namespace CSVSettings ///returns the list of views associated with the page const QList &views () const { return mViews; } + QString getLabel() const; + private: ///Creates views based on the passed setting list diff --git a/apps/opencs/view/settings/settingwindow.cpp b/apps/opencs/view/settings/settingwindow.cpp index 4570a96db..76ea9dc4f 100644 --- a/apps/opencs/view/settings/settingwindow.cpp +++ b/apps/opencs/view/settings/settingwindow.cpp @@ -20,9 +20,9 @@ void CSVSettings::SettingWindow::createPages() foreach (const QString &pageName, pageMap.keys()) { - QList pageSettings = pageMap.value (pageName); + QList pageSettings = pageMap.value (pageName).second; - mPages.append (new Page (pageName, pageSettings, this)); + mPages.append (new Page (pageName, pageSettings, this, pageMap.value (pageName).first)); for (int i = 0; i < pageSettings.size(); i++) { From e27da6a0d42a032f5f3a0ef7fecefa576f14c7f5 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 16 Oct 2014 13:59:34 +0200 Subject: [PATCH 07/15] removed settings file mixup --- apps/opencs/model/settings/usersettings.cpp | 27 +++------------------ apps/opencs/model/settings/usersettings.hpp | 1 - 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 3729ed6cc..a1cb91402 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -35,15 +35,11 @@ CSMSettings::UserSettings *CSMSettings::UserSettings::mUserSettingsInstance = 0; CSMSettings::UserSettings::UserSettings (const Files::ConfigurationManager& configurationManager) : mCfgMgr (configurationManager) , mSettingDefinitions(NULL) - , mSettingCfgDefinitions(NULL) { assert(!mUserSettingsInstance); mUserSettingsInstance = this; buildSettingModelDefaults(); - - // for overriding opencs.ini settings with those from settings.cfg - mSettingCfgDefinitions = new QSettings(QSettings::IniFormat, QSettings::UserScope, "", QString(), this); } void CSMSettings::UserSettings::buildSettingModelDefaults() @@ -351,10 +347,6 @@ void CSMSettings::UserSettings::loadSettings (const QString &fileName) mSettingDefinitions = new QSettings (QSettings::IniFormat, QSettings::UserScope, "opencs", QString(), this); - - // check if override entry exists (default: disabled) - if(!mSettingDefinitions->childGroups().contains("Video", Qt::CaseInsensitive)) - mSettingDefinitions->setValue("Video/use settings.cfg", "false"); } // if the key is not found create one with a defaut value @@ -391,23 +383,10 @@ QString CSMSettings::UserSettings::settingValue (const QString &settingKey) { QStringList defs; - // check if video settings are overriden - if(settingKey.contains(QRegExp("^Video\\b", Qt::CaseInsensitive)) && - mSettingDefinitions->value("Video/use settings.cfg") == "true" && - settingKey.contains(QRegExp("^Video/\\brender|antialiasing|vsync|fullscreen\\b", Qt::CaseInsensitive))) - { - if (!mSettingCfgDefinitions->contains (settingKey)) - return QString(); - else - defs = mSettingCfgDefinitions->value (settingKey).toStringList(); - } - else - { - if (!mSettingDefinitions->contains (settingKey)) - return QString(); + if (!mSettingDefinitions->contains (settingKey)) + return QString(); - defs = mSettingDefinitions->value (settingKey).toStringList(); - } + defs = mSettingDefinitions->value (settingKey).toStringList(); if (defs.isEmpty()) return QString(); diff --git a/apps/opencs/model/settings/usersettings.hpp b/apps/opencs/model/settings/usersettings.hpp index ef5c61438..37c7cffb5 100644 --- a/apps/opencs/model/settings/usersettings.hpp +++ b/apps/opencs/model/settings/usersettings.hpp @@ -36,7 +36,6 @@ namespace CSMSettings { const Files::ConfigurationManager& mCfgMgr; QSettings *mSettingDefinitions; - QSettings *mSettingCfgDefinitions; QList mSettings; QString mSection; std::map mSectionLabels; From 799cd87b52fce3636e2567f3acae57c7e74250c7 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 16 Oct 2014 14:24:17 +0200 Subject: [PATCH 08/15] name convention and spelling fixes --- apps/opencs/model/settings/usersettings.cpp | 14 +++++++------- apps/opencs/model/settings/usersettings.hpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index a1cb91402..18270b4d4 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -30,14 +30,14 @@ namespace boost } /* namespace boost */ #endif /* (BOOST_VERSION <= 104600) */ -CSMSettings::UserSettings *CSMSettings::UserSettings::mUserSettingsInstance = 0; +CSMSettings::UserSettings *CSMSettings::UserSettings::sUserSettingsInstance = 0; CSMSettings::UserSettings::UserSettings (const Files::ConfigurationManager& configurationManager) : mCfgMgr (configurationManager) , mSettingDefinitions(NULL) { - assert(!mUserSettingsInstance); - mUserSettingsInstance = this; + assert(!sUserSettingsInstance); + sUserSettingsInstance = this; buildSettingModelDefaults(); } @@ -318,7 +318,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() CSMSettings::UserSettings::~UserSettings() { - mUserSettingsInstance = 0; + sUserSettingsInstance = 0; } void CSMSettings::UserSettings::loadSettings (const QString &fileName) @@ -349,7 +349,7 @@ void CSMSettings::UserSettings::loadSettings (const QString &fileName) (QSettings::IniFormat, QSettings::UserScope, "opencs", QString(), this); } -// if the key is not found create one with a defaut value +// if the key is not found create one with a default value QString CSMSettings::UserSettings::setting(const QString &viewKey, const QString &value) { if(mSettingDefinitions->contains(viewKey)) @@ -396,8 +396,8 @@ QString CSMSettings::UserSettings::settingValue (const QString &settingKey) CSMSettings::UserSettings& CSMSettings::UserSettings::instance() { - assert(mUserSettingsInstance); - return *mUserSettingsInstance; + assert(sUserSettingsInstance); + return *sUserSettingsInstance; } void CSMSettings::UserSettings::updateUserSetting(const QString &settingKey, diff --git a/apps/opencs/model/settings/usersettings.hpp b/apps/opencs/model/settings/usersettings.hpp index 37c7cffb5..5188a9842 100644 --- a/apps/opencs/model/settings/usersettings.hpp +++ b/apps/opencs/model/settings/usersettings.hpp @@ -32,7 +32,7 @@ namespace CSMSettings { Q_OBJECT - static UserSettings *mUserSettingsInstance; + static UserSettings *sUserSettingsInstance; const Files::ConfigurationManager& mCfgMgr; QSettings *mSettingDefinitions; @@ -67,7 +67,7 @@ namespace CSMSettings { void removeSetting (const QString &pageName, const QString &settingName); - ///Retreive a map of the settings, keyed by page name + ///Retrieve a map of the settings, keyed by page name SettingPageMap settingPageMap() const; ///Returns a string list of defined vlaues for the specified setting From dddd20ba1ebd3f52f0f0b027ce4f9473ddd41319 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 16 Oct 2014 14:31:13 +0200 Subject: [PATCH 09/15] added default values for display format settings --- apps/opencs/model/settings/usersettings.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 18270b4d4..49930e334 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -83,7 +83,6 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() Setting *reuse = createSetting (Type_CheckBox, "reuse", "Reuse SubView"); reuse->setDefaultValue("true"); -// reuse->setSpecialValueText("Reuse SubView"); } declareSection ("Window Size", "Window Size"); @@ -130,6 +129,9 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() Setting *ritd = createSetting (Type_RadioButton, "Referenceable ID Type Display", "Referenceable ID Type Display"); + rsd->setDefaultValue (defaultValue); + ritd->setDefaultValue (defaultValue); + rsd->setDeclaredValues (values); ritd->setDeclaredValues (values); } From f4894deff1d91e386b2b78db25a3ffb6d693d3e5 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 16 Oct 2014 14:47:55 +0200 Subject: [PATCH 10/15] removed special value text from spin boxes (broken feature, not used anyway) --- apps/opencs/view/settings/rangeview.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/opencs/view/settings/rangeview.cpp b/apps/opencs/view/settings/rangeview.cpp index c96df9859..3f79c71b6 100644 --- a/apps/opencs/view/settings/rangeview.cpp +++ b/apps/opencs/view/settings/rangeview.cpp @@ -126,8 +126,6 @@ void CSVSettings::RangeView::buildSpinBox (CSMSettings::Setting *setting) mRangeWidget->setProperty ("minimum", setting->minimum()); mRangeWidget->setProperty ("maximum", setting->maximum()); mRangeWidget->setProperty ("singleStep", setting->singleStep()); - mRangeWidget->setProperty ("specialValueText", - setting->specialValueText()); } mRangeWidget->setProperty ("prefix", setting->prefix()); From 7de636069537cd5238b00e57ec398af4b32b874f Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 16 Oct 2014 14:50:25 +0200 Subject: [PATCH 11/15] Removed all content from opencs.ini Not needed since we already have reasonable default values within the code. Keeping the file to allow global modifications to these values. --- files/opencs.ini | 7 ------- 1 file changed, 7 deletions(-) diff --git a/files/opencs.ini b/files/opencs.ini index 065f11a88..e69de29bb 100644 --- a/files/opencs.ini +++ b/files/opencs.ini @@ -1,7 +0,0 @@ -[Display%20Format] -Record%20Status%20Display=Icon Only -Referenceable%20ID%20Type%20Display=Text Only - -[Window%20Size] -Height=900 -Width=1440 From ed44f3ec7dc43649124d42f7ca5e7ddfcd9c3b84 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 16 Oct 2014 15:11:07 +0200 Subject: [PATCH 12/15] added tooltip support to user settings UI --- apps/opencs/model/settings/setting.cpp | 10 ++++++++++ apps/opencs/model/settings/setting.hpp | 3 +++ apps/opencs/model/settings/support.hpp | 9 +++++---- apps/opencs/view/settings/view.cpp | 3 +++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/apps/opencs/model/settings/setting.cpp b/apps/opencs/model/settings/setting.cpp index 374462ac2..9e33ab916 100644 --- a/apps/opencs/model/settings/setting.cpp +++ b/apps/opencs/model/settings/setting.cpp @@ -375,6 +375,16 @@ QString CSMSettings::Setting::getLabel() const return property (Property_Label).at (0); } +void CSMSettings::Setting::setToolTip (const QString& toolTip) +{ + setProperty (Property_ToolTip, toolTip); +} + +QString CSMSettings::Setting::getToolTip() const +{ + return property (Property_ToolTip).at (0); +} + void CSMSettings::Setting::setProperty (SettingProperty prop, bool value) { setProperty (prop, QStringList() << QVariant (value).toString()); diff --git a/apps/opencs/model/settings/setting.hpp b/apps/opencs/model/settings/setting.hpp index bc542dbd0..be51a531a 100644 --- a/apps/opencs/model/settings/setting.hpp +++ b/apps/opencs/model/settings/setting.hpp @@ -135,6 +135,9 @@ namespace CSMSettings void setLabel (const QString& label); QString getLabel() const; + void setToolTip (const QString& toolTip); + QString getToolTip() const; + ///returns the specified property value QStringList property (SettingProperty prop) const; diff --git a/apps/opencs/model/settings/support.hpp b/apps/opencs/model/settings/support.hpp index 15ad34191..ab0e5088c 100644 --- a/apps/opencs/model/settings/support.hpp +++ b/apps/opencs/model/settings/support.hpp @@ -37,12 +37,13 @@ namespace CSMSettings Property_TicksBelow = 21, Property_StyleSheet = 22, Property_Label = 23, + Property_ToolTip = 24, //Stringlists should always be the last items - Property_DefaultValues = 24, - Property_DeclaredValues = 25, - Property_DefinedValues = 26, - Property_Proxies = 27 + Property_DefaultValues = 25, + Property_DeclaredValues = 26, + Property_DefinedValues = 27, + Property_Proxies = 28 }; ///Basic setting widget types. diff --git a/apps/opencs/view/settings/view.cpp b/apps/opencs/view/settings/view.cpp index dbe2244a6..39c7f89b2 100644 --- a/apps/opencs/view/settings/view.cpp +++ b/apps/opencs/view/settings/view.cpp @@ -19,6 +19,9 @@ CSVSettings::View::View(CSMSettings::Setting *setting, mSerializable (setting->serializable()), Frame(true, setting->getLabel(), parent) { + if (!setting->getToolTip().isEmpty()) + setToolTip (setting->getToolTip()); + setObjectName (setting->name()); buildView(); buildModel (setting); From 4b921c387606aa2a3ad46b9cb9c1013a2d88114b Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 17 Oct 2014 13:49:33 +0200 Subject: [PATCH 13/15] user settings cleanup --- apps/opencs/editor.cpp | 2 +- apps/opencs/model/settings/usersettings.cpp | 162 +++++++++--------- apps/opencs/view/doc/view.cpp | 10 +- apps/opencs/view/render/scenewidget.cpp | 12 +- apps/opencs/view/world/idtypedelegate.cpp | 2 +- .../view/world/recordstatusdelegate.cpp | 2 +- 6 files changed, 93 insertions(+), 97 deletions(-) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index fb185e426..360a7515c 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -331,7 +331,7 @@ std::auto_ptr CS::Editor::setupGraphics() factory->loadAllFiles(); - bool shaders = mUserSettings.setting("Objects/shaders", QString("true")) == "true" ? true : false; + bool shaders = mUserSettings.setting("3d-render/shaders", QString("true")) == "true" ? true : false; sh::Factory::getInstance ().setShadersEnabled (shaders); std::string fog = mUserSettings.setting("Shader/fog", QString("true")).toStdString(); diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 49930e334..022d7e089 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -46,105 +46,111 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() { QString section; - declareSection ("Objects", "Objects"); + declareSection ("3d-render", "3D Rendering"); { - Setting *numLights = createSetting (Type_SpinBox, "num_lights", "num_lights"); - numLights->setDefaultValue(8); - numLights->setRange (0, 100); - Setting *shaders = createSetting (Type_CheckBox, "shaders", "Enable Shaders"); - shaders->setDefaultValue("true"); - } + shaders->setDefaultValue ("true"); - declareSection ("Scene", "Scene"); - { - Setting *fastFactor = createSetting (Type_SpinBox, "fast factor", "fast factor"); - fastFactor->setDefaultValue(4); - fastFactor->setRange (1, 100); - - Setting *farClipDist = createSetting (Type_DoubleSpinBox, "far clip distance", "far clip distance"); - farClipDist->setDefaultValue(300000); + Setting *farClipDist = createSetting (Type_DoubleSpinBox, "far-clip-distance", "Far clipping distance"); + farClipDist->setDefaultValue (300000); farClipDist->setRange (0, 1000000); + farClipDist->setToolTip ("The maximum distance objects are still rendered at."); - Setting *timerStart = createSetting (Type_SpinBox, "timer start", "timer start"); - timerStart->setDefaultValue(20); - timerStart->setRange (1, 100); + QString defaultValue = "None"; + Setting *antialiasing = createSetting (Type_ComboBox, "antialiasing", "Antialiasing"); + antialiasing->setDeclaredValues (QStringList() + << defaultValue << "MSAA 2" << "MSAA 4" << "MSAA 8" << "MSAA 16"); + antialiasing->setDefaultValue (defaultValue); } - declareSection ("SubView", "SubView"); + declareSection ("scene-input", "Scene Input"); { - Setting *maxSubView = createSetting (Type_SpinBox, "max subviews", "max subviews"); - maxSubView->setDefaultValue(256); - maxSubView->setRange (1, 256); - - Setting *minWidth = createSetting (Type_SpinBox, "minimum width", "minimum width"); - minWidth->setDefaultValue(325); - minWidth->setRange (50, 10000); - - Setting *reuse = createSetting (Type_CheckBox, "reuse", "Reuse SubView"); - reuse->setDefaultValue("true"); + Setting *timer = createSetting (Type_SpinBox, "timer", "Input responsiveness"); + timer->setDefaultValue (20); + timer->setRange (1, 100); + timer->setToolTip ("The time between two checks for user input in milliseconds.

" + "Lower value result in higher responsiveness."); + + Setting *fastFactor = createSetting (Type_SpinBox, "fast-factor", + "Fast movement factor"); + fastFactor->setDefaultValue (4); + fastFactor->setRange (1, 100); + fastFactor->setToolTip ( + "Factor by which movement is speed up while the shift key is held down."); } - declareSection ("Window Size", "Window Size"); + declareSection ("window", "Window"); { - Setting *width = createSetting (Type_LineEdit, "Width", "Width"); - Setting *height = createSetting (Type_LineEdit, "Height", "Height"); - - width->setDefaultValues (QStringList() << "1024"); - height->setDefaultValues (QStringList() << "768"); - - height->setViewLocation (2,2); - width->setViewLocation (2,1); - - /* - *Create the proxy setting for predefined values - */ - Setting *preDefined = createSetting (Type_ComboBox, "Pre-Defined", "Pre-Defined"); - + Setting *preDefined = createSetting (Type_ComboBox, "pre-defined", + "Default window size"); preDefined->setEditorSetting (false); - - preDefined->setDeclaredValues (QStringList() << "640 x 480" - << "800 x 600" << "1024 x 768" << "1440 x 900"); - + preDefined->setDeclaredValues ( + QStringList() << "640 x 480" << "800 x 600" << "1024 x 768" << "1440 x 900"); preDefined->setViewLocation (1, 1); preDefined->setColumnSpan (2); + preDefined->setToolTip ("Newly opened top-level windows will open with this size " + "(picked from a list of pre-defined values)"); + + Setting *width = createSetting (Type_LineEdit, "default-width", + "Default window width"); + width->setDefaultValues (QStringList() << "1024"); + width->setViewLocation (2, 1); + width->setColumnSpan (1); + width->setToolTip ("Newly opened top-level windows will open with this width."); + preDefined->addProxy (width, QStringList() << "640" << "800" << "1024" << "1440"); - preDefined->addProxy (width, - QStringList() << "640" << "800" << "1024" << "1440" - ); + Setting *height = createSetting (Type_LineEdit, "default-height", + "Default window height"); + height->setDefaultValues (QStringList() << "768"); + height->setViewLocation (2, 2); + height->setColumnSpan (1); + height->setToolTip ("Newly opened top-level windows will open with this height."); + preDefined->addProxy (height, QStringList() << "480" << "600" << "768" << "900"); + + Setting *reuse = createSetting (Type_CheckBox, "reuse", "Reuse Subviews"); + reuse->setDefaultValue ("true"); + reuse->setToolTip ("When a new subview is requested and a matching subview already " + " exist, do not open a new subview and use the existing one instead."); + + Setting *maxSubView = createSetting (Type_SpinBox, "max-subviews", + "Maximum number of subviews per top-level window"); + maxSubView->setDefaultValue (256); + maxSubView->setRange (1, 256); + maxSubView->setToolTip ("If the maximum number is reached and a new subview is opened " + "it will be placed into a new top-level window."); - preDefined->addProxy (height, - QStringList() << "480" << "600" << "768" << "900" - ); + Setting *minWidth = createSetting (Type_SpinBox, "minimum-width", + "Minimum subview width"); + minWidth->setDefaultValue (325); + minWidth->setRange (50, 10000); + minWidth->setToolTip ("Minimum width of subviews."); } - declareSection ("Display Format", "Display Format"); + declareSection ("records", "Records"); { QString defaultValue = "Icon and Text"; + QStringList values = QStringList() << defaultValue << "Icon Only" << "Text Only"; - QStringList values = QStringList() - << defaultValue << "Icon Only" << "Text Only"; - - Setting *rsd = createSetting (Type_RadioButton, "Record Status Display", "Record Status Display"); - - Setting *ritd = createSetting (Type_RadioButton, "Referenceable ID Type Display", "Referenceable ID Type Display"); - + Setting *rsd = createSetting (Type_RadioButton, "status-format", + "Modification status display format"); rsd->setDefaultValue (defaultValue); - ritd->setDefaultValue (defaultValue); - rsd->setDeclaredValues (values); + + Setting *ritd = createSetting (Type_RadioButton, "type-format", + "ID type display format"); + ritd->setDefaultValue (defaultValue); ritd->setDeclaredValues (values); } - declareSection ("Video", "Video"); + declareSection ("Objects", "Objects"); { - QString defaultValue = "None"; - QStringList values = QStringList() - << defaultValue << "MSAA 2" << "MSAA 4" << "MSAA 8" << "MSAA 16"; - Setting *antialiasing = createSetting (Type_SpinBox, "antialiasing", "antialiasing"); - antialiasing->setDeclaredValues (values); + + Setting *numLights = createSetting (Type_SpinBox, "num_lights", "num_lights"); + numLights->setDefaultValue(8); + numLights->setRange (0, 100); } + { /****************************************************************** * There are three types of values: @@ -411,7 +417,7 @@ void CSMSettings::UserSettings::updateUserSetting(const QString &settingKey, { sh::Factory::getInstance ().setGlobalSetting ("num_lights", list.at(0).toStdString()); } - else if(settingKey == "Objects/shaders" && !list.empty()) + else if(settingKey == "3d-render/shaders" && !list.empty()) { sh::Factory::getInstance ().setShadersEnabled (list.at(0).toStdString() == "true" ? true : false); } @@ -492,19 +498,9 @@ CSMSettings::Setting *CSMSettings::UserSettings::createSetting if (!mSettings.empty()) row = mSettings.back()->viewRow()+1; - int column = 2; - - if (type==Type_CheckBox) - column = 1; - - setting->setViewLocation (row, column); - - int span = 1; - - if (type==Type_CheckBox) - span = 3; + setting->setViewLocation (row, 1); - setting->setColumnSpan (span); + setting->setColumnSpan (3); int width = 10; diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index 67c76d026..d36e01901 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -369,10 +369,10 @@ CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int to mViewTotal (totalViews) { QString width = CSMSettings::UserSettings::instance().settingValue - ("Window Size/Width"); + ("window/default-width"); QString height = CSMSettings::UserSettings::instance().settingValue - ("Window Size/Height"); + ("window/default-height"); // trick to get the window decorations and their sizes show(); @@ -459,7 +459,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin // User setting to reuse sub views (on a per top level view basis) bool reuse = - userSettings.setting("SubView/reuse", QString("true")) == "true" ? true : false; + userSettings.setting ("window/reuse", QString("true")) == "true" ? true : false; if(reuse) { foreach(SubView *sb, mSubViews) @@ -478,7 +478,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin // // If the sub view limit setting is one, the sub view title bar is hidden and the // text in the main title bar is adjusted accordingly - int maxSubView = userSettings.setting("SubView/max subviews", QString("256")).toInt(); + int maxSubView = userSettings.setting("window/max-subviews", QString("256")).toInt(); if(mSubViews.size() >= maxSubView) // create a new top level view { mViewManager.addView(mDocument, id, hint); @@ -501,7 +501,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin if (!hint.empty()) view->useHint (hint); - int minWidth = userSettings.setting("SubView/minimum width", QString("325")).toInt(); + int minWidth = userSettings.setting ("window/minimum-width", QString("325")).toInt(); view->setMinimumWidth(minWidth); view->setStatusBar (mShowStatusBar->isChecked()); diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index 53599c3cb..125af152f 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -50,10 +50,10 @@ namespace CSVRender CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance(); - float farClipDist = userSettings.setting("Scene/far clip distance", QString("300000")).toFloat(); + float farClipDist = userSettings.setting("3d-render/far-clip-distance", QString("300000")).toFloat(); mCamera->setFarClipDistance (farClipDist); - mFastFactor = userSettings.setting("Scene/fast factor", QString("4")).toInt(); + mFastFactor = userSettings.setting("scene-input/fast-factor", QString("4")).toInt(); mCamera->roll (Ogre::Degree (90)); @@ -63,7 +63,7 @@ namespace CSVRender connect (timer, SIGNAL (timeout()), this, SLOT (update())); - int timerStart = userSettings.setting("Scene/timer start", QString("20")).toInt(); + int timerStart = userSettings.setting("scene-input/timer", QString("20")).toInt(); timer->start (timerStart); /// \todo make shortcut configurable @@ -132,7 +132,7 @@ namespace CSVRender params.insert(std::make_pair("title", windowTitle.str())); std::string antialiasing = - CSMSettings::UserSettings::instance().settingValue("Video/antialiasing").toStdString(); + CSMSettings::UserSettings::instance().settingValue("3d-render/antialiasing").toStdString(); if(antialiasing == "MSAA 16") antialiasing = "16"; else if(antialiasing == "MSAA 8") antialiasing = "8"; else if(antialiasing == "MSAA 4") antialiasing = "4"; @@ -409,14 +409,14 @@ namespace CSVRender if(key.contains(QRegExp("^\\b(Objects|Shader|Scene)", Qt::CaseInsensitive))) flagAsModified(); - if(key == "Scene/far clip distance" && !list.empty()) + if(key == "3d-render/far-clip-distance" && !list.empty()) { if(mCamera->getFarClipDistance() != list.at(0).toFloat()) mCamera->setFarClipDistance(list.at(0).toFloat()); } // minimise unnecessary ogre window creation by updating only when there is a change - if(key == "Video/antialiasing") + if(key == "3d-render/antialiasing") { unsigned int aa = mWindow->getFSAA(); unsigned int antialiasing = 0; diff --git a/apps/opencs/view/world/idtypedelegate.cpp b/apps/opencs/view/world/idtypedelegate.cpp index 543c96a24..3b440ff71 100755 --- a/apps/opencs/view/world/idtypedelegate.cpp +++ b/apps/opencs/view/world/idtypedelegate.cpp @@ -5,7 +5,7 @@ CSVWorld::IdTypeDelegate::IdTypeDelegate (const ValueList &values, const IconList &icons, CSMDoc::Document& document, QObject *parent) : DataDisplayDelegate (values, icons, document, - "Display Format", "Referenceable ID Type Display", + "records", "type-format", parent) {} diff --git a/apps/opencs/view/world/recordstatusdelegate.cpp b/apps/opencs/view/world/recordstatusdelegate.cpp index 13931b7ad..708a78015 100644 --- a/apps/opencs/view/world/recordstatusdelegate.cpp +++ b/apps/opencs/view/world/recordstatusdelegate.cpp @@ -11,7 +11,7 @@ CSVWorld::RecordStatusDelegate::RecordStatusDelegate(const ValueList& values, const IconList & icons, CSMDoc::Document& document, QObject *parent) : DataDisplayDelegate (values, icons, document, - "Display Format", "Record Status Display", + "records", "status-format", parent) {} From 5a1ce4943e7edce1e68da8f953f925b84e0b4878 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 19 Oct 2014 13:41:56 +0200 Subject: [PATCH 14/15] added advance 3D rendering user settings section --- apps/opencs/editor.cpp | 2 +- apps/opencs/model/settings/usersettings.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index 360a7515c..396df87cd 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -350,7 +350,7 @@ std::auto_ptr CS::Editor::setupGraphics() // internal setting - may be switched on or off by the use of shader configurations sh::Factory::getInstance ().setGlobalSetting ("viewproj_fix", "false"); - std::string num_lights = mUserSettings.setting("Objects/num_lights", QString("8")).toStdString(); + std::string num_lights = mUserSettings.setting("3d-render-adv/num_lights", QString("8")).toStdString(); sh::Factory::getInstance ().setGlobalSetting ("num_lights", num_lights); /// \todo add more configurable shiny settings diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 022d7e089..1813a97ff 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -63,6 +63,14 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() antialiasing->setDefaultValue (defaultValue); } + declareSection ("3d-render-adv", "3D Rendering (Advanced)"); + { + Setting *numLights = createSetting (Type_SpinBox, "num_lights", + "Number of lights per pass"); + numLights->setDefaultValue (8); + numLights->setRange (1, 100); + } + declareSection ("scene-input", "Scene Input"); { Setting *timer = createSetting (Type_SpinBox, "timer", "Input responsiveness"); @@ -142,14 +150,6 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() ritd->setDeclaredValues (values); } - declareSection ("Objects", "Objects"); - { - - Setting *numLights = createSetting (Type_SpinBox, "num_lights", "num_lights"); - numLights->setDefaultValue(8); - numLights->setRange (0, 100); - } - { /****************************************************************** @@ -413,7 +413,7 @@ void CSMSettings::UserSettings::updateUserSetting(const QString &settingKey, { mSettingDefinitions->setValue (settingKey ,list); - if(settingKey == "Objects/num_lights" && !list.empty()) + if(settingKey == "3d-render-adv/num_lights" && !list.empty()) { sh::Factory::getInstance ().setGlobalSetting ("num_lights", list.at(0).toStdString()); } From a5bbfff9e2d8fa177411734bd35ebaad836814bd Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 19 Oct 2014 13:43:40 +0200 Subject: [PATCH 15/15] another layout correction --- apps/opencs/view/settings/dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/opencs/view/settings/dialog.cpp b/apps/opencs/view/settings/dialog.cpp index e66da8571..0b1231266 100644 --- a/apps/opencs/view/settings/dialog.cpp +++ b/apps/opencs/view/settings/dialog.cpp @@ -74,7 +74,7 @@ void CSVSettings::Dialog::buildPages() mStackedWidget->addWidget (page); } - mPageListWidget->setMaximumWidth (maxWidth + 50); + mPageListWidget->setMaximumWidth (maxWidth + 10); resize (mStackedWidget->sizeHint()); }