diff --git a/src/plugins/nim/CMakeLists.txt b/src/plugins/nim/CMakeLists.txt index ac450f76f48..3850f9bd8af 100644 --- a/src/plugins/nim/CMakeLists.txt +++ b/src/plugins/nim/CMakeLists.txt @@ -12,7 +12,6 @@ add_qtc_plugin(Nim project/nimcompilerbuildstep.cpp project/nimcompilerbuildstep.h project/nimcompilerbuildstepconfigwidget.cpp project/nimcompilerbuildstepconfigwidget.h project/nimcompilerbuildstepconfigwidget.ui project/nimcompilercleanstep.cpp project/nimcompilercleanstep.h - project/nimcompilercleanstepconfigwidget.cpp project/nimcompilercleanstepconfigwidget.h project/nimcompilercleanstepconfigwidget.ui project/nimproject.cpp project/nimproject.h project/nimprojectnode.cpp project/nimprojectnode.h project/nimrunconfiguration.cpp project/nimrunconfiguration.h diff --git a/src/plugins/nim/nim.pro b/src/plugins/nim/nim.pro index 2cb7bb2de35..1c10baf4f0d 100644 --- a/src/plugins/nim/nim.pro +++ b/src/plugins/nim/nim.pro @@ -22,7 +22,6 @@ HEADERS += \ project/nimcompilerbuildstep.h \ project/nimcompilerbuildstepconfigwidget.h \ project/nimcompilercleanstep.h \ - project/nimcompilercleanstepconfigwidget.h \ project/nimrunconfiguration.h \ editor/nimeditorfactory.h \ settings/nimcodestylesettingspage.h \ @@ -52,7 +51,6 @@ SOURCES += \ project/nimcompilerbuildstep.cpp \ project/nimcompilerbuildstepconfigwidget.cpp \ project/nimcompilercleanstep.cpp \ - project/nimcompilercleanstepconfigwidget.cpp \ project/nimrunconfiguration.cpp \ editor/nimeditorfactory.cpp \ settings/nimcodestylesettingspage.cpp \ @@ -70,6 +68,5 @@ SOURCES += \ FORMS += \ project/nimcompilerbuildstepconfigwidget.ui \ - project/nimcompilercleanstepconfigwidget.ui \ settings/nimcodestylepreferenceswidget.ui \ settings/nimtoolssettingswidget.ui diff --git a/src/plugins/nim/nim.qbs b/src/plugins/nim/nim.qbs index cf5dc409303..f9502a5b9ee 100644 --- a/src/plugins/nim/nim.qbs +++ b/src/plugins/nim/nim.qbs @@ -40,7 +40,6 @@ QtcPlugin { "nimcompilerbuildstep.h", "nimcompilerbuildstep.cpp", "nimcompilerbuildstepconfigwidget.h", "nimcompilerbuildstepconfigwidget.cpp", "nimcompilerbuildstepconfigwidget.ui", "nimcompilercleanstep.h", "nimcompilercleanstep.cpp", - "nimcompilercleanstepconfigwidget.h", "nimcompilercleanstepconfigwidget.cpp", "nimcompilercleanstepconfigwidget.ui", "nimproject.h", "nimproject.cpp", "nimprojectnode.h", "nimprojectnode.cpp", "nimrunconfiguration.h", "nimrunconfiguration.cpp", diff --git a/src/plugins/nim/nimconstants.h b/src/plugins/nim/nimconstants.h index 552e01d4b31..03f945689a2 100644 --- a/src/plugins/nim/nimconstants.h +++ b/src/plugins/nim/nimconstants.h @@ -58,11 +58,6 @@ const char C_NIMCOMPILERBUILDSTEPWIDGET_SUMMARY[] = QT_TRANSLATE_NOOP("NimCompil // NimCompilerCleanStep const char C_NIMCOMPILERCLEANSTEP_ID[] = "Nim.NimCompilerCleanStep"; -const char C_NIMCOMPILERCLEANSTEP_DISPLAY[] = QT_TRANSLATE_NOOP("NimCompilerCleanStepFactory", "Nim Compiler Clean Step"); - -// NimCompilerCleanStepWidget -const char C_NIMCOMPILERCLEANSTEPWIDGET_DISPLAY[] = QT_TRANSLATE_NOOP("NimCompilerCleanStepWidget", "Nim clean step"); -const char C_NIMCOMPILERCLEANSTEPWIDGET_SUMMARY[] = QT_TRANSLATE_NOOP("NimCompilerCleanStepWidget", "Nim clean step"); const char C_NIMLANGUAGE_ID[] = "Nim"; const char C_NIMCODESTYLESETTINGSPAGE_ID[] = "Nim.NimCodeStyleSettings"; diff --git a/src/plugins/nim/project/nimcompilercleanstep.cpp b/src/plugins/nim/project/nimcompilercleanstep.cpp index b8025821086..2884aa9e168 100644 --- a/src/plugins/nim/project/nimcompilercleanstep.cpp +++ b/src/plugins/nim/project/nimcompilercleanstep.cpp @@ -25,10 +25,10 @@ #include "nimcompilercleanstep.h" #include "nimbuildconfiguration.h" -#include "nimcompilercleanstepconfigwidget.h" #include "../nimconstants.h" +#include #include #include @@ -45,11 +45,15 @@ NimCompilerCleanStep::NimCompilerCleanStep(BuildStepList *parentList) { setDefaultDisplayName(tr("Nim Clean Step")); setDisplayName(tr("Nim Clean Step")); -} -BuildStepConfigWidget *NimCompilerCleanStep::createConfigWidget() -{ - return new NimCompilerCleanStepConfigWidget(this); + auto workingDirectory = addAspect(); + workingDirectory->setLabelText(tr("Working directory:")); + workingDirectory->setDisplayStyle(BaseStringAspect::LineEditDisplay); + + setSummaryUpdater([this, workingDirectory] { + workingDirectory->setFileName(buildConfiguration()->buildDirectory()); + return displayName(); + }); } bool NimCompilerCleanStep::init() @@ -122,7 +126,7 @@ NimCompilerCleanStepFactory::NimCompilerCleanStepFactory() setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN); setSupportedConfiguration(Constants::C_NIMBUILDCONFIGURATION_ID); setRepeatable(false); - setDisplayName(NimCompilerCleanStep::tr(Nim::Constants::C_NIMCOMPILERCLEANSTEP_DISPLAY)); + setDisplayName(NimCompilerCleanStep::tr("Nim Compiler Clean Step")); } } // Nim diff --git a/src/plugins/nim/project/nimcompilercleanstep.h b/src/plugins/nim/project/nimcompilercleanstep.h index 2cbde61bebe..8acf4e0ae5d 100644 --- a/src/plugins/nim/project/nimcompilercleanstep.h +++ b/src/plugins/nim/project/nimcompilercleanstep.h @@ -38,8 +38,6 @@ class NimCompilerCleanStep : public ProjectExplorer::BuildStep public: NimCompilerCleanStep(ProjectExplorer::BuildStepList *parentList); - ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; - private: bool init() override; void doRun() override; diff --git a/src/plugins/nim/project/nimcompilercleanstepconfigwidget.cpp b/src/plugins/nim/project/nimcompilercleanstepconfigwidget.cpp deleted file mode 100644 index 0b82052202c..00000000000 --- a/src/plugins/nim/project/nimcompilercleanstepconfigwidget.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) Filippo Cucchetto -** Contact: http://www.qt.io/licensing -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "nimcompilercleanstepconfigwidget.h" -#include "ui_nimcompilercleanstepconfigwidget.h" -#include "nimcompilercleanstep.h" - -#include "../nimconstants.h" - -#include "projectexplorer/buildconfiguration.h" - -using namespace ProjectExplorer; - -namespace Nim { - -NimCompilerCleanStepConfigWidget::NimCompilerCleanStepConfigWidget(NimCompilerCleanStep *cleanStep) - : BuildStepConfigWidget(cleanStep) - , m_ui(new Ui::NimCompilerCleanStepConfigWidget()) -{ - m_ui->setupUi(this); - setDisplayName(tr(Constants::C_NIMCOMPILERCLEANSTEPWIDGET_DISPLAY)); - setSummaryText(tr(Constants::C_NIMCOMPILERCLEANSTEPWIDGET_SUMMARY)); - connect(cleanStep->buildConfiguration(), &BuildConfiguration::buildDirectoryChanged, - this, &NimCompilerCleanStepConfigWidget::updateUi); - updateUi(); -} - -NimCompilerCleanStepConfigWidget::~NimCompilerCleanStepConfigWidget() = default; - -void NimCompilerCleanStepConfigWidget::updateUi() -{ - auto buildDiretory = step()->buildConfiguration()->buildDirectory(); - m_ui->workingDirectoryLineEdit->setText(buildDiretory.toString()); -} - -} - diff --git a/src/plugins/nim/project/nimcompilercleanstepconfigwidget.h b/src/plugins/nim/project/nimcompilercleanstepconfigwidget.h deleted file mode 100644 index 3de99648566..00000000000 --- a/src/plugins/nim/project/nimcompilercleanstepconfigwidget.h +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) Filippo Cucchetto -** Contact: http://www.qt.io/licensing -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include - -namespace Nim { - -class NimCompilerCleanStep; - -namespace Ui { class NimCompilerCleanStepConfigWidget; } - -class NimCompilerCleanStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget -{ - Q_OBJECT - -public: - NimCompilerCleanStepConfigWidget(NimCompilerCleanStep *cleanStep); - - ~NimCompilerCleanStepConfigWidget(); - -private: - void updateUi(); - - QScopedPointer m_ui; -}; - -} diff --git a/src/plugins/nim/project/nimcompilercleanstepconfigwidget.ui b/src/plugins/nim/project/nimcompilercleanstepconfigwidget.ui deleted file mode 100644 index 20dd2e05d0d..00000000000 --- a/src/plugins/nim/project/nimcompilercleanstepconfigwidget.ui +++ /dev/null @@ -1,39 +0,0 @@ - - - Nim::NimCompilerCleanStepConfigWidget - - - - 0 - 0 - 400 - 300 - - - - - - - - - - - - Working directory: - - - - - - - true - - - - - - - - - -