From 70cfa63cb44e19e1ad94b4e8d95f16e3aa93d49c Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 20 Jul 2022 10:42:06 +0200 Subject: [PATCH] Core: Inline systemsettings.ui And convert text to QLabel for "Grid" layout too. Change-Id: I50488462f8795337a2cd59fc88bb9834d988912d Reviewed-by: hjk --- src/libs/utils/layoutbuilder.cpp | 2 + src/plugins/coreplugin/CMakeLists.txt | 2 +- src/plugins/coreplugin/coreplugin.qbs | 1 - src/plugins/coreplugin/systemsettings.cpp | 350 ++++++++----- src/plugins/coreplugin/systemsettings.ui | 567 ---------------------- 5 files changed, 243 insertions(+), 679 deletions(-) delete mode 100644 src/plugins/coreplugin/systemsettings.ui diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index a1444656824..c3491fabf68 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -265,6 +265,8 @@ static void doLayoutHelper(QLayout *layout, gridLayout->addWidget(widget, currentGridRow, currentGridColumn, 1, item.span, align); else if (item.layout) gridLayout->addLayout(item.layout, currentGridRow, currentGridColumn, 1, item.span, align); + else if (!item.text.isEmpty()) + gridLayout->addWidget(new QLabel(item.text)); currentGridColumn += item.span; } else if (boxLayout) { addItemToBoxLayout(boxLayout, item); diff --git a/src/plugins/coreplugin/CMakeLists.txt b/src/plugins/coreplugin/CMakeLists.txt index 2113c558323..b034e777b5c 100644 --- a/src/plugins/coreplugin/CMakeLists.txt +++ b/src/plugins/coreplugin/CMakeLists.txt @@ -153,7 +153,7 @@ add_qtc_plugin(Core sidebarwidget.cpp sidebarwidget.h statusbarmanager.cpp statusbarmanager.h styleanimator.cpp styleanimator.h - systemsettings.cpp systemsettings.h systemsettings.ui + systemsettings.cpp systemsettings.h textdocument.cpp textdocument.h themechooser.cpp themechooser.h vcsmanager.cpp vcsmanager.h diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index a9cc2cbb76e..39e29899d5d 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -166,7 +166,6 @@ Project { "styleanimator.h", "systemsettings.cpp", "systemsettings.h", - "systemsettings.ui", "textdocument.cpp", "textdocument.h", "themechooser.cpp", diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index b7e98da416e..44b60e503c7 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -39,19 +39,27 @@ #include #include +#include #include #include #include +#include +#include #include #include +#include +#include #include +#include #include +#include #include - -#include "ui_systemsettings.h" +#include +#include using namespace Utils; +using namespace Layouting; namespace Core { namespace Internal { @@ -83,61 +91,166 @@ class SystemSettingsWidget : public IOptionsPageWidget public: SystemSettingsWidget() - { - m_ui.setupUi(this); - m_ui.terminalOpenArgs->setToolTip( - tr("Command line arguments used for \"%1\".").arg(FileUtils::msgTerminalHereAction())); + : m_fileSystemCaseSensitivityChooser(new QComboBox) + , m_autoSuspendMinDocumentCount(new QSpinBox) + , m_externalFileBrowserEdit(new QLineEdit) + , m_autoSuspendCheckBox(new QCheckBox(tr("Auto-suspend unmodified files"))) + , m_maxRecentFilesSpinBox(new QSpinBox) + , m_enableCrashReportingCheckBox(new QCheckBox(tr("Enable crash reporting"))) + , m_warnBeforeOpeningBigFiles( + new QCheckBox(tr("Warn before opening text files greater than"))) + , m_bigFilesLimitSpinBox(new QSpinBox) + , m_terminalComboBox(new QComboBox) + , m_terminalOpenArgs(new QLineEdit) + , m_terminalExecuteArgs(new QLineEdit) + , m_patchChooser(new Utils::PathChooser) + , m_environmentChangesLabel(new Utils::ElidingLabel) + , m_askBeforeExitCheckBox(new QCheckBox(tr("Ask for confirmation before exiting"))) + , m_reloadBehavior(new QComboBox) + , m_autoSaveCheckBox(new QCheckBox(tr("Auto-save modified files"))) + , m_clearCrashReportsButton(new QPushButton(tr("Clear Local Crash Reports"))) + , m_crashReportsSizeText(new QLabel) + , m_autoSaveInterval(new QSpinBox) + , m_autoSaveRefactoringCheckBox(new QCheckBox(tr("Auto-save files after refactoring"))) - m_ui.reloadBehavior->setCurrentIndex(EditorManager::reloadSetting()); + { + m_autoSuspendCheckBox->setToolTip( + tr("Automatically free resources of old documents that are not visible and not " + "modified. They stay visible in the list of open documents.")); + m_autoSuspendMinDocumentCount->setMinimum(1); + m_autoSuspendMinDocumentCount->setMaximum(500); + m_autoSuspendMinDocumentCount->setValue(30); + m_enableCrashReportingCheckBox->setToolTip( + tr("Allow crashes to be automatically reported. Collected reports are " + "used for the sole purpose of fixing bugs.")); + m_bigFilesLimitSpinBox->setSuffix(tr("MB")); + m_bigFilesLimitSpinBox->setMinimum(1); + m_bigFilesLimitSpinBox->setMaximum(500); + m_bigFilesLimitSpinBox->setValue(5); + m_terminalExecuteArgs->setToolTip( + tr("Command line arguments used for \"Run in terminal\".")); + QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + sizePolicy.setHorizontalStretch(5); + m_environmentChangesLabel->setSizePolicy(sizePolicy); + m_reloadBehavior->addItem(tr("Always Ask")); + m_reloadBehavior->addItem(tr("Reload All Unchanged Editors")); + m_reloadBehavior->addItem(tr("Ignore Modifications")); + m_autoSaveInterval->setSuffix(tr("min")); + QSizePolicy termSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); + termSizePolicy.setHorizontalStretch(3); + m_terminalComboBox->setSizePolicy(termSizePolicy); + m_terminalComboBox->setMinimumSize(QSize(100, 0)); + m_terminalComboBox->setEditable(true); + m_terminalOpenArgs->setToolTip( + tr("Command line arguments used for \"%1\".").arg(FileUtils::msgTerminalHereAction())); + m_autoSaveInterval->setMinimum(1); + + auto fileSystemCaseSensitivityLabel = new QLabel(tr("File system case sensitivity:")); + fileSystemCaseSensitivityLabel->setToolTip( + tr("Influences how file names are matched to decide if they are the same.")); + auto autoSuspendLabel = new QLabel(tr("Files to keep open:")); + autoSuspendLabel->setToolTip( + tr("Minimum number of open documents that should be kept in memory. Increasing this " + "number will lead to greater resource usage when not manually closing documents.")); + auto resetFileBrowserButton = new QPushButton(tr("Reset")); + resetFileBrowserButton->setToolTip(tr("Reset to default.")); + auto helpExternalFileBrowserButton = new QToolButton; + helpExternalFileBrowserButton->setText(tr("?")); + auto helpCrashReportingButton = new QToolButton; + helpCrashReportingButton->setText(tr("?")); + auto resetTerminalButton = new QPushButton(tr("Reset")); + resetTerminalButton->setToolTip(tr("Reset to default.", "Terminal")); + auto patchCommandLabel = new QLabel(tr("Patch command:")); + auto environmentButton = new QPushButton(tr("Change...")); + environmentButton->setSizePolicy(QSizePolicy::Fixed, + environmentButton->sizePolicy().verticalPolicy()); + + Grid form; + form.addRow( + {tr("Environment:"), Span(2, Row{m_environmentChangesLabel, environmentButton})}); if (HostOsInfo::isAnyUnixHost()) { - const QVector availableTerminals = TerminalCommand::availableTerminalEmulators(); + form.addRow({tr("Terminal:"), + Span(2, + Row{m_terminalComboBox, + m_terminalOpenArgs, + m_terminalExecuteArgs, + resetTerminalButton})}); + } + if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) { + form.addRow({tr("External file browser:"), + Span(2, + Row{m_externalFileBrowserEdit, + resetFileBrowserButton, + helpExternalFileBrowserButton})}); + } + form.addRow({patchCommandLabel, Span(2, m_patchChooser)}); + if (HostOsInfo::isMacHost()) { + form.addRow({fileSystemCaseSensitivityLabel, + Span(2, Row{m_fileSystemCaseSensitivityChooser, Stretch()})}); + } + form.addRow( + {tr("When files are externally modified:"), Span(2, Row{m_reloadBehavior, Stretch()})}); + form.addRow( + {m_autoSaveCheckBox, Span(2, Row{tr("Interval:"), m_autoSaveInterval, Stretch()})}); + form.addRow(Span(3, m_autoSaveRefactoringCheckBox)); + form.addRow({m_autoSuspendCheckBox, + Span(2, Row{autoSuspendLabel, m_autoSuspendMinDocumentCount, Stretch()})}); + form.addRow(Span(3, Row{m_warnBeforeOpeningBigFiles, m_bigFilesLimitSpinBox, Stretch()})); + form.addRow(Span(3, + Row{tr("Maximum number of entries in \"Recent Files\":"), + m_maxRecentFilesSpinBox, + Stretch()})); + form.addRow(m_askBeforeExitCheckBox); +#ifdef ENABLE_CRASHPAD + form.addRow( + Span(3, Row{m_enableCrashReportingCheckBox, helpCrashReportingButton, Stretch()})); + form.addRow(Span(3, Row{m_clearCrashReportsButton, m_crashReportsSizeText, Stretch()})); +#endif + + Column{Group{Title(tr("System")), form, Stretch()}}.attachTo(this); + + m_reloadBehavior->setCurrentIndex(EditorManager::reloadSetting()); + if (HostOsInfo::isAnyUnixHost()) { + const QVector availableTerminals + = TerminalCommand::availableTerminalEmulators(); for (const TerminalCommand &term : availableTerminals) - m_ui.terminalComboBox->addItem(term.command, QVariant::fromValue(term)); + m_terminalComboBox->addItem(term.command, QVariant::fromValue(term)); updateTerminalUi(TerminalCommand::terminalEmulator()); - connect(m_ui.terminalComboBox, &QComboBox::currentIndexChanged, this, - [this](int index) { - updateTerminalUi(m_ui.terminalComboBox->itemData(index).value()); + connect(m_terminalComboBox, &QComboBox::currentIndexChanged, this, [this](int index) { + updateTerminalUi(m_terminalComboBox->itemData(index).value()); }); - } else { - m_ui.terminalLabel->hide(); - m_ui.terminalComboBox->hide(); - m_ui.terminalOpenArgs->hide(); - m_ui.terminalExecuteArgs->hide(); - m_ui.resetTerminalButton->hide(); } if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) { - m_ui.externalFileBrowserEdit->setText(UnixUtils::fileBrowser(ICore::settings())); - } else { - m_ui.externalFileBrowserLabel->hide(); - m_ui.externalFileBrowserWidget->hide(); + m_externalFileBrowserEdit->setText(UnixUtils::fileBrowser(ICore::settings())); } const QString patchToolTip = tr("Command used for reverting diff chunks."); - m_ui.patchCommandLabel->setToolTip(patchToolTip); - m_ui.patchChooser->setToolTip(patchToolTip); - m_ui.patchChooser->setExpectedKind(PathChooser::ExistingCommand); - m_ui.patchChooser->setHistoryCompleter(QLatin1String("General.PatchCommand.History")); - m_ui.patchChooser->setFilePath(PatchTool::patchCommand()); - m_ui.autoSaveCheckBox->setChecked(EditorManagerPrivate::autoSaveEnabled()); - m_ui.autoSaveCheckBox->setToolTip(tr("Automatically creates temporary copies of " - "modified files. If %1 is restarted after " - "a crash or power failure, it asks whether to " - "recover the auto-saved content.") - .arg(Constants::IDE_DISPLAY_NAME)); - m_ui.autoSaveRefactoringCheckBox->setChecked(EditorManager::autoSaveAfterRefactoring()); - m_ui.autoSaveRefactoringCheckBox->setToolTip(tr("Automatically saves all open files " - "affected by a refactoring operation,\n provided they were unmodified before the " - "refactoring.")); - m_ui.autoSaveInterval->setValue(EditorManagerPrivate::autoSaveInterval()); - m_ui.autoSuspendCheckBox->setChecked(EditorManagerPrivate::autoSuspendEnabled()); - m_ui.autoSuspendMinDocumentCount->setValue(EditorManagerPrivate::autoSuspendMinDocumentCount()); - m_ui.warnBeforeOpeningBigFiles->setChecked( - EditorManagerPrivate::warnBeforeOpeningBigFilesEnabled()); - m_ui.bigFilesLimitSpinBox->setValue(EditorManagerPrivate::bigFileSizeLimit()); - m_ui.maxRecentFilesSpinBox->setMinimum(1); - m_ui.maxRecentFilesSpinBox->setMaximum(99); - m_ui.maxRecentFilesSpinBox->setValue(EditorManagerPrivate::maxRecentFiles()); + patchCommandLabel->setToolTip(patchToolTip); + m_patchChooser->setToolTip(patchToolTip); + m_patchChooser->setExpectedKind(PathChooser::ExistingCommand); + m_patchChooser->setHistoryCompleter(QLatin1String("General.PatchCommand.History")); + m_patchChooser->setFilePath(PatchTool::patchCommand()); + m_autoSaveCheckBox->setChecked(EditorManagerPrivate::autoSaveEnabled()); + m_autoSaveCheckBox->setToolTip(tr("Automatically creates temporary copies of " + "modified files. If %1 is restarted after " + "a crash or power failure, it asks whether to " + "recover the auto-saved content.") + .arg(Constants::IDE_DISPLAY_NAME)); + m_autoSaveRefactoringCheckBox->setChecked(EditorManager::autoSaveAfterRefactoring()); + m_autoSaveRefactoringCheckBox->setToolTip( + tr("Automatically saves all open files " + "affected by a refactoring operation,\n provided they were unmodified before the " + "refactoring.")); + m_autoSaveInterval->setValue(EditorManagerPrivate::autoSaveInterval()); + m_autoSuspendCheckBox->setChecked(EditorManagerPrivate::autoSuspendEnabled()); + m_autoSuspendMinDocumentCount->setValue(EditorManagerPrivate::autoSuspendMinDocumentCount()); + m_warnBeforeOpeningBigFiles->setChecked( + EditorManagerPrivate::warnBeforeOpeningBigFilesEnabled()); + m_bigFilesLimitSpinBox->setValue(EditorManagerPrivate::bigFileSizeLimit()); + m_maxRecentFilesSpinBox->setMinimum(1); + m_maxRecentFilesSpinBox->setMaximum(99); + m_maxRecentFilesSpinBox->setValue(EditorManagerPrivate::maxRecentFiles()); #ifdef ENABLE_CRASHPAD if (ICore::settings()->value(showCrashButtonKey).toBool()) { auto crashButton = new QPushButton("CRASH!!!"); @@ -148,12 +261,12 @@ public: }); } - m_ui.enableCrashReportingCheckBox->setChecked( - ICore::settings()->value(crashReportingEnabledKey).toBool()); - connect(m_ui.helpCrashReportingButton, &QAbstractButton::clicked, this, [this] { + m_enableCrashReportingCheckBox->setChecked( + ICore::settings()->value(crashReportingEnabledKey).toBool()); + connect(helpCrashReportingButton, &QAbstractButton::clicked, this, [this] { showHelpDialog(tr("Crash Reporting"), CorePlugin::msgCrashpadInformation()); }); - connect(m_ui.enableCrashReportingCheckBox, &QCheckBox::stateChanged, this, [this] { + connect(m_enableCrashReportingCheckBox, &QCheckBox::stateChanged, this, [this] { const QString restartText = tr("The change will take effect after restart."); Core::RestartDialog restartDialog(Core::ICore::dialogParent(), restartText); restartDialog.exec(); @@ -162,7 +275,7 @@ public: }); updateClearCrashWidgets(); - connect(m_ui.clearCrashReportsButton, &QPushButton::clicked, this, [&] { + connect(m_clearCrashReportsButton, &QPushButton::clicked, this, [&] { QDir crashReportsDir = ICore::crashReportsPath().toDir(); crashReportsDir.setFilter(QDir::Files); const QStringList crashFiles = crashReportsDir.entryList(); @@ -170,24 +283,26 @@ public: crashReportsDir.remove(file); updateClearCrashWidgets(); }); -#else - m_ui.enableCrashReportingCheckBox->setVisible(false); - m_ui.helpCrashReportingButton->setVisible(false); - m_ui.clearCrashReportsButton->setVisible(false); - m_ui.crashReportsSizeText->setVisible(false); #endif - m_ui.askBeforeExitCheckBox->setChecked( - static_cast(ICore::mainWindow())->askConfirmationBeforeExit()); + m_askBeforeExitCheckBox->setChecked( + static_cast(ICore::mainWindow()) + ->askConfirmationBeforeExit()); if (HostOsInfo::isAnyUnixHost()) { - connect(m_ui.resetTerminalButton, &QAbstractButton::clicked, - this, &SystemSettingsWidget::resetTerminal); + connect(resetTerminalButton, + &QAbstractButton::clicked, + this, + &SystemSettingsWidget::resetTerminal); if (!HostOsInfo::isMacHost()) { - connect(m_ui.resetFileBrowserButton, &QAbstractButton::clicked, - this, &SystemSettingsWidget::resetFileBrowser); - connect(m_ui.helpExternalFileBrowserButton, &QAbstractButton::clicked, - this, &SystemSettingsWidget::showHelpForFileBrowser); + connect(resetFileBrowserButton, + &QAbstractButton::clicked, + this, + &SystemSettingsWidget::resetFileBrowser); + connect(helpExternalFileBrowserButton, + &QAbstractButton::clicked, + this, + &SystemSettingsWidget::showHelpForFileBrowser); } } @@ -195,38 +310,34 @@ public: Qt::CaseSensitivity defaultSensitivity = OsSpecificAspects::fileNameCaseSensitivity(HostOsInfo::hostOs()); if (defaultSensitivity == Qt::CaseSensitive) { - m_ui.fileSystemCaseSensitivityChooser->addItem(tr("Case Sensitive (Default)"), - Qt::CaseSensitive); + m_fileSystemCaseSensitivityChooser->addItem(tr("Case Sensitive (Default)"), + Qt::CaseSensitive); } else { - m_ui.fileSystemCaseSensitivityChooser->addItem(tr("Case Sensitive"), - Qt::CaseSensitive); + m_fileSystemCaseSensitivityChooser->addItem(tr("Case Sensitive"), Qt::CaseSensitive); } if (defaultSensitivity == Qt::CaseInsensitive) { - m_ui.fileSystemCaseSensitivityChooser->addItem(tr("Case Insensitive (Default)"), - Qt::CaseInsensitive); + m_fileSystemCaseSensitivityChooser->addItem(tr("Case Insensitive (Default)"), + Qt::CaseInsensitive); } else { - m_ui.fileSystemCaseSensitivityChooser->addItem(tr("Case Insensitive"), - Qt::CaseInsensitive); + m_fileSystemCaseSensitivityChooser->addItem(tr("Case Insensitive"), + Qt::CaseInsensitive); } const Qt::CaseSensitivity sensitivity = EditorManagerPrivate::readFileSystemSensitivity( ICore::settings()); if (sensitivity == Qt::CaseSensitive) - m_ui.fileSystemCaseSensitivityChooser->setCurrentIndex(0); + m_fileSystemCaseSensitivityChooser->setCurrentIndex(0); else - m_ui.fileSystemCaseSensitivityChooser->setCurrentIndex(1); - } else { - m_ui.fileSystemCaseSensitivityLabel->hide(); - m_ui.fileSystemCaseSensitivityWidget->hide(); + m_fileSystemCaseSensitivityChooser->setCurrentIndex(1); } updatePath(); - m_ui.environmentChangesLabel->setElideMode(Qt::ElideRight); + m_environmentChangesLabel->setElideMode(Qt::ElideRight); m_environmentChanges = CorePlugin::environmentChanges(); updateEnvironmentChangesLabel(); - connect(m_ui.environmentButton, &QPushButton::clicked, [this] { + connect(environmentButton, &QPushButton::clicked, this, [this, environmentButton] { Utils::optional changes - = Utils::EnvironmentDialog::getEnvironmentItems(m_ui.environmentButton, + = Utils::EnvironmentDialog::getEnvironmentItems(environmentButton, m_environmentChanges); if (!changes) return; @@ -251,7 +362,27 @@ private: void updateClearCrashWidgets(); void showHelpDialog(const QString &title, const QString &helpText); - Ui::SystemSettings m_ui; + + QComboBox *m_fileSystemCaseSensitivityChooser; + QSpinBox *m_autoSuspendMinDocumentCount; + QLineEdit *m_externalFileBrowserEdit; + QCheckBox *m_autoSuspendCheckBox; + QSpinBox *m_maxRecentFilesSpinBox; + QCheckBox *m_enableCrashReportingCheckBox; + QCheckBox *m_warnBeforeOpeningBigFiles; + QSpinBox *m_bigFilesLimitSpinBox; + QComboBox *m_terminalComboBox; + QLineEdit *m_terminalOpenArgs; + QLineEdit *m_terminalExecuteArgs; + Utils::PathChooser *m_patchChooser; + Utils::ElidingLabel *m_environmentChangesLabel; + QCheckBox *m_askBeforeExitCheckBox; + QComboBox *m_reloadBehavior; + QCheckBox *m_autoSaveCheckBox; + QPushButton *m_clearCrashReportsButton; + QLabel *m_crashReportsSizeText; + QSpinBox *m_autoSaveInterval; + QCheckBox *m_autoSaveRefactoringCheckBox; QPointer m_dialog; EnvironmentItems m_environmentChanges; }; @@ -259,39 +390,38 @@ private: void SystemSettingsWidget::apply() { QtcSettings *settings = ICore::settings(); - EditorManager::setReloadSetting(IDocument::ReloadSetting(m_ui.reloadBehavior->currentIndex())); + EditorManager::setReloadSetting(IDocument::ReloadSetting(m_reloadBehavior->currentIndex())); if (HostOsInfo::isAnyUnixHost()) { - TerminalCommand::setTerminalEmulator({m_ui.terminalComboBox->lineEdit()->text(), - m_ui.terminalOpenArgs->text(), - m_ui.terminalExecuteArgs->text()}); + TerminalCommand::setTerminalEmulator({m_terminalComboBox->lineEdit()->text(), + m_terminalOpenArgs->text(), + m_terminalExecuteArgs->text()}); if (!HostOsInfo::isMacHost()) { - UnixUtils::setFileBrowser(settings, m_ui.externalFileBrowserEdit->text()); + UnixUtils::setFileBrowser(settings, m_externalFileBrowserEdit->text()); } } - PatchTool::setPatchCommand(m_ui.patchChooser->filePath()); - EditorManagerPrivate::setAutoSaveEnabled(m_ui.autoSaveCheckBox->isChecked()); - EditorManagerPrivate::setAutoSaveInterval(m_ui.autoSaveInterval->value()); - EditorManagerPrivate::setAutoSaveAfterRefactoring( - m_ui.autoSaveRefactoringCheckBox->isChecked()); - EditorManagerPrivate::setAutoSuspendEnabled(m_ui.autoSuspendCheckBox->isChecked()); - EditorManagerPrivate::setAutoSuspendMinDocumentCount(m_ui.autoSuspendMinDocumentCount->value()); + PatchTool::setPatchCommand(m_patchChooser->filePath()); + EditorManagerPrivate::setAutoSaveEnabled(m_autoSaveCheckBox->isChecked()); + EditorManagerPrivate::setAutoSaveInterval(m_autoSaveInterval->value()); + EditorManagerPrivate::setAutoSaveAfterRefactoring(m_autoSaveRefactoringCheckBox->isChecked()); + EditorManagerPrivate::setAutoSuspendEnabled(m_autoSuspendCheckBox->isChecked()); + EditorManagerPrivate::setAutoSuspendMinDocumentCount(m_autoSuspendMinDocumentCount->value()); EditorManagerPrivate::setWarnBeforeOpeningBigFilesEnabled( - m_ui.warnBeforeOpeningBigFiles->isChecked()); - EditorManagerPrivate::setBigFileSizeLimit(m_ui.bigFilesLimitSpinBox->value()); - EditorManagerPrivate::setMaxRecentFiles(m_ui.maxRecentFilesSpinBox->value()); + m_warnBeforeOpeningBigFiles->isChecked()); + EditorManagerPrivate::setBigFileSizeLimit(m_bigFilesLimitSpinBox->value()); + EditorManagerPrivate::setMaxRecentFiles(m_maxRecentFilesSpinBox->value()); #ifdef ENABLE_CRASHPAD ICore::settings()->setValue(crashReportingEnabledKey, - m_ui.enableCrashReportingCheckBox->isChecked()); + m_enableCrashReportingCheckBox->isChecked()); #endif - static_cast(ICore::mainWindow())->setAskConfirmationBeforeExit( - m_ui.askBeforeExitCheckBox->isChecked()); + static_cast(ICore::mainWindow()) + ->setAskConfirmationBeforeExit(m_askBeforeExitCheckBox->isChecked()); if (HostOsInfo::isMacHost()) { const Qt::CaseSensitivity sensitivity = EditorManagerPrivate::readFileSystemSensitivity( settings); const Qt::CaseSensitivity selectedSensitivity = Qt::CaseSensitivity( - m_ui.fileSystemCaseSensitivityChooser->currentData().toInt()); + m_fileSystemCaseSensitivityChooser->currentData().toInt()); if (selectedSensitivity != sensitivity) { EditorManagerPrivate::writeFileSystemSensitivity(settings, selectedSensitivity); RestartDialog dialog( @@ -307,35 +437,35 @@ void SystemSettingsWidget::apply() void SystemSettingsWidget::resetTerminal() { if (HostOsInfo::isAnyUnixHost()) - m_ui.terminalComboBox->setCurrentIndex(0); + m_terminalComboBox->setCurrentIndex(0); } void SystemSettingsWidget::updateTerminalUi(const TerminalCommand &term) { - m_ui.terminalComboBox->lineEdit()->setText(term.command); - m_ui.terminalOpenArgs->setText(term.openArgs); - m_ui.terminalExecuteArgs->setText(term.executeArgs); + m_terminalComboBox->lineEdit()->setText(term.command); + m_terminalOpenArgs->setText(term.openArgs); + m_terminalExecuteArgs->setText(term.executeArgs); } void SystemSettingsWidget::resetFileBrowser() { if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) - m_ui.externalFileBrowserEdit->setText(UnixUtils::defaultFileBrowser()); + m_externalFileBrowserEdit->setText(UnixUtils::defaultFileBrowser()); } void SystemSettingsWidget::updatePath() { EnvironmentChange change; change.addAppendToPath(VcsManager::additionalToolsPath()); - m_ui.patchChooser->setEnvironmentChange(change); + m_patchChooser->setEnvironmentChange(change); } void SystemSettingsWidget::updateEnvironmentChangesLabel() { const QString shortSummary = Utils::EnvironmentItem::toStringList(m_environmentChanges) .join("; "); - m_ui.environmentChangesLabel->setText(shortSummary.isEmpty() ? tr("No changes to apply.") - : shortSummary); + m_environmentChangesLabel->setText(shortSummary.isEmpty() ? tr("No changes to apply.") + : shortSummary); } void SystemSettingsWidget::showHelpDialog(const QString &title, const QString &helpText) @@ -367,8 +497,8 @@ void SystemSettingsWidget::updateClearCrashWidgets() for (QString file : crashFiles) size += QFileInfo(crashReportsDir, file).size(); - m_ui.clearCrashReportsButton->setEnabled(!crashFiles.isEmpty()); - m_ui.crashReportsSizeText->setText(formatSize(size)); + m_clearCrashReportsButton->setEnabled(!crashFiles.isEmpty()); + m_crashReportsSizeText->setText(formatSize(size)); } #endif diff --git a/src/plugins/coreplugin/systemsettings.ui b/src/plugins/coreplugin/systemsettings.ui deleted file mode 100644 index 9b93d3672ab..00000000000 --- a/src/plugins/coreplugin/systemsettings.ui +++ /dev/null @@ -1,567 +0,0 @@ - - - Core::Internal::SystemSettings - - - - 0 - 0 - 628 - 545 - - - - - - - System - - - - - - Terminal: - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - Qt::Horizontal - - - - 202 - 20 - - - - - - - - - - - Influences how file names are matched to decide if they are the same. - - - File system case sensitivity: - - - - - - - - - Minimum number of open documents that should be kept in memory. Increasing this number will lead to greater resource usage when not manually closing documents. - - - Files to keep open: - - - - - - - 1 - - - 500 - - - 30 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - Reset to default. - - - Reset - - - - - - - ? - - - - - - - - - - Maximum number of entries in "Recent Files": - - - - - - - Automatically free resources of old documents that are not visible and not modified. They stay visible in the list of open documents. - - - Auto-suspend unmodified files - - - true - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Environment: - - - - - - - When files are externally modified: - - - - - - - - - Allow crashes to be automatically reported. Collected reports are used for the sole purpose of fixing bugs. - - - Enable crash reporting - - - - - - - ? - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Warn before opening text files greater than - - - true - - - - - - - MB - - - 1 - - - 500 - - - 5 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 3 - 0 - - - - - 100 - 0 - - - - true - - - - - - - - - - Command line arguments used for "Run in terminal". - - - - - - - Reset to default. - - - Reset - - - - - - - - - - Patch command: - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 5 - 0 - - - - - - - - - - - - 0 - 0 - - - - Change... - - - - - - - - - - - - Ask for confirmation before exiting - - - - - - - - - - - 0 - - - - Always Ask - - - - - Reload All Unchanged Editors - - - - - Ignore Modifications - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - External file browser: - - - - - - - Auto-save modified files - - - true - - - - - - - - - Clear Local Crash Reports - - - - - - - - - - - - - - - - - - Interval: - - - - - - - min - - - 1 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Auto-save files after refactoring - - - - - - - - - - Qt::Vertical - - - - 20 - 30 - - - - - - - - - Utils::PathChooser - QWidget -
utils/pathchooser.h
- 1 - - editingFinished() - browsingFinished() - -
- - Utils::ElidingLabel - QLabel -
utils/elidinglabel.h
-
-
- - resetTerminalButton - externalFileBrowserEdit - resetFileBrowserButton - helpExternalFileBrowserButton - reloadBehavior - autoSaveCheckBox - autoSaveInterval - autoSuspendCheckBox - autoSuspendMinDocumentCount - warnBeforeOpeningBigFiles - bigFilesLimitSpinBox - - - -