diff options
author | Robert Loehning <robert.loehning@theqtcompany.com> | 2015-05-11 15:13:01 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@theqtcompany.com> | 2015-05-11 18:36:43 +0300 |
commit | 5526421cebf492249c415a4ef75f56e6455340e0 (patch) | |
tree | c9eb82e39a11cd57f53fb9c98ec8d480826b11ef | |
parent | 67682f01a7e06416ac5986f15e5b9a662ee8bf14 (diff) | |
download | qt-creator-5526421cebf492249c415a4ef75f56e6455340e0.tar.gz |
Add PathChooser for path to Squish in Options
Change-Id: Iac7efa859f80cf78760f78e5b04eb8dea0e94750
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
-rw-r--r-- | plugins/autotest/squishsettings.cpp | 6 | ||||
-rw-r--r-- | plugins/autotest/squishsettings.h | 4 | ||||
-rw-r--r-- | plugins/autotest/squishsettingspage.cpp | 2 | ||||
-rw-r--r-- | plugins/autotest/squishsettingspage.ui | 41 |
4 files changed, 52 insertions, 1 deletions
diff --git a/plugins/autotest/squishsettings.cpp b/plugins/autotest/squishsettings.cpp index c66a30d16d..182945c899 100644 --- a/plugins/autotest/squishsettings.cpp +++ b/plugins/autotest/squishsettings.cpp @@ -25,20 +25,24 @@ namespace Autotest { namespace Internal { static const char group[] = "Squish"; +static const char squishPathKey[] = "SquishPath"; void SquishSettings::toSettings(QSettings *s) const { s->beginGroup(QLatin1String(group)); + s->setValue(QLatin1String(squishPathKey), squishPath.toString()); s->endGroup(); } void SquishSettings::fromSettings(const QSettings *s) { + const QString root = QLatin1String(group) + QLatin1Char('/'); + squishPath = Utils::FileName::fromString(s->value(root + QLatin1String(squishPathKey)).toString()); } bool SquishSettings::operator==(const SquishSettings &other) const { - return true; + return squishPath == other.squishPath; } bool SquishSettings::operator!=(const SquishSettings &other) const diff --git a/plugins/autotest/squishsettings.h b/plugins/autotest/squishsettings.h index 0764735855..571636e767 100644 --- a/plugins/autotest/squishsettings.h +++ b/plugins/autotest/squishsettings.h @@ -20,6 +20,8 @@ #ifndef SQUISHSETTINGS_H #define SQUISHSETTINGS_H +#include <utils/fileutils.h> + #include <QtGlobal> QT_BEGIN_NAMESPACE @@ -36,6 +38,8 @@ struct SquishSettings bool operator==(const SquishSettings &other) const; bool operator!=(const SquishSettings &other) const; + + Utils::FileName squishPath; }; diff --git a/plugins/autotest/squishsettingspage.cpp b/plugins/autotest/squishsettingspage.cpp index 9c650c2c01..4c94dd5fb7 100644 --- a/plugins/autotest/squishsettingspage.cpp +++ b/plugins/autotest/squishsettingspage.cpp @@ -35,11 +35,13 @@ SquishSettingsWidget::SquishSettingsWidget(QWidget *parent) void SquishSettingsWidget::setSettings(const SquishSettings &settings) { + m_ui.squishPathChooser->setFileName(settings.squishPath); } SquishSettings SquishSettingsWidget::settings() const { SquishSettings result; + result.squishPath = m_ui.squishPathChooser->fileName(); return result; } diff --git a/plugins/autotest/squishsettingspage.ui b/plugins/autotest/squishsettingspage.ui index 626137663a..5dd82dc97e 100644 --- a/plugins/autotest/squishsettingspage.ui +++ b/plugins/autotest/squishsettingspage.ui @@ -13,6 +13,47 @@ <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> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>289</height> + </size> + </property> + </spacer> + </item> + </layout> </widget> + <customwidgets> + <customwidget> + <class>Utils::PathChooser</class> + <extends>QLineEdit</extends> + <header location="global">utils/pathchooser.h</header> + </customwidget> + </customwidgets> + <resources/> <connections/> </ui> |