diff options
author | Christian Kandeler <christian.kandeler@nokia.com> | 2011-07-06 13:52:23 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@nokia.com> | 2011-07-06 13:54:08 +0200 |
commit | 8bddd27a2b9894fcd90684126866496dc59efdb1 (patch) | |
tree | c3b258bf610944bf5d360f8b6441733d3fb0c916 | |
parent | b37fda1aa75f79093e018f9e9e74d181cb3710d3 (diff) | |
download | qt-creator-8bddd27a2b9894fcd90684126866496dc59efdb1.tar.gz |
Maemo: Add possibility to set the SSH port in the device config wizard.
This is for weird people who do port forwarding.
Task-number: QTCREATORBUG-5317
Change-Id: If15cab3cc3a12aa79aef0e1cfd1111db79e57b7c
Reviewed-on: http://codereview.qt.nokia.com/1235
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
-rw-r--r-- | src/plugins/remotelinux/maemodeviceconfigwizard.cpp | 21 | ||||
-rw-r--r-- | src/plugins/remotelinux/maemodeviceconfigwizardstartpage.ui | 34 |
2 files changed, 45 insertions, 10 deletions
diff --git a/src/plugins/remotelinux/maemodeviceconfigwizard.cpp b/src/plugins/remotelinux/maemodeviceconfigwizard.cpp index 60a8605ea1..969515a75c 100644 --- a/src/plugins/remotelinux/maemodeviceconfigwizard.cpp +++ b/src/plugins/remotelinux/maemodeviceconfigwizard.cpp @@ -82,6 +82,7 @@ struct WizardData QString publicKeyFilePath; QString userName; QString password; + int sshPort; }; enum PageId { @@ -119,6 +120,9 @@ public: m_ui->hwButton->setChecked(true); handleDeviceTypeChanged(); m_ui->hostNameLineEdit->setText(defaultHost(deviceType())); + m_ui->sshPortSpinBox->setMinimum(1); + m_ui->sshPortSpinBox->setMaximum(65535); + m_ui->sshPortSpinBox->setValue(22); connect(m_ui->nameLineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); connect(m_ui->hostNameLineEdit, SIGNAL(textChanged(QString)), this, @@ -150,12 +154,20 @@ public: ? LinuxDeviceConfiguration::Physical : LinuxDeviceConfiguration::Emulator; } + int sshPort() const + { + return deviceType() == LinuxDeviceConfiguration::Emulator + ? 6666 : m_ui->sshPortSpinBox->value(); + } + private slots: void handleDeviceTypeChanged() { const bool enable = deviceType() == LinuxDeviceConfiguration::Physical; m_ui->hostNameLabel->setEnabled(enable); m_ui->hostNameLineEdit->setEnabled(enable); + m_ui->sshPortLabel->setEnabled(enable); + m_ui->sshPortSpinBox->setEnabled(enable); } private: @@ -495,9 +507,9 @@ private: SshConnectionParameters sshParams(SshConnectionParameters::NoProxy); sshParams.authenticationType = SshConnectionParameters::AuthenticationByPassword; sshParams.host = hostAddress(); - sshParams.port = 22; + sshParams.port = m_wizardData.sshPort; sshParams.password = password(); - sshParams.timeout = 30; + sshParams.timeout = 10; sshParams.userName = defaultUser(m_wizardData.osType); m_ui->statusLabel->setText(tr("Deploying... ")); m_keyDeployer->deployPublicKey(sshParams, m_wizardData.publicKeyFilePath); @@ -609,18 +621,17 @@ LinuxDeviceConfiguration::Ptr MaemoDeviceConfigWizard::deviceConfiguration() Utils::SshConnectionParameters sshParams(Utils::SshConnectionParameters::NoProxy); sshParams.userName = defaultUser(d->wizardData.osType); sshParams.host = d->wizardData.hostName; + sshParams.port = d->wizardData.sshPort; if (d->wizardData.deviceType == LinuxDeviceConfiguration::Emulator) { sshParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByPassword; sshParams.password = d->wizardData.osType == LinuxDeviceConfiguration::MeeGoOsType ? QLatin1String("meego") : QString(); - sshParams.port = 6666; sshParams.timeout = 30; freePortsSpec = QLatin1String("13219,14168"); doTest = false; } else { sshParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByKey; sshParams.privateKeyFile = d->wizardData.privateKeyFilePath; - sshParams.port = 22; sshParams.timeout = 10; freePortsSpec = QLatin1String("10000-10100"); doTest = true; @@ -643,7 +654,7 @@ int MaemoDeviceConfigWizard::nextId() const d->wizardData.osType = d->startPage.osType(); d->wizardData.deviceType = d->startPage.deviceType(); d->wizardData.hostName = d->startPage.hostName(); - + d->wizardData.sshPort = d->startPage.sshPort(); if (d->wizardData.deviceType == LinuxDeviceConfiguration::Emulator) return FinalPageId; return PreviousKeySetupCheckPageId; diff --git a/src/plugins/remotelinux/maemodeviceconfigwizardstartpage.ui b/src/plugins/remotelinux/maemodeviceconfigwizardstartpage.ui index dc89ebe98f..062a89c4d1 100644 --- a/src/plugins/remotelinux/maemodeviceconfigwizardstartpage.ui +++ b/src/plugins/remotelinux/maemodeviceconfigwizardstartpage.ui @@ -6,17 +6,14 @@ <rect> <x>0</x> <y>0</y> - <width>727</width> - <height>136</height> + <width>721</width> + <height>176</height> </rect> </property> <property name="windowTitle"> <string>WizardPage</string> </property> <layout class="QFormLayout" name="formLayout"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> <item row="0" column="0"> <widget class="QLabel" name="nameLabel"> <property name="text"> @@ -102,6 +99,33 @@ <item row="3" column="1"> <widget class="QLineEdit" name="hostNameLineEdit"/> </item> + <item row="4" column="0"> + <widget class="QLabel" name="sshPortLabel"> + <property name="text"> + <string>The SSH port:</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QSpinBox" name="sshPortSpinBox"/> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> </layout> </widget> <resources/> |