aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/coreplugin/mainwindow.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2023-07-26 18:29:20 +0200
committerhjk <hjk@qt.io>2023-07-28 13:27:10 +0000
commit7f908d737b0e017e65e917c65b19499f3093fa4c (patch)
treee9bcdd4b9a44d147b25f1ab99b9a0825031c946e /src/plugins/coreplugin/mainwindow.cpp
parentbc1ef0f158f2004fa4fd66752d7d51c857cc2b46 (diff)
Core: Move SystemSettings page closer to current setup
Also align items a bit and use BaseAspect::setEnabler() where appropriate. Change-Id: I7497e3ce82f3685582a84b1bf383e65892d76f96 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/mainwindow.cpp')
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index 805365e061..5b3eaca50c 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -103,7 +103,6 @@ namespace Internal {
static const char settingsGroup[] = "MainWindow";
static const char colorKey[] = "Color";
-static const char askBeforeExitKey[] = "AskBeforeExit";
static const char windowGeometryKey[] = "WindowGeometry";
static const char windowStateKey[] = "WindowState";
static const char modeSelectorLayoutKey[] = "ModeSelectorLayout";
@@ -129,7 +128,6 @@ MainWindow::MainWindow()
, m_jsExpander(JsExpander::createGlobalJsExpander())
, m_vcsManager(new VcsManager)
, m_modeStack(new FancyTabWidget(this))
- , m_systemSettings(new SystemSettings)
, m_shortcutSettings(new ShortcutSettings)
, m_toolSettings(new ToolSettings)
, m_mimeTypeSettings(new MimeTypeSettings)
@@ -232,16 +230,6 @@ void MainWindow::setSidebarVisible(bool visible, Side side)
navigationWidget(side)->setShown(visible);
}
-bool MainWindow::askConfirmationBeforeExit() const
-{
- return m_askConfirmationBeforeExit;
-}
-
-void MainWindow::setAskConfirmationBeforeExit(bool ask)
-{
- m_askConfirmationBeforeExit = ask;
-}
-
void MainWindow::setOverrideColor(const QColor &color)
{
m_overrideColor = color;
@@ -275,8 +263,6 @@ MainWindow::~MainWindow()
m_messageManager = nullptr;
delete m_shortcutSettings;
m_shortcutSettings = nullptr;
- delete m_systemSettings;
- m_systemSettings = nullptr;
delete m_toolSettings;
m_toolSettings = nullptr;
delete m_mimeTypeSettings;
@@ -376,7 +362,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
return;
}
- if (m_askConfirmationBeforeExit
+ if (systemSettings().askBeforeExit()
&& (QMessageBox::question(this,
Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()),
Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()),
@@ -1181,8 +1167,6 @@ void MainWindow::readSettings()
QColor(StyleHelper::DEFAULT_BASE_COLOR)).value<QColor>());
}
- m_askConfirmationBeforeExit = settings->value(askBeforeExitKey, askBeforeExitDefault).toBool();
-
{
ModeManager::Style modeStyle =
ModeManager::Style(settings->value(modeSelectorLayoutKey, int(ModeManager::Style::IconsAndText)).toInt());
@@ -1216,10 +1200,6 @@ void MainWindow::saveSettings()
StyleHelper::requestedBaseColor(),
QColor(StyleHelper::DEFAULT_BASE_COLOR));
- settings->setValueWithDefault(askBeforeExitKey,
- m_askConfirmationBeforeExit,
- askBeforeExitDefault);
-
settings->endGroup();
DocumentManager::saveSettings();