forked from qt-creator/qt-creator
MainWindow: ask confirmation before closing Qt Creator
When working with multiple windows, pressing the close button multiple times can close Qt Creator too. This patch adds a system option, asking for a confirmation before closing the IDE. By default it's not enabled. Fixes: QTCREATORBUG-7637 Change-Id: Ifc5e8c97511f9227ce0634c8a7064d95775c76c2 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
André Hartmann
parent
70b226144f
commit
6e4ca8b6af
@@ -29,6 +29,7 @@
|
||||
#include "fileutils.h"
|
||||
#include "icore.h"
|
||||
#include "iversioncontrol.h"
|
||||
#include "mainwindow.h"
|
||||
#include "patchtool.h"
|
||||
#include "vcsmanager.h"
|
||||
|
||||
@@ -112,6 +113,8 @@ public:
|
||||
m_ui.maxRecentFilesSpinBox->setMinimum(1);
|
||||
m_ui.maxRecentFilesSpinBox->setMaximum(99);
|
||||
m_ui.maxRecentFilesSpinBox->setValue(EditorManagerPrivate::maxRecentFiles());
|
||||
m_ui.askBeforeExitCheckBox->setChecked(
|
||||
static_cast<Core::Internal::MainWindow *>(ICore::mainWindow())->askConfirmationBeforeExit());
|
||||
|
||||
if (HostOsInfo::isAnyUnixHost()) {
|
||||
connect(m_ui.resetTerminalButton, &QAbstractButton::clicked,
|
||||
@@ -191,6 +194,8 @@ void SystemSettingsWidget::apply()
|
||||
m_ui.warnBeforeOpeningBigFiles->isChecked());
|
||||
EditorManagerPrivate::setBigFileSizeLimit(m_ui.bigFilesLimitSpinBox->value());
|
||||
EditorManagerPrivate::setMaxRecentFiles(m_ui.maxRecentFilesSpinBox->value());
|
||||
static_cast<Core::Internal::MainWindow *>(ICore::mainWindow())->setAskConfirmationBeforeExit(
|
||||
m_ui.askBeforeExitCheckBox->isChecked());
|
||||
|
||||
if (HostOsInfo::isMacHost()) {
|
||||
Qt::CaseSensitivity defaultSensitivity
|
||||
|
||||
Reference in New Issue
Block a user