[meego-commits] 7998: Changes to MeeGo:1.1:Handset/meego-handset-sms

Emma Kuo no_reply at build.meego.com
Fri Oct 1 18:08:54 UTC 2010


Hi,
I have made the following changes to meego-handset-sms in project MeeGo:1.1:Handset. Please review and accept ASAP.

Thank You,
Emma Kuo

[This message was auto-generated]

---

Request #7998:

  submit:   devel:ux:handset:MeeGo:1.1/meego-handset-sms(r3) -> MeeGo:1.1:Handset/meego-handset-sms


Message:
    Fixes: BMC#4293 message widget shakes with 1 or 2 messages in history, Fixes: BMC#6231 add internationalization to sms

State:   new          2010-10-01T11:08:53 ekuo
Comment: None



changes files:
--------------
--- meego-handset-sms.changes
+++ meego-handset-sms.changes
@@ -0,0 +1,4 @@
+* Fri Oct 1 2010 Emma Kuo <emma.kuo at intel.com> 0.0.25
+- Fixes BMC#6231 internationalize UI strings
+- Fixes BMC#4293 message widget shakes with 1 or 2 messages in history
+

new:
----
  01_i18n.patch
  02_fixwidgetshake.patch

spec files:
-----------
--- meego-handset-sms.spec
+++ meego-handset-sms.spec
@@ -1,6 +1,6 @@
 # 
-# Do not Edit! Generated by:
-# spectacle version 0.18
+# Do NOT Edit the Auto-generated Part!
+# Generated by: spectacle version 0.20
 # 
 # >> macros
 # << macros
@@ -14,6 +14,8 @@
 URL:        http://www.meego.com
 Source0:    %{name}-%{version}.tar.bz2
 Source100:  meego-handset-sms.yaml
+Patch0:     01_i18n.patch
+Patch1:     02_fixwidgetshake.patch
 Requires:   ofono
 Requires:   smshistory
 Requires:   meego-handset-sms-branding
@@ -46,6 +48,10 @@
 %prep
 %setup -q -n %{name}-%{version}
 
+# 01_i18n.patch
+%patch0 -p1
+# 02_fixwidgetshake.patch
+%patch1 -p1
 # >> setup
 # << setup
 
@@ -87,6 +93,7 @@
 %{_bindir}/sms
 %{_datadir}/dbus-1/services/sms.service
 %{_datadir}/applications/sms.desktop
+%{_datadir}/l10n/meegotouch/sms.qm
 %{_libdir}/qt4/plugins
 # >> files
 # << files

other changes:
--------------

