summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@theqtcompany.com>2015-05-13 16:34:24 +0200
committerRobert Loehning <robert.loehning@theqtcompany.com>2015-05-18 16:24:51 +0300
commitbbc656f3d37da9bb4bfe74a57c8e17b035fbd0ec (patch)
tree192661ab5ced45bc8e52d9e74238a7c2ffea17af
parent145cbdc1b8ceb02ee928961e9536d66a4f90bdd5 (diff)
downloadqt-creator-bbc656f3d37da9bb4bfe74a57c8e17b035fbd0ec.tar.gz
Add further settings for Squish
Change-Id: I9b297a8c7fdf3634676bd84479f2b6fd210e0d3f Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
-rw-r--r--plugins/autotest/squishsettings.cpp22
-rw-r--r--plugins/autotest/squishsettings.h6
-rw-r--r--plugins/autotest/squishsettingspage.cpp19
-rw-r--r--plugins/autotest/squishsettingspage.h2
-rw-r--r--plugins/autotest/squishsettingspage.ui108
5 files changed, 136 insertions, 21 deletions
diff --git a/plugins/autotest/squishsettings.cpp b/plugins/autotest/squishsettings.cpp
index 182945c899..db981ce34a 100644
--- a/plugins/autotest/squishsettings.cpp
+++ b/plugins/autotest/squishsettings.cpp
@@ -26,11 +26,21 @@ namespace Internal {
static const char group[] = "Squish";
static const char squishPathKey[] = "SquishPath";
+static const char licensePathKey[] = "LicensePath";
+static const char localKey[] = "Local";
+static const char serverHostKey[] = "ServerHost";
+static const char serverPortKey[] = "ServerPort";
+static const char verboseKey[] = "Verbose";
void SquishSettings::toSettings(QSettings *s) const
{
s->beginGroup(QLatin1String(group));
s->setValue(QLatin1String(squishPathKey), squishPath.toString());
+ s->setValue(QLatin1String(licensePathKey), licensePath.toString());
+ s->setValue(QLatin1String(localKey), local);
+ s->setValue(QLatin1String(serverHostKey), serverHost);
+ s->setValue(QLatin1String(serverPortKey), serverPort);
+ s->setValue(QLatin1String(verboseKey), verbose);
s->endGroup();
}
@@ -38,11 +48,21 @@ void SquishSettings::fromSettings(const QSettings *s)
{
const QString root = QLatin1String(group) + QLatin1Char('/');
squishPath = Utils::FileName::fromString(s->value(root + QLatin1String(squishPathKey)).toString());
+ licensePath = Utils::FileName::fromString(s->value(root + QLatin1String(licensePathKey)).toString());
+ local = s->value(root + QLatin1String(localKey), true).toBool();
+ serverHost = s->value(root + QLatin1String(serverHostKey), QStringLiteral("localhost")).toString();
+ serverPort = s->value(root + QLatin1String(serverPortKey), 9999).toUInt();
+ verbose = s->value(root + QLatin1String(verboseKey), false).toBool();
}
bool SquishSettings::operator==(const SquishSettings &other) const
{
- return squishPath == other.squishPath;
+ return local == other.local
+ && verbose == other.verbose
+ && serverPort == other.serverPort
+ && squishPath == other.squishPath
+ && licensePath == other.licensePath
+ && serverHost == other.serverHost;
}
bool SquishSettings::operator!=(const SquishSettings &other) const
diff --git a/plugins/autotest/squishsettings.h b/plugins/autotest/squishsettings.h
index 571636e767..5c11e1793c 100644
--- a/plugins/autotest/squishsettings.h
+++ b/plugins/autotest/squishsettings.h
@@ -23,6 +23,7 @@
#include <utils/fileutils.h>
#include <QtGlobal>
+#include <QString>
QT_BEGIN_NAMESPACE
class QSettings;
@@ -40,6 +41,11 @@ struct SquishSettings
bool operator!=(const SquishSettings &other) const;
Utils::FileName squishPath;
+ Utils::FileName licensePath;
+ QString serverHost;
+ quint16 serverPort;
+ bool local;
+ bool verbose;
};
diff --git a/plugins/autotest/squishsettingspage.cpp b/plugins/autotest/squishsettingspage.cpp
index 4c94dd5fb7..9325e928e6 100644
--- a/plugins/autotest/squishsettingspage.cpp
+++ b/plugins/autotest/squishsettingspage.cpp
@@ -31,20 +31,39 @@ SquishSettingsWidget::SquishSettingsWidget(QWidget *parent)
: QWidget(parent)
{
m_ui.setupUi(this);
+
+ connect(m_ui.localCheckBox, &QCheckBox::toggled,
+ this, &SquishSettingsWidget::onLocalToggled);
}
void SquishSettingsWidget::setSettings(const SquishSettings &settings)
{
m_ui.squishPathChooser->setFileName(settings.squishPath);
+ m_ui.licensePathChooser->setFileName(settings.licensePath);
+ m_ui.localCheckBox->setChecked(settings.local);
+ m_ui.serverHostLineEdit->setText(settings.serverHost);
+ m_ui.serverPortSpinBox->setValue(settings.serverPort);
+ m_ui.verboseCheckBox->setChecked(settings.verbose);
}
SquishSettings SquishSettingsWidget::settings() const
{
SquishSettings result;
result.squishPath = m_ui.squishPathChooser->fileName();
+ result.licensePath = m_ui.licensePathChooser->fileName();
+ result.local = m_ui.localCheckBox->checkState() == Qt::Checked;
+ result.serverHost = m_ui.serverHostLineEdit->text();
+ result.serverPort = m_ui.serverPortSpinBox->value();
+ result.verbose = m_ui.verboseCheckBox->checkState() == Qt::Checked;
return result;
}
+void SquishSettingsWidget::onLocalToggled(bool checked)
+{
+ m_ui.serverHostLineEdit->setEnabled(!checked);
+ m_ui.serverPortSpinBox->setEnabled(!checked);
+}
+
SquishSettingsPage::SquishSettingsPage(const QSharedPointer<SquishSettings> &settings)
: m_settings(settings), m_widget(0)
{
diff --git a/plugins/autotest/squishsettingspage.h b/plugins/autotest/squishsettingspage.h
index b15c39ef00..2685012485 100644
--- a/plugins/autotest/squishsettingspage.h
+++ b/plugins/autotest/squishsettingspage.h
@@ -43,6 +43,8 @@ public:
SquishSettings settings() const;
private:
+ void onLocalToggled(bool checked);
+
Ui::SquishSettingsPage m_ui;
};
diff --git a/plugins/autotest/squishsettingspage.ui b/plugins/autotest/squishsettingspage.ui
index 5dd82dc97e..08fbe72ee5 100644
--- a/plugins/autotest/squishsettingspage.ui
+++ b/plugins/autotest/squishsettingspage.ui
@@ -13,26 +13,93 @@
<property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLabel" name="squishPathLabel">
- <property name="text">
- <string>Squish path:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="Utils::PathChooser" name="squishPathChooser">
- <property name="toolTip">
- <string>Path to Squish installation directory.</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="squishPathLabel">
+ <property name="text">
+ <string>Squish path:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" colspan="5">
+ <widget class="Utils::PathChooser" name="squishPathChooser">
+ <property name="toolTip">
+ <string>Path to Squish installation directory.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="2">
+ <widget class="QLabel" name="licensePathLabel">
+ <property name="text">
+ <string>License path:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" colspan="5">
+ <widget class="Utils::PathChooser" name="licensePathChooser">
+ <property name="toolTip">
+ <string>Path to directory containing Squish license file. You will only need this in special configurations like if you did not run the Squish setup tool.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="3">
+ <widget class="QCheckBox" name="localCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Local server</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="QLabel" name="serverHostLabel">
+ <property name="text">
+ <string>Server host:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="4">
+ <widget class="QLineEdit" name="serverHostLineEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="5">
+ <widget class="QLabel" name="portLabel">
+ <property name="text">
+ <string>Port:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="6">
+ <widget class="QSpinBox" name="serverPortSpinBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximum">
+ <number>65535</number>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" colspan="3">
+ <widget class="QCheckBox" name="verboseCheckBox">
+ <property name="text">
+ <string>Verbose log</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -52,6 +119,7 @@
<class>Utils::PathChooser</class>
<extends>QLineEdit</extends>
<header location="global">utils/pathchooser.h</header>
+ <container>1</container>
</customwidget>
</customwidgets>
<resources/>