From bbc656f3d37da9bb4bfe74a57c8e17b035fbd0ec Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 13 May 2015 16:34:24 +0200 Subject: Add further settings for Squish Change-Id: I9b297a8c7fdf3634676bd84479f2b6fd210e0d3f Reviewed-by: Christian Stenger --- plugins/autotest/squishsettingspage.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'plugins/autotest/squishsettingspage.cpp') 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 &settings) : m_settings(settings), m_widget(0) { -- cgit v1.2.1