forked from qt-creator/qt-creator
ProjectExplorer: Factor out some common code in runconfigurations
DesktopQmake, CMake, Qbs, Nim, RemoteLinux and Qnx now have a common understanding what should be in a runnable and how their configuration widget should be set up. So move them over to using shared code, too. Several others runconfigs only lack a one or two more aspects to follow suit in later patches. Change-Id: Ia862c95c97d63bd0a0f2dc303435775a2fc530d3 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -36,26 +36,12 @@
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QFormLayout>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Nim {
|
||||
|
||||
class NimRunConfigurationWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
explicit NimRunConfigurationWidget(NimRunConfiguration *rc)
|
||||
{
|
||||
auto fl = new QFormLayout(this);
|
||||
rc->extraAspect<ExecutableAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
rc->extraAspect<ArgumentsAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
rc->extraAspect<WorkingDirectoryAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
rc->extraAspect<TerminalAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
}
|
||||
};
|
||||
|
||||
NimRunConfiguration::NimRunConfiguration(Target *target)
|
||||
: RunConfiguration(target, Constants::C_NIMRUNCONFIGURATION_ID)
|
||||
{
|
||||
@@ -77,22 +63,6 @@ NimRunConfiguration::NimRunConfiguration(Target *target)
|
||||
updateConfiguration();
|
||||
}
|
||||
|
||||
QWidget *NimRunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
return wrapWidget(new NimRunConfigurationWidget(this));
|
||||
}
|
||||
|
||||
Runnable NimRunConfiguration::runnable() const
|
||||
{
|
||||
StandardRunnable result;
|
||||
result.runMode = extraAspect<TerminalAspect>()->runMode();
|
||||
result.executable = extraAspect<ExecutableAspect>()->executable().toString();
|
||||
result.commandLineArguments = extraAspect<ArgumentsAspect>()->arguments();
|
||||
result.workingDirectory = extraAspect<WorkingDirectoryAspect>()->workingDirectory().toString();
|
||||
result.environment = extraAspect<EnvironmentAspect>()->environment();
|
||||
return result;
|
||||
}
|
||||
|
||||
void NimRunConfiguration::updateConfiguration()
|
||||
{
|
||||
auto buildConfiguration = qobject_cast<NimBuildConfiguration *>(activeBuildConfiguration());
|
||||
|
||||
Reference in New Issue
Block a user