[meego-commits] 9662: Changes to Trunk:Handset/meego-handset-sms
btdrucke
no_reply at build.meego.com
Mon Nov 22 19:17:14 UTC 2010
Hi,
I have made the following changes to meego-handset-sms in project Trunk:Handset. Please review and accept ASAP.
Thank You,
btdrucke
[This message was auto-generated]
---
Request #9662:
submit: devel:ux:handset/meego-handset-sms(r59) -> Trunk:Handset/meego-handset-sms
Message:
Fix BMC#3533: when drafting SMS messages, contact list is initially empty. It is also empty when the To: field is erased.
State: new 2010-11-22T11:17:13 btdrucke
Comment: None
changes files:
--------------
--- meego-handset-sms.changes
+++ meego-handset-sms.changes
@@ -0,0 +1,4 @@
+* Thu Nov 11 2010 Ben Drucker <benjamin.t.drucke at intel.com> 0.0.34
+- Fix BMC#3533: when drafting SMS messages, contact list is initially empty.
+ It is also empty when the To: field is erased.
+
old:
----
meego-handset-sms-0.0.33.tar.bz2
new:
----
meego-handset-sms-0.0.34.tar.bz2
spec files:
-----------
--- meego-handset-sms.spec
+++ meego-handset-sms.spec
@@ -7,7 +7,7 @@
Name: meego-handset-sms
Summary: MeeGo Touch Framework based SMS Application
-Version: 0.0.33
+Version: 0.0.34
Release: 1
Group: System/GUI/Other
License: Apache License, Version 2.0
other changes:
--------------
++++++ meego-handset-sms-0.0.33.tar.bz2 -> meego-handset-sms-0.0.34.tar.bz2
--- ARCHITECTURE
+++ ARCHITECTURE
+__Overview__
+
+meego-handset-sms is a reference text messaging application for MeeGo Handset. It
+supports the following features:
+
+* send and receive SMS
+* persistent message history
+* draft messages
+* associating phone numbers with name/avatar stored in contacts (meego-handset-people)
+* pop-up notifications of incoming SMS
+* Cell Broadcast messages
+* SMS delivery reports
+
+SMS uses the following components:
+
+* MTF/libmeegotouch - touch based UI, built on top of QGraphics
+* libseaside - MeeGo utility library for contacts, built on top of Qt-Contacts
+* Qt-Contacts - Qt-Mobility contacts API
+* Ofono - telephony stack
+* smshistory - plugin to Ofono that provides temporary message storage
+* QMF - message storage
+
+
+ .-----------------.
+ | SMS application |
+ | |
+ '-----------------'
+ ^ |
+ | |
+ | |
+.---------------. | .----------------.
+| QMF | | SendMessage()| ofonod |
+| messageserver | '------------->| | .-----------.
+| ............| |............. | | modem or |
+| . libsms.so | GetSmsHistory() | smshistory . |----| phonesim |
+| . plugin |<----------------| plugin . | '-----------'
+'---------------' '----------------'
+ |
+ |
+.---------------.
+| sqlite3 db |
+'---------------'
+
+meego-handset-sms consists of three components, the "sms" application, the QMF
+plugin libsms.so, and the "smsinit" binary. Operation assumes that the QMF
+"messageserver" daemon is running persistently from system startup. This is so that
+incoming messages will always be spooled to the QMF data storage, and MTF
+notifications for incoming messages can be generated, whether the SMS application
+is running or not.
+
+Note that this is NOT how QMF messageserver is normally run. Normally the
+messageserver daemon is spawned on-demand when a client email app is started.
+Additionally, an account must be configured in QMF to use the sms plugin, before
+this can work. The binary "smsinit" handles both configuration of the initial
+account, as well as launching messageserver. It installs a file to
+/etc/xdg/autostart/smsinit.desktop, so it is launched as startup.
+
+Layout of the source tree:
+
+src/ - SMS application source
+plugin/ - QMF plugin source
+smsinit/ - smsinit source
+theme/ - css stylesheet and theme assets
+translations/ - "engineering english" translations
+
+There is a separate repo, meego-handset-sms-translations, that provides
+the actual localization files.
+
+__Ofono__
+
+Ofono's SMS API is still in the process of being designed, so some parts are not
+currently used. Additionally, the IncomingMessage() signal is not used, because
+this API does not expose message status (sent, failed, delivered, etc). The
+smshistory plugin is used instead (see below). Ofono exports a DBus interface for
+SMS under the name "org.ofono.MessageManager".
+
+Methods:
+
+a{sv} GetProperties() - used to get SMS stack settings (delivery reports, SMSC)
+SetProperty(s, v) - used to set SMS stack settings (delivery reports, SMSC)
+o SendMessage(s,s) - used to send messages
+a(oa{sv}) GetMessages() - NOT USED, new to the API
+
+Signals:
+
+PropertyChanged(s, v) - NOT USED, notify that a property changed
+IncomingMessage(s, a{sv}) - NOT USED, incoming class 1 SMS
+ImmediateMessage(s, a{sv}) - NOT USED, incoming class 0 SMS
+MessageAdded(o, a{sv}) - NOT USED, new to the API
+MessageRemoved(o) - NOT USED, new to the API
+
+_Smshistory_
+
+smshistory is a plugin to Ofono that provides temporary storage of SMS messages,
+both incoming and outgoing. It is only meant to be temporary storage as there is a
+hard limit to the number of messages that can stored before old ones will be
+overwritten. It is analogous to the callhistory plugin used by dialer. It exports
+the DBus interface "org.ofono.SmsHistory".
+
+Methods:
+
+a(sqqssii) GetSmsHistory() - returns an array of SMS message "structs"
+SetSmsHistoryRead() - called after GetSmsHistory() to clear the history
+
+Signals:
+
+SmsHistoryChanged(u) - notifies the client that there are new messages
+SmsStatusChanged(s, q, i) - notifies that the status of a message has changed
+
+_phonesim_
+
+Phonesim is a modem simulator that can be used with Ofono to simulate calls and
+SMS. It has a Qt based GUI and listens on a tcp socket for a connection from Ofono.
+Ofono can be configured to use phonesim in /etc/ofono/modem.conf.
+
+__QMF__
+
+QMF (Qt Messaging Framework) is a library for unified messaging (email, SMS, MMS,
+IM). Unfortunately, it does not provide out of the box support for anything
+other than email, and its architecture has issues with SMS/MMS and IM. It can be
+extended by plugins. Examples of functionality provided by plugins are SMTP, POP,
+IMAP, and Sqlite based message storage.
+
+It is used by the SMS app for receiving and storing messages, but not sending. The
+QMF plugin libsms.so is installed by meego-handset-sms, and spools messages from
+smshistory to the QMF message store. It also provides MTF notifications for
+incoming messages and cell broadcast messages. The design of this plugin is
+somewhat of a kludge due to problems with the QMF architecture, and a better
+long-term solution needs to be found.
+
+These are the issues with using QMF for SMS:
+
+* no support for asynchronous "always-on" reception of messages
+* no support for sending/receiving messages without an account configured
+* no SMS specific metadata fields
+
+__Qt-Messaging__
+
+Qt-Messaging is a higher level API that is part of Qt Mobility. On MeeGo and linux
+platforms, it uses QMF as its backend. Its API is almost identical to the QMF,
+however it is not currently being used because it does not provide access to QMF's
+"custom fields". These custom fields are needed as a work-around to the
+lack of SMS metadata fields for storing the message status flags.
+
+__Architecture Gaps/TODOs__
+
+Eventually, MeeGo SMS applications need to use the Qt-Messaging API instead of
+talking directly to Ofono and QMF. For this to be possible the following needs
+to be happen:
+
+* finalization of the Ofono SMS API
+* address the architectural issues in QMF and/or Qt-Messaging APIs
+* implementation of a QMF plugin or Qt-Messaging backend that connects to Ofono
+
+_Phone number matching_
+
+Phone numbers on incoming messages can be in many different formats, such as
+international or national. The phone number an SMS is sent to may not be identical
+to the one the reply is received from. Identifying numbers that are semantically
+equivalent is complex, and varies based on country and carrier.
+
+Emma Kuo <emma.kuo at intel.com>
+Nov 4, 2010
--- README
+++ README
@@ -1,11 +1,28 @@
-meego-handset-sms - Meego Handset SMS application
+meego-handset-sms - MeeGo Handset SMS application
Copyright (C) 2010, Intel Corporation.
meego-handset-sms is an SMS application based on Qt 4.7 and libmeegotouch
It depends on:
- - ofono and smshistory, for telephony services
- - libseaside, for contacts data
- - messagingframework (QMF), for storage of SMS messages
+
+ - libmeegotouch
+ - Ofono and smshistory, for telephony services
+ - libseaside and Qt-Mobility, for contacts data
+ - Qt Messaging Framework (QMF), for storage of SMS messages
+
+If you are building from source on MeeGo, the packages you need are:
+
+ - gcc-c++
+ - make
+ - libqt-devel
+ - libmeegotouch-devel
+ - meegotouch-theme-meego
+ - ofono
+ - ofono-test
+ - smshistory
+ - phonesim
+ - libseaside-devel
+ - qt-mobility-devel
+ - qmf-devel
-----------------------------------------------------------------------------
Build
@@ -21,16 +38,20 @@
-----------------------------------------------------------------------------
Running
-----------------------------------------------------------------------------
+The following assumes ofono is already running. For more detailed
+usage see below.
+
+$ smsinit
$ sms
-----------------------------------------------------------------------------
- Running phonesim remotely
+ Running phonesim and ofono
-----------------------------------------------------------------------------
-You must be running phonesim to simulate incoming SMS messages. It is possible
-to run phonesim on a desktop computer and have ofono on the mobile device
-connect to it over tcp/ip. In this example, the desktop computer is address
-192.168.0.1.
+You must be running phonesim to simulate incoming SMS messages. It
+is possible to run phonesim on a desktop computer and have ofono on
+the mobile device connect to it over tcp/ip. In this example, the
+desktop computer is address 192.168.0.1.
------[on mobile device]-------
@@ -50,8 +71,9 @@
------[on mobile device]-------
-3. Reboot the mobile device. If the phonesim window does not appear on the
-desktop, you may need to start ofono manually using the commands below:
+3. Reboot the mobile device. If the phonesim window does not appear
+on the desktop, you may need to start ofono manually using the
+commands below:
3a. Start ofono (as root):
@@ -60,9 +82,13 @@
3b. Tell ofono to enable the modem:
$ /usr/lib/ofono/test/enable-modem
+ $ /usr/lib/ofono/test/online-modem
+
+Online-modem must be run a few seconds after enable-modem, or the
+SMS interface will not be available.
-Once the phonesim window appears, there will be an "SMS" tab from which you can
-simulate an incoming SMS. You can start sms now and it will be able to send
-and receive messages through ofono.
+Once the phonesim window appears, there will be an "SMS" tab from
+which you can simulate an incoming SMS. You can start sms now and it
+will be able to send and receive messages through ofono.
--- src/contactsortfiltermodel.cpp
+++ src/contactsortfiltermodel.cpp
@@ -22,23 +22,45 @@
ContactSortFilterModel::~ContactSortFilterModel()
{}
-bool ContactSortFilterModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
+bool ContactSortFilterModel::filterAcceptsRow(int source_row,
+ const QModelIndex &source_parent) const
{
- // match at the beginning of word boundaries
// or phone number substrings
Q_UNUSED(source_parent);
- ContactItemModel *model = dynamic_cast<ContactItemModel*>(sourceModel());
- ContactData dat = model->data(model->index(source_row, 0)).value<ContactData>();
- QRegExp nameRegExp = filterRegExp();
- nameRegExp.setPatternSyntax(QRegExp::RegExp);
- nameRegExp.setPattern("\\b" + QRegExp::escape(nameRegExp.pattern()));
- return dat.name.contains(nameRegExp) ||
- (!stripPhone(filterRegExp().pattern()).isEmpty() &&
- stripPhone(dat.phone).
- contains(QRegExp(stripPhone(filterRegExp().pattern()))));
+
+ const ContactItemModel *model = dynamic_cast<const ContactItemModel*>(sourceModel());
+ const ContactData dat = model->data(model->index(source_row, 0)).value<ContactData>();
+
+ bool isAccepted = false;
+
+ // Assume pattern is the start of a name (first or last). Match
+ // at the beginning of word boundaries
+
+ const QString pattern = filterRegExp().pattern().trimmed();
+ if (!pattern.isEmpty())
+ {
+ const QString namePattern = ("\\b" + QRegExp::escape(pattern));
+ const QRegExp rex(namePattern, Qt::CaseInsensitive);
+ const QString name = dat.name;
+ isAccepted = name.contains(rex);
+ }
+
+ // Assume pattern is a phone number fragment
+
+ const QString phonePattern = stripPhone(pattern);
+ if (!isAccepted && !phonePattern.isEmpty())
+ {
+ const QRegExp rex(pattern, Qt::CaseInsensitive, QRegExp::FixedString);
+ const QString phone = stripPhone(dat.phone);
+ isAccepted = phone.contains(rex);
+ }
+
+ return isAccepted;
}
-bool ContactSortFilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
+bool ContactSortFilterModel::lessThan(const QModelIndex &left,
+ const QModelIndex &right) const
{
- return QString::localeAwareCompare(left.data().value<ContactData>().name, right.data().value<ContactData>().name) < 0;
+ return QString::localeAwareCompare(left.data().value<ContactData>().name,
+ right.data().value<ContactData>().name) < 0;
}
--- src/dialogpage.cpp
+++ src/dialogpage.cpp
@@ -75,6 +75,8 @@
mAddressEntry->setObjectName("textEntry");
mAddressEntry->setCompleter(mCompleter);
connect(mCompleter, SIGNAL(startCompleting(const QString&)), this, SLOT(customizedComplete(const QString&)));
+ connect(mAddressEntry, SIGNAL(textChanged()), this, SLOT(maybeClearedComplete()));
+
//MButton *clear = new MButton();
//clear->setObjectName("clearButton");
entryLayout->addItem(mAddressEntry);
@@ -283,6 +285,14 @@
mContactFilterModel->setFilterRegExp(QRegExp(prefix, Qt::CaseInsensitive, QRegExp::FixedString));
}
+void DialogPage::maybeClearedComplete()
+{
+ if (mAddressEntry->text().isEmpty())
+ {
+ mContactFilterModel->setFilterRegExp(QRegExp());
+ }
+}
+
void DialogPage::contactItemClicked(const QModelIndex &index)
{
QVariant data = index.data(Qt::DisplayRole);
--- src/dialogpage.h
+++ src/dialogpage.h
@@ -48,6 +48,7 @@
void dialogUpdated();
void scrollToBottom();
void customizedComplete(const QString&);
+ void maybeClearedComplete();
void contactItemClicked(const QModelIndex&);
void sms_added(QList<SmsData>);
++++++ meego-handset-sms.yaml
--- meego-handset-sms.yaml
+++ meego-handset-sms.yaml
@@ -1,6 +1,6 @@
Name: meego-handset-sms
Summary: MeeGo Touch Framework based SMS Application
-Version: 0.0.33
+Version: 0.0.34
Release: 1
Group: System/GUI/Other
License: Apache License, Version 2.0
More information about the MeeGo-commits
mailing list