diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingspage.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemosettingspage.cpp index 5ffd14e49d958f7d74fa10f315ac8e1468ae7064..7d3025a1baabba662c65d7ebb8d8aecb664c873c 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingspage.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingspage.cpp @@ -87,9 +87,16 @@ QIcon MaemoSettingsPage::categoryIcon() const return QIcon(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON)); } +bool MaemoSettingsPage::matches(const QString &searchKeyWord) const +{ + return m_keywords.contains(searchKeyWord, Qt::CaseInsensitive); +} + QWidget *MaemoSettingsPage::createPage(QWidget *parent) { m_widget = new MaemoSettingsWidget(parent); + if (m_keywords.isEmpty()) + m_keywords = m_widget->searchKeywords(); return m_widget; } diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingspage.h b/src/plugins/qt4projectmanager/qt-maemo/maemosettingspage.h index e325134d3cb6e05d4553e89c6a9f13a6a7da09e8..dcc90a50fc0c0e8d04276f375a3db033093e9193 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingspage.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingspage.h @@ -61,11 +61,13 @@ public: virtual QString category() const; virtual QString displayCategory() const; virtual QIcon categoryIcon() const; + virtual bool matches(const QString &searchKeyWord) const; virtual QWidget *createPage(QWidget *parent); virtual void apply(); virtual void finish(); private: + QString m_keywords; MaemoSettingsWidget *m_widget; }; diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp index 7b825bf71f2cf8b5435164e99ce005ba4113a8a7..c67f8ef751ffc0d9e682b90a445df42c1333d136 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp @@ -41,6 +41,8 @@ #include "maemosshthread.h" #include <QtCore/QRegExp> +#include <QtCore/QTextStream> + #include <QtCore/QFileInfo> #include <QtGui/QFileDialog> #include <QtGui/QMessageBox> @@ -125,6 +127,33 @@ MaemoSettingsWidget::~MaemoSettingsWidget() { } +QString MaemoSettingsWidget::searchKeywords() const +{ + QString rc; + QTextStream(&rc) << m_ui->configurationLabel->text() + << ' ' << m_ui->gdbServerLabel->text() + << ' ' << m_ui->sshPortLabel->text() + << ' ' << m_ui->keyButton->text() + << ' ' << m_ui->passwordButton->text() + << ' ' << m_ui->authTypeLabel->text() + << ' ' << m_ui->connectionTimeoutLabel->text() + << ' ' << m_ui->deviceButton->text() + << ' ' << m_ui->simulatorButton->text() + << ' ' << m_ui->deviceTypeLabel->text() + << ' ' << m_ui->deviceNameLabel->text() + << ' ' << m_ui->hostNameLabel->text() + << ' ' << m_ui->keyLabel->text() + << ' ' << m_ui->nameLineEdit->text() + << ' ' << m_ui->passwordLabel->text() + << ' ' << m_ui->portsLabel->text() + << ' ' << m_ui->pwdLineEdit->text() + << ' ' << m_ui->timeoutLineEdit->text() + << ' ' << m_ui->userLineEdit->text() + << ' ' << m_ui->userNameLabel->text(); + rc.remove(QLatin1Char('&')); + return rc; +} + void MaemoSettingsWidget::initGui() { m_ui->setupUi(this); @@ -133,13 +162,15 @@ void MaemoSettingsWidget::initGui() m_ui->keyFileLineEdit->setExpectedKind(Utils::PathChooser::File); foreach (const MaemoDeviceConfig &devConf, m_devConfs) m_ui->configurationComboBox->addItem(devConf.name); - connect(m_ui->configurationComboBox, SIGNAL(currentIndexChanged(int)), SLOT(currentConfigChanged(int))); + connect(m_ui->configurationComboBox, SIGNAL(currentIndexChanged(int)), + SLOT(currentConfigChanged(int))); currentConfigChanged(m_ui->configurationComboBox->currentIndex()); } void MaemoSettingsWidget::addConfig() { - const QString prefix = tr("New Device Configuration %1", "Standard Configuration name with number"); + const QString prefix = tr("New Device Configuration %1", "Standard " + "Configuration name with number"); int suffix = 1; QString newName; bool isUnique = false; @@ -331,12 +362,9 @@ void MaemoSettingsWidget::deployKey() return; m_ui->deployKeyButton->disconnect(); - SshDeploySpec deploySpec(keyFile, - homeDirOnDevice(currentConfig().uname) - + QLatin1String("/.ssh/authorized_keys"), - true); - m_keyDeployer = new MaemoSshDeployer(currentConfig(), - QList<SshDeploySpec>() << deploySpec); + SshDeploySpec deploySpec(keyFile, homeDirOnDevice(currentConfig().uname) + + QLatin1String("/.ssh/authorized_keys"), true); + m_keyDeployer = new MaemoSshDeployer(currentConfig(), QList<SshDeploySpec>() << deploySpec); connect(m_keyDeployer, SIGNAL(finished()), this, SLOT(handleDeployThreadFinished())); m_ui->deployKeyButton->setText(tr("Stop deploying")); @@ -350,11 +378,13 @@ void MaemoSettingsWidget::handleDeployThreadFinished() if (!m_keyDeployer) return; - if (m_keyDeployer->hasError()) - QMessageBox::critical(this, tr("Deployment Failed"), tr("Key deployment failed: %1").arg(m_keyDeployer->error())); - else - QMessageBox::information(this, tr("Deployment Succeeded"), tr("Key was successfully deployed.")); - + if (m_keyDeployer->hasError()) { + QMessageBox::critical(this, tr("Deployment Failed"), + tr("Key deployment failed: %1").arg(m_keyDeployer->error())); + } else { + QMessageBox::information(this, tr("Deployment Succeeded"), + tr("Key was successfully deployed.")); + } stopDeploying(); } @@ -368,8 +398,7 @@ void MaemoSettingsWidget::stopDeploying() delete m_keyDeployer; m_keyDeployer = 0; m_ui->deployKeyButton->setText(tr("Deploy Key ...")); - connect(m_ui->deployKeyButton, SIGNAL(clicked()), - this, SLOT(deployKey())); + connect(m_ui->deployKeyButton, SIGNAL(clicked()), this, SLOT(deployKey())); m_ui->deployKeyButton->setEnabled(buttonWasEnabled); } } diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h index 20305e74d572c0285fe0f8af3a01f40f0949183f..0b2844c8e2bfa40c0f79aa5ac6bd27b985ab6b09 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h @@ -60,7 +60,10 @@ class MaemoSettingsWidget : public QWidget public: MaemoSettingsWidget(QWidget *parent); ~MaemoSettingsWidget(); + void saveSettings(); + QString searchKeywords() const; + private slots: void currentConfigChanged(int index); void addConfig(); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.ui b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.ui index d7da01e6f81129f1844becf1b540d7e0efb4b39a..021a0c94558aef4d9817f265b503576e0efacee0 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.ui +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>534</width> - <height>340</height> + <width>448</width> + <height>307</height> </rect> </property> <property name="windowTitle"> @@ -17,7 +17,7 @@ <item row="0" column="0" colspan="2"> <layout class="QFormLayout" name="formLayout"> <item row="0" column="0"> - <widget class="QLabel" name="label"> + <widget class="QLabel" name="configurationLabel"> <property name="text"> <string>Configuration:</string> </property> @@ -114,7 +114,7 @@ </property> <layout class="QFormLayout" name="formLayout_2"> <item row="0" column="0"> - <widget class="QLabel" name="deviceTypeLabel_2"> + <widget class="QLabel" name="deviceNameLabel"> <property name="text"> <string>Name</string> </property> @@ -184,7 +184,7 @@ </widget> </item> <item row="3" column="0"> - <widget class="QLabel" name="label_3"> + <widget class="QLabel" name="hostNameLabel"> <property name="text"> <string>Host Name:</string> </property> @@ -198,7 +198,7 @@ </widget> </item> <item row="4" column="0"> - <widget class="QLabel" name="label_4"> + <widget class="QLabel" name="portsLabel"> <property name="text"> <string>Ports:</string> </property> @@ -207,7 +207,7 @@ <item row="4" column="1"> <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> - <widget class="QLabel" name="label_7"> + <widget class="QLabel" name="sshPortLabel"> <property name="text"> <string>SSH:</string> </property> @@ -227,7 +227,7 @@ </widget> </item> <item> - <widget class="QLabel" name="label_2"> + <widget class="QLabel" name="gdbServerLabel"> <property name="text"> <string>Gdb server:</string> </property> @@ -246,7 +246,7 @@ </layout> </item> <item row="5" column="0"> - <widget class="QLabel" name="label_5"> + <widget class="QLabel" name="connectionTimeoutLabel"> <property name="text"> <string>Connection Timeout:</string> </property> @@ -260,7 +260,7 @@ </widget> </item> <item row="6" column="0"> - <widget class="QLabel" name="label_6"> + <widget class="QLabel" name="userNameLabel"> <property name="text"> <string>User Name:</string> </property>