diff --git a/src/plugins/projectexplorer/CMakeLists.txt b/src/plugins/projectexplorer/CMakeLists.txt index 46b7ebf8c2f..35a3e6114a6 100644 --- a/src/plugins/projectexplorer/CMakeLists.txt +++ b/src/plugins/projectexplorer/CMakeLists.txt @@ -137,7 +137,7 @@ add_qtc_plugin(ProjectExplorer projectexplorerconstants.h projectexplorericons.cpp projectexplorericons.h projectexplorersettings.h - projectexplorersettingspage.cpp projectexplorersettingspage.h projectexplorersettingspage.ui + projectexplorersettingspage.cpp projectexplorersettingspage.h projectfilewizardextension.cpp projectfilewizardextension.h projectimporter.cpp projectimporter.h projectmacro.cpp projectmacro.h diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index a7eb66151f6..cbcbf06e74d 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -143,6 +143,7 @@ #include #include #include +#include #include #include diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 62512aa7d4c..0afa0b399bb 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -111,7 +111,7 @@ Project { "projectexplorerconstants.h", "projectexplorericons.h", "projectexplorericons.cpp", "projectexplorersettings.h", - "projectexplorersettingspage.cpp", "projectexplorersettingspage.h", "projectexplorersettingspage.ui", + "projectexplorersettingspage.cpp", "projectexplorersettingspage.h", "projectfilewizardextension.cpp", "projectfilewizardextension.h", "projectimporter.cpp", "projectimporter.h", "projectmacro.cpp", "projectmacro.h", diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.cpp b/src/plugins/projectexplorer/projectexplorersettingspage.cpp index d41e3c2833b..ca4ed450c4b 100644 --- a/src/plugins/projectexplorer/projectexplorersettingspage.cpp +++ b/src/plugins/projectexplorer/projectexplorersettingspage.cpp @@ -4,13 +4,19 @@ #include "projectexplorersettingspage.h" #include "projectexplorersettings.h" #include "projectexplorer.h" -#include "ui_projectexplorersettingspage.h" #include #include +#include #include +#include +#include +#include +#include #include +#include +#include using namespace Core; using namespace Utils; @@ -39,102 +45,183 @@ public: private: void slotDirectoryButtonGroupChanged(); - void setJomVisible(bool); - - Ui::ProjectExplorerSettingsPageUi m_ui; mutable ProjectExplorerSettings m_settings; + QRadioButton *m_currentDirectoryRadioButton; + QRadioButton *m_directoryRadioButton; + PathChooser *m_projectsDirectoryPathChooser; + QCheckBox *m_closeSourceFilesCheckBox; + QCheckBox *m_saveAllFilesCheckBox; + QCheckBox *m_deployProjectBeforeRunCheckBox; + QCheckBox *m_addLibraryPathsToRunEnvCheckBox; + QCheckBox *m_promptToStopRunControlCheckBox; + QCheckBox *m_automaticallyCreateRunConfiguration; + QCheckBox *m_clearIssuesCheckBox; + QCheckBox *m_abortBuildAllOnErrorCheckBox; + QCheckBox *m_lowBuildPriorityCheckBox; + QComboBox *m_buildBeforeDeployComboBox; + QComboBox *m_stopBeforeBuildComboBox; + QComboBox *m_terminalModeComboBox; + QCheckBox *m_jomCheckbox; + + QButtonGroup *m_directoryButtonGroup; }; ProjectExplorerSettingsWidget::ProjectExplorerSettingsWidget(QWidget *parent) : QWidget(parent) { - m_ui.setupUi(this); - setJomVisible(HostOsInfo::isWindowsHost()); - m_ui.stopBeforeBuildComboBox->addItem(tr("None"), int(StopBeforeBuild::None)); - m_ui.stopBeforeBuildComboBox->addItem(tr("All"), int(StopBeforeBuild::All)); - m_ui.stopBeforeBuildComboBox->addItem(tr("Same Project"), int(StopBeforeBuild::SameProject)); - m_ui.stopBeforeBuildComboBox->addItem(tr("Same Build Directory"), - int(StopBeforeBuild::SameBuildDir)); - m_ui.stopBeforeBuildComboBox->addItem(tr("Same Application"), - int(StopBeforeBuild::SameApp)); - m_ui.buildBeforeDeployComboBox->addItem(tr("Do Not Build Anything"), - int(BuildBeforeRunMode::Off)); - m_ui.buildBeforeDeployComboBox->addItem(tr("Build the Whole Project"), - int(BuildBeforeRunMode::WholeProject)); - m_ui.buildBeforeDeployComboBox->addItem(tr("Build Only the Application to Be Run"), - int(BuildBeforeRunMode::AppOnly)); - m_ui.directoryButtonGroup->setId(m_ui.currentDirectoryRadioButton, UseCurrentDirectory); - m_ui.directoryButtonGroup->setId(m_ui.directoryRadioButton, UseProjectDirectory); + m_currentDirectoryRadioButton = new QRadioButton(tr("Current directory")); + m_directoryRadioButton = new QRadioButton(tr("Directory")); + m_projectsDirectoryPathChooser = new PathChooser; + m_closeSourceFilesCheckBox = new QCheckBox(tr("Close source files along with project")); + m_saveAllFilesCheckBox = new QCheckBox(tr("Save all files before build")); + m_deployProjectBeforeRunCheckBox = new QCheckBox(tr("Always deploy project before running it")); + m_addLibraryPathsToRunEnvCheckBox = + new QCheckBox(tr("Add linker library search paths to run environment")); + m_promptToStopRunControlCheckBox = new QCheckBox(tr("Always ask before stopping applications")); + m_automaticallyCreateRunConfiguration = + new QCheckBox(tr("Create suitable run configurations automatically")); + m_clearIssuesCheckBox = new QCheckBox(tr("Clear issues list on new build")); + m_abortBuildAllOnErrorCheckBox = new QCheckBox(tr("Abort on error when building all projects")); + m_lowBuildPriorityCheckBox = new QCheckBox(tr("Start build processes with low priority")); + m_buildBeforeDeployComboBox = new QComboBox; + m_buildBeforeDeployComboBox->addItem(tr("Do Not Build Anything"), + int(BuildBeforeRunMode::Off)); + m_buildBeforeDeployComboBox->addItem(tr("Build the Whole Project"), + int(BuildBeforeRunMode::WholeProject)); + m_buildBeforeDeployComboBox->addItem(tr("Build Only the Application to Be Run"), + int(BuildBeforeRunMode::AppOnly)); + const QSizePolicy cbSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); + m_buildBeforeDeployComboBox->setSizePolicy(cbSizePolicy); + m_stopBeforeBuildComboBox = new QComboBox; + m_stopBeforeBuildComboBox->addItem(tr("None"), int(StopBeforeBuild::None)); + m_stopBeforeBuildComboBox->addItem(tr("All"), int(StopBeforeBuild::All)); + m_stopBeforeBuildComboBox->addItem(tr("Same Project"), int(StopBeforeBuild::SameProject)); + m_stopBeforeBuildComboBox->addItem(tr("Same Build Directory"), + int(StopBeforeBuild::SameBuildDir)); + m_stopBeforeBuildComboBox->addItem(tr("Same Application"), + int(StopBeforeBuild::SameApp)); + m_stopBeforeBuildComboBox->setSizePolicy(cbSizePolicy); + m_terminalModeComboBox = new QComboBox; + m_terminalModeComboBox->addItem(tr("Enabled")); + m_terminalModeComboBox->addItem(tr("Disabled")); + m_terminalModeComboBox->addItem(tr("Deduced from Project")); + m_terminalModeComboBox->setSizePolicy(cbSizePolicy); + m_jomCheckbox = new QCheckBox(tr("Use jom instead of nmake")); + m_jomCheckbox->setVisible(HostOsInfo::isWindowsHost()); + auto jomLabel = new QLabel("jom is a drop-in replacement for nmake which " + "distributes the compilation process to multiple CPU cores. " + "The latest binary is available at " + "" + "http://download.qt.io/official_releases/jom/. " + "Disable it if you experience problems with your builds."); + jomLabel->setVisible(HostOsInfo::isWindowsHost()); - connect(m_ui.directoryButtonGroup, &QButtonGroup::buttonClicked, + using namespace Utils::Layouting; + Column { + Group { + title(tr("Projects Directory")), + Column { + m_currentDirectoryRadioButton, + Row { m_directoryRadioButton, m_projectsDirectoryPathChooser }, + }, + }, + Group { + title(tr("Closing Projects")), + Column { + m_closeSourceFilesCheckBox, + }, + }, + Group { + title(tr("Build and Run")), + Column { + m_saveAllFilesCheckBox, + m_deployProjectBeforeRunCheckBox, + m_addLibraryPathsToRunEnvCheckBox, + m_promptToStopRunControlCheckBox, + m_automaticallyCreateRunConfiguration, + m_clearIssuesCheckBox, + m_abortBuildAllOnErrorCheckBox, + m_lowBuildPriorityCheckBox, + Form { + tr("Build before deploying:"), m_buildBeforeDeployComboBox, br, + tr("Stop applications before building:"), m_stopBeforeBuildComboBox, br, + tr("Default for \"Run in terminal\":"), m_terminalModeComboBox, br, + }, + m_jomCheckbox, + jomLabel, + }, + }, + st, + }.attachTo(this); + + m_directoryButtonGroup = new QButtonGroup; + m_directoryButtonGroup->setExclusive(true); + m_directoryButtonGroup->addButton(m_currentDirectoryRadioButton, UseCurrentDirectory); + m_directoryButtonGroup->addButton(m_directoryRadioButton, UseProjectDirectory); + + connect(m_directoryButtonGroup, &QButtonGroup::buttonClicked, this, &ProjectExplorerSettingsWidget::slotDirectoryButtonGroupChanged); } -void ProjectExplorerSettingsWidget::setJomVisible(bool v) -{ - m_ui.jomCheckbox->setVisible(v); - m_ui.jomLabel->setVisible(v); -} - ProjectExplorerSettings ProjectExplorerSettingsWidget::settings() const { m_settings.buildBeforeDeploy = static_cast( - m_ui.buildBeforeDeployComboBox->currentData().toInt()); - m_settings.deployBeforeRun = m_ui.deployProjectBeforeRunCheckBox->isChecked(); - m_settings.saveBeforeBuild = m_ui.saveAllFilesCheckBox->isChecked(); - m_settings.useJom = m_ui.jomCheckbox->isChecked(); - m_settings.addLibraryPathsToRunEnv = m_ui.addLibraryPathsToRunEnvCheckBox->isChecked(); - m_settings.prompToStopRunControl = m_ui.promptToStopRunControlCheckBox->isChecked(); - m_settings.automaticallyCreateRunConfigurations = m_ui.automaticallyCreateRunConfiguration->isChecked(); + m_buildBeforeDeployComboBox->currentData().toInt()); + m_settings.deployBeforeRun = m_deployProjectBeforeRunCheckBox->isChecked(); + m_settings.saveBeforeBuild = m_saveAllFilesCheckBox->isChecked(); + m_settings.useJom = m_jomCheckbox->isChecked(); + m_settings.addLibraryPathsToRunEnv = m_addLibraryPathsToRunEnvCheckBox->isChecked(); + m_settings.prompToStopRunControl = m_promptToStopRunControlCheckBox->isChecked(); + m_settings.automaticallyCreateRunConfigurations = m_automaticallyCreateRunConfiguration->isChecked(); m_settings.stopBeforeBuild = static_cast( - m_ui.stopBeforeBuildComboBox->currentData().toInt()); - m_settings.terminalMode = static_cast(m_ui.terminalModeComboBox->currentIndex()); - m_settings.closeSourceFilesWithProject = m_ui.closeSourceFilesCheckBox->isChecked(); - m_settings.clearIssuesOnRebuild = m_ui.clearIssuesCheckBox->isChecked(); - m_settings.abortBuildAllOnError = m_ui.abortBuildAllOnErrorCheckBox->isChecked(); - m_settings.lowBuildPriority = m_ui.lowBuildPriorityCheckBox->isChecked(); + m_stopBeforeBuildComboBox->currentData().toInt()); + m_settings.terminalMode = static_cast(m_terminalModeComboBox->currentIndex()); + m_settings.closeSourceFilesWithProject = m_closeSourceFilesCheckBox->isChecked(); + m_settings.clearIssuesOnRebuild = m_clearIssuesCheckBox->isChecked(); + m_settings.abortBuildAllOnError = m_abortBuildAllOnErrorCheckBox->isChecked(); + m_settings.lowBuildPriority = m_lowBuildPriorityCheckBox->isChecked(); return m_settings; } void ProjectExplorerSettingsWidget::setSettings(const ProjectExplorerSettings &pes) { m_settings = pes; - m_ui.buildBeforeDeployComboBox->setCurrentIndex( - m_ui.buildBeforeDeployComboBox->findData(int(m_settings.buildBeforeDeploy))); - m_ui.deployProjectBeforeRunCheckBox->setChecked(m_settings.deployBeforeRun); - m_ui.saveAllFilesCheckBox->setChecked(m_settings.saveBeforeBuild); - m_ui.jomCheckbox->setChecked(m_settings.useJom); - m_ui.addLibraryPathsToRunEnvCheckBox->setChecked(m_settings.addLibraryPathsToRunEnv); - m_ui.promptToStopRunControlCheckBox->setChecked(m_settings.prompToStopRunControl); - m_ui.automaticallyCreateRunConfiguration->setChecked(m_settings.automaticallyCreateRunConfigurations); - m_ui.stopBeforeBuildComboBox->setCurrentIndex( - m_ui.stopBeforeBuildComboBox->findData(int(m_settings.stopBeforeBuild))); - m_ui.terminalModeComboBox->setCurrentIndex(static_cast(m_settings.terminalMode)); - m_ui.closeSourceFilesCheckBox->setChecked(m_settings.closeSourceFilesWithProject); - m_ui.clearIssuesCheckBox->setChecked(m_settings.clearIssuesOnRebuild); - m_ui.abortBuildAllOnErrorCheckBox->setChecked(m_settings.abortBuildAllOnError); - m_ui.lowBuildPriorityCheckBox->setChecked(m_settings.lowBuildPriority); + m_buildBeforeDeployComboBox->setCurrentIndex( + m_buildBeforeDeployComboBox->findData(int(m_settings.buildBeforeDeploy))); + m_deployProjectBeforeRunCheckBox->setChecked(m_settings.deployBeforeRun); + m_saveAllFilesCheckBox->setChecked(m_settings.saveBeforeBuild); + m_jomCheckbox->setChecked(m_settings.useJom); + m_addLibraryPathsToRunEnvCheckBox->setChecked(m_settings.addLibraryPathsToRunEnv); + m_promptToStopRunControlCheckBox->setChecked(m_settings.prompToStopRunControl); + m_automaticallyCreateRunConfiguration->setChecked(m_settings.automaticallyCreateRunConfigurations); + m_stopBeforeBuildComboBox->setCurrentIndex( + m_stopBeforeBuildComboBox->findData(int(m_settings.stopBeforeBuild))); + m_terminalModeComboBox->setCurrentIndex(static_cast(m_settings.terminalMode)); + m_closeSourceFilesCheckBox->setChecked(m_settings.closeSourceFilesWithProject); + m_clearIssuesCheckBox->setChecked(m_settings.clearIssuesOnRebuild); + m_abortBuildAllOnErrorCheckBox->setChecked(m_settings.abortBuildAllOnError); + m_lowBuildPriorityCheckBox->setChecked(m_settings.lowBuildPriority); } FilePath ProjectExplorerSettingsWidget::projectsDirectory() const { - return m_ui.projectsDirectoryPathChooser->filePath(); + return m_projectsDirectoryPathChooser->filePath(); } void ProjectExplorerSettingsWidget::setProjectsDirectory(const FilePath &pd) { - m_ui.projectsDirectoryPathChooser->setFilePath(pd); + m_projectsDirectoryPathChooser->setFilePath(pd); } bool ProjectExplorerSettingsWidget::useProjectsDirectory() { - return m_ui.directoryButtonGroup->checkedId() == UseProjectDirectory; + return m_directoryButtonGroup->checkedId() == UseProjectDirectory; } void ProjectExplorerSettingsWidget::setUseProjectsDirectory(bool b) { if (useProjectsDirectory() != b) { - (b ? m_ui.directoryRadioButton : m_ui.currentDirectoryRadioButton)->setChecked(true); + (b ? m_directoryRadioButton : m_currentDirectoryRadioButton)->setChecked(true); slotDirectoryButtonGroupChanged(); } } @@ -142,7 +229,7 @@ void ProjectExplorerSettingsWidget::setUseProjectsDirectory(bool b) void ProjectExplorerSettingsWidget::slotDirectoryButtonGroupChanged() { bool enable = useProjectsDirectory(); - m_ui.projectsDirectoryPathChooser->setEnabled(enable); + m_projectsDirectoryPathChooser->setEnabled(enable); } // ------------------ ProjectExplorerSettingsPage diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.h b/src/plugins/projectexplorer/projectexplorersettingspage.h index 8e774dcb39c..a0ebabca65c 100644 --- a/src/plugins/projectexplorer/projectexplorersettingspage.h +++ b/src/plugins/projectexplorer/projectexplorersettingspage.h @@ -3,8 +3,6 @@ #pragma once -#include "ui_projectexplorersettingspage.h" - #include #include diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.ui b/src/plugins/projectexplorer/projectexplorersettingspage.ui deleted file mode 100644 index 2a2fc286d73..00000000000 --- a/src/plugins/projectexplorer/projectexplorersettingspage.ui +++ /dev/null @@ -1,319 +0,0 @@ - - - ProjectExplorer::Internal::ProjectExplorerSettingsPageUi - - - - 0 - 0 - 994 - 808 - - - - - - - Projects Directory - - - - - - Current directory - - - directoryButtonGroup - - - - - - - Directory - - - true - - - directoryButtonGroup - - - - - - - - - - - - - Closing Projects - - - - - - Close source files along with project - - - - - - - - - - Build and Run - - - - - - Abort on error when building all projects - - - - - - - 0 - - - - - - - - Use jom instead of nmake - - - - - - - <i>jom</i> is a drop-in replacement for <i>nmake</i> which distributes the compilation process to multiple CPU cores. The latest binary is available at <a href="http://download.qt.io/official_releases/jom/">http://download.qt.io/official_releases/jom/</a>. Disable it if you experience problems with your builds. - - - true - - - 20 - - - true - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - Enable this if your system becomes unresponsive while building. - - - Start build processes with low priority - - - - - - - Always deploy project before running it - - - - - - - Add linker library search paths to run environment - - - - - - - Save all files before build - - - - - - - Creates suitable run configurations automatically when setting up a new kit. - - - Create suitable run configurations automatically - - - - - - - Asks before terminating the running application in response to clicking the stop button in Application Output. - - - Always ask before stopping applications - - - - - - - Clear issues list on new build - - - - - - - - - Build before deploying: - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Stop applications before building: - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Default for "Run in terminal": - - - - - - - - - - Enabled - - - - - Disabled - - - - - Deduced from Project - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Utils::PathChooser - QLineEdit -
utils/pathchooser.h
- 1 -
-
- - - - - -