forked from qt-creator/qt-creator
Nim: Simplify NimCleanStep
Change-Id: I76213999b394fb18e228cf3c4d24a47c26afb398 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
|
||||
#include "nimcompilercleanstep.h"
|
||||
#include "nimbuildconfiguration.h"
|
||||
#include "nimcompilercleanstepconfigwidget.h"
|
||||
|
||||
#include "../nimconstants.h"
|
||||
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -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<BaseStringAspect>();
|
||||
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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) Filippo Cucchetto <filippocucchetto@gmail.com>
|
||||
** 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) Filippo Cucchetto <filippocucchetto@gmail.com>
|
||||
** 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 <projectexplorer/buildstep.h>
|
||||
|
||||
namespace Nim {
|
||||
|
||||
class NimCompilerCleanStep;
|
||||
|
||||
namespace Ui { class NimCompilerCleanStepConfigWidget; }
|
||||
|
||||
class NimCompilerCleanStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
NimCompilerCleanStepConfigWidget(NimCompilerCleanStep *cleanStep);
|
||||
|
||||
~NimCompilerCleanStepConfigWidget();
|
||||
|
||||
private:
|
||||
void updateUi();
|
||||
|
||||
QScopedPointer<Ui::NimCompilerCleanStepConfigWidget> m_ui;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Nim::NimCompilerCleanStepConfigWidget</class>
|
||||
<widget class="QWidget" name="Nim::NimCompilerCleanStepConfigWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="workingDirectoryLabel">
|
||||
<property name="text">
|
||||
<string>Working directory:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="workingDirectoryLineEdit">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user