diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingspage.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemosettingspage.cpp index 5ffd14e49d9..7d3025a1baa 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 e325134d3cb..dcc90a50fc0 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 7b825bf71f2..c67f8ef751f 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 +#include + #include #include #include @@ -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() << deploySpec); + SshDeploySpec deploySpec(keyFile, homeDirOnDevice(currentConfig().uname) + + QLatin1String("/.ssh/authorized_keys"), true); + m_keyDeployer = new MaemoSshDeployer(currentConfig(), QList() << 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 20305e74d57..0b2844c8e2b 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 d7da01e6f81..021a0c94558 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.ui +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.ui @@ -6,8 +6,8 @@ 0 0 - 534 - 340 + 448 + 307 @@ -17,7 +17,7 @@ - + Configuration: @@ -114,7 +114,7 @@ - + Name @@ -184,7 +184,7 @@ - + Host Name: @@ -198,7 +198,7 @@ - + Ports: @@ -207,7 +207,7 @@ - + SSH: @@ -227,7 +227,7 @@ - + Gdb server: @@ -246,7 +246,7 @@ - + Connection Timeout: @@ -260,7 +260,7 @@ - + User Name: