Commit 8f1b78bf authored by Joerg Bornemann's avatar Joerg Bornemann

WinRt: add windeployqt configuration widget

A simple line edit to display or change the arguments that are
passed to windeployqt.

Task-number: QTCREATORBUG-11693

Change-Id: I059f5c2af3fce17f9f8463ecfa2af91f21ffe6d8
Reviewed-by: default avatarOliver Wolff <oliver.wolff@digia.com>
Reviewed-by: default avatarAndrew Knight <andrew.knight@digia.com>
parent d035dbb1
...@@ -6,6 +6,7 @@ HEADERS += \ ...@@ -6,6 +6,7 @@ HEADERS += \
winrtdevice.h \ winrtdevice.h \
winrtdevicefactory.h \ winrtdevicefactory.h \
winrtpackagedeploymentstep.h \ winrtpackagedeploymentstep.h \
winrtpackagedeploymentstepwidget.h \
winrtphoneqtversion.h \ winrtphoneqtversion.h \
winrtplugin.h \ winrtplugin.h \
winrtqtversion.h \ winrtqtversion.h \
...@@ -20,6 +21,7 @@ SOURCES += \ ...@@ -20,6 +21,7 @@ SOURCES += \
winrtdevice.cpp \ winrtdevice.cpp \
winrtdevicefactory.cpp \ winrtdevicefactory.cpp \
winrtpackagedeploymentstep.cpp \ winrtpackagedeploymentstep.cpp \
winrtpackagedeploymentstepwidget.cpp \
winrtphoneqtversion.cpp \ winrtphoneqtversion.cpp \
winrtplugin.cpp \ winrtplugin.cpp \
winrtqtversion.cpp \ winrtqtversion.cpp \
...@@ -32,4 +34,5 @@ SOURCES += \ ...@@ -32,4 +34,5 @@ SOURCES += \
DEFINES += WINRT_LIBRARY DEFINES += WINRT_LIBRARY
FORMS += \ FORMS += \
winrtpackagedeploymentstepwidget.ui \
winrtrunconfigurationwidget.ui winrtrunconfigurationwidget.ui
...@@ -21,6 +21,9 @@ QtcPlugin { ...@@ -21,6 +21,9 @@ QtcPlugin {
"winrtdevicefactory.h", "winrtdevicefactory.h",
"winrtpackagedeploymentstep.cpp", "winrtpackagedeploymentstep.cpp",
"winrtpackagedeploymentstep.h", "winrtpackagedeploymentstep.h",
"winrtpackagedeploymentstepwidget.cpp",
"winrtpackagedeploymentstepwidget.h",
"winrtpackagedeploymentstepwidget.ui",
"winrtphoneqtversion.cpp", "winrtphoneqtversion.cpp",
"winrtphoneqtversion.h", "winrtphoneqtversion.h",
"winrtplugin.cpp", "winrtplugin.cpp",
......
...@@ -37,6 +37,7 @@ const char WINRT_DEVICE_TYPE_LOCAL[] = "WinRt.Device.Local"; ...@@ -37,6 +37,7 @@ const char WINRT_DEVICE_TYPE_LOCAL[] = "WinRt.Device.Local";
const char WINRT_DEVICE_TYPE_EMULATOR[] = "WinRt.Device.Emulator"; const char WINRT_DEVICE_TYPE_EMULATOR[] = "WinRt.Device.Emulator";
const char WINRT_DEVICE_TYPE_PHONE[] = "WinRt.Device.Phone"; const char WINRT_DEVICE_TYPE_PHONE[] = "WinRt.Device.Phone";
const char WINRT_BUILD_STEP_DEPLOY[] = "WinRt.BuildStep.Deploy"; const char WINRT_BUILD_STEP_DEPLOY[] = "WinRt.BuildStep.Deploy";
const char WINRT_BUILD_STEP_DEPLOY_ARGUMENTS[] = "WinRt.BuildStep.Deploy.Arguments";
const char WINRT_WINRTQT[] = "WinRt.QtVersion.WindowsRuntime"; const char WINRT_WINRTQT[] = "WinRt.QtVersion.WindowsRuntime";
const char WINRT_WINPHONEQT[] = "WinRt.QtVersion.WindowsPhone"; const char WINRT_WINPHONEQT[] = "WinRt.QtVersion.WindowsPhone";
const char WINRT_QTMAP_SUBKEYNAME[] = "WinRt"; const char WINRT_QTMAP_SUBKEYNAME[] = "WinRt";
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
****************************************************************************/ ****************************************************************************/
#include "winrtpackagedeploymentstep.h" #include "winrtpackagedeploymentstep.h"
#include "winrtpackagedeploymentstepwidget.h"
#include "winrtconstants.h" #include "winrtconstants.h"
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
...@@ -46,6 +47,7 @@ WinRtPackageDeploymentStep::WinRtPackageDeploymentStep(BuildStepList *bsl) ...@@ -46,6 +47,7 @@ WinRtPackageDeploymentStep::WinRtPackageDeploymentStep(BuildStepList *bsl)
: AbstractProcessStep(bsl, Constants::WINRT_BUILD_STEP_DEPLOY) : AbstractProcessStep(bsl, Constants::WINRT_BUILD_STEP_DEPLOY)
{ {
setDisplayName(tr("Deploy Qt binaries and application files to output directory")); setDisplayName(tr("Deploy Qt binaries and application files to output directory"));
m_args = defaultWinDeployQtArguments();
} }
bool WinRtPackageDeploymentStep::init() bool WinRtPackageDeploymentStep::init()
...@@ -57,10 +59,8 @@ bool WinRtPackageDeploymentStep::init() ...@@ -57,10 +59,8 @@ bool WinRtPackageDeploymentStep::init()
// ### Actually, targetForProject is supposed to return the file path including the file // ### Actually, targetForProject is supposed to return the file path including the file
// extension. Whenever this will eventually work, we have to remove the .exe suffix here. // extension. Whenever this will eventually work, we have to remove the .exe suffix here.
QString args; QString args = QtcProcess::quoteArg(QDir::toNativeSeparators(targetPath));
QtcProcess::addArg(&args, QDir::toNativeSeparators(targetPath)); args += QLatin1Char(' ') + m_args;
QtcProcess::addArg(&args, QStringLiteral("--qmldir"));
QtcProcess::addArg(&args, QDir::toNativeSeparators(project()->projectDirectory()));
ProcessParameters *params = processParameters(); ProcessParameters *params = processParameters();
params->setCommand(QLatin1String("windeployqt.exe")); params->setCommand(QLatin1String("windeployqt.exe"));
...@@ -72,7 +72,42 @@ bool WinRtPackageDeploymentStep::init() ...@@ -72,7 +72,42 @@ bool WinRtPackageDeploymentStep::init()
BuildStepConfigWidget *WinRtPackageDeploymentStep::createConfigWidget() BuildStepConfigWidget *WinRtPackageDeploymentStep::createConfigWidget()
{ {
return new SimpleBuildStepConfigWidget(this); return new WinRtPackageDeploymentStepWidget(this);
}
void WinRtPackageDeploymentStep::setWinDeployQtArguments(const QString &args)
{
m_args = args;
}
QString WinRtPackageDeploymentStep::winDeployQtArguments() const
{
return m_args;
}
QString WinRtPackageDeploymentStep::defaultWinDeployQtArguments() const
{
QString args;
QtcProcess::addArg(&args, QStringLiteral("--qmldir"));
QtcProcess::addArg(&args, QDir::toNativeSeparators(project()->projectDirectory()));
return args;
}
bool WinRtPackageDeploymentStep::fromMap(const QVariantMap &map)
{
if (!AbstractProcessStep::fromMap(map))
return false;
QVariant v = map.value(QLatin1String(Constants::WINRT_BUILD_STEP_DEPLOY_ARGUMENTS));
if (v.isValid())
m_args = v.toString();
return true;
}
QVariantMap WinRtPackageDeploymentStep::toMap() const
{
QVariantMap map = AbstractProcessStep::toMap();
map.insert(QLatin1String(Constants::WINRT_BUILD_STEP_DEPLOY_ARGUMENTS), m_args);
return map;
} }
} // namespace Internal } // namespace Internal
......
...@@ -42,6 +42,16 @@ public: ...@@ -42,6 +42,16 @@ public:
explicit WinRtPackageDeploymentStep(ProjectExplorer::BuildStepList *bsl); explicit WinRtPackageDeploymentStep(ProjectExplorer::BuildStepList *bsl);
bool init(); bool init();
ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
void setWinDeployQtArguments(const QString &args);
QString winDeployQtArguments() const;
QString defaultWinDeployQtArguments() const;
bool fromMap(const QVariantMap &map);
QVariantMap toMap() const;
private:
QString m_args;
}; };
} // namespace Internal } // namespace Internal
......
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "winrtpackagedeploymentstepwidget.h"
#include <ui_winrtpackagedeploymentstepwidget.h>
#include <coreplugin/coreconstants.h>
#include <QIcon>
namespace WinRt {
namespace Internal {
WinRtPackageDeploymentStepWidget::WinRtPackageDeploymentStepWidget(WinRtPackageDeploymentStep *step)
: m_ui(new Ui::WinRtPackageDeploymentStepWidget)
, m_step(step)
{
m_ui->setupUi(this);
m_ui->leArguments->setText(m_step->winDeployQtArguments());
m_ui->btnRestoreDefaultArgs->setIcon(QIcon(QLatin1String(Core::Constants::ICON_RESET)));
}
WinRtPackageDeploymentStepWidget::~WinRtPackageDeploymentStepWidget()
{
delete m_ui;
}
QString WinRtPackageDeploymentStepWidget::summaryText() const
{
return QStringLiteral("<b>") + displayName() + QStringLiteral("</b>");
}
QString WinRtPackageDeploymentStepWidget::displayName() const
{
return m_step->displayName();
}
void WinRtPackageDeploymentStepWidget::on_btnRestoreDefaultArgs_clicked()
{
m_ui->leArguments->setText(m_step->defaultWinDeployQtArguments());
}
void WinRtPackageDeploymentStepWidget::on_leArguments_textChanged(QString str)
{
m_step->setWinDeployQtArguments(str);
}
} // namespace Internal
} // namespace WinRt
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef WINRTPACKAGEDEPLOYMENTSTEPWIDGET_H
#define WINRTPACKAGEDEPLOYMENTSTEPWIDGET_H
#include "winrtpackagedeploymentstep.h"
#include <projectexplorer/buildstep.h>
namespace WinRt {
namespace Internal {
namespace Ui { class WinRtPackageDeploymentStepWidget; }
class WinRtPackageDeploymentStepWidget : public ProjectExplorer::BuildStepConfigWidget
{
Q_OBJECT
public:
WinRtPackageDeploymentStepWidget(WinRtPackageDeploymentStep *step);
~WinRtPackageDeploymentStepWidget();
virtual QString summaryText() const;
virtual QString displayName() const;
private slots:
void on_btnRestoreDefaultArgs_clicked();
void on_leArguments_textChanged(QString str);
private:
Ui::WinRtPackageDeploymentStepWidget *m_ui;
WinRtPackageDeploymentStep *m_step;
};
} // namespace Internal
} // namespace WinRt
#endif // WINRTPACKAGEDEPLOYMENTSTEPWIDGET_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WinRt::Internal::WinRtPackageDeploymentStepWidget</class>
<widget class="QWidget" name="WinRt::Internal::WinRtPackageDeploymentStepWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>59</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Arguments:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="leArguments"/>
</item>
<item>
<widget class="QToolButton" name="btnRestoreDefaultArgs">
<property name="text">
<string>Restore Default Arguments</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment