Sat, 08 Apr 2023 16:59:55 +0300
Move the about dialog to MainWindow. The hack to retrieve GL extensions is made a bit cleaner
7 | 1 | #include <QSettings> |
202
b05af0bab735
Replaced the tab widget with an MDI area
Teemu Piippo <teemu@hecknology.net>
parents:
48
diff
changeset
|
2 | #include <QMdiArea> |
264
76a025db4948
Convert all includes to be relative to project root directory. Files that cannot be found in this manner use angle brackets.
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
259
diff
changeset
|
3 | #include <ui_settingseditor.h> |
76a025db4948
Convert all includes to be relative to project root directory. Files that cannot be found in this manner use angle brackets.
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
259
diff
changeset
|
4 | #include "src/settings.h" |
76a025db4948
Convert all includes to be relative to project root directory. Files that cannot be found in this manner use angle brackets.
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
259
diff
changeset
|
5 | #include "src/gl/common.h" |
76a025db4948
Convert all includes to be relative to project root directory. Files that cannot be found in this manner use angle brackets.
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
259
diff
changeset
|
6 | #include "src/settingseditor/keyboardshortcutseditor.h" |
76a025db4948
Convert all includes to be relative to project root directory. Files that cannot be found in this manner use angle brackets.
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
259
diff
changeset
|
7 | #include "src/settingseditor/settingseditor.h" |
7 | 8 | |
341
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
9 | static QVariantMap storeSettings() |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
10 | { |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
11 | QVariantMap result; |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
12 | QSettings settingsObject; |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
13 | for (const QString& key : settingsObject.allKeys()) { |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
14 | result[key] = settingsObject.value(key); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
15 | } |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
16 | return result; |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
17 | } |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
18 | |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
19 | static void restoreSettings(const QVariantMap& storedValues) |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
20 | { |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
21 | QSettings settingsObject; |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
22 | settingsObject.clear(); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
23 | for (const QString& key : storedValues.keys()) { |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
24 | settingsObject.setValue(key, storedValues[key]); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
25 | } |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
26 | } |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
27 | |
16 | 28 | SettingsEditor::SettingsEditor( |
29 | const uiutilities::KeySequenceMap& defaultKeyboardShortcuts, | |
30 | QWidget* parent | |
31 | ) : | |
285
99af8bf63d10
Don't create more than one settings editor
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
282
diff
changeset
|
32 | QMdiSubWindow{parent}, |
7 | 33 | ui{*new Ui_SettingsEditor}, |
218
63125c36de73
Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
202
diff
changeset
|
34 | libraries{this}, |
63125c36de73
Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
202
diff
changeset
|
35 | librariesEditor{this}, |
16 | 36 | defaultKeyboardShortcuts{defaultKeyboardShortcuts} |
7 | 37 | { |
341
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
38 | QWidget* centralWidget = new QWidget{this}; |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
39 | this->ui.setupUi(centralWidget); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
40 | this->setWidget(centralWidget); |
202
b05af0bab735
Replaced the tab widget with an MDI area
Teemu Piippo <teemu@hecknology.net>
parents:
48
diff
changeset
|
41 | this->ui.keyboardShortcutsView->setModel(new KeyboardShortcutsEditor{parent, this}); |
b05af0bab735
Replaced the tab widget with an MDI area
Teemu Piippo <teemu@hecknology.net>
parents:
48
diff
changeset
|
42 | this->ui.viewModeButtonGroup->setId(this->ui.viewModeTabs, int{QMdiArea::TabbedView}); |
b05af0bab735
Replaced the tab widget with an MDI area
Teemu Piippo <teemu@hecknology.net>
parents:
48
diff
changeset
|
43 | this->ui.viewModeButtonGroup->setId(this->ui.viewModeSubWindows, int{QMdiArea::SubWindowView}); |
335 | 44 | this->ui.toolButtonStyle->addItem(tr("Icons only"), Qt::ToolButtonIconOnly); |
45 | this->ui.toolButtonStyle->addItem(tr("Text only"), Qt::ToolButtonTextOnly); | |
46 | this->ui.toolButtonStyle->addItem(tr("Text beside icon"), Qt::ToolButtonTextBesideIcon); | |
47 | this->ui.toolButtonStyle->addItem(tr("Text under icon"), Qt::ToolButtonTextUnderIcon); | |
48 | this->ui.toolButtonStyle->addItem(tr("Style default"), Qt::ToolButtonFollowStyle); | |
282
f2dc3bbecbfa
Make settings editor a sub window instead of a dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
49 | this->loadSettings(); |
f2dc3bbecbfa
Make settings editor a sub window instead of a dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
50 | this->setWindowTitle(tr("Settings")); |
285
99af8bf63d10
Don't create more than one settings editor
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
282
diff
changeset
|
51 | this->setWindowIcon(QIcon{":/icons/settings-outline.png"}); |
259
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
52 | this->librariesEditor.setModel(&libraries); |
7 | 53 | QVBoxLayout* layout = new QVBoxLayout{this}; |
54 | layout->addWidget(&librariesEditor); | |
55 | this->ui.tabLdrawLibraries->setLayout(layout); | |
341
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
56 | QSettings settingsObject; |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
57 | connect( |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
58 | this->ui.buttonBox, &QDialogButtonBox::clicked, |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
59 | [this, previousSettings = storeSettings()](QAbstractButton* button) |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
60 | { |
282
f2dc3bbecbfa
Make settings editor a sub window instead of a dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
61 | const auto role = this->ui.buttonBox->buttonRole(button); |
341
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
62 | switch (role) |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
63 | { |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
64 | case QDialogButtonBox::AcceptRole: |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
65 | this->close(); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
66 | break; |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
67 | case QDialogButtonBox::RejectRole: |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
68 | restoreSettings(previousSettings); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
69 | Q_EMIT this->settingsChanged(); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
70 | this->close(); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
71 | break; |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
72 | case QDialogButtonBox::ResetRole: |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
73 | restoreSettings(previousSettings); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
74 | Q_EMIT this->settingsChanged(); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
75 | break; |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
76 | default: |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
77 | break; |
282
f2dc3bbecbfa
Make settings editor a sub window instead of a dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
78 | } |
341
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
79 | } |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
80 | ); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
81 | for (auto* widget : this->findChildren<QAbstractButton*>()) { |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
82 | connect(widget, &QAbstractButton::clicked, this, &SettingsEditor::saveSettings); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
83 | } |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
84 | for (auto* widget : this->findChildren<QSpinBox*>()) { |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
85 | connect(widget, qOverload<int>(&QSpinBox::valueChanged), this, &SettingsEditor::saveSettings); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
86 | } |
347
5c655cc006de
Rename ColorButton -> ColorEdit
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
341
diff
changeset
|
87 | for (auto* widget : this->findChildren<ColorEdit*>()) { |
5c655cc006de
Rename ColorButton -> ColorEdit
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
341
diff
changeset
|
88 | connect(widget, &ColorEdit::colorChanged, this, &SettingsEditor::saveSettings); |
341
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
89 | } |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
90 | for (auto* widget : this->findChildren<QComboBox*>()) { |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
91 | connect(widget, qOverload<int>(&QComboBox::currentIndexChanged), this, &SettingsEditor::saveSettings); |
71c8cea3c205
Save settings as soon as they are changed, Cancel and Reset buttons revert changes
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
335
diff
changeset
|
92 | } |
7 | 93 | } |
94 | ||
95 | SettingsEditor::~SettingsEditor() | |
96 | { | |
97 | delete &this->ui; | |
98 | } | |
99 | ||
282
f2dc3bbecbfa
Make settings editor a sub window instead of a dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
100 | void SettingsEditor::saveSettings() |
7 | 101 | { |
256
c6f5de03dc0f
Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
237
diff
changeset
|
102 | setSetting<Setting::MainColor>(this->ui.mainColorButton->color()); |
c6f5de03dc0f
Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
237
diff
changeset
|
103 | setSetting<Setting::BackgroundColor>(this->ui.backgroundColorButton->color()); |
c6f5de03dc0f
Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
237
diff
changeset
|
104 | setSetting<Setting::SelectedColor>(this->ui.selectedColorButton->color()); |
218
63125c36de73
Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
202
diff
changeset
|
105 | setSetting<Setting::LineThickness>(static_cast<GLfloat>(this->ui.lineThickness->value())); |
63125c36de73
Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
202
diff
changeset
|
106 | setSetting<Setting::LineAntiAliasing>(this->ui.lineAntiAliasing->isChecked()); |
237
10a6298f636f
Add an option to log opengl messages
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
218
diff
changeset
|
107 | setSetting<Setting::LogOpenGLDebugMessages>(this->ui.logOpenGLDebugMessages->isChecked()); |
202
b05af0bab735
Replaced the tab widget with an MDI area
Teemu Piippo <teemu@hecknology.net>
parents:
48
diff
changeset
|
108 | const int viewMode = this->ui.viewModeButtonGroup->checkedId(); |
b05af0bab735
Replaced the tab widget with an MDI area
Teemu Piippo <teemu@hecknology.net>
parents:
48
diff
changeset
|
109 | if (viewMode != -1) { |
218
63125c36de73
Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
202
diff
changeset
|
110 | setSetting<Setting::ViewMode>(static_cast<QMdiArea::ViewMode>(viewMode)); |
202
b05af0bab735
Replaced the tab widget with an MDI area
Teemu Piippo <teemu@hecknology.net>
parents:
48
diff
changeset
|
111 | } |
335 | 112 | const QVariant toolButtonStyle = this->ui.toolButtonStyle->currentData(); |
113 | if (toolButtonStyle.isValid()) { | |
114 | setSetting<Setting::ToolButtonStyle>( | |
115 | static_cast<Qt::ToolButtonStyle>(toolButtonStyle.toInt())); | |
116 | } | |
218
63125c36de73
Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
202
diff
changeset
|
117 | this->librariesEditor.saveSettings(); |
282
f2dc3bbecbfa
Make settings editor a sub window instead of a dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
118 | Q_EMIT this->settingsChanged(); |
7 | 119 | } |
120 | ||
282
f2dc3bbecbfa
Make settings editor a sub window instead of a dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
121 | void SettingsEditor::loadSettings() |
7 | 122 | { |
259
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
123 | this->libraries.restoreFromSettings(); |
256
c6f5de03dc0f
Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
237
diff
changeset
|
124 | this->ui.mainColorButton->setColor(setting<Setting::MainColor>()); |
c6f5de03dc0f
Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
237
diff
changeset
|
125 | this->ui.backgroundColorButton->setColor(setting<Setting::BackgroundColor>()); |
c6f5de03dc0f
Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
237
diff
changeset
|
126 | this->ui.selectedColorButton->setColor(setting<Setting::SelectedColor>()); |
218
63125c36de73
Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
202
diff
changeset
|
127 | this->ui.lineThickness->setValue(double_cast(setting<Setting::LineThickness>())); |
63125c36de73
Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
202
diff
changeset
|
128 | this->ui.lineAntiAliasing->setChecked(setting<Setting::LineAntiAliasing>()); |
237
10a6298f636f
Add an option to log opengl messages
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
218
diff
changeset
|
129 | this->ui.logOpenGLDebugMessages->setChecked(setting<Setting::LogOpenGLDebugMessages>()); |
218
63125c36de73
Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
202
diff
changeset
|
130 | auto* const viewModeButton = this->ui.viewModeButtonGroup->button(setting<Setting::ViewMode>()); |
202
b05af0bab735
Replaced the tab widget with an MDI area
Teemu Piippo <teemu@hecknology.net>
parents:
48
diff
changeset
|
131 | if (viewModeButton != nullptr) { |
b05af0bab735
Replaced the tab widget with an MDI area
Teemu Piippo <teemu@hecknology.net>
parents:
48
diff
changeset
|
132 | viewModeButton->setChecked(true); |
b05af0bab735
Replaced the tab widget with an MDI area
Teemu Piippo <teemu@hecknology.net>
parents:
48
diff
changeset
|
133 | } |
335 | 134 | int toolButtonStyleIndex = this->ui.toolButtonStyle->findData( |
135 | setting<Setting::ToolButtonStyle>()); | |
136 | if (toolButtonStyleIndex != -1) { | |
137 | this->ui.toolButtonStyle->setCurrentIndex(toolButtonStyleIndex); | |
138 | } | |
7 | 139 | } |