++++++ 01_i18n.patch (new)
--- 01_i18n.patch
+++ 01_i18n.patch
+Description: Fixes BMC#6231 internationalize UI strings
+Author: Emma Kuo <emma.kuo at intel.com>
+
+diff --git a/plugin/smsservice.cpp b/plugin/smsservice.cpp
+index add4e67..388b396 100644
+--- a/plugin/smsservice.cpp
++++ b/plugin/smsservice.cpp
+@@ -319,14 +319,29 @@ void SmsService::getSmsHistoryFinished(QDBusPendingCallWatcher *call)
+ void SmsService::emergencyBroadcast(const QString &message, const QVariantMap &properties)
+ {
+     // create notification
+-    QString type = "UnknownType";
++    QString type;
+     if (properties.contains("EmergencyType")) {
+         // FIXME: need to test correct way to extract the type
+         //type = properties["EmergencyType"].toString();
+         properties["EmergencyType"].value<QDBusArgument>() >> type;
+     }
+ 
+-    MNotification notification(MNotification::MessageArrivedEvent, "Emergency Broadcast Message", type + ": " + message);
++    if (type == "Earthquake") {
++        // % "Earthquake"
++        type = qtTrId("backend_broadcast_earthquake");
++    } else if (type == "Tsunami") {
++        // % "Tsunami"
++        type = qtTrId("backend_broadcast_tsunami");
++    } else if (type == "Earthquake+Tsunami") {
++        // % "Earthquake+Tsunami"
++        type = qtTrId("backend_broadcast_earthquaketsunami");
++    } else if (type == "Other") {
++        // % "Other"
++        type = qtTrId("backend_broadcast_other");
++    }
++
++    // % "Emergency Broadcast Message"
++    MNotification notification(MNotification::MessageArrivedEvent, qtTrId("backend_emergency_broadcast"), type + ": " + message);
+     notification.setImage("icon-s-sms");
+     notification.publish();
+ }
+@@ -334,7 +349,8 @@ void SmsService::emergencyBroadcast(const QString &message, const QVariantMap &p
+ void SmsService::incomingBroadcast(const QString &message, ushort channel)
+ {
+     // create notification
+-    MNotification notification(MNotification::MessageArrivedEvent, QString("Broadcast Message (%1)").arg(channel), message);
++    // % "Broadcast Message (%1)"
++    MNotification notification(MNotification::MessageArrivedEvent, qtTrId("backend_broadcast").arg(channel), message);
+     notification.setImage("icon-s-sms");
+     notification.publish();
+ }
+diff --git a/sms.pro b/sms.pro
+index d7fd0a7..dc1d617 100644
+--- a/sms.pro
++++ b/sms.pro
+@@ -1,7 +1,7 @@
+ include(common.pri)
+ 
+ TEMPLATE = subdirs
+-SUBDIRS = src plugin theme
++SUBDIRS = src plugin theme translations
+ 
+ # Desktop
+ desktop_entry.files = sms.desktop
+diff --git a/src/backend.cpp b/src/backend.cpp
+index 14b8703..fd67614 100644
+--- a/src/backend.cpp
++++ b/src/backend.cpp
+@@ -207,7 +207,8 @@ void Backend::send(const QString recipient, const QString message)
+ {
+     if (!mSmsManagerInterface || !mSmsManagerInterface->isValid()) {
+         qCritical("not connected to ofono");
+-        MMessageBox message("Error: not connected to ofono");
++        //% "Error: not connected to ofono"
++        MMessageBox message(qtTrId("backend_send_err"));
+         message.exec();
+         return;
+     }
+diff --git a/src/dialogitem.cpp b/src/dialogitem.cpp
+index 1435f11..3772d17 100644
+--- a/src/dialogitem.cpp
++++ b/src/dialogitem.cpp
+@@ -54,27 +54,32 @@ DialogItem::DialogItem(MWidget *parent)
+     mTimestamp->setObjectName("dialogItemTimestamp");
+     bubbleLayout->addItem(mTimestamp, 1, 0);
+ 
+-    MAction *forwardaction = new MAction("Forward", this);
++    //% "Forward"
++    MAction *forwardaction = new MAction(qtTrId("dialogitem_action_forward"), this);
+     forwardaction->setLocation(MAction::ObjectMenuLocation);
+     addAction(forwardaction);
+     connect(forwardaction, SIGNAL(triggered()), this, SLOT(forwardActionClicked()));
+ 
+-    MAction *callaction = new MAction("Call", this);
++    //% "Call"
++    MAction *callaction = new MAction(qtTrId("dialogitem_action_call"), this);
+     callaction->setLocation(MAction::ObjectMenuLocation);
+     addAction(callaction);
+     connect(callaction, SIGNAL(triggered()), this, SLOT(callClicked()));
+ 
+-    MAction *detailaction = new MAction("Contact details", this);
++    //% "Contact details"
++    MAction *detailaction = new MAction(qtTrId("dialogitem_action_details"), this);
+     detailaction->setLocation(MAction::ObjectMenuLocation);
+     addAction(detailaction);
+     connect(detailaction, SIGNAL(triggered()), this, SLOT(contactDetailsClicked()));
+ 
+-    MAction *clearaction = new MAction("Clear thread", this);
++    //% "Clear thread"
++    MAction *clearaction = new MAction(qtTrId("dialogitem_action_clear"), this);
+     clearaction->setLocation(MAction::ObjectMenuLocation);
+     addAction(clearaction);
+     connect(clearaction, SIGNAL(triggered()), this, SLOT(clearThreadClicked()));
+ 
+-    MAction *deleteaction = new MAction("Delete this thread", this);
++    //% "Delete this thread"
++    MAction *deleteaction = new MAction(qtTrId("dialogitem_action_delete"), this);
+     deleteaction->setLocation(MAction::ObjectMenuLocation);
+     addAction(deleteaction);
+     connect(deleteaction, SIGNAL(triggered()), this, SLOT(deleteThreadClicked()));
+@@ -128,9 +133,10 @@ void DialogItem::createContent()
+     QString text;
+     if (mPosition == POSITION_FIRST) {
+         if (mCalltype == SmsData::INCOMING) {
+-            text = "<b>" + SmsApplication::instance()->backend()->getName(mSender) + ":</b> ";
++            text = QString("<b>%1:</b> ").arg(SmsApplication::instance()->backend()->getName(mSender));
+         } else {
+-            text = "<b>Me:</b> ";
++            //% "Me"
++            text = QString("<b>%1:</b> ").arg(qtTrId("dialogitem_me"));
+         }
+     }
+     text += mMessage;
+@@ -140,27 +146,33 @@ void DialogItem::createContent()
+     switch (mStatus) {
+         case SmsData::SENT:
+             if (mCalltype == SmsData::INCOMING) {
+-                mTimestamp->setText(QString("Received ") + formatTimestamp(mDatetime));
++                //% "Received %1"
++                mTimestamp->setText(qtTrId("dialogitem_received").arg(formatTimestamp(mDatetime)));
+             } else {
+-                mTimestamp->setText(QString("Sent ") + formatTimestamp(mDatetime));
++                //% "Sent %1"
++                mTimestamp->setText(qtTrId("dialogitem_sent").arg(formatTimestamp(mDatetime)));
+             }
+             mTimestamp->setObjectName("dialogItemTimestamp");
+             break;
+         case SmsData::DELIVERED:
+-            mTimestamp->setText(QString("[Delivered] ") + formatTimestamp(mDatetime));
++            //% "Delivered %1"
++            mTimestamp->setText(qtTrId("dialogitem_delivered").arg(formatTimestamp(mDatetime)));
+             mTimestamp->setObjectName("dialogItemTimestamp");
+             break;
+         case SmsData::PENDING:
+-            mTimestamp->setText("<b>Sending...</b>");
++            //% "Sending..."
++            mTimestamp->setText(QString("<b>%1</b>").arg(qtTrId("dialogitem_sending")));
+             mTimestamp->setObjectName("dialogItemSending");
+             break;
+         case SmsData::DELIVER_FAILED:
+-            mTimestamp->setText("<b>Sorry, your message could not be delivered!</b>");
++            //% "Sorry, your message could not be delivered!"
++            mTimestamp->setText(QString("<b>%1</b>").arg(qtTrId("dialogitem_deliverfailed")));
+             mTimestamp->setObjectName("dialogItemFailed");
+             break;
+         case SmsData::FAILED:
+         default:
+-            mTimestamp->setText("<b>Sorry, your message failed to send!</b>");
++            //% "Sorry, your message failed to send!"
++            mTimestamp->setText(QString("<b>%1</b>").arg(qtTrId("dialogitem_sendfailed")));
+             mTimestamp->setObjectName("dialogItemFailed");
+             break;
+     }
+@@ -180,7 +192,8 @@ void DialogItem::callClicked()
+ void DialogItem::contactDetailsClicked()
+ {
+     // TODO: launch seaside here
+-    MMessageBox message("TODO: launch contacts here");
++    //% "TODO: launch contacts here"
++    MMessageBox message(qtTrId("dialogitem_todo_contacts"));
+     message.exec();
+ }
+ 
+@@ -235,7 +248,8 @@ void DialogItem::cancelEvent(MCancelEvent *ev)
+ void DialogItem::phoneLinkPressed(QString phone)
+ {
+     qDebug() << "phoneLinkPressed" << phone;
+-    MDialog *dialog = new MDialog("Call " + phone, M::OkButton | M::CancelButton);
++    //% "Call %1"
++    MDialog *dialog = new MDialog(qtTrId("dialogitem_hyperlink_call").arg(phone), M::OkButton | M::CancelButton);
+     if (dialog->exec() == M::OkButton) {
+         SmsApplication::instance()->backend()->call(phone);
+     }
+@@ -244,7 +258,8 @@ void DialogItem::phoneLinkPressed(QString phone)
+ void DialogItem::urlLinkPressed(QString url)
+ {
+     qDebug() << "urlLinkPressed" << url;
+-    MDialog *dialog = new MDialog("Open " + url, M::OkButton | M::CancelButton);
++    //% "Open %1"
++    MDialog *dialog = new MDialog(qtTrId("dialogitem_hyperlink_openurl").arg(url), M::OkButton | M::CancelButton);
(268 more lines skipped)

++++++ 02_fixwidgetshake.patch (new)
--- 02_fixwidgetshake.patch
+++ 02_fixwidgetshake.patch
+Description: Fixes BMC#4293 message widget shakes with 1 or 2 messages in history
+Author: Arun Ravindran <ext-arun.1.ravindran at nokia.com> 
+Author: Emma Kuo <emma.kuo at intel.com>
+
+diff --git a/src/dialogpage.cpp b/src/dialogpage.cpp
+index c64dddc..fa474c1 100644
+--- a/src/dialogpage.cpp
++++ b/src/dialogpage.cpp
+@@ -17,6 +17,7 @@
+ #include <MButton>
+ #include <MAction>
+ #include <MSceneManager>
++#include <MPositionIndicator>
+ 
+ #include <MWidgetCreator>
+ 
+@@ -160,7 +161,7 @@ DialogPage::DialogPage(Backend *backend, QString phone, QString message) :
+ 
+     if (!phone.isEmpty()) {
+         setDialogMode(phone);
+-        QTimer::singleShot(50, this, SLOT(scrollToBottom()));
++        QTimer::singleShot(200, this, SLOT(scrollToBottom()));
+     } else {
+         //% "New message"
+         setTitle(qtTrId("newmessagepage_title"));
+@@ -240,7 +241,10 @@ void DialogPage::dialogUpdated()
+ 
+ void DialogPage::scrollToBottom()
+ {
+-    mDialogList->scrollTo(mModel->index(mModel->rowCount() - 1, 0));
++    // No need to scroll to bottom if the list is not covering the viewport area.
++    if(mDialogViewport->positionIndicator()->viewportSize().height() < mDialogViewport->positionIndicator()->range().height()) {
++        mDialogList->scrollTo(mModel->index(mModel->rowCount() - 1, 0));
++    }
+ }
+ 
+ void DialogPage::customizedComplete(const QString &prefix)

++++++ meego-handset-sms.yaml
--- meego-handset-sms.yaml
+++ meego-handset-sms.yaml
@@ -7,6 +7,9 @@
 URL: http://www.meego.com
 Sources:
     - "%{name}-%{version}.tar.bz2"
+Patches:
+    - 01_i18n.patch
+    - 02_fixwidgetshake.patch
 Description: MeeGo Touch Framework based SMS Application
 
 Requires:
@@ -31,6 +34,7 @@
 - "%{_bindir}/sms"
 - "%{_datadir}/dbus-1/services/sms.service"
 - "%{_datadir}/applications/sms.desktop"
+- "%{_datadir}/l10n/meegotouch/sms.qm"
 - "%{_libdir}/qt4/plugins"
 
 SubPackages:




More information about the MeeGo-commits mailing list