From 62e75919e7bb966bd5771ffdb0bd34ed0e7873d5 Mon Sep 17 00:00:00 2001
From: Christian Kandeler <christian.kandeler@nokia.com>
Date: Thu, 31 Mar 2011 14:43:02 +0200
Subject: [PATCH] Maemo: "Mad Developer" is now called "SDK Connectivity" on
 Harmattan.

---
 .../qt-maemo/maemoconfigtestdialog.cpp               | 12 +++++++++---
 .../qt-maemo/maemodeviceconfigwizard.cpp             |  8 +++++++-
 .../maemodeviceconfigwizardkeydeploymentpage.ui      | 10 +++++-----
 .../qt4projectmanager/qt-maemo/maemoglobal.cpp       |  6 ++++++
 src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h |  2 ++
 5 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoconfigtestdialog.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoconfigtestdialog.cpp
index 5c2104363c2..df17f578477 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemoconfigtestdialog.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemoconfigtestdialog.cpp
@@ -160,9 +160,15 @@ void MaemoConfigTestDialog::handleMadDeveloperTestResult(int exitStatus)
         m_ui->testResultEdit->setPlainText(tr("Remote process failed: %1")
             .arg(m_testProcessRunner->process()->errorString()));
     } else if (m_testProcessRunner->process()->exitCode() != 0) {
-        m_ui->errorLabel->setText(m_ui->errorLabel->text()
-            + QLatin1String("<br>") + tr("Mad Developer is not installed.<br>"
-                  "You will not be able to deploy to this device."));
+        QString errorMsg = m_ui->errorLabel->text() + QLatin1String("<br>")
+            + tr("%1 is not installed.<br>You will not be able to deploy "
+                 "to this device.")
+                .arg(MaemoGlobal::madDeveloperUiName(m_config->osVersion()));
+        if (m_config->osVersion() == MaemoGlobal::Maemo6) {
+            errorMsg += QLatin1String("<br>")
+                + tr("Please switch the device to developer mode via Settings -> Security.");
+        }
+        m_ui->errorLabel->setText(errorMsg);
     }
     if (m_config->freePorts().hasMore())
         m_portsGatherer->start(m_testProcessRunner->connection(),
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizard.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizard.cpp
index e83b4c5f727..bf7570c1c2e 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizard.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizard.cpp
@@ -364,6 +364,7 @@ public:
               m_keyDeployer(new MaemoKeyDeployer(this))
     {
         m_ui->setupUi(this);
+        m_instructionTextTemplate = m_ui->instructionLabel->text();
         setTitle(tr("Key Deployment"));
         setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
         connect(m_ui->deviceAddressLineEdit, SIGNAL(textChanged(QString)),
@@ -381,6 +382,9 @@ public:
     {
         m_isComplete = false;
         m_ui->deviceAddressLineEdit->setText(m_wizardData.hostName);
+        m_ui->instructionLabel->setText(QString(m_instructionTextTemplate)
+            .replace(QLatin1String("%%%maddev%%%"),
+                MaemoGlobal::madDeveloperUiName(m_wizardData.maemoVersion)));
         m_ui->passwordLineEdit->clear();
         enableInput();
     }
@@ -425,7 +429,8 @@ private:
     {
         QMessageBox::information(this, tr("Key Deployment Success"),
             tr("The key was successfully deployed. You may now close "
-               "the \"Mad Developer\" application and continue."));
+               "the \"%1\" application and continue.")
+               .arg(MaemoGlobal::madDeveloperUiName(m_wizardData.maemoVersion)));
         m_ui->statusLabel->setText(m_ui->statusLabel->text() + tr("Done."));
         m_isComplete = true;
         emit completeChanged();
@@ -448,6 +453,7 @@ private:
     bool m_isComplete;
     const WizardData &m_wizardData;
     MaemoKeyDeployer * const m_keyDeployer;
+    QString m_instructionTextTemplate;
 };
 
 class MaemoDeviceConfigWizardFinalPage : public QWizardPage
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizardkeydeploymentpage.ui b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizardkeydeploymentpage.ui
index a9eabf26758..ec9069fff55 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizardkeydeploymentpage.ui
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizardkeydeploymentpage.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>452</width>
-    <height>235</height>
+    <width>470</width>
+    <height>322</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -20,9 +20,9 @@
       <string>To deploy the public key to your device, please execute the following steps:
 &lt;ul&gt;
 &lt;li&gt;Connect the device to your computer (unless you plan to connect via WLAN).&lt;/li&gt;
-&lt;li&gt;On the device, start the &quot;Mad Developer&quot; application.&lt;/li&gt;
-&lt;li&gt;In &quot;Mad Developer&quot;, configure the device's IP address to the one shown below (or edit the field below to match the address you have configured).&lt;/li&gt;
-&lt;li&gt;In &quot;Mad Developer&quot;, press &quot;Developer Password&quot; and enter it in the field below.&lt;/li&gt;
+&lt;li&gt;On the device, start the &quot;%%%maddev%%%&quot; application.&lt;/li&gt;
+&lt;li&gt;In &quot;%%%maddev%%%&quot;, configure the device's IP address to the one shown below (or edit the field below to match the address you have configured).&lt;/li&gt;
+&lt;li&gt;In &quot;%%%maddev%%%&quot;, press &quot;Developer Password&quot; and enter it in the field below.&lt;/li&gt;
 &lt;li&gt;Click &quot;Deploy Key&quot;&lt;/li&gt;
 </string>
      </property>
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp
index ad24fa11fe3..2cfbfba9995 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp
@@ -187,6 +187,12 @@ QString MaemoGlobal::madCommand(const QtVersion *qtVersion)
     return maddeRoot(qtVersion) + QLatin1String("/bin/mad");
 }
 
+QString MaemoGlobal::madDeveloperUiName(MaemoVersion maemoVersion)
+{
+    return maemoVersion == Maemo6
+        ? tr("SDK Connectivity") : tr("Mad Developer");
+}
+
 MaemoGlobal::MaemoVersion MaemoGlobal::version(const QtVersion *qtVersion)
 {
     const QString &name = targetName(qtVersion);
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h
index 3fb2cac002e..0daac02695f 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h
@@ -90,7 +90,9 @@ public:
     static QString targetRoot(const QtVersion *qtVersion);
     static QString targetName(const QtVersion *qtVersion);
     static QString madCommand(const QtVersion *qtVersion);
+    static QString madDeveloperUiName(MaemoVersion maemoVersion);
     static MaemoVersion version(const QtVersion *qtVersion);
+
     // TODO: IS this still needed with Qt Version having an Abi?
     static QString architecture(const QtVersion *version);
 
-- 
GitLab