[meego-commits] 7565: Changes to Trunk:Handset/meego-handset-email
cwong
no_reply at build.meego.com
Thu Sep 16 23:16:26 UTC 2010
Hi,
I have made the following changes to meego-handset-email in project Trunk:Handset. Please review and accept ASAP.
Thank You,
cwong
[This message was auto-generated]
---
Request #7565:
submit: devel:ux:handset/meego-handset-email(r22) -> Trunk:Handset/meego-handset-email
Message:
This fixes BMC#6026, FEA#4357, BMC#6277, FEA#4353, BMC#6264, BMC#6058 and BMC#6599.
State: new 2010-09-16T16:16:26 cwong
Comment: None
changes files:
--------------
--- meego-handset-email.changes
+++ meego-handset-email.changes
@@ -0,0 +1,9 @@
+* Thu Sep 16 2010 Carl Wong <carl.wong at intel.com> - 0.2.2
+- Fixes BMC#6026 - Email launched from quick launch bar and app-launcher are not consistent.
+- Fixes: Feature 4357 - [FEA] Email signature
+- Fixes: BMC#6277 - The default pop3/smtp/imap incoming/outgoing port number is incorrect
+- Completed feature #4353 - Email composer send action. It prompts the user if subject and message fields are empty.
+- Fixes: BMC#6264 - need dbus interface to share photo via email from photo app
+- Fixes: BMC#6058 - expose an interface to get Recent communications from a contact
+- Fixes: BMC#6599 - [L10N] Email client needs to be translatable
+
old:
----
meego-handset-email-0.2.1.tar.gz
new:
----
meego-handset-email-0.2.2.tar.gz
spec files:
-----------
--- meego-handset-email.spec
+++ meego-handset-email.spec
@@ -7,7 +7,7 @@
Name: meego-handset-email
Summary: MeeGo Handset Email Client Application
-Version: 0.2.1
+Version: 0.2.2
Release: 1
Group: Applications/Internet
License: Apache License, Version 2.0
@@ -15,31 +15,21 @@
Source0: %{name}-%{version}.tar.gz
Source100: meego-handset-email.yaml
Requires: %{name} >= %{version}
-
BuildRequires: pkgconfig(QtCore) >= 4.6.0
-BuildRequires: pkgconfig(QtDBus)
BuildRequires: pkgconfig(QtGui)
+BuildRequires: pkgconfig(QtContacts)
BuildRequires: pkgconfig(messageserver)
BuildRequires: pkgconfig(meegotouch)
BuildRequires: pkgconfig(qtopiamail)
-BuildRequires: qt-mobility-devel
BuildRequires: libseaside-devel
+BuildRequires: qt-mobility-devel
BuildRequires: desktop-file-utils
+
%description
MeeGo Handset Email Client Application
-%package branding-upstream
-Summary: MeeGo people default theme files
-License: Restricted
-Group: System/GUI/Other
-Requires: %{name} = %{version}-%{release}
-Provides: meego-handset-email-branding
-
-%description branding-upstream
-Theme assets for the MeeGo email application
-
%prep
%setup -q -n %{name}-%{version}
@@ -52,9 +42,9 @@
# >> build pre
export QMF_INCLUDEDIR=/usr/include
export QMF_LIBDIR=/usr/lib
-qmake install_prefix=/usr
# << build pre
+qmake install_prefix=/usr
make %{?jobs:-j%jobs}
# >> build post
@@ -62,7 +52,6 @@
%install
rm -rf %{buildroot}
# >> install pre
-export INSTALL_ROOT=%{buildroot}
# << install pre
%make_install INSTALL_ROOT=%{buildroot}
@@ -79,16 +68,12 @@
%files
%defattr(-,root,root,-)
-%{_bindir}/meego-handset-email
-%{_datadir}/dbus-1/services/meego-handset-email.service
-%{_datadir}/applications/meego-handset-email.desktop
+%{_bindir}/%{name}
+%{_datadir}/dbus-1/services/email.service
+%{_datadir}/applications/email.desktop
+%{_datadir}/l10n/meegotouch/%{name}.qm
+%{_datadir}/themes/base/meegotouch/%{name}
# >> files
# << files
-%files branding-upstream
-%defattr(-,root,root,-)
-# >> files branding-upstream
-%{_datadir}/themes/base/meegotouch/meego-handset-email
-# << files branding-upstream
-#
other changes:
--------------
++++++ meego-handset-email-0.2.1.tar.gz -> meego-handset-email-0.2.2.tar.gz
--- email.desktop
+++ email.desktop
+[Desktop Entry]
+Name=Email
+Comment=MeeGo handset email client
+Type=Application
+Icon=icon-Applications-email
+Exec=meego-handset-email
+StartupNotify=true
+Terminal=false
+Categories=Network;Email;
--- email.service
+++ email.service
(renamed from meego-handset-email.service)
--- meego-handset-email.desktop
+++ meego-handset-email.desktop
-[Desktop Entry]
-Name=MeeGo Handset Email
-Comment=MeeGo handset email client
-Type=Application
-Icon=icon-l-email
-Exec=meego-handset-email
-StartupNotify=true
-Terminal=false
-Categories=Network;Email;
--- meego-handset-email.service
+++ meego-handset-email.service
(renamed to email.service)
--- projects.pro
+++ projects.pro
@@ -1,90 +1,25 @@
-TEMPLATE = app
+TEMPLATE = subdirs
VERSION=0.2
TARGET = meego-handset-email
-OBJECTS_DIR = .obj
-MOC_DIR = .moc
-MGEN_OUTDIR = .gen
-
-PKGCONFIG += meegotouch
-QT += dbus network
-CONFIG += qt meegotouch mobility debug
-MOBILITY += contacts
-
-INCLUDEPATH += $$(QMF_INCLUDEDIR)/qtopiamail $$(QMF_INCLUDEDIR)/qtopiamail/support $$(QMF_INCLUDEDIR)/messageserver ./src
-LIBS += -L $$(QMF_LIBDIR) -lqtopiamail -lqmfutil -lmessageserver -lseaside -lQtContacts
-
# Paths
M_PREFIX = /usr
M_INSTALL_BIN = $$INSTALL_ROOT$$M_PREFIX/bin/
M_INSTALL_DATA = $$INSTALL_ROOT$$M_PREFIX/share/
M_THEME_DIR = $$M_INSTALL_DATA/themes/
-DEFINES += THEMEDIR=\\\"\"$$M_PREFIX/share/themes/base/meegotouch/$$TARGET/\"\\\"
-
-target.path = $$M_INSTALL_BIN
-
-STYLE_HEADERS += src/messageitemstyle.h
-
-SOURCES += src/main.cpp \
- src/accountinfo.cpp \
- src/accountitem.cpp \
- src/accountsetuppage.cpp \
- src/composepage.cpp \
- src/contactpage.cpp \
- src/conversationpage.cpp \
- src/editexistingaccountpage.cpp \
- src/emailapplication.cpp \
- src/emaildbusadaptor.cpp \
- src/emailsettingspage.cpp \
- src/emailserviceconfiguration.cpp \
- src/emailutils.cpp \
- src/folderitem.cpp \
- src/folderpage.cpp \
- src/mailmanager.cpp \
- src/manualaccounteditpage.cpp \
- src/messageitem.cpp \
- src/messageitemcreator.cpp \
- src/messageitemmodel.cpp \
- src/messagelistpage.cpp \
- src/reviewaccountpage.cpp \
- src/servercontroller.cpp \
-
-HEADERS += src/emailapplication.h \
- src/accountinfo.h \
- src/accountitem.h \
- src/accountsetuppage.h \
- src/composepage.h \
- src/contactpage.h \
- src/conversationpage.h \
- src/editexistingaccountpage.h \
- src/emaildbusadaptor.h \
- src/emailsettingspage.h \
- src/emailserviceconfiguration.h \
- src/emailutils.h \
- src/folderitem.h \
- src/folderpage.h \
- src/mailmanager.h \
- src/manualaccounteditpage.h \
- src/messageitem.h \
- src/messageitemcreator.h \
- src/messageitemmodel.h \
- src/messageitemstyle.h \
- src/messagelistpage.h \
- src/reviewaccountpage.h \
- src/servercontroller.h \
- $$STYLE_HEADERS
+SUBDIRS = src translations
# Themes
basetheme.files = theme/base/*
basetheme.path = $$M_THEME_DIR/base/meegotouch/$$TARGET/
# Desktop
-desktop_entry.files = meego-handset-email.desktop
+desktop_entry.files = email.desktop
desktop_entry.path = $$M_INSTALL_DATA/applications
# DBUS Service
-dbus_service.files = meego-handset-email.service
+dbus_service.files = email.service
dbus_service.path = $$M_INSTALL_DATA/dbus-1/services/
MAKE_CLEAN += $$OBJECTS_DIR/*.o
@@ -93,7 +28,6 @@
$$OBJECTS_DIR/* $$OBJECTS_DIR \
$$MGEN_OUTDIR/* $$MGEN_OUTDIR
-INSTALLS += target \
- desktop_entry \
+INSTALLS += desktop_entry \
dbus_service \
basetheme
--- src/accountinfo.cpp
+++ src/accountinfo.cpp
@@ -30,17 +30,18 @@
m_inPassword (""),
m_inPort (-1),
- m_inSecurity ("None"),
+ //% "None"
+ m_inSecurity (qtTrId("xx_none")),
m_inServerAddress (""),
- m_inServerType ("None"),
+ m_inServerType (qtTrId("xx_none")),
m_inUsername (""),
m_outAuthentication (AccountInfo::Authentication_None),
m_outPassword (""),
m_outPort (-1),
- m_outSecurity ("None"),
+ m_outSecurity (qtTrId("xx_none")),
m_outServerAddress (""),
- m_outServerType ("None"),
+ m_outServerType (qtTrId("xx_none")),
m_outUsername ("")
{
m_account = new QMailAccount();
@@ -54,32 +55,35 @@
m_account->setStatus(QMailAccount::MessageSource, true);
m_account->setStatus(QMailAccount::MessageSink, true);
m_account->setStatus(QMailAccount::CanTransmit, true);
+ m_account->setStatus(QMailAccount::CanRetrieve, true);
- retrievalActionDone = false;
- transmitActionDone = false;
- retrievalAction = new QMailRetrievalAction(this);
- transmitAction = new QMailTransmitAction(this);
+ m_retrievalAction = new QMailRetrievalAction(this);
+ m_transmitAction = new QMailTransmitAction(this);
- connect(retrievalAction, SIGNAL(progressChanged(uint, uint)),
+ connect(m_retrievalAction, SIGNAL(progressChanged(uint, uint)),
this, SLOT(displayRetrieveProgress(uint, uint)));
- connect(retrievalAction, SIGNAL(activityChanged(QMailServiceAction::Activity)),
+ connect(m_retrievalAction, SIGNAL(activityChanged(QMailServiceAction::Activity)),
this, SLOT(activityChanged(QMailServiceAction::Activity)));
- connect(transmitAction, SIGNAL(progressChanged(uint, uint)),
+ connect(m_transmitAction, SIGNAL(progressChanged(uint, uint)),
this, SLOT(displayTransmitProgress(uint, uint)));
- connect(transmitAction, SIGNAL(activityChanged(QMailServiceAction::Activity)),
+ connect(m_transmitAction, SIGNAL(activityChanged(QMailServiceAction::Activity)),
this, SLOT(activityChanged(QMailServiceAction::Activity)));
}
-AccountInfo::AccountInfo(QMailAccount *account)
-{
- m_account = account;
- m_config = new QMailAccountConfiguration (account->id());
- // Todo: need to extra service configuration from m_config
-}
-
AccountInfo::~AccountInfo()
{
+ if (m_retrievalAction != NULL)
+ delete m_retrievalAction;
+
+ if (m_transmitAction != NULL)
+ delete m_transmitAction;
+
+ if (m_account != NULL)
+ delete m_account;
+
+ if (m_config != NULL)
+ delete m_config;
}
bool AccountInfo::accountIsValid()
@@ -88,7 +92,8 @@
m_account->setStatus (QMailAccount::PreferredSender, true);
- if (m_inServerType.compare("IMAP", Qt::CaseInsensitive) == 0)
+ //% "IMAP"
+ if (m_inServerType.compare(qtTrId("xx_imap"), Qt::CaseInsensitive) == 0)
{
if (!m_config->services().contains(imapServiceKey))
m_config->addServiceConfiguration(imapServiceKey);
@@ -103,9 +108,11 @@
imapConfig.setIntValue ("port", (m_inPort == -1 ? 143 : m_inPort));
QMailTransport::EncryptType encrypType = QMailTransport::Encrypt_NONE;
- if (QString::compare(m_inSecurity, "SSL", Qt::CaseInsensitive) == 0)
+ //% "SSL"
+ if (QString::compare(m_inSecurity, qtTrId("xx_ssl"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_SSL;
- else if (QString::compare(m_inSecurity, "TLS", Qt::CaseInsensitive) == 0)
+ //% "TLS"
+ else if (QString::compare(m_inSecurity, qtTrId("xx_tls"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_TLS;
imapConfig.setIntValue ("encryption", encrypType);
@@ -126,7 +133,8 @@
m_account->setStatus(QMailAccount::CanCreateFolders, true);
m_account->setStatus(QMailAccount::CanRetrieve, true);
}
- else if (m_inServerType.compare("POP", Qt::CaseInsensitive) == 0)
+ //% "POP"
+ else if (m_inServerType.compare(qtTrId("xx_pop"), Qt::CaseInsensitive) == 0)
{
if (!m_config->services().contains(popServiceKey))
m_config->addServiceConfiguration(popServiceKey);
@@ -142,9 +150,11 @@
popConfig.setIntValue ("port", (m_inPort == -1 ? 143 : m_inPort));
QMailTransport::EncryptType encrypType = QMailTransport::Encrypt_NONE;
- if (QString::compare(m_inSecurity, "SSL", Qt::CaseInsensitive) == 0)
+ //% "SSL"
+ if (QString::compare(m_inSecurity, qtTrId("xx_ssl"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_SSL;
- else if (QString::compare(m_inSecurity, "TLS", Qt::CaseInsensitive) == 0)
+ //% "TLS"
+ else if (QString::compare(m_inSecurity, qtTrId("xx_tls"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_TLS;
popConfig.setIntValue ("encryption", encrypType);
@@ -165,7 +175,8 @@
}
- if (m_outServerType.compare(smtpServiceKey, Qt::CaseInsensitive) == 0)
+ //% "SMTP"
+ if (m_outServerType.compare(qtTrId("xx_smtp"), Qt::CaseInsensitive) == 0)
{
m_account->setFromAddress(QMailAddress(m_emailAddress));
@@ -190,9 +201,11 @@
}
QMailTransport::EncryptType encrypType = QMailTransport::Encrypt_NONE;
- if (QString::compare(m_outSecurity, "SSL", Qt::CaseInsensitive) == 0)
+ //% "SSL"
+ if (QString::compare(m_outSecurity, qtTrId("xx_ssl"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_SSL;
- else if (QString::compare(m_outSecurity, "TLS", Qt::CaseInsensitive) == 0)
+ //% "TLS"
+ else if (QString::compare(m_outSecurity, qtTrId("xx_tls"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_TLS;
smtpConfig.setIntValue("encryption", encrypType);
@@ -234,7 +247,7 @@
{
QMailStore::instance()->addAccount(m_account, m_config);
}
- testAccountConfiguration();
+ QTimer::singleShot(10, this, SLOT(testAccountConfiguration()));
return true;
}
@@ -243,49 +256,49 @@
if (m_account->status() & (QMailAccount::MessageSource | QMailAccount::MessageSink))
{
if (m_account->status() & QMailAccount::MessageSource) {
- retrievalAction->retrieveFolderList(m_account->id(), QMailFolderId(), true);
+ m_retrievalAction->retrieveFolderList(m_account->id(), QMailFolderId(), true);
} else if (m_account->status() & QMailAccount::MessageSink) {
- transmitAction->transmitMessages(m_account->id());
+ m_transmitAction->transmitMessages(m_account->id());
}
}
}
void AccountInfo::activityChanged(QMailServiceAction::Activity activity)
{
- if (sender() == static_cast<QObject*>(retrievalAction)) {
- const QMailServiceAction::Status status(retrievalAction->status());
+ if (sender() == static_cast<QObject*>(m_retrievalAction)) {
+ const QMailServiceAction::Status status(m_retrievalAction->status());
if (status.accountId.isValid()) {
QMailAccount account(status.accountId);
if (activity == QMailServiceAction::Successful) {
if (account.status() & QMailAccount::MessageSink) {
- transmitAction->transmitMessages(account.id());
+ m_transmitAction->transmitMessages(account.id());
} else {
emit accountReady();
}
} else if (activity == QMailServiceAction::Failed) {
- QString caption(tr("Retrieve Failure"));
- QString action(tr("<b></b>%1 - Error retrieving folders: %2", "%1: account name, %2: error text"));
+ //% "Retrieve Failure"
+ QString caption(qtTrId("xx_retrieve_failure"));
+ //% "%1 - Error retrieving folders: %2"
+ QString errMsg(qtTrId("xx_retrieval_failure_error").arg(account.name()).arg(status.text));
- action = action.arg(account.name()).arg(status.text);
-
- MMessageBox message(action);
+ MMessageBox message(errMsg);
message.exec();
}
}
- } else if (sender() == static_cast<QObject*>(transmitAction)) {
+ } else if (sender() == static_cast<QObject*>(m_transmitAction)) {
if (activity == QMailServiceAction::Successful) {
emit accountReady();
} else if (activity == QMailServiceAction::Failed) {
- const QMailServiceAction::Status status(transmitAction->status());
+ const QMailServiceAction::Status status(m_transmitAction->status());
QMailAccount account(status.accountId);
- QString caption(tr("Transmission Failure"));
- QString action(tr("%1 - Error testing connection: %2", "%1: account name, %2: error text"));
-
- action = action.arg(account.name()).arg(status.text);
+ //% "Transmission Failure"
+ QString caption(qtTrId("xx_tranmit_failed"));
+ //% "%1 - Error testing connection: %2"
+ QString errMsg(qtTrId("xx_connection_failure_error").arg(account.name()).arg(status.text));
- MMessageBox message(action);
+ MMessageBox message(errMsg);
message.exec();
}
}
@@ -293,21 +306,14 @@
void AccountInfo::displayRetrieveProgress(uint value, uint range)
{
- if (value == 0 && range == 0)
- {
- retrievalActionDone = true;
- emit accountReady();
- }
-
- if (retrievalActionDone && transmitActionDone)
- emit accountReady();
+ Q_UNUSED (value);
+ Q_UNUSED (range);
+ // TODO: might want to put up a progress dialog in future
}
void AccountInfo::displayTransmitProgress(uint value, uint range)
{
- if (value == 0 && range == 0)
- transmitActionDone = true;
-
- /*if (retrievalActionDone && transmitActionDone)
- emit accountReady();*/
+ Q_UNUSED (value);
+ Q_UNUSED (range);
+ // TODO: might want to put up a progress dialog in future
}
--- src/accountinfo.h
+++ src/accountinfo.h
@@ -29,7 +29,7 @@
};
AccountInfo();
- explicit AccountInfo(QMailAccount *account);
+// explicit AccountInfo(QMailAccount *account);
~AccountInfo();
void setEmailAddress (const QString &emailAddress) {m_emailAddress = emailAddress; }
@@ -88,10 +88,8 @@
QMailAccount *m_account;
QMailAccountConfiguration *m_config;
- bool retrievalActionDone;
- QMailRetrievalAction *retrievalAction;
- bool transmitActionDone;
- QMailTransmitAction *transmitAction;
+ QMailRetrievalAction *m_retrievalAction;
+ QMailTransmitAction *m_transmitAction;
QString m_emailAddress;
QString m_displayName;
--- src/accountsetuppage.cpp
+++ src/accountsetuppage.cpp
@@ -33,7 +33,6 @@
MLabel *label = new MLabel (text);
label->setWordWrap(true);
label->setObjectName ("AccountSetupPageLabel");
- label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(label);
if (addSpacing)
policy->setItemSpacing(policy->indexOf(label), 5);
@@ -53,32 +52,39 @@
{
MApplicationPage::createContent();
setContentsMargins(0, 0, 0, 0);
- setTitle("Mail");
setPannable(true);
+ //% "Mail"
+ setTitle(qtTrId("xx_page_title"));
+
+ MLayout *layout = new MLayout(centralWidget());
- MWidget *panel = (MWidget *)centralWidget();
- MLayout *layout = new MLayout(panel);
MLinearLayoutPolicy *policy = new MLinearLayoutPolicy(layout, Qt::Vertical);
- creatLabel (policy, qtTrId("<b>New mail account</b>"), true);
- creatLabel (policy, qtTrId("<b></b>We need to take some details to setup your account."), true);
+ //% "New mail account"
+ creatLabel (policy, ("<b>" + qtTrId("xx_new_mail_account") + "<b>"), true);
+
+ //% "We need to take some details to setup your account."
+ creatLabel (policy, qtTrId("xx_need_account_detail"), true);
// Prompt the user for name
- creatLabel(policy, "<b></b>What's your name?");
+ //% "What's your name?"
+ creatLabel(policy, qtTrId("xx_enter_your_name"));
m_username = new MTextEdit(MTextEditModel::SingleLine, "", this);
m_username->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(m_username);
policy->setItemSpacing(policy->indexOf(m_username), 5);
// Prompt the user for email address
- creatLabel (policy, "<b></b>Email address:");
+ //% "Email address"
+ creatLabel (policy, qtTrId("xx_email_address"));
m_emailAddress = new MTextEdit(MTextEditModel::SingleLine, "", this);
m_emailAddress->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(m_emailAddress);
policy->setItemSpacing(policy->indexOf(m_emailAddress), 5);
// Prompt the user for password
- creatLabel(policy, "<b></b>Password:");
+ //% "Password"
+ creatLabel(policy, qtTrId("xx_password"));
m_password = new MTextEdit(MTextEditModel::SingleLine, "", this);
m_password->setEchoMode(MTextEditModel::Password);
m_password->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -86,13 +92,15 @@
policy->setItemSpacing(policy->indexOf(m_password), 5);
// Setup button
- MButton *button = new MButton(qtTrId("Setup account"), this);
+ //% "Setup account"
+ MButton *button = new MButton(qtTrId("xx_setup_account_button_label"), this);
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(button, SIGNAL(clicked(bool)), this, SLOT(setupAccount()));
policy->addItem(button);
// Settings menu
- MAction *action = new MAction(qtTrId("Settings"), this);
+ //% "Settings"
+ MAction *action = new MAction(qtTrId("xx_settings_actions"), this);
action->setLocation(MAction::ApplicationMenuLocation);
connect(action, SIGNAL(triggered(bool)), this, SIGNAL(emailSettingsTriggered()));
addAction(action);
@@ -105,21 +113,24 @@
QString emailAddress = m_emailAddress->text();
if (emailAddress == "")
{
- displayError (qtTrId("Please enter a valid email address."));
+ //% "Please enter a valid email address."
+ displayError (qtTrId("xx_enter_valid_email_address"));
return;
}
QString name = m_username->text();
if (name == "")
{
- displayError (qtTrId("Please enter your user name."));
+ //% "Please enter your user name."
+ displayError (qtTrId("xx_enter_user_name"));
return;
}
QString password = m_password->text();
if (password == "")
{
- displayError (qtTrId("Please enter your password."));
+ //% "Please enter your password."
+ displayError (qtTrId("xx_enter_your_password"));
return;
}
@@ -141,40 +152,52 @@
QString login = emailAddress.left(index);
m_account->setInUsername(login);
m_account->setInPort (993);
- m_account->setInSecurity ("SSL");
+ //% "SSL"
+ m_account->setInSecurity (qtTrId("xx_ssl"));
m_account->setInServerAddress ("linux.intel.com");
- m_account->setInServerType ("IMAP");
+ //% "IMAP"
+ m_account->setInServerType (qtTrId("xx_imap"));
m_account->setOutAuthentication (AccountInfo::Authentication_None);
- m_account->setOutServerType ("SMTP");
+ //% "SMTP"
+ m_account->setOutServerType (qtTrId("xx_smtp"));
m_account->setOutServerAddress ("smtp.intel.com");
m_account->setOutPort (25);
- m_account->setOutSecurity("None");
+ //% "None"
+ m_account->setOutSecurity(qtTrId("xx_none"));
m_account->setOutUsername("");
m_account->setOutPassword("");
}
else if (emailAddress.endsWith ("@gmail.com", Qt::CaseInsensitive))
{
m_account->setInPort (993);
- m_account->setInSecurity ("SSL");
+ //% "SSL"
+ m_account->setInSecurity (qtTrId("xx_ssl"));
m_account->setInServerAddress ("imap.gmail.com");
- m_account->setInServerType ("IMAP");
+ //% "IMAP"
+ m_account->setInServerType (qtTrId("xx_imap"));
m_account->setOutAuthentication (AccountInfo::Authentication_Login);
m_account->setOutPort (465);
- m_account->setOutServerType ("SMTP");
+ //% "SMTP"
+ m_account->setOutServerType (qtTrId("xx_smtp"));
m_account->setOutServerAddress ("smtp.gmail.com");
- m_account->setOutSecurity("SSL");
+ //% "SSL"
+ m_account->setOutSecurity (qtTrId("xx_ssl"));
}
else if (emailAddress.endsWith ("@yahoo.com", Qt::CaseInsensitive))
{
m_account->setInPort (110);
- m_account->setInSecurity ("SSL");
+ //% "SSL"
+ m_account->setInSecurity (qtTrId("xx_ssl"));
m_account->setInServerAddress ("pop.mail.yahoo.com");
- m_account->setInServerType ("POP");
+ //% "POP"
+ m_account->setInServerType (qtTrId("xx_pop"));
m_account->setOutAuthentication (AccountInfo::Authentication_Login);
m_account->setOutPort (25);
- m_account->setOutServerType ("SMTP");
+ //% "SMTP"
+ m_account->setOutServerType (qtTrId("xx_smtp"));
m_account->setOutServerAddress ("smtp.mail.yahoo.com");
- m_account->setOutSecurity("SSL");
+ //% "SSL"
+ m_account->setOutSecurity (qtTrId("xx_ssl"));
}
else if (emailAddress.endsWith ("@aol.com", Qt::CaseInsensitive))
{
@@ -184,18 +207,24 @@
m_account->setInUsername(login);
m_account->setInPort (993);
- m_account->setInSecurity ("SSL");
+ //% "SSL"
+ m_account->setInSecurity (qtTrId("xx_ssl"));
m_account->setInServerAddress ("imap.aol.com");
- m_account->setInServerType ("IMAP");
+ //% "IMAP"
+ m_account->setInServerType (qtTrId("xx_imap"));
m_account->setOutAuthentication (AccountInfo::Authentication_Plain);
m_account->setOutPort (587);
- m_account->setOutServerType ("SMTP");
+ //% "SMTP"
+ m_account->setOutServerType (qtTrId("xx_smtp"));
m_account->setOutServerAddress ("smtp.aol.com");
- m_account->setOutSecurity("None");
+ //% "None"
+ m_account->setOutSecurity(qtTrId("xx_none"));
m_account->setOutUsername(login);
}
else
{
+ m_account->setInSecurity (qtTrId("xx_none"));
+ m_account->setOutSecurity(qtTrId("xx_none"));
emit manualAccountEdit(m_account);
dismiss();
return;
--- src/composepage.cpp
+++ src/composepage.cpp
@@ -33,17 +33,29 @@
#include "mailmanager.h"
#include "contactpage.h"
+Attachment::Attachment(const QString &fileName) : m_fileName(fileName)
+{
+ QFileInfo fi(m_fileName);
+ m_displayName = fi.fileName();
+}
+
+Attachment::Attachment(const QMailMessagePart &messagePart) : m_mailPart(messagePart)
+{
+ m_displayName = m_mailPart.displayName();
+}
+
+
DeleteButton::DeleteButton(EmailAddressType type, MStylableWidget* parent, const QMailAddress &address)
: m_type (type), m_parent (parent), m_address (address)
{
- setIconID ("email-address-delete");
+ setIconID ("icon-m-common-remove");
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
}
-DeleteButton::DeleteButton(MStylableWidget* parent, const QString &attachment)
+DeleteButton::DeleteButton(MStylableWidget* parent, Attachment *attachment)
: m_parent(parent), m_attachment(attachment)
{
- setIconID ("email-address-delete");
+ setIconID ("icon-m-common-remove");
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
}
@@ -54,7 +66,8 @@
setPannable(true);
createActions();
- setTitle(tr("Mail"));
+ //% "Mail"
+ setTitle(qtTrId("xx_page_title"));
MLayout *layout = new MLayout;
@@ -71,7 +84,8 @@
m_mailAccounts = QMailStore::instance()->queryAccounts(emailKey);
m_from = new MComboBox;
- m_from->setTitle(tr("From"));
+ //% "From"
+ m_from->setTitle(qtTrId("xx_from"));
int ci = 0;
for (int i = 0; i < m_mailAccounts.size(); i++)
@@ -90,7 +104,8 @@
m_toRow->setObjectName("entryBox");
QGraphicsLinearLayout *entryLayout = new QGraphicsLinearLayout(Qt::Horizontal);
m_toRow->setLayout(entryLayout);
- MLabel *label = new MLabel("To ");
+ //% "To"
+ MLabel *label = new MLabel(qtTrId("xx_to") + " ");
entryLayout->addItem(label);
m_to = new MTextEdit(MTextEditModel::SingleLine, QString());
m_to->setObjectName ("textEdit");
@@ -114,12 +129,14 @@
}
}
- m_to->setPrompt("Enter email address here");
+ //% "Enter email address here"
+ m_to->setPrompt(qtTrId("xx_enter_email_address_here"));
m_to->setObjectName("textEntry");
entryLayout->addItem(m_to);
MButton *emailAddButton = new MButton(m_toRow);
- emailAddButton->setIconID ("email-address-add");
+ emailAddButton->setIconID ("icon-m-common-add");
+ emailAddButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect (emailAddButton, SIGNAL(clicked(bool)), SLOT(chooseToContactFromList()));
entryLayout->addItem(emailAddButton);
@@ -136,11 +153,13 @@
m_ccButtonsRow->setLayout(entryLayout);
m_ccButtonsRow->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- m_ccButton = new MButton("Add Cc");
+ //% "Add Cc"
+ m_ccButton = new MButton(qtTrId("xx_add_cc"));
connect (m_ccButton, SIGNAL(clicked(bool)), SLOT(addCcRow()));
entryLayout->addItem(m_ccButton);
- m_bccButton = new MButton("Add Bcc");
+ //% "Add Bcc"
+ m_bccButton = new MButton(qtTrId("xx_add_bcc"));
connect (m_bccButton, SIGNAL(clicked(bool)), SLOT(addBccRow()));
entryLayout->addItem(m_bccButton);
@@ -160,22 +179,23 @@
entryBox->setObjectName("entryBox");
entryLayout = new QGraphicsLinearLayout(Qt::Horizontal);
entryBox->setLayout(entryLayout);
- label = new MLabel("Subject");
- //entryLayout->addItem(label);
m_subject = new MTextEdit(MTextEditModel::SingleLine, QString());
if (type == QMailMessage::Reply || type == QMailMessage::ReplyToAll)
{
- m_subject->setText("Re: " + msg.subject());
+ //% "Re: %1"
+ m_subject->setText(qtTrId("xx_reply_subject_line").arg(msg.subject()));
m_subject->setCursorPosition(0);
}
else if (type == QMailMessage::Forward)
{
- m_subject->setText("Fwd: " + msg.subject());
+ //% "Fwd: %1"
+ m_subject->setText(qtTrId("xx_fwd_subject_line").arg(msg.subject()));
m_subject->setCursorPosition(0);
}
else
- m_subject->setPrompt("Enter subject here");
+ //% "Enter subject here"
+ m_subject->setPrompt(qtTrId("xx_enter_subject_here"));
m_subject->setObjectName("textEntry");
m_subject->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -190,29 +210,34 @@
entryBox->setLayout(entryLayout);
m_body= new MTextEdit(MTextEditModel::MultiLine, QString());
if (type == QMailMessage::NoResponse)
- m_body->setPrompt(tr("Enter mail message here"));
+ //% "Enter mail message here"
+ m_body->setPrompt(qtTrId("xx_enter_mail_message_here"));
else
{
QString bodyText("\n");
if (type == QMailMessage::Reply || type == QMailMessage::ReplyToAll)
{
- bodyText.append(tr("On ")); // i18 work
- bodyText.append(msg.receivedDate().toString() + ",");
- bodyText.append(msg.from().name());
- bodyText.append(tr(" wrote:")); //i18 work
+ //% "On %1, %2 wrote:"
+ bodyText.append(qtTrId("xx_message_header").arg(msg.receivedDate().toString())
+ .arg(msg.from().name()));
QString text = "\n>" + Utils::bodyPlainText(&msg).replace('\n', "\n>");
text.truncate(text.size() - 1); // remove the extra ">" put there by QString.replace
m_body->setText(bodyText + text);
}
else if (type == QMailMessage::Forward)
{
- bodyText.append(tr("------------ Forwarded Message ------------\n"));
+ //% "------------ Forwarded Message ------------\n"
+ bodyText.append(qtTrId("xx_forwarded_message"));
QString date = msg.receivedDate().toString();
- bodyText.append(tr("Date: ") + msg.receivedDate().toString() +"\n");
- bodyText.append(tr("From: ") + msg.from().address() + "\n");
+ //% "Date: %1\n"
+ bodyText.append(qtTrId("xx_date_text").arg(msg.receivedDate().toString()));
+ //% "From: %1\n"
+ bodyText.append(qtTrId("xx_from_text").arg(msg.from().address()));
QStringList tolist = QMailAddress::toStringList (msg.to());
- bodyText.append(tr("To: ") + tolist.join(" ") + "\n");
- bodyText.append(tr("Subject: ") + msg.subject() + "\n\n");
+ //% "To: %1\n"
+ bodyText.append(qtTrId("xx_to_list").arg(tolist.join(";")));
+ //% "Subject: %1\n\n"
+ bodyText.append(qtTrId("xx_subject_text").arg(msg.subject()));
m_body->setText(bodyText + Utils::bodyPlainText(&msg));
}
m_body->setCursorPosition(0);
@@ -221,8 +246,14 @@
m_policy->addItem(entryBox);
+ // if forward, need to extract attachments from previous mail message and attach to this one
+ if (type == QMailMessage::Forward)
+ extractAttachmentsFromOldMail();
+
+
// Add a "Send" button to the bottom of the page.
- m_sendButton = new MButton(tr("Send"));
+ //% "Send"
+ m_sendButton = new MButton(qtTrId("xx_send"));
connect(m_sendButton, SIGNAL(clicked(bool)), this, SLOT(sendMail()));
m_policy->addItem(m_sendButton);
centralWidget()->setLayout(layout);
@@ -240,25 +271,29 @@
void ComposePage::createActions()
{
// "send" action item
- MAction *action = new MAction(tr("Send"), this);
+ //% "Send"
+ MAction *action = new MAction(qtTrId("xx_send"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(sendMail()));
// "save draft" action item
- action = new MAction(tr("Save draft"), this);
+ //% "Save draft"
+ action = new MAction(qtTrId("xx_save_draft"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(saveDraft()));
// "attach file" action item
- action = new MAction(tr("Attach file"), this);
+ //% "Attach file"
+ action = new MAction(qtTrId("xx_attach_file"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(attachFile()));
// "discard" action item
- action = new MAction(tr("Discard message"), this);
+ //% "Discard message"
+ action = new MAction(qtTrId("xx_discard_message"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(discard()));
@@ -272,14 +307,16 @@
QGraphicsLinearLayout *entryLayout = new QGraphicsLinearLayout(Qt::Horizontal);
m_ccRow->setLayout(entryLayout);
m_ccRow->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- MLabel *label = new MLabel("Cc ");
+ //% "Cc "
+ MLabel *label = new MLabel(qtTrId("xx_cc_label"));
entryLayout->addItem(label);
- m_cc->setPrompt("Enter email address here");
+ //% "Enter email address here"
+ m_cc->setPrompt(qtTrId("xx_enter_email_address_here"));
m_cc->setObjectName("textEntry");
m_cc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
entryLayout->addItem(m_cc);
MButton *emailAddButton = new MButton(m_ccRow);
- emailAddButton->setIconID ("email-address-add");
+ emailAddButton->setIconID ("icon-m-common-add");
connect (emailAddButton, SIGNAL(clicked(bool)), SLOT(chooseCcContactFromList()));
entryLayout->addItem(emailAddButton);
m_policy->insertItem(m_policy->indexOf(m_ccButtonsRow), m_ccRow);
@@ -304,15 +341,17 @@
QGraphicsLinearLayout *entryLayout = new QGraphicsLinearLayout(Qt::Horizontal);
m_bccRow->setLayout(entryLayout);
m_bccRow->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- MLabel *label = new MLabel("Bcc");
+ //% "Bcc"
+ MLabel *label = new MLabel(qtTrId("xx_bcc_label"));
entryLayout->addItem(label);
m_bcc = new MTextEdit(MTextEditModel::SingleLine, QString());
- m_bcc->setPrompt("Enter email address here");
+ //% "Enter email address here"
+ m_bcc->setPrompt(qtTrId("xx_enter_email_address_here"));
m_bcc->setObjectName("textEntry");
m_bcc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
entryLayout->addItem(m_bcc);
MButton *emailAddButton = new MButton(m_bccRow);
- emailAddButton->setIconID ("email-address-add");
+ emailAddButton->setIconID ("icon-m-common-add");
emailAddButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect (emailAddButton, SIGNAL(clicked(bool)), SLOT(chooseBccContactFromList()));
entryLayout->addItem(emailAddButton);
@@ -334,6 +373,8 @@
{
QMailMessage message;
+ QMailAccountId id = m_mailAccounts[m_from->currentIndex()];
+
// set Destinations
QStringList addresses = m_to->text().split(";", QString::SkipEmptyParts);
foreach (QString address, addresses)
@@ -364,6 +405,10 @@
// Set message body
QString messageText(m_body->text());
+ QString signature = QMailAccount(id).signature();
+ if (signature.size() > 0)
+ messageText.append("\n" + signature);
+
QMailMessageContentType type("text/plain; charset=UTF-8");
if (m_attachments.length() == 0)
@@ -389,11 +434,6 @@
if (!message.id().isValid())
message.setStatus(QMailMessage::LocalOnly, true);
- // Fix ME: need to add some code here to Get the current prefer account. Hack it for now.
- QMailAccountKey emailKey(QMailAccountKey::messageType(QMailMessage::Email));
- QMailAccountIdList accounts = QMailStore::instance()->queryAccounts(emailKey);
-
- QMailAccountId id = accounts[0];
if (id.isValid())
{
message.setParentAccountId(id);
@@ -425,16 +465,34 @@
if (destinations.count() > 0) {
foreach (const QMailAddress dest, destinations) {
if (!dest.isEmailAddress()) {
- MMessageBox(tr("One or more destinations is invalid, send aborting")).exec();
+ //% "One or more destinations is invalid, send aborting"
+ MMessageBox(qtTrId("xx_invalid_email_address")).exec();
return;
}
}
}
else {
- MMessageBox(tr("No destination specified, send aborting")).exec();
+ //% "No destination specified, send aborting"
+ MMessageBox(qtTrId("xx_no_destination_specified")).exec();
return;
}
+ if (m_subject->text().size() == 0)
+ {
+ //% "The subject field is empty. Do you want to continue?"
+ MMessageBox msg(qtTrId("xx_subject_empty"), M::YesButton | M::NoButton);
+ if (msg.exec() == QMessageBox::No)
+ return;
+ }
+
+ if (m_body->text().size() == 0)
+ {
+ //% "The message is empty. Do you want to send an empty message?"
+ MMessageBox msg(qtTrId("xx_message_empty"), M::YesButton | M::NoButton);
+ if (msg.exec() == QMessageBox::No)
+ return;
+ }
+
bool stored = false;
if (!message.id().isValid())
@@ -459,19 +517,62 @@
void ComposePage::attachFile()
{
- QFileDialog *dialog = new QFileDialog (0, 0,"/");
- dialog->setFileMode(QFileDialog::ExistingFiles);
+ QDir homeDir = QDir::home();
+ QStringList folders= homeDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
- if (dialog->exec() == QDialog::Accepted) {
- foreach (QString name, dialog->selectedFiles()) {
- insertAttachment(name);
- }
- }
+ MPopupList *popupList = new MPopupList();
+ QStringListModel *model = new QStringListModel(this);
+ model->setStringList(folders);
+ popupList->setItemModel(model);
+
+ //% "Select a folder"
+ popupList->setTitle(qtTrId("xx_select_a_folder"));
+ popupList->appear();
+ connect(popupList, SIGNAL(clicked(const QModelIndex&)), SLOT(folderSelected(const QModelIndex &)));
+}
+
+void ComposePage::folderSelected(const QModelIndex & index)
+{
+ MPopupList *popupList = qobject_cast<MPopupList *>(sender());
+ if (!popupList)
+ return;
+
+ QStringListModel *model = (QStringListModel *) popupList->itemModel();
+ QStringList folders = model->stringList();
+
+ m_currentFolder = QDir::homePath() + "/" + folders[index.row()];
+ QDir aDir(m_currentFolder);
+
+ QStringList files = aDir.entryList(QDir::Files | QDir::Readable);
+
+ MPopupList *filePopupList = new MPopupList();
+ model = new QStringListModel(this);
+ model->setStringList(files);
+ filePopupList->setItemModel(model);
+
+ //% "Select a file"
+ filePopupList->setTitle(qtTrId("xx_select_a_file"));
+ filePopupList->appear();
+ connect(filePopupList, SIGNAL(clicked(const QModelIndex&)), SLOT(fileSelected(const QModelIndex &)));
+}
+
+void ComposePage::fileSelected(const QModelIndex & index)
+{
+ MPopupList *popupList = qobject_cast<MPopupList *>(sender());
+ if (!popupList)
+ return;
+
+ QStringListModel *model = (QStringListModel *) popupList->itemModel();
+ QStringList fileList = model->stringList();
+
+ QString filePath = m_currentFolder + "/" + fileList[index.row()];
+ insertAttachment(new Attachment(filePath));
}
void ComposePage::discard()
{
- MMessageBox msg(tr("Do you want to save a draft?"), M::YesButton | M::NoButton);
+ //% "Do you want to save a draft?"
+ MMessageBox msg(qtTrId("xx_save_draft_question"), M::YesButton | M::NoButton);
if (msg.exec() == QMessageBox::Yes)
saveDraft();;
@@ -544,7 +645,8 @@
QStringListModel *model = new QStringListModel(this);
model->setStringList(emails);
popuplist->setItemModel(model);
- popuplist->setTitle(tr("Select an email"));
+ //% "Select an email"
+ popuplist->setTitle(qtTrId("xx_select_an_email"));
popuplist->appear();
connect(popuplist, SIGNAL(clicked(const QModelIndex&)), SLOT(addToContact(const QModelIndex &)));
}
@@ -578,7 +680,8 @@
QStringListModel *model = new QStringListModel(this);
model->setStringList(emails);
popuplist->setItemModel(model);
- popuplist->setTitle(tr("Select an email"));
+ //% "Select an email"
+ popuplist->setTitle(qtTrId("xx_select_an_email"));
popuplist->appear();
connect(popuplist, SIGNAL(clicked(const QModelIndex&)), SLOT(addCcContact(const QModelIndex &)));
}
@@ -612,7 +715,8 @@
QStringListModel *model = new QStringListModel(this);
model->setStringList(emails);
popuplist->setItemModel(model);
- popuplist->setTitle(tr("Select an email"));
+ //% "Select an email"
+ popuplist->setTitle(qtTrId("xx_select_an_email"));
popuplist->appear();
connect(popuplist, SIGNAL(clicked(const QModelIndex&)), SLOT(addBccContact(const QModelIndex &)));
}
@@ -638,20 +742,19 @@
insertEmailAddressRow (ADDRESSTYPE_BCC, m_bccRow, address);
}
-void ComposePage::insertAttachment(const QString &attachment)
+void ComposePage::insertAttachment(Attachment *attachment)
{
MStylableWidget *entryBox = new MStylableWidget();
entryBox->setObjectName("entryBox");
QGraphicsGridLayout *grid = new QGraphicsGridLayout;
entryBox->setLayout(grid);
entryBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- MLabel *label = new MLabel(tr("Attachment: "));
+ //% "Attachment: "
+ MLabel *label = new MLabel(qtTrId("xx_attachment"));
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
grid->addItem(label, 0, 0, Qt::AlignLeft);
- int index = attachment.lastIndexOf("/");
- QString filename = attachment.right(attachment.length()- index - 1);
- label = new MLabel(filename);
+ label = new MLabel(attachment->displayName());
label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
grid->addItem(label, 0, 1, Qt::AlignLeft);
DeleteButton *deleteButton = new DeleteButton(entryBox, attachment);
@@ -661,14 +764,20 @@
m_attachments << attachment;
}
+void ComposePage::insertAttachment(const QString &file)
+{
+ insertAttachment(new Attachment(file));
+}
+
void ComposePage::deleteAttachment()
{
DeleteButton *button = qobject_cast<DeleteButton *>(sender());
if (button)
{
delete button->parent();
- QString attachment = button->attachment();
+ Attachment *attachment = button->attachment();
m_attachments.removeOne(attachment);
+ delete attachment;
}
}
@@ -677,32 +786,35 @@
// Add attachment(s) as necessary
QMailMessagePart attachmentpart;
- foreach (QString attachment, m_attachments) {
+ foreach (Attachment *attachment, m_attachments) {
+ if (!attachment->isFile())
+ {
// Attaching a file
- QFileInfo fi(attachment);
+ QFileInfo fi(attachment->fileName());
- // Just in case..
- if (!fi.isFile())
- continue;
+ // Just in case..
+ if (!fi.isFile())
+ continue;
- // TODO: the toLatin1() calls here, how does that affect non-latin1 filenames?
- QMailMessageContentType attachmenttype(QMail::mimeTypeFromFileName(attachment).toLatin1());
- attachmenttype.setName(fi.fileName().toLatin1());
-
- QMailMessageContentDisposition disposition(QMailMessageContentDisposition::Attachment);
- disposition.setFilename(fi.fileName().toLatin1());
- disposition.setSize(fi.size());
-
- attachmentpart = QMailMessagePart::fromFile(attachment,
- disposition,
- attachmenttype,
- QMailMessageBody::Base64,
- QMailMessageBody::RequiresEncoding);
- message.appendPart(attachmentpart);
- }
- /*
+ QMailMessageContentType attachmenttype(QMail::mimeTypeFromFileName(attachment->fileName()).toLatin1());
+ attachmenttype.setName(fi.fileName().toLatin1());
+
+ QMailMessageContentDisposition disposition(QMailMessageContentDisposition::Attachment);
+ disposition.setFilename(fi.fileName().toLatin1());
+ disposition.setSize(fi.size());
+
+ attachmentpart = QMailMessagePart::fromFile(attachment->fileName(),
+ disposition,
+ attachmenttype,
+ QMailMessageBody::Base64,
+ QMailMessageBody::RequiresEncoding);
+ message.appendPart(attachmentpart);
+ }
+ else
+ {
// Forwarding a messagepart
- QMailAccount originallyFrom(m_oldMail.parentAccountId());
+ QMailMessage oldMail(m_id);
+ QMailAccount originallyFrom(oldMail.parentAccountId());
QMailAccount nowFrom(message.parentAccountId());
bool viaReference = ((originallyFrom.status() & QMailAccount::CanReferenceExternalData) &&
nowFrom.status() & QMailAccount::CanTransmitViaReference);
@@ -727,8 +839,23 @@
sourcePart.contentType(),
QMailMessageBody::Base64));
}
- */
-
+ }
+ }
return message;
}
+void ComposePage::extractAttachmentsFromOldMail()
+{
+ QMailMessage message(m_id);
+
+ if (!message.status() & QMailMessageMetaData::HasAttachments)
+ return;
+
+ for (uint i = 1; i < message.partCount(); ++i)
+ {
+ QMailMessagePart sourcePart = message.partAt(i);
+ if (!(sourcePart.multipartType() == QMailMessagePartContainer::MultipartNone))
+ continue;
+ insertAttachment(new Attachment(sourcePart));
+ }
+}
--- src/composepage.h
+++ src/composepage.h
@@ -22,6 +22,8 @@
#include <qmailmessage.h>
#include <qmailaccount.h>
+class Attachment;
+
typedef enum _EmailAddressType
{
ADDRESSTYPE_TO = 0,
@@ -38,6 +40,8 @@
virtual ~ComposePage();
void setRecipient(const QString & emailAddress);
+ void insertAttachment(const QString &file);
+ void insertAttachment(Attachment *attachment);
signals:
void mailSent();
@@ -60,12 +64,14 @@
void saveDraft();
void sendMail();
void deleteAttachment();
+ void folderSelected(const QModelIndex &);
+ void fileSelected(const QModelIndex &);
private:
void createActions();
void insertEmailAddressRow(EmailAddressType type, MStylableWidget* parent, const QMailAddress& address);
- void insertAttachment(const QString &file);
QMailMessage processAttachments(QMailMessage message);
+ void extractAttachmentsFromOldMail();
QMailMessage::ResponseType m_type;
QMailMessageId m_id;
@@ -80,7 +86,8 @@
QList<QMailAddress> m_toEmailAddresses;
QList<QMailAddress> m_ccEmailAddresses;
QList<QMailAddress> m_bccEmailAddresses;
- QStringList m_attachments;
+ QList<Attachment *> m_attachments;
+ QString m_currentFolder;
MButton *m_ccButton;
MButton *m_bccButton;
@@ -93,6 +100,24 @@
MComboBox *m_from;
};
+class Attachment
+{
+public:
+ Attachment (const QString &fileName);
+ Attachment (const QMailMessagePart & messagePart);
+ ~Attachment() {}
+
+ QString &displayName() { return m_displayName; }
+ bool isFile() { return (m_fileName.isEmpty() ? true : false); }
+ QString &fileName() { return m_fileName; }
+ QMailMessagePart messagePart() { return m_mailPart; }
+
+private:
+ QString m_fileName;
+ QMailMessagePart m_mailPart;
+ QString m_displayName;
+};
+
//helper class to handle the delete Button on the email address row.
class DeleteButton : public MButton
{
@@ -100,20 +125,19 @@
public :
DeleteButton(EmailAddressType type, MStylableWidget* parent, const QMailAddress &address);
- DeleteButton(MStylableWidget* parent, const QString &file);
+ DeleteButton(MStylableWidget* parent, Attachment *file);
virtual ~DeleteButton() {}
EmailAddressType type() { return m_type; }
MStylableWidget *parent() { return m_parent; }
QMailAddress address() { return m_address; }
- QString attachment() { return m_attachment; }
+ Attachment *attachment() { return m_attachment; }
-
private:
EmailAddressType m_type;
MStylableWidget *m_parent;
QMailAddress m_address;
- QString m_attachment;
+ Attachment *m_attachment;
};
#endif // COMPOSEPAGE_H
--- src/conversationpage.cpp
+++ src/conversationpage.cpp
@@ -45,7 +45,8 @@
setPannable(true);
createActions();
- setTitle(tr("Mail"));
+ //% "Mail"
+ setTitle(qtTrId("xx_page_title"));
MLayout *layout = new MLayout(centralWidget());
layout->setContentsMargins(0, 0, 0, 0);
@@ -57,23 +58,29 @@
m_policy->setSpacing(0);
QMailMessage message(m_id);
- QString body = tr("From: ") + message.from().address() + "\n";
+ //% "From"
+ QString body = qtTrId("xx_from") + ": " + message.from().address() + "\n";
QStringList addresses = QMailAddress::toStringList(message.to());
- body.append(tr("To: " ) + addresses.join("; ") + "\n");
+ //% "To"
+ body.append(qtTrId("xx_to") + ": " + addresses.join("; ") + "\n");
addresses = QMailAddress::toStringList(message.cc());
if (addresses.size() > 0)
- body.append(tr("Cc:" ) + addresses.join("; ") + "\n");
+ //% "Cc"
+ body.append(qtTrId("xx_cc" ) + ": " + addresses.join("; ") + "\n");
addresses = QMailAddress::toStringList(message.bcc());
if (addresses.size() > 0)
- body.append(tr("Bcc:" ) + addresses.join("; ") + "\n");
+ //% "Bcc"
+ body.append(qtTrId("xx_bcc" ) + ": " + addresses.join("; ") + "\n");
QMailAddress replyTo = message.replyTo();
if (!replyTo.isNull())
- body.append(tr("Reply-To: ") + replyTo.toString() + "\n");
+ //% "Reply-To"
+ body.append(qtTrId("xx_reply_to") + ": " + replyTo.toString() + "\n");
- body.append(tr("Subject: ") + message.subject() + "\n");
- //body.append(tr("Date: ") + Utils::humanDateTime(message.date().toLocalTime()));
- body.append(tr("Date: ") + message.date().toLocalTime().toString(Qt::SystemLocaleShortDate));
+ //% "Subject"
+ body.append(qtTrId("xx_subject") + ": " + message.subject() + "\n");
+ //% "Date: %1"
+ body.append(qtTrId("xx_date").arg(message.date().toLocalTime().toString(Qt::SystemLocaleShortDate)));
MLabel *messageBody = new MLabel(body);
messageBody->setWordWrap(true);
messageBody->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -97,50 +104,50 @@
void ConversationPage::createActions()
{
- // "Delete" context action item
- MAction *action = new MAction("Delete", this);
+ //% "Delete"
+ MAction *action = new MAction(qtTrId("xx_delete_action"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(deleteActionTriggered()));
- // "Reply" toolbar action item
- action = new MAction("Reply", this);
+ //% "Reply"
+ action = new MAction(qtTrId("xx_reply_action"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(replyActionTriggered()));
- // "Reply to all" toolbar action item
- action = new MAction("Reply to all", this);
+ //% "Reply to all"
+ action = new MAction(qtTrId("xx_reply_all_action"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(replyAllActionTriggered()));
- // "Forward" toolbar action item
- action = new MAction("Forward", this);
+ //% "Forward"
+ action = new MAction(qtTrId("xx_forward_action"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(forwardActionTriggered()));
// "Delete" context action item
- action = new MAction("Delete", this);
+ action = new MAction(qtTrId("xx_delete_action"), this);
action->setLocation(MAction::ObjectMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(deleteActionTriggered()));
// "Reply" context action item
- action = new MAction("Reply", this);
+ action = new MAction(qtTrId("xx_reply_action"), this);
action->setLocation(MAction::ObjectMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(replyActionTriggered()));
// "Reply to all" context action item
- action = new MAction("Reply to all", this);
+ action = new MAction(qtTrId("xx_reply_all_action"), this);
action->setLocation(MAction::ObjectMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(replyAllActionTriggered()));
// "Forward" context action item
- action = new MAction("Forward", this);
+ action = new MAction(qtTrId("xx_forward_action"), this);
action->setLocation(MAction::ObjectMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(forwardActionTriggered()));
@@ -171,7 +178,8 @@
MStylableWidget *w = new MStylableWidget(this);
QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal);
w->setLayout(layout);
- MLabel *label = new MLabel(tr("Attached: "));
+ //% "Attached: "
+ MLabel *label = new MLabel(qtTrId("xx_attached"));
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
label->setObjectName ("AttachmentText");
layout->addItem(label);
@@ -180,12 +188,12 @@
button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
layout->addItem(button);
- // "Download..." context action item
- AttachmentAction *action = new AttachmentAction(tr("Download..."), button, sourcePart);
+ //% "Download..."
+ AttachmentAction *action = new AttachmentAction(qtTrId("xx_download_context_menu"), button, sourcePart);
connect(action, SIGNAL(triggered()), this, SLOT(openAttachmentDownloadDialog()));
- // "Open..." context action item
- action = new AttachmentAction(tr("Open..."), button, sourcePart);
+ //% "Open..."
+ action = new AttachmentAction(qtTrId("xx_open_context_menu"), button, sourcePart);
connect(action, SIGNAL(triggered()), this, SLOT(openAttachmentOpenDialog()));
m_policy->addItem (w);
}
@@ -203,7 +211,8 @@
}
}
MBanner *infoBanner = new MBanner();
- infoBanner->setSubtitle (tr("Download completed"));
+ //% "Download completed"
+ infoBanner->setSubtitle (qtTrId("xx_download_completed"));
infoBanner->appear(MSceneWindow::DestroyWhenDone);
}
@@ -256,13 +265,13 @@
MPopupList *popuplist = new MPopupList();
QStringListModel *model = new QStringListModel(this);
- // FIX ME: the available folders are hard coded for now. Should look into using the QDesktopService
- // API to determine these folders names and locations.
- QStringList folders = QStringList() << tr("Documents") << tr("Music") << tr("Pictures") << tr("Videos");
+ QDir homeDir = QDir::home();
+ QStringList folders= homeDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
model->setStringList(folders);
popuplist->setItemModel(model);
- popuplist->setTitle(tr("Select a folder"));
+ //% "Select a folder"
+ popuplist->setTitle(qtTrId("xx_select_a_folder"));
popuplist->appear();
connect(popuplist, SIGNAL(clicked(const QModelIndex&)), SLOT(folderSelected(const QModelIndex &)));
}
@@ -296,5 +305,48 @@
void ConversationPage::openAttachmentOpenDialog()
{
- // TBD....
+ MPopupList *popuplist = new MPopupList();
+ QStringListModel *model = new QStringListModel(this);
+
+ QDir homeDir = QDir::home();
+
+ // Hack: hardcoded the list of applications for the 1.1 release
+ QStringList apps = QStringList()
+ //% "Music player"
+ << qtTrId("xx_music_player")
+ //% "Photo viewer"
+ << qtTrId("xx_photo_viewer")
+ //% "Video player"
+ << qtTrId("xx_video player");
+
+
+ model->setStringList(apps);
+ popuplist->setItemModel(model);
+ //% "Select an application"
+ popuplist->setTitle(qtTrId("xx_select_an_application"));
+ popuplist->appear();
+ connect(popuplist, SIGNAL(clicked(const QModelIndex&)), SLOT(applicationSelected(const QModelIndex &)));
+
+}
+
+void ConversationPage::applicationSelected(const QModelIndex &index)
+{
+
+ MPopupList *popupList = qobject_cast<MPopupList *>(sender());
+ if (!popupList)
+ return;
+
+ int selection = index.row();
+ if (selection == 0) // music
+ {
+ //Todo: add code to invoke music player
+ }
+ else if (selection == 1) // photo
+ {
+ //Todo: add code to invoke photo viewer
+ }
+ else if (selection == 2) // video
+ {
+ //Todo: add code to invoke video player
+ }
}
--- src/conversationpage.h
+++ src/conversationpage.h
@@ -43,6 +43,7 @@
void openAttachmentDownloadDialog();
void openAttachmentOpenDialog();
void folderSelected(const QModelIndex& index);
+ void applicationSelected(const QModelIndex& index);
void saveAttachment();
--- src/editexistingaccountpage.cpp
+++ src/editexistingaccountpage.cpp
@@ -12,6 +12,7 @@
#include <MComboBox>
#include <MLayout>
#include <MLinearLayoutPolicy>
+#include <MMessageBox>
#include <QGraphicsLinearLayout>
#include <MLabel>
#include <MTextEdit>
@@ -28,11 +29,6 @@
#include "emailserviceconfiguration.h"
#include "emailsettingspage.h"
-static QStringList s_inServerTypes = (QStringList() << qtTrId("None") << qtTrId("IMAP") << qtTrId("POP"));
-static QStringList s_outServerTypes = (QStringList() << qtTrId("None") << qtTrId("SMTP"));
-static QStringList s_securityTypes = (QStringList() << qtTrId("None") << qtTrId("SSL") << qtTrId("TSL"));
-static QStringList s_authTypes = (QStringList() << qtTrId("None") << qtTrId("Login") << qtTrId("Plain"));
-
static const QString imapServiceKey("imap4");
static const QString popServiceKey("pop3");
static const QString smtpServiceKey("smtp");
@@ -74,8 +70,8 @@
{
setContentsMargins(0, 0, 0, 0);
setPannable(true);
-
- setTitle(qtTrId("Mail"));
+ //% "Mail"
+ setTitle(qtTrId("xx_page_title"));
MLayout *layout = new MLayout(centralWidget());
layout->setContentsMargins(0, 0, 0, 0);
@@ -85,10 +81,12 @@
m_policy->setSpacing(5);
QMailAccount mailAccount(id);
- m_displayName = creatLabelWithEdit(m_policy, qtTrId("Your name"), mailAccount.name());
+ //% "Your name"
+ m_displayName = creatLabelWithEdit(m_policy, qtTrId("xx_your_name"), mailAccount.name());
QMailAddress from = mailAccount.fromAddress();
- m_emailAddress = creatLabelWithEdit(m_policy, qtTrId("Email address"), from.toString());
+ //% "Email address"
+ m_emailAddress = creatLabelWithEdit(m_policy, qtTrId("xx_email_address"), from.toString());
// Recieving Settings start here
MWidgetController *container = new MWidgetController;
@@ -99,12 +97,14 @@
layout->setContentsMargins(0, 0, 0, 0);
MLinearLayoutPolicy *policy = new MLinearLayoutPolicy(layout, Qt::Vertical);
policy->setSpacing(5);
- policy->addItem(new MLabel(qtTrId("<b>Receiving settings</b>")));
+ //% "Receiving settings"
+ policy->addItem(new MLabel(QString("<b>" + qtTrId("xx_receiving_settings") + "</b>")));
QMailAccountConfiguration config(id);
m_services = config.services();
- m_inServiceKey = "None";
+ //% "None"
+ m_inServiceKey = qtTrId("xx_none");
int sIndex = 0;
if (m_services.contains(imapServiceKey))
{
@@ -122,13 +122,24 @@
EmailServiceConfiguration svcCfg(&config, m_inServiceKey);
- m_inServerType = creatComboBoxEntry (policy, qtTrId("Server type"), s_inServerTypes, sIndex);
- m_inServerAddress = creatLabelWithEdit(policy, qtTrId("Server address"), svcCfg.value("server"));
- m_inServerPort = creatLabelWithEdit(policy, qtTrId("Port"), svcCfg.value("port"));
- m_inServerSecurity = creatComboBoxEntry (policy, qtTrId("Security"), s_securityTypes,
+ QStringList inServerTypes = EmailSettingsPage::instance()->incomingServerTypes();
+ //% "Server type"
+ m_inServerType = creatComboBoxEntry (policy, qtTrId("xx_server_type"), inServerTypes, sIndex);
+ connect(m_inServerType, SIGNAL(currentIndexChanged(int)), this, SLOT(onInServerTypeChanged(int)));
+ //% "Server address"
+ m_inServerAddress = creatLabelWithEdit(policy, qtTrId("xx_server_address"), svcCfg.value("server"));
+ //% "Port"
+ m_inServerPort = creatLabelWithEdit(policy, qtTrId("xx_port"), svcCfg.value("port"));
+ QStringList securityTypes = EmailSettingsPage::instance()->securityTypes();
+ //% "Security"
+ m_inServerSecurity = creatComboBoxEntry (policy, qtTrId("xx_security"), securityTypes,
svcCfg.value("encryption").toInt());
- m_inUsername = creatLabelWithEdit(policy, qtTrId("Username"), svcCfg.value("username"));
- m_inPassword = creatLabelWithEdit(policy, qtTrId("Passowrd"), svcCfg.decode(svcCfg.value("password")));
+ connect(m_inServerSecurity, SIGNAL(currentIndexChanged(int)), this, SLOT(onInServerSecurityChanged(int)));
+
+ //% "Username"
+ m_inUsername = creatLabelWithEdit(policy, qtTrId("xx_username"), svcCfg.value("username"));
+ //% "Password"
+ m_inPassword = creatLabelWithEdit(policy, qtTrId("xx_password"), svcCfg.decode(svcCfg.value("password")));
m_inPassword->setEchoMode(MTextEditModel::Password);
m_policy->addItem (container);
@@ -142,11 +153,13 @@
layout->setContentsMargins(0, 0, 0, 0);
policy = new MLinearLayoutPolicy(layout, Qt::Vertical);
policy->setSpacing(5);
- policy->addItem(new MLabel(qtTrId("<b>Sending settings</b>")));
+ //% "Sending settings"
+ policy->addItem(new MLabel(QString("<b>" + qtTrId("xx_sending_settings") + "</b>")));
// for this relesae, we only support smtp
sIndex = 0;
- m_outServiceKey = "None";
+ //% "None"
+ m_outServiceKey = qtTrId("xx_none");
if (m_services.contains(smtpServiceKey))
{
m_outServiceKey = smtpServiceKey;
@@ -158,15 +171,30 @@
EmailServiceConfiguration outSvcCfg(&config, m_outServiceKey);
- m_outServerType = creatComboBoxEntry (policy, qtTrId("Server type"), s_outServerTypes, sIndex);
- m_outServerAddress = creatLabelWithEdit(policy, qtTrId("Server address"), outSvcCfg.value("server"));
- m_outServerPort = creatLabelWithEdit(policy, qtTrId("Port"), outSvcCfg.value("port"));
- m_outAuthentication = creatComboBoxEntry (policy, qtTrId("Authentication"), s_authTypes,
+ QStringList outServerTypes = EmailSettingsPage::instance()->sendServerTypes();
+ //% "Server type"
+ m_outServerType = creatComboBoxEntry (policy, qtTrId("xx_server_type"), outServerTypes, sIndex);
+ connect(m_outServerType, SIGNAL(currentIndexChanged(int)), this, SLOT(onOutServerTypeChanged(int)));
+
+ //% "Server address"
+ m_outServerAddress = creatLabelWithEdit(policy, qtTrId("xx_server_address"), outSvcCfg.value("server"));
+ //% "port"
+ m_outServerPort = creatLabelWithEdit(policy, qtTrId("xx_port"), outSvcCfg.value("port"));
+ QStringList authTypes = EmailSettingsPage::instance()->authTypes();
+ //% "Authentication"
+ m_outAuthentication = creatComboBoxEntry (policy, qtTrId("xx_authentication"), authTypes,
outSvcCfg.value("authentication").toInt());
- m_outServerSecurity = creatComboBoxEntry (policy, qtTrId("Security"), s_securityTypes,
+
+ securityTypes = EmailSettingsPage::instance()->securityTypes();
+ //% "Security"
+ m_outServerSecurity = creatComboBoxEntry (policy, qtTrId("xx_security"), securityTypes,
outSvcCfg.value("encryption").toInt());
- m_outUsername = creatLabelWithEdit(policy, qtTrId("Username"), outSvcCfg.value("smtpusername"));
- m_outPassword = creatLabelWithEdit(policy, qtTrId("Password"), outSvcCfg.decode(outSvcCfg.value("smtppassword")));
+ connect(m_outServerSecurity, SIGNAL(currentIndexChanged(int)), this, SLOT(onOutServerSecurityChanged(int)));
+
+ //% "Username"
+ m_outUsername = creatLabelWithEdit(policy, qtTrId("xx_username"), outSvcCfg.value("smtpusername"));
+ //% "Password"
+ m_outPassword = creatLabelWithEdit(policy, qtTrId("xx_password"), outSvcCfg.decode(outSvcCfg.value("smtppassword")));
m_outPassword->setEchoMode(MTextEditModel::Password);
m_policy->addItem (container);
@@ -176,24 +204,26 @@
QGraphicsLinearLayout *buttonLayout = new QGraphicsLinearLayout(Qt::Horizontal);
buttonRow->setLayout(buttonLayout);
- MButton *button = new MButton(qtTrId("Update"), this);
+ //% "Update"
+ MButton *button = new MButton(qtTrId("xx_update"), this);
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(button, SIGNAL(clicked(bool)), this, SLOT(onUpdateAccount()));
buttonLayout->addItem(button);
- button= new MButton(qtTrId("Delete"), this);
+ //% "Delete account"
+ button= new MButton(qtTrId("xx_delete_account"), this);
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(button, SIGNAL(clicked(bool)), this, SLOT(onDeleteAccount()));
buttonLayout->addItem (button);
m_policy->addItem(buttonRow);
- MAction *action = new MAction (qtTrId("Update"),this);
+ MAction *action = new MAction (qtTrId("xx_update"),this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect (action, SIGNAL(triggered()), this, SLOT(onUpdateAccount()));
- action = new MAction (qtTrId("Delete account"),this);
+ action = new MAction (qtTrId("xx_delete_account"),this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect (action, SIGNAL(triggered()), this, SLOT(onDeleteAccount()));
@@ -208,7 +238,8 @@
// check the Receiving settings for any changes
// check for changes in server type.
int index = m_inServerType->currentIndex();
- QString serviceKey = "None";
+ //% "None"
+ QString serviceKey = qtTrId("xx_none");
if (index == 1)
serviceKey = imapServiceKey;
else if (index == 2)
@@ -253,9 +284,11 @@
imapConfig.setValue ("port", m_inServerPort->text());
QMailTransport::EncryptType encrypType = QMailTransport::Encrypt_NONE;
- if (QString::compare(m_inServerSecurity->currentText(), "SSL", Qt::CaseInsensitive) == 0)
+ //% "SSL"
+ if (QString::compare(m_inServerSecurity->currentText(), qtTrId("xx_ssl"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_SSL;
- else if (QString::compare(m_inServerSecurity->currentText(), "TLS", Qt::CaseInsensitive) == 0)
+ //% "TLS"
+ else if (QString::compare(m_inServerSecurity->currentText(), qtTrId("xx_tls"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_TLS;
imapConfig.setIntValue ("encryption", encrypType);
@@ -286,9 +319,11 @@
popConfig.setValue ("port", m_inServerPort->text());
QMailTransport::EncryptType encrypType = QMailTransport::Encrypt_NONE;
- if (QString::compare(m_inServerSecurity->currentText(), "SSL", Qt::CaseInsensitive) == 0)
+ //% "SSL"
+ if (QString::compare(m_inServerSecurity->currentText(), qtTrId("xx_ssl"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_SSL;
- else if (QString::compare(m_inServerSecurity->currentText(), "TLS", Qt::CaseInsensitive) == 0)
+ //% "TLS"
+ else if (QString::compare(m_inServerSecurity->currentText(), qtTrId("xx_tls"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_TLS;
popConfig.setIntValue ("encryption", encrypType);
@@ -299,7 +334,9 @@
// Now lets take care of send settings
index = m_outServerType->currentIndex();
- serviceKey = "None";
+
+ //% "None"
+ serviceKey = qtTrId("xx_none");
if (index == 1)
serviceKey = smtpServiceKey;
@@ -308,7 +345,8 @@
{
// we need to delete the previous service configuration and create a new one
- if (serviceKey == "None")
+ //% "None"
+ if (serviceKey == qtTrId("xx_none"))
config.removeServiceConfiguration(m_outServiceKey);
else
config.addServiceConfiguration(serviceKey);
@@ -317,7 +355,8 @@
newService = true;
}
- if (serviceKey != "None")
+ //% "None"
+ if (serviceKey != qtTrId("xx_none"))
{
EmailServiceConfiguration smtpConfig (&config, smtpServiceKey);
if (newService)
@@ -358,15 +397,31 @@
}
QMailTransport::EncryptType encrypType = QMailTransport::Encrypt_NONE;
- if (QString::compare(m_outServerSecurity->currentText(), "SSL", Qt::CaseInsensitive) == 0)
+ //% "SSL"
+ if (QString::compare(m_outServerSecurity->currentText(), qtTrId("xx_ssl"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_SSL;
- else if (QString::compare(m_outServerSecurity->currentText(), "TLS", Qt::CaseInsensitive) == 0)
+ //% "TLS"
+ else if (QString::compare(m_outServerSecurity->currentText(), qtTrId("xx_tls"), Qt::CaseInsensitive) == 0)
encrypType = QMailTransport::Encrypt_TLS;
smtpConfig.setIntValue("encryption", encrypType);
}
QMailStore::instance()->updateAccount(&account, &config);
+ m_retrievalAction = new QMailRetrievalAction(this);
+ m_transmitAction = new QMailTransmitAction(this);
+
+ connect(m_retrievalAction, SIGNAL(progressChanged(uint, uint)),
+ this, SLOT(displayRetrieveProgress(uint, uint)));
+ connect(m_retrievalAction, SIGNAL(activityChanged(QMailServiceAction::Activity)),
+ this, SLOT(activityChanged(QMailServiceAction::Activity)));
+
+ connect(m_transmitAction, SIGNAL(progressChanged(uint, uint)),
+ this, SLOT(displayTransmitProgress(uint, uint)));
+ connect(m_transmitAction, SIGNAL(activityChanged(QMailServiceAction::Activity)),
+ this, SLOT(activityChanged(QMailServiceAction::Activity)));
+
+ QTimer::singleShot(10, this, SLOT(testAccountConfiguration()));
dismiss();
}
@@ -375,3 +430,149 @@
QMailStore::instance()->removeAccount(m_accountId);
dismiss();
}
+
+void EditExistingAccountPage::testAccountConfiguration()
+{
+ QMailAccount account (m_accountId);
+ if (account.status() & (QMailAccount::MessageSource | QMailAccount::MessageSink))
+ {
+ if (account.status() & QMailAccount::MessageSource) {
+ m_retrievalAction->retrieveFolderList(m_accountId, QMailFolderId(), true);
+ } else if (account.status() & QMailAccount::MessageSink) {
+ m_transmitAction->transmitMessages(m_accountId);
+ }
+ }
+}
+void EditExistingAccountPage::activityChanged(QMailServiceAction::Activity activity)
+{
+ if (sender() == static_cast<QObject*>(m_retrievalAction)) {
+ const QMailServiceAction::Status status(m_retrievalAction->status());
+ if (status.accountId.isValid()) {
+ QMailAccount account(status.accountId);
+
+ if (activity == QMailServiceAction::Successful) {
+ if (account.status() & QMailAccount::MessageSink) {
+ m_transmitAction->transmitMessages(account.id());
+ } else {
+ emit accountReady();
+ }
+ } else if (activity == QMailServiceAction::Failed) {
+ //% "Retrieve Failure"
+ QString caption(qtTrId("xx_retrieve_failure"));
+ //% "%1 - Error retrieving folders: %2"
+ QString errMsg(qtTrId("xx_retrieval_failure_error").arg(account.name()).arg(status.text));
+
+ MMessageBox message(errMsg);
+ message.exec();
+ }
+ }
+ } else if (sender() == static_cast<QObject*>(m_transmitAction)) {
+ if (activity == QMailServiceAction::Successful) {
+ emit accountReady();
+ } else if (activity == QMailServiceAction::Failed) {
+ const QMailServiceAction::Status status(m_transmitAction->status());
+ QMailAccount account(status.accountId);
+
+ //% "Transmission Failure"
+ QString caption(qtTrId("xx_tranmit_failed"));
+ //% "%1 - Error testing connection: %2"
+ QString errMsg(qtTrId("xx_connection_failure_error").arg(account.name()).arg(status.text));
+
+ MMessageBox message(errMsg);
+ message.exec();
+ }
+ }
+}
+
+void EditExistingAccountPage::displayRetrieveProgress(uint value, uint range)
+{
+ Q_UNUSED (value);
+ Q_UNUSED (range);
+ // TODO: might want to put up a progress dialog in future
+}
+
+void EditExistingAccountPage::displayTransmitProgress(uint value, uint range)
+{
+ Q_UNUSED (value);
+ Q_UNUSED (range);
+ // TODO: might want to put up a progress dialog in future
+}
+
+void EditExistingAccountPage::onInServerTypeChanged(int index)
+{
+ int securityType = m_inServerSecurity->currentIndex();
+
+ QString port = "-1"; // default to invalid port
+ if (index == 1) // imap
+ {
+ if (securityType == 0) // none
+ port = "143";
+ else
+ port = "993";
+ }
+ else if (index == 2) // pop
+ {
+ if (securityType == 0) // none
+ port = "110";
+ else
+ port = "995";
+ }
+ // update the port with the appropriate default value
+ m_inServerPort->setText(port);
+}
+
+void EditExistingAccountPage::onInServerSecurityChanged(int index)
+{
+ int serverType = m_inServerType->currentIndex();
+
+ QString port = "-1"; // default to invalid port
+ if (index == 0) // none
+ {
+ if (serverType == 1) // imap
+ port = "143";
+ else if (serverType == 2) // pop
+ port = "110";
+ }
+ else // SSL or TSL
+ {
+ if (serverType == 1) // imap
+ port = "993";
+ else if (serverType == 2) // pop
+ port = "995";
+ }
+ // update the port with the appropriate default value
+ m_inServerPort->setText(port);
+}
+
+void EditExistingAccountPage::onOutServerTypeChanged(int index)
+{
+ int securityType = m_outServerSecurity->currentIndex();
+
+ QString port = "-1";
+ if (index == 1) // smtp
+ {
+ if (securityType == 0) // none
+ port = "25";
+ else
+ // ssl & tsl
+ port = "465";
+ }
+ m_outServerPort->setText(port);
+}
+
+void EditExistingAccountPage::onOutServerSecurityChanged(int index)
+{
+ int serverType = m_outServerType->currentIndex();
+
+ QString port = "-1"; // default to invalid port
+
+ if (serverType == 1) // smtp
+ {
+ if (index == 0) // none
+ port = "25";
+ else
+ // ssl & tsl
+ port = "465";
+ }
+ m_outServerPort->setText(port);
+}
--- src/editexistingaccountpage.h
+++ src/editexistingaccountpage.h
@@ -18,6 +18,7 @@
#include <qmailstore.h>
#include <qmailaccount.h>
+#include <qmailserviceaction.h>
class EditExistingAccountPage : public MApplicationPage
{
@@ -27,9 +28,20 @@
EditExistingAccountPage(const QMailAccountId &);
~EditExistingAccountPage();
+signals:
+ void accountReady();
+
private slots:
void onUpdateAccount();
void onDeleteAccount();
+ void activityChanged(QMailServiceAction::Activity activity);
+ void testAccountConfiguration();
+ void displayRetrieveProgress(uint, uint);
+ void displayTransmitProgress(uint, uint);
+ void onInServerTypeChanged (int);
+ void onInServerSecurityChanged (int);
+ void onOutServerTypeChanged (int);
+ void onOutServerSecurityChanged (int);
private:
MLinearLayoutPolicy *m_policy;
@@ -58,6 +70,9 @@
MComboBox *m_outServerSecurity;
MTextEdit *m_outUsername;
MTextEdit *m_outPassword;
+
+ QMailRetrievalAction *m_retrievalAction;
+ QMailTransmitAction *m_transmitAction;
};
#endif // EDITEXISTINGACCOUNTPAGE_H
--- src/emailapplication.cpp
+++ src/emailapplication.cpp
@@ -63,8 +63,8 @@
SLOT(showMessageListPage(QMailFolderId)));
connect (m_folderPage, SIGNAL(emailSettingsTriggered()), this,
SLOT(showEmailSettingsPage()));
+ m_folderPage->appear();
}
- m_folderPage->appear();
}
void EmailApplication::showAccountSetupPage()
@@ -80,10 +80,12 @@
}
-void EmailApplication::showComposePage(QString recipient)
+void EmailApplication::showComposePage(QString recipient, QStringList attachments)
{
m_composePage = new ComposePage(QMailMessageId());
m_composePage->setRecipient(recipient);
+ foreach (QString attachment, attachments)
+ m_composePage->insertAttachment(attachment);
m_composePage->appear();
}
--- src/emailapplication.h
+++ src/emailapplication.h
@@ -37,7 +37,7 @@
public slots:
void showFolderPage();
- void showComposePage(QString recipient="");
+ void showComposePage(QString recipient="", QStringList attachments=QStringList());
void showAccountSetupPage();
void showMessageListPage(QMailFolderId);
void showConversationPage(QMailMessageId);
--- src/emaildbusadaptor.cpp
+++ src/emaildbusadaptor.cpp
@@ -9,12 +9,18 @@
*/
#include "emaildbusadaptor.h"
+#include "mailmanager.h"
EmailDBusAdaptor::EmailDBusAdaptor(EmailApplication *app) :
QDBusAbstractAdaptor(app), mApp(app)
{}
-void EmailDBusAdaptor::showComposePage(QString recipient)
+void EmailDBusAdaptor::showComposePage(QString recipient, QStringList attachments)
{
- mApp->showComposePage(recipient);
+ mApp->showComposePage(recipient, attachments);
+}
+
+QString EmailDBusAdaptor::getRecentEmailTimeStamp(const QString& emailAddress)
+{
+ return MailManager::instance()->getRecentEmailTimeStamp(emailAddress);
}
--- src/emaildbusadaptor.h
+++ src/emaildbusadaptor.h
@@ -24,7 +24,8 @@
EmailDBusAdaptor(EmailApplication *app);
public slots:
- void showComposePage(QString recipient="");
+ void showComposePage(QString recipient="", QStringList attachments=QStringList());
+ Q_SCRIPTABLE QString getRecentEmailTimeStamp (const QString &emailAddress);
private:
EmailApplication *mApp;
--- src/emailsettingspage.cpp
+++ src/emailsettingspage.cpp
@@ -15,6 +15,7 @@
#include <MComboBox>
#include <MDialog>
#include <MButton>
+#include <MSeparator>
#include <QStringList>
#include <QGraphicsLinearLayout>
#include <QGraphicsGridLayout>
@@ -31,21 +32,60 @@
#include "mailmanager.h"
EmailSettingsPage *EmailSettingsPage::m_instance = 0;
-
-static QStringList s_frequencyList = (QStringList() << qtTrId("Every 5 minutes")
- << qtTrId("Every 15 minutes")
- << qtTrId("Every 30 minutes")
- << qtTrId("Every hour")
- << qtTrId("Manual checking only"));
+QStringList EmailSettingsPage::m_frequencyList;
+QStringList EmailSettingsPage::m_inServerTypes;
+QStringList EmailSettingsPage::m_outServerTypes;
+QStringList EmailSettingsPage::m_securityTypes;
+QStringList EmailSettingsPage::m_authTypes;
EmailSettingsPage *EmailSettingsPage::instance()
{
if (!m_instance)
+ {
+ // Initialize some of the strings used in account settings here.
+ // This makes the i18n work go easier.
+
+ //% "Every 5 minutes"
+ m_frequencyList.append(qtTrId("xx_frequency_5_minutes"));
+ //% "Every 15 minutes"
+ m_frequencyList.append(qtTrId("xx_frequency_15_minutes"));
+ //% "Every 30 minutes"
+ m_frequencyList.append(qtTrId("xx_frequency_30_minutes"));
+ //% "Every hour"
+ m_frequencyList.append(qtTrId("xx_frequency_hour"));
+ //% "Manual checking only"
+ m_frequencyList.append(qtTrId("xx_frequency_manual"));
+
+ //% "None"
+ m_inServerTypes.append(qtTrId("xx_none"));
+ //% "IMAP"
+ m_inServerTypes.append(qtTrId("xx_imap"));
+ //% "POP"
+ m_inServerTypes.append(qtTrId("xx_pop"));
+
+ m_outServerTypes.append(qtTrId("xx_none"));
+ //% "SMTP"
+ m_outServerTypes.append(qtTrId("xx_smtp"));
+
+ m_securityTypes.append(qtTrId("xx_none"));
+ //% "SSL"
+ m_securityTypes.append(qtTrId("xx_ssl"));
+ //% "TLS"
+ m_securityTypes.append(qtTrId("xx_tls"));
+
+ m_authTypes.append(qtTrId("xx_none"));
+ //% "Login"
+ m_authTypes.append(qtTrId("xx_login"));
+ //% "Plain"
+ m_authTypes.append(qtTrId("xx_plain"));
+
+
m_instance = new EmailSettingsPage();
+ }
return m_instance;
}
-
+
EmailSettingsPage::EmailSettingsPage()
: m_accountsContainer(NULL),
m_frequency(-1),
@@ -58,23 +98,28 @@
MApplicationPage::createContent();
setContentsMargins(0, 0, 0, 0);
setPannable(true);
- setTitle(qtTrId("Mail"));
+ //% "Mail"
+ setTitle(qtTrId("xx_page_title"));
MLayout *layout = new MLayout(centralWidget());
layout->setContentsMargins(0, 0, 0, 0);
layout->setAnimation(0);
m_policy = new MLinearLayoutPolicy(layout, Qt::Vertical);
+ m_policy->setSpacing(5);
MWidgetController *container = new MWidgetController;
- container->setObjectName("settigCategory");
container->setViewType ("background");
container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
layout = new MLayout (container);
layout->setContentsMargins(0, 0, 0, 0);
MLinearLayoutPolicy *containerPolicy = new MLinearLayoutPolicy(layout, Qt::Vertical);
containerPolicy->setSpacing(5);
- containerPolicy->addItem(new MLabel(qtTrId("Settings:")));
+ MSeparator *separator = new MSeparator();
+ separator->setObjectName("Separator");
+ m_policy->addItem(separator);
+ //% "Settings:"
+ containerPolicy->addItem(new MLabel(qtTrId("xx_settings_label")));
QMailAccountIdList ids = MailManager::instance()->accountIdList();
int fIndex = 4; // manual check by default
@@ -106,8 +151,10 @@
}
MComboBox *frequency = new MComboBox();
- frequency->addItems(s_frequencyList);
- frequency->setTitle(qtTrId("Check frequency"));
+ frequency->addItems(m_frequencyList);
+
+ //% "Check frequency"
+ frequency->setTitle(qtTrId("xx_check_frequency"));
frequency->setCurrentIndex (fIndex);
connect(frequency, SIGNAL(currentIndexChanged(int)), this, SLOT(frequencyChanged(int)));
containerPolicy->addItem(frequency);
@@ -119,7 +166,8 @@
widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
// Add new email alert setting
- MLabel *label = new MLabel(qtTrId("New email alert"));
+ //% "New email alert"
+ MLabel *label = new MLabel(qtTrId("xx_new_email_alert"));
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
grid->addItem (label, 0, 0, Qt::AlignLeft);
MButton *button = new MButton(this);
@@ -130,7 +178,8 @@
grid->addItem (button, 0, 1, Qt::AlignLeft);
// Add Ask before deleting setting
- label = new MLabel(qtTrId("Ask before deleting"));
+ //% "Ask before deleting"
+ label = new MLabel(qtTrId("xx_ask_before_deleting"));
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
grid->addItem (label, 1, 0, Qt::AlignLeft);
button = new MButton(this);
@@ -142,7 +191,8 @@
containerPolicy->addItem(widget);
- button = new MButton(qtTrId("Edit signature"), this);
+ //% "Edit signature"
+ button = new MButton(qtTrId("xx_edit_signature"), this);
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(button, SIGNAL(clicked(bool)), this, SLOT(editSignature()));
containerPolicy->addItem(button);
@@ -179,14 +229,14 @@
}
m_accountsContainer = new MWidgetController;
- m_accountsContainer->setObjectName("settigCategory");
m_accountsContainer->setViewType ("background");
m_accountsContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
MLayout *layout = new MLayout (m_accountsContainer);
layout->setContentsMargins(0, 0, 0, 0);
MLinearLayoutPolicy *policy = new MLinearLayoutPolicy(layout, Qt::Vertical);
policy->setSpacing(5);
- policy->addItem(new MLabel(qtTrId("Accounts:")));
+ //% "Accounts:"
+ policy->addItem(new MLabel(qtTrId("xx_accounts_label")));
QMailAccountIdList accounts = MailManager::instance()->accountIdList();
@@ -194,14 +244,16 @@
{
QMailAccount mailAccount(id);
- MButton *button = new MButton(qtTrId("Edit ") + mailAccount.name());
+ //% "Edit %1"
+ MButton *button = new MButton(qtTrId("xx_edit").arg(mailAccount.name()));
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(button);
m_accountButtons.insert(button, id);
connect(button, SIGNAL(clicked()), this, SLOT(handleAccountSelection()));
}
- MButton *button = new MButton(qtTrId("Add new account"), m_accountsContainer);
+ //% "Add new account"
+ MButton *button = new MButton(qtTrId("xx_add_new_account"), m_accountsContainer);
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(button, SIGNAL(clicked(bool)), this, SIGNAL(addNewAccount()));
policy->addItem(button);
@@ -255,7 +307,8 @@
centralWidget->setLayout(layout);
layout->addItem(edit);
- MDialog dialog(qtTrId("Edit signature"), M::OkButton | M::CancelButton);
+ //% "Edit signature"
+ MDialog dialog(qtTrId("xx_edit_signature_dialog_title"), M::OkButton | M::CancelButton);
dialog.setCentralWidget(centralWidget);
dialog.appear(MSceneWindow::DestroyWhenDone);
if (dialog.exec() == MDialog::Accepted)
--- src/emailsettingspage.h
+++ src/emailsettingspage.h
@@ -15,6 +15,7 @@
#include <MLinearLayoutPolicy>
#include <MAction>
#include <MButton>
+#include <QStringList>
#include "accountinfo.h"
#include "qmailaccount.h"
@@ -36,6 +37,11 @@
bool askBeforeDeleting() { return m_askBeforeDeleting; }
QString signature () { return m_signature; }
+ QStringList incomingServerTypes() { return m_inServerTypes; }
+ QStringList sendServerTypes() { return m_outServerTypes; }
+ QStringList securityTypes() { return m_securityTypes; }
+ QStringList authTypes() { return m_authTypes; }
+
signals:
void addNewAccount();
void editExistingAccount(QMailAccountId);
@@ -48,11 +54,12 @@
void handleAccountSelection();
void handleAccountsChanged(const QMailAccountIdList &);
-private:
+private: // private member functions
explicit EmailSettingsPage();
void updateAccountDisplayList();
void updateAccounts();
+private: // private member data
MLinearLayoutPolicy *m_policy;
MWidgetController *m_accountsContainer;
QHash < MButton *, QMailAccountId > m_accountButtons;
@@ -65,6 +72,12 @@
QString m_signature;
bool m_signatureModified;
+ static QStringList m_frequencyList;
+ static QStringList m_inServerTypes;
+ static QStringList m_outServerTypes;
+ static QStringList m_securityTypes;
+ static QStringList m_authTypes;
+
static EmailSettingsPage *m_instance;
};
--- src/emailutils.cpp
+++ src/emailutils.cpp
@@ -62,23 +62,28 @@
// See if it's in the last hour
if ((seconds / 60) < 60)
{
- readable = tr("%1 minutes ago").arg(seconds / 60);
+ //% "%1 minutes ago"
+ readable = QString(qtTrId("xx_minutes_ago").arg(seconds / 60));
}
else if (hours < 6) // See if it's in the past 5 hours
{
if (hours == 1)
- readable = tr("1 hour ago");
+ //% "1 hour ago"
+ readable = QString(qtTrId("xx_one_hour_ago"));
else
- readable = tr("%1 hours ago").arg(hours);
+ //% "%1 hours ago"
+ readable = QString(qtTrId("xx_hours_ago").arg(hours));
}
else if (days < 8) // See if it's in the past week
{
switch (days) {
case 0:
- readable = tr("Today");
+ //% "Today"
+ readable = QString(qtTrId("xx_today"));
break;
case 1:
- readable = tr("Yesterday");
+ //% "Yesterday"
+ readable = QString(qtTrId("xx_yesterday"));
break;
default:
readable = dateTime.date().toString("dddd");
--- src/folderitem.cpp
+++ src/folderitem.cpp
@@ -18,6 +18,7 @@
#include <qmailfolder.h>
#include "folderitem.h"
+#include "mailmanager.h"
FolderItem::FolderItem (QMailFolderId id) :
m_id (id)
@@ -37,16 +38,18 @@
label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
label->setObjectName("EmailFolderItem");
policy->addItem (label, 0, 0, Qt::AlignLeft);
- label = new MLabel("");
- if (folder.serverCount() != 0)
+ m_unreadTotalCount = new MLabel("");
+ uint totalCount = MailManager::instance()->folderTotalCount(id);
+ uint unreadCount = MailManager::instance()->folderUnreadCount(id);
+ if (unreadCount != 0)
{
QString str;
- str.setNum(folder.serverCount());
- label->setText(str);
+ str = QString("%1/%2").arg(unreadCount).arg(totalCount);
+ m_unreadTotalCount->setText(str);
}
- label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- label->setObjectName("EmailFolderMessageCount");
- policy->addItem (label, 0, 1, Qt::AlignRight);
+ m_unreadTotalCount->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ m_unreadTotalCount->setObjectName("EmailFolderMessageCount");
+ policy->addItem (m_unreadTotalCount, 0, 1, Qt::AlignRight);
}
@@ -64,3 +67,15 @@
Q_UNUSED(event);
emit clicked(m_id);
}
+
+void FolderItem::updateMessagesCount()
+{
+ QString str("");
+ uint totalCount = MailManager::instance()->folderTotalCount(m_id);
+ uint unreadCount = MailManager::instance()->folderUnreadCount(m_id);
+
+ if (unreadCount != 0)
+ str = QString("%1/%2").arg(unreadCount).arg(totalCount);
+
+ m_unreadTotalCount->setText(str);
+}
--- src/folderitem.h
+++ src/folderitem.h
@@ -11,7 +11,9 @@
#ifndef FOLDERITEM_H
#define FOLDERITEM_H
+#include <MLabel>
#include <MWidgetController>
+
#include <qmailfolder.h>
class FolderItem: public MWidgetController
@@ -22,6 +24,9 @@
FolderItem(QMailFolderId folderId);
virtual ~FolderItem();
+ QMailFolderId folderId() { return m_id; }
+ void updateMessagesCount();
+
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
@@ -31,6 +36,7 @@
private:
QMailFolderId m_id;
+ MLabel *m_unreadTotalCount;
};
#endif // FOLDERITEM_H
--- src/folderpage.cpp
+++ src/folderpage.cpp
@@ -31,7 +31,8 @@
setPannable(true);
createActions();
- setTitle("Mail");
+ //% "Mail"
+ setTitle(qtTrId("xx_page_title"));
}
FolderPage::~FolderPage()
@@ -57,6 +58,10 @@
SLOT(accountsRemoved(const QMailAccountIdList &)));
connect (QMailStore::instance(), SIGNAL(accountsUpdated(const QMailAccountIdList &)), this,
SLOT(accountsUpdated(const QMailAccountIdList &)));
+ connect (QMailStore::instance(), SIGNAL(folderContentsModified(const QMailFolderIdList &)), this,
+ SLOT(onFolderContentsModified(const QMailFolderIdList &)));
+ connect (QMailStore::instance(), SIGNAL(foldersAdded(const QMailFolderIdList &)), this,
+ SLOT(onFoldersAdded(const QMailFolderIdList &)));
foreach (const QMailAccountId &id, m_mailAccounts)
insertAccount(id);
@@ -73,11 +78,15 @@
SLOT(toggleAccountSection(const QMailAccountId &)));
m_accountItems[id] = accountItem;
+ // Make sure message server downloaded some messages for the account
+ MailManager::instance()->retrieveMessages(id);
+
// Get all the folders belonging to this email account
QMailFolderKey key = QMailFolderKey::parentAccountId(id);
const QMailFolderIdList folders = QMailStore::instance()->queryFolders(key);
QList<FolderItem *> folderItems;
+ folderItems.clear();
foreach (const QMailFolderId id, folders)
{
// Get this folder
@@ -92,10 +101,6 @@
}
m_folderItems[id] = folderItems;
m_accountFolderVisible[id] = true;
-
- QMailRetrievalAction *retrievalAction = new QMailRetrievalAction();
- // FIX ME: the minimum number of email to be retrieve should come from email setting.
- retrievalAction->retrieveMessageList (id, QMailFolderId(), 20);
}
void FolderPage::getEmailAccounts()
@@ -109,19 +114,22 @@
void FolderPage::createActions()
{
// "Write new mail" action item
- MAction *action = new MAction("<b></b>Write new mail", this);
+ //% "Write new mail"
+ MAction *action = new MAction(qtTrId("xx_write_new_mail"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(composeActionTriggered()));
// "Settings" action item
- action = new MAction("Settings", this);
+ //% "Settings"
+ action = new MAction(qtTrId("xx_settings"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SIGNAL(emailSettingsTriggered()));
// "Refresh mail" action item
- action = new MAction("<b></b>Refresh mail", this);
+ //% "Refresh mail"
+ action = new MAction(qtTrId("xx_refresh_mail"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(refreshActionTriggered()));
@@ -152,12 +160,14 @@
MailManager::instance()->accountsSync();
foreach (QMailAccountId id, ids)
+ {
+ m_mailAccounts.append(id);
insertAccount (id);
+ }
}
void FolderPage::accountsUpdated(const QMailAccountIdList &ids)
{
- Q_UNUSED(ids);
foreach (QMailAccountId id, ids)
{
AccountItem *accountItem = m_accountItems[id];
@@ -184,6 +194,10 @@
QList<FolderItem *>folderItems = m_folderItems[id];
foreach (FolderItem *item, folderItems)
m_policy->removeItem(item);
+ m_mailAccounts.removeOne(id);
+ m_folderItems.remove(id);
+ m_accountFolderVisible.remove(id);
+ m_accountItems.remove(id);
}
}
@@ -207,3 +221,63 @@
m_policy->insertItem(++index, item);
}
}
+
+void FolderPage::onFolderContentsModified(const QMailFolderIdList &folderIds)
+{
+ // folder contents has been changed
+ foreach (QMailFolderId folderId, folderIds)
+ {
+ bool found = false;
+ foreach (QMailAccountId id, m_mailAccounts)
+ {
+ QList<FolderItem *>folderItems = m_folderItems[id];
+ foreach (FolderItem *item, folderItems)
+ {
+ if (item->folderId() == folderId)
+ {
+ item->updateMessagesCount();
+ found = true;
+ break;
+ }
+ }
+ if (found) break;
+ }
+ }
+}
+
+void FolderPage::onFoldersAdded(const QMailFolderIdList & folderIds)
+{
+ // Lets take the first folder and determine which mail account it belongs to
+ QMailFolder folder(folderIds[0]);
+ QMailAccountId account = folder.parentAccountId();
+ QMailAccount mailAccount(account);
+
+ // Make sure message server downloaded some messages for the account
+ MailManager::instance()->retrieveMessages(account);
+
+ int index = m_policy->indexOf(m_accountItems[account]);
+ if (m_folderItems[account].size() > 0)
+ {
+ index = m_policy->indexOf(m_folderItems[account].last());
+ }
+
+ index++;
+
+ bool showFolder = m_accountFolderVisible[account];
+ foreach (const QMailFolderId id, folderIds)
+ {
+ // Get this folder
+ QMailFolder folder = QMailStore::instance()->folder(id);
+
+ FolderItem *folderItem = new FolderItem (id);
+ m_folderItems[account] << folderItem;
+
+ if (showFolder)
+ {
+ m_policy->insertItem (index, folderItem);
+ index++;
+ }
+ connect (folderItem, SIGNAL(clicked(QMailFolderId)), this,
+ SLOT(folderSelected(QMailFolderId)));
+ }
+}
--- src/folderpage.h
+++ src/folderpage.h
@@ -42,6 +42,8 @@
void composeActionTriggered();
void refreshActionTriggered();
void toggleAccountSection(const QMailAccountId &);
+ void onFolderContentsModified (const QMailFolderIdList &);
+ void onFoldersAdded (const QMailFolderIdList &);
private:
void createActions();
--- src/mailmanager.cpp
+++ src/mailmanager.cpp
@@ -70,7 +70,7 @@
QMailMessageKey countKey(QMailMessageKey::parentFolderId(folderId));
countKey &= ~QMailMessageKey::status(QMailMessage::Temporary);
int retrievedMinimum = QMailStore::instance()->countMessages(countKey);
- retrievedMinimum += 20;
+ retrievedMinimum += 30;
m_retrieving = true;
m_cancelling = false;
m_retrievalAction->retrieveMessageList(folder.parentAccountId(), folderId, retrievedMinimum);
@@ -82,7 +82,7 @@
if (!isSynchronizing() && id.isValid()) {
m_cancelling = false;
m_retrieving = true;
- m_retrievalAction->synchronizeAll(id);
+ m_retrievalAction->retrieveMessageList(id, QMailFolderId(), 30);
}
}
@@ -295,3 +295,31 @@
}
}
}
+
+uint MailManager::folderUnreadCount (const QMailFolderId &id)
+{
+ QMailMessageKey parentFolderKey(QMailMessageKey::parentFolderId(id));
+ QMailMessageKey unreadKey(QMailMessageKey::status(QMailMessage::Read, QMailDataComparator::Excludes));
+ return (QMailStore::instance()->countMessages(parentFolderKey & unreadKey));
+}
+
+uint MailManager::folderTotalCount (const QMailFolderId &id)
+{
+ QMailMessageKey parentFolderKey(QMailMessageKey::parentFolderId(id));
+ return (QMailStore::instance()->countMessages(parentFolderKey));
+}
+
+QString MailManager::getRecentEmailTimeStamp (const QString &senderEmail)
+{
+ QMailMessageKey senderKey(QMailMessageKey::sender(senderEmail, QMailDataComparator::Includes));
+ QMailMessageSortKey sortKey(QMailMessageSortKey::receptionTimeStamp(Qt::DescendingOrder));
+ QMailMessageIdList ids = QMailStore::instance()->queryMessages(senderKey, sortKey, 1);
+ if (ids.size() == 0)
+ {
+ return QString("");
+ }
+
+ QMailMessage message(ids[0]);
+ QDateTime timeStamp = message.receivedDate().toLocalTime();
+ return (timeStamp.toString("hh:mm dd MM yyyy"));
+}
--- src/mailmanager.h
+++ src/mailmanager.h
@@ -144,6 +144,24 @@
*/
QMailAccountIdList accountIdList() const;
+ /**
+ * Get the unread message count for folder
+ * @returns the total number of unread messages currently known to messageserver for folder
+ */
+ uint folderUnreadCount (const QMailFolderId &id);
+
+ /**
+ * Get the total message count for folder
+ * @returns the total number of messages currently known to messageserver for folder
+ */
+ uint folderTotalCount (const QMailFolderId &id);
+
+ /**
+ * Get the most recent email timestamp from sender
+ * @returns the most recent email timestamp from send
+ */
+ QString getRecentEmailTimeStamp (const QString &sender);
+
private slots:
void progressChanged(uint value, uint total);
void activityChanged(QMailServiceAction::Activity activity);
--- src/manualaccounteditpage.cpp
+++ src/manualaccounteditpage.cpp
@@ -19,13 +19,9 @@
#include <qmailaccountkey.h>
#include <QtDebug>
-#include "manualaccounteditpage.h"
#include "accountinfo.h"
-
-static QStringList s_inServerTypes = (QStringList() << QObject::tr("None") << QObject::tr("IMAP") << QObject::tr("POP"));
-static QStringList s_outServerTypes = (QStringList() << QObject::tr("None") << QObject::tr("SMTP"));
-static QStringList s_securityTypes = (QStringList() << QObject::tr("None") << QObject::tr("SSL") << QObject::tr("TSL"));
-static QStringList s_authTypes = (QStringList() << QObject::tr("None") << QObject::tr("Login") << QObject::tr("Plain"));
+#include "emailsettingspage.h"
+#include "manualaccounteditpage.h"
static void creatLabel (MLinearLayoutPolicy *policy, QString text)
{
@@ -51,16 +47,19 @@
{
MApplicationPage::createContent();
setContentsMargins(0, 0, 0, 0);
- setTitle(tr("Mail"));
+ //% "Mail"
+ setTitle(qtTrId("xx_page_title"));
setPannable(true);
MWidget *panel = (MWidget *)centralWidget();
MLayout *layout = new MLayout(panel);
m_policy = new MLinearLayoutPolicy(layout, Qt::Vertical);
- creatLabel (m_policy, tr("<b>New mail account</b>"));
- creatLabel (m_policy, tr("<b></b>Sorry, we can't automatically setup your account. You may need to contact your email provider for these settings."));
-
+ //% "New mail account"
+ creatLabel (m_policy, ("<b>" + qtTrId("xx_new_mail_account") +"</b>"));
+ //% "Sorry, we can't automatically setup your account. You may need to contact your email provider for these settings."
+ creatLabel (m_policy, qtTrId("xx_cannot_auto_setup_account"));
+
displayReceiveSettings();
}
@@ -77,41 +76,53 @@
MLayout *layout = new MLayout(m_receiveSettingsWidget);
MLinearLayoutPolicy *policy = new MLinearLayoutPolicy(layout, Qt::Vertical);
- creatLabel (policy, "<b>Receiving settings</b>");
+ //% "Receiving settings"
+ creatLabel (policy, ("<b>" + qtTrId("xx_receiving_settings") + "</b>"));
m_inServerType = new MComboBox(m_receiveSettingsWidget);
- m_inServerType->setTitle(tr("Server type"));
- m_inServerType->addItems(s_inServerTypes);
- m_inServerType->setCurrentIndex(s_inServerTypes.indexOf(m_account->inServerType()));
+ //% "Server type"
+ m_inServerType->setTitle(qtTrId("xx_server_type"));
+ QStringList inServerTypes = EmailSettingsPage::instance()->incomingServerTypes();
+ m_inServerType->addItems(inServerTypes);
+ m_inServerType->setCurrentIndex(inServerTypes.indexOf(m_account->inServerType()));
m_inServerType->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ connect(m_inServerType, SIGNAL(currentIndexChanged(int)), this, SLOT(onInServerTypeChanged(int)));
policy->addItem(m_inServerType);
- creatLabel (policy, tr("Server address"));
+ //% "Server address"
+ creatLabel (policy, qtTrId("xx_server_address"));
m_inServerAddress = new MTextEdit(MTextEditModel::SingleLine, "", m_receiveSettingsWidget);
m_inServerAddress->setText (m_account->inServerAddress());
m_inServerAddress->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(m_inServerAddress);
- creatLabel (policy, tr("Port"));
+ //% "Port"
+ creatLabel (policy, qtTrId("xx_port"));
m_inServerPort = new MTextEdit(MTextEditModel::SingleLine, "", m_receiveSettingsWidget);
m_inServerPort->setText (QString::number(m_account->inPort()));
+ m_inServerPort->setContentType(M::NumberContentType);
m_inServerPort->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(m_inServerPort);
m_inServerSecurity = new MComboBox (m_receiveSettingsWidget);;
- m_inServerSecurity->setTitle(tr("Security"));
- m_inServerSecurity->addItems(s_securityTypes);
- m_inServerSecurity->setCurrentIndex(s_securityTypes.indexOf(m_account->inSecurity()));
+ //% "Security"
+ m_inServerSecurity->setTitle(qtTrId("xx_security"));
+ QStringList securityTypes = EmailSettingsPage::instance()->securityTypes();
+ m_inServerSecurity->addItems(securityTypes);
+ m_inServerSecurity->setCurrentIndex(securityTypes.indexOf(m_account->inSecurity()));
m_inServerSecurity->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ connect(m_inServerSecurity, SIGNAL(currentIndexChanged(int)), this, SLOT(onInServerSecurityChanged(int)));
policy->addItem(m_inServerSecurity);
- creatLabel (policy, tr("Username"));
+ //% "Username"
+ creatLabel (policy, qtTrId("xx_username"));
m_inServerUsername = new MTextEdit(MTextEditModel::SingleLine, "", m_receiveSettingsWidget);
m_inServerUsername->setText (m_account->inUsername());
m_inServerUsername->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(m_inServerUsername);
- creatLabel (policy, tr("Password"));
+ //% "Password"
+ creatLabel (policy, qtTrId("xx_password"));
m_inServerPassword = new MTextEdit(MTextEditModel::SingleLine, "", m_receiveSettingsWidget);
m_inServerPassword->setText (m_account->inPassword());
m_inServerPassword->setEchoMode(MTextEditModel::Password);
@@ -119,7 +130,8 @@
policy->addItem(m_inServerPassword);
policy->setItemSpacing(policy->indexOf(m_inServerPassword), 4);
- MButton *button = new MButton(tr("Next: Sending"), this);
+ //% "Next: Sending"
+ MButton *button = new MButton(qtTrId("xx_next_sending"), this);
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(button, SIGNAL(clicked(bool)), this, SLOT(displaySendSettings()));
policy->addItem(button);
@@ -138,61 +150,77 @@
MLayout *layout = new MLayout(m_sendSettingsWidget);
MLinearLayoutPolicy *policy = new MLinearLayoutPolicy(layout, Qt::Vertical);
- creatLabel (policy, tr("<b>Sending settings</b>"));
+ //% "Sending settings"
+ creatLabel (policy, "<b>" + qtTrId("xx_sending_settings") + "</b>");
m_outServerType = new MComboBox(m_sendSettingsWidget);
- m_outServerType->setTitle(tr("Server type"));
- m_outServerType->addItems(s_outServerTypes);
- m_outServerType->setCurrentIndex(s_outServerTypes.indexOf(m_account->outServerType().toUpper()));
+ //% "Server type"
+ m_outServerType->setTitle(qtTrId("xx_Server type"));
+ QStringList outServerTypes = EmailSettingsPage::instance()->sendServerTypes();
+ m_outServerType->addItems(outServerTypes);
+ m_outServerType->setCurrentIndex(outServerTypes.indexOf(m_account->outServerType().toUpper()));
m_outServerType->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ connect(m_outServerType, SIGNAL(currentIndexChanged(int)), this, SLOT(onOutServerTypeChanged(int)));
policy->addItem(m_outServerType);
- creatLabel (policy, tr("From"));
+ //% "From"
+ creatLabel (policy, qtTrId("xx_from"));
m_senderName = new MTextEdit(MTextEditModel::SingleLine, "", m_sendSettingsWidget);
m_senderName->setText(m_account->displayName());
m_senderName->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(m_senderName);
- creatLabel (policy, tr("Email address"));
+ //% "Email address"
+ creatLabel (policy, qtTrId("xx_email_address"));
m_emailAddress = new MTextEdit(MTextEditModel::SingleLine, "", m_sendSettingsWidget);
m_emailAddress->setText(m_account->emailAddress());
+ m_emailAddress->setContentType(M::EmailContentType);
m_emailAddress->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(m_emailAddress);
- creatLabel (policy, tr("Server address"));
+ //% "Server address"
+ creatLabel (policy, qtTrId("xx_server_address"));
m_outServerAddress = new MTextEdit(MTextEditModel::SingleLine, "", m_sendSettingsWidget);
m_outServerAddress->setText(m_account->outServerAddress());
m_outServerAddress->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(m_outServerAddress);
- creatLabel (policy, tr("Port"));
+ //% "Port"
+ creatLabel (policy, qtTrId("xx_port"));
m_outServerPort = new MTextEdit(MTextEditModel::SingleLine, "", m_sendSettingsWidget);
m_outServerPort->setText(QString::number(m_account->outPort()));
m_outServerPort->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ m_outServerPort->setContentType(M::NumberContentType);
policy->addItem(m_outServerPort);
m_outServerSecurity = new MComboBox (m_sendSettingsWidget);;
- m_outServerSecurity->setTitle(tr("Security"));
- m_outServerSecurity->addItems(s_securityTypes);
- m_outServerSecurity->setCurrentIndex(s_securityTypes.indexOf(m_account->outSecurity()));
+ //% "Security"
+ m_outServerSecurity->setTitle(qtTrId("xx_security"));
+ QStringList securityTypes = EmailSettingsPage::instance()->securityTypes();
+ m_outServerSecurity->addItems(securityTypes);
+ m_outServerSecurity->setCurrentIndex(securityTypes.indexOf(m_account->outSecurity()));
m_outServerSecurity->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ connect(m_outServerSecurity, SIGNAL(currentIndexChanged(int)), this, SLOT(onOutServerSecurityChanged(int)));
policy->addItem(m_outServerSecurity);
m_outAuthentication = new MComboBox (m_sendSettingsWidget);;
- m_outAuthentication->setTitle(tr("Authentication"));
- m_outAuthentication->addItems(s_authTypes);
+ //% "Authentication"
+ m_outAuthentication->setTitle(qtTrId("xx_authentication"));
+ QStringList authTypes = EmailSettingsPage::instance()->authTypes();
+ m_outAuthentication->addItems(authTypes);
m_outAuthentication->setCurrentIndex(m_account->outAuthentication());
m_outAuthentication->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(m_outAuthentication);
-
- creatLabel (policy, tr("Username"));
+ //% "Username"
+ creatLabel (policy, qtTrId("xx_username"));
m_outServerUsername = new MTextEdit(MTextEditModel::SingleLine, "", m_sendSettingsWidget);
m_outServerUsername->setText(m_account->outUsername());
m_outServerUsername->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
policy->addItem(m_outServerUsername);
- creatLabel (policy, tr("Password"));
+ //% "Password"
+ creatLabel (policy, qtTrId("xx_password"));
m_outServerPassword = new MTextEdit(MTextEditModel::SingleLine, "", m_sendSettingsWidget);
m_outServerPassword->setEchoMode(MTextEditModel::Password);
m_outServerPassword->setText(m_account->outPassword());
@@ -204,12 +232,14 @@
QGraphicsLinearLayout *buttonLayout = new QGraphicsLinearLayout(Qt::Horizontal);
buttonRow->setLayout(buttonLayout);
- MButton *button = new MButton(tr("<b></b>Back: Receiving"), this);
+ //% "Back: Receiving"
+ MButton *button = new MButton(qtTrId("xx_back_to_receiving"), this);
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(button, SIGNAL(clicked(bool)), this, SLOT(displayReceiveSettings()));
buttonLayout->addItem(button);
- button= new MButton(tr("<b></b>Next: Review"), this);
+ //% "Next: Review"
+ button= new MButton(qtTrId("xx_next_review"), this);
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(button, SIGNAL(clicked(bool)), this, SLOT(reviewAccountSettings()));
buttonLayout->addItem (button);
@@ -253,3 +283,82 @@
dismiss();
emit verifyAccount(m_account);
}
+
+void ManualAccountEditPage::onInServerTypeChanged(int index)
+{
+ int securityType = m_inServerSecurity->currentIndex();
+
+ QString port = "-1"; // default to invalid port
+ if (index == 1) // imap
+ {
+ if (securityType == 0) // none
+ port = "143";
+ else
+ port = "993";
+ }
+ else if (index == 2) // pop
+ {
+ if (securityType == 0) // none
+ port = "110";
+ else
+ port = "995";
+ }
+ // update the port with the appropriate default value
+ m_inServerPort->setText(port);
+}
+
+void ManualAccountEditPage::onInServerSecurityChanged(int index)
+{
+ int serverType = m_inServerType->currentIndex();
+
+ QString port = "-1"; // default to invalid port
+ if (index == 0) // none
+ {
+ if (serverType == 1) // imap
+ port = "143";
+ else if (serverType == 2) // pop
+ port = "110";
+ }
+ else // SSL or TSL
+ {
+ if (serverType == 1) // imap
+ port = "993";
+ else if (serverType == 2) // pop
+ port = "995";
+ }
+ // update the port with the appropriate default value
+ m_inServerPort->setText(port);
+}
+
+void ManualAccountEditPage::onOutServerTypeChanged(int index)
+{
+ int securityType = m_outServerSecurity->currentIndex();
+
+ QString port = "-1";
+ if (index == 1) // smtp
+ {
+ if (securityType == 0) // none
+ port = "25";
+ else
+ // ssl & tsl
+ port = "465";
+ }
+ m_outServerPort->setText(port);
+}
+
+void ManualAccountEditPage::onOutServerSecurityChanged(int index)
+{
+ int serverType = m_outServerType->currentIndex();
+
+ QString port = "-1"; // default to invalid port
+
+ if (serverType == 1) // smtp
+ {
+ if (index == 0) // none
+ port = "25";
+ else
+ // ssl & tsl
+ port = "465";
+ }
+ m_outServerPort->setText(port);
+}
--- src/manualaccounteditpage.h
+++ src/manualaccounteditpage.h
@@ -37,6 +37,10 @@
void displayReceiveSettings();
void displaySendSettings();
void reviewAccountSettings ();
+ void onInServerTypeChanged (int);
+ void onInServerSecurityChanged (int);
+ void onOutServerTypeChanged (int);
+ void onOutServerSecurityChanged (int);
private:
AccountInfo *m_account;
--- src/messageitem.cpp
+++ src/messageitem.cpp
@@ -30,10 +30,9 @@
M_REGISTER_WIDGET(MessageItem);
MessageItem::MessageItem(MWidget *parent)
-/* : MStylableWidget(parent),
- m_pressed(false) */
+ : m_pressed(false), m_markReadUnreadAction(NULL)
{
-
+ Q_UNUSED(parent);
this->setViewType("background");
MLayout *layout = new MLayout();
layout->setAnimation(NULL);
@@ -70,60 +69,52 @@
void MessageItem::createContent(const QMailMessageId & id)
{
- m_id = id;
- QMailMessage message(id);
- quint64 status = message.status();
+ m_id = id; // saves the message id
+ QMailMessage message (id);
// Extract sender's email address and Subject from message
- m_sender->setText((tr("From: ") + message.from().address()));
- m_subject->setText((tr("Subject: ") + message.subject()));
+ //% "From: %1"
+ m_sender->setText(QString(qtTrId("xx_from_sender").arg(message.from().address())));
+ //% "Subject: %1"
+ m_subject->setText(QString(qtTrId("xx_subject_text").arg(message.subject())));
m_timeStamp->setText(Utils::humanDateTime(message.receivedDate().toLocalTime()));
- if ((status & QMailMessage::Read) && (status & QMailMessage::PartialContentAvailable))
- {
- m_sender->setObjectName("MessageSenderRead");
- m_timeStamp->setObjectName("MessageTimeStampRead");
- m_subject->setObjectName("MessageSubjectRead");
- }
- else
- {
- m_sender->setObjectName("MessageSender");
- m_timeStamp->setObjectName("MessageTimeStamp");
- m_subject->setObjectName("MessageSubject");
- }
+ updateMarkAsReadUnreadAction();
}
void MessageItem::createActions()
{
- // "Delete" context action item
- MAction *action = new MAction("Delete", this);
+ //% "Delete"
+ MAction *action = new MAction(qtTrId("xx_delete_action"), this);
action->setLocation(MAction::ObjectMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(deleteActionTriggered()));
- // "Forward" context action item
- action = new MAction("Forward", this);
+ //% "Forward"
+ action = new MAction(qtTrId("xx_forward_action"), this);
action->setLocation(MAction::ObjectMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(forwardActionTriggered()));
- // "Reply" context action item
- action = new MAction("Reply", this);
+ //% "Reply"
+ action = new MAction(qtTrId("xx_reply_action"), this);
action->setLocation(MAction::ObjectMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(replyActionTriggered()));
- // "Reply to all" context action item
- action = new MAction("Reply to all", this);
+ //% "Reply to all"
+ action = new MAction(qtTrId("xx_reply_all_action"), this);
action->setLocation(MAction::ObjectMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(replyAllActionTriggered()));
- // "Mark as read" context action item
- action = new MAction("Mark as read", this);
- action->setLocation(MAction::ObjectMenuLocation);
- addAction(action);
- connect(action, SIGNAL(triggered()), this, SLOT(markAsReadActionTriggered()));
+ m_markReadUnreadAction = new MAction("", this);
+ m_markReadUnreadAction->setLocation(MAction::ObjectMenuLocation);
+ addAction(m_markReadUnreadAction);
+ connect(m_markReadUnreadAction, SIGNAL(triggered()), this, SLOT(markAsReadActionTriggered()));
+
+ connect(QMailStore::instance(), SIGNAL(messagesUpdated(QMailMessageIdList)), this,
+ SLOT(onMessagesUpdated(QMailMessageIdList)));
}
void MessageItem::mousePressEvent(QGraphicsSceneMouseEvent *ev)
@@ -188,8 +179,53 @@
{
QMailMessage message(m_id);
quint64 status(QMailMessage::Read);
- QMailStore::instance()->updateMessagesMetaData(QMailMessageKey::id(m_id), status, true);
- m_sender->setObjectName("MessageSenderRead");
- m_timeStamp->setObjectName("MessageTimeStampRead");
- m_subject->setObjectName("MessageSubjectRead");
+ bool setFlag = true;
+
+ if (message.status() & QMailMessage::Read)
+ setFlag = false;
+
+ QMailStore::instance()->updateMessagesMetaData(QMailMessageKey::id(m_id), status, setFlag);
+}
+
+void MessageItem::onMessagesUpdated(const QMailMessageIdList & idList)
+{
+ if (idList.contains(m_id))
+ {
+ updateMarkAsReadUnreadAction();
+ }
+}
+
+void MessageItem::updateMarkAsReadUnreadAction()
+{
+ // update the mark as read/unread action label
+ QMailMessage message(m_id);
+ quint64 status = message.status();
+
+ if (m_markReadUnreadAction)
+ {
+ removeAction(m_markReadUnreadAction);
+ delete m_markReadUnreadAction;
+ }
+
+ if (status & QMailMessage::Read)
+ {
+ //% "Mark as unread"
+ m_markReadUnreadAction = new MAction(qtTrId("xx_mark_as_unread"), this);
+ m_sender->setObjectName("MessageSenderRead");
+ m_timeStamp->setObjectName("MessageTimeStampRead");
+ m_subject->setObjectName("MessageSubjectRead");
+ }
+ else
+ {
+ //% "Mark as read"
+ m_markReadUnreadAction = new MAction(qtTrId("xx_mark_as_read"), this);
+ m_sender->setObjectName("MessageSender");
+ m_timeStamp->setObjectName("MessageTimeStamp");
+ m_subject->setObjectName("MessageSubject");
+ }
+
+ m_markReadUnreadAction->setLocation(MAction::ObjectMenuLocation);
+ addAction(m_markReadUnreadAction);
+ connect(m_markReadUnreadAction, SIGNAL(triggered()), this, SLOT(markAsReadActionTriggered()));
+
}
--- src/messageitem.h
+++ src/messageitem.h
@@ -14,6 +14,7 @@
#include <QPixmap>
#include <QGraphicsSceneMouseEvent>
+#include <MAction>
#include <MStylableWidget>
#include <MLabel>
#include <MLayout>
@@ -54,9 +55,11 @@
void replyActionTriggered();
void replyAllActionTriggered();
void markAsReadActionTriggered();
+ void onMessagesUpdated(const QMailMessageIdList&);
private:
void createActions();
+ void updateMarkAsReadUnreadAction();
private:
MLabel *m_sender;
@@ -64,7 +67,7 @@
MLabel *m_timeStamp;
bool m_pressed;
QMailMessageId m_id;
- //M_STYLABLE_WIDGET(MessageItemStyle);
+ MAction *m_markReadUnreadAction;
};
#endif // MESSAGEITEM_H
--- src/messageitemmodel.cpp
+++ src/messageitemmodel.cpp
@@ -32,6 +32,16 @@
return QVariant();
}
+void MessageItemModel::addMessage(const QMailMessageId &id)
+{
+ if (m_messageIds.contains(id))
+ return;
+
+ beginInsertRows(QModelIndex(), 0, 0);
+ m_messageIds.prepend(id);
+ endInsertRows();
+}
+
void MessageItemModel::removeMessage(const QMailMessageId &id)
{
for (int i = 0; i < m_messageIds.size(); i++)
--- src/messageitemmodel.h
+++ src/messageitemmodel.h
@@ -26,6 +26,7 @@
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+ void addMessage (const QMailMessageId &id);
void removeMessage (const QMailMessageId &id);
void update(const QMailMessageIdList &ids);
--- src/messagelistpage.cpp
+++ src/messagelistpage.cpp
@@ -45,6 +45,8 @@
setPannable(true);
createActions();
+ //% "Mail"
+ setTitle(qtTrId("xx_page_title"));
MLayout *layout = new MLayout(centralWidget());
layout->setContentsMargins(0, 0, 0, 0);
@@ -57,7 +59,6 @@
// Get this folder
QMailFolder folder = QMailStore::instance()->folder(m_folderId);
- setTitle (tr("Mail"));
QMailMessageSortKey descendingDateKey(QMailMessageSortKey::receptionTimeStamp(Qt::DescendingOrder));
@@ -79,6 +80,8 @@
messages->setItemModel(m_model);
messages->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ connect (QMailStore::instance(), SIGNAL(messagesAdded(QMailMessageIdList)), this,
+ SLOT(addMessages(QMailMessageIdList)));
connect (MailManager::instance(), SIGNAL(messagesDeleted(QMailMessageIdList)), this,
SLOT(deleteMessages(QMailMessageIdList)));
@@ -95,14 +98,14 @@
void MessageListPage::createActions()
{
- // "Write new mail" menu action item
- MAction *action = new MAction(tr("Write new mail"), this);
+ //% "Write new mail"
+ MAction *action = new MAction(qtTrId("xx_write_new_mail"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(composeActionTriggered()));
- // "Refresh mail" menu action item
- action = new MAction(tr("Refresh mail"), this);
+ //% "Refresh mail"
+ action = new MAction(qtTrId("xx_refresh_mail"), this);
action->setLocation(MAction::ApplicationMenuLocation);
addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(refreshActionTriggered()));
@@ -131,12 +134,18 @@
m_currentIndex = index;
}
-void MessageListPage::deleteMessages(QMailMessageIdList ids)
+void MessageListPage::deleteMessages(const QMailMessageIdList &ids)
{
foreach (QMailMessageId id, ids)
m_model->removeMessage (id);
}
+void MessageListPage::addMessages(const QMailMessageIdList &ids)
+{
+ foreach (QMailMessageId id, ids)
+ m_model->addMessage (id);
+}
+
void MessageListPage::update()
{
QMailMessageSortKey descendingDateKey(QMailMessageSortKey::receptionTimeStamp(Qt::DescendingOrder));
--- src/messagelistpage.h
+++ src/messagelistpage.h
@@ -41,7 +41,8 @@
void update();
void messageItemClicked(const QModelIndex &);
- void deleteMessages(QMailMessageIdList);
+ void deleteMessages(const QMailMessageIdList &);
+ void addMessages(const QMailMessageIdList &);
private:
void createActions();
--- src/reviewaccountpage.cpp
+++ src/reviewaccountpage.cpp
@@ -49,41 +49,54 @@
{
MApplicationPage::createContent();
setContentsMargins(0, 0, 0, 0);
- setTitle(tr("Mail"));
+ //% "Mail"
+ setTitle(qtTrId("xx_page_title"));
setPannable(true);
- MWidget *panel = (MWidget *)centralWidget();
- MLayout *layout = new MLayout(panel);
+ MLayout *layout = new MLayout(centralWidget());
m_policy = new MLinearLayoutPolicy(layout, Qt::Vertical);
- creatLabel (m_policy, tr("<b></b>You entered the following details, please check they're correct."));
- creatLabel (m_policy, (tr("Name: ") + m_account->displayName()));
- creatLabel (m_policy, (tr("Email address: ") + m_account->emailAddress()));
+ //% "You entered the following details, please check they're correct."
+ creatLabel (m_policy, QString(qtTrId("xx_check_for_account_details")));
+ //% "Name: %1"
+ creatLabel (m_policy, QString(qtTrId("xx_review_display_name").arg(m_account->displayName())));
+ //% "Email address: %1"
+ creatLabel (m_policy, QString(qtTrId("xx_review_email_address").arg(m_account->emailAddress())));
// Receive settings.
- creatLabel (m_policy, (tr("<b>Receiving</b>")));
- creatLabel (m_policy, (tr("Server type: ") + m_account->inServerType()));
- creatLabel (m_policy, (tr("Server address: ") + m_account->inServerAddress()));
- creatLabel (m_policy, (tr("Port: ") + QString::number(m_account->inPort())));
- creatLabel (m_policy, (tr("Security: ") + m_account->inSecurity()));
- creatLabel (m_policy, (tr("Username: ") + m_account->inUsername()));
+ //% "Receiving"
+ creatLabel (m_policy, QString("<b>" + qtTrId("xx_receiving_title") + "</b>"));
+ //% "Server type: %1"
+ creatLabel (m_policy, QString(qtTrId("xx_review_server_type").arg(m_account->inServerType())));
+ //% "Server address: %1"
+ creatLabel (m_policy, QString(qtTrId("xx_review_server_address").arg(m_account->inServerAddress())));
+ //% "Port: %1"
+ creatLabel (m_policy, QString(qtTrId("xx_review_port").arg(QString::number(m_account->inPort()))));
+ //% "Security: %1"
+ creatLabel (m_policy, QString(qtTrId("xx_review_security").arg(m_account->inSecurity())));
+ //% "Username: %1"
+ creatLabel (m_policy, QString(qtTrId("xx_review_username").arg(m_account->inUsername())));
// Send settings.
- creatLabel (m_policy, (tr("<b>Sending</b>")));
- creatLabel (m_policy, (tr("Server type: ") + m_account->outServerType()));
- creatLabel (m_policy, (tr("Server address: ") + m_account->outServerAddress()));
- creatLabel (m_policy, (tr("Port: ") + QString::number(m_account->outPort())));
- creatLabel (m_policy, (tr("Security: ") + m_account->outSecurity()));
+ //% "Sending"
+ creatLabel (m_policy, QString("<b>" + qtTrId("xx_sending_title") + "</b>"));
+ creatLabel (m_policy, QString(qtTrId("xx_review_server_type").arg(m_account->outServerType())));
+ creatLabel (m_policy, QString(qtTrId("xx_review_server_address").arg(m_account->outServerAddress())));
+ creatLabel (m_policy, QString(qtTrId("xx_review_port").arg(QString::number(m_account->outPort()))));
+ creatLabel (m_policy, QString(qtTrId("xx_review_security").arg(m_account->outSecurity())));
if (m_account->outAuthentication() == AccountInfo::Authentication_None)
- creatLabel (m_policy, (tr("Authentication: None")));
+ //% "Authentication: None"
+ creatLabel (m_policy, QString(qtTrId("xx_authentication_none")));
else
{
if (m_account->outAuthentication() == AccountInfo::Authentication_Login)
- creatLabel (m_policy, (tr("Authentication: Login")));
+ //% "Authentication: Login"
+ creatLabel (m_policy, QString(qtTrId("xx_authentication_login")));
else if (m_account->outAuthentication() == AccountInfo::Authentication_Plain)
- creatLabel (m_policy, (tr("Authentication: Plain")));
+ //% "Authentication: Plain"
+ creatLabel (m_policy, QString(qtTrId("xx_authentication_plain")));
- creatLabel (m_policy, (tr("Username: ") + m_account->outUsername()));
+ creatLabel (m_policy, QString(qtTrId("xx_review_username").arg(m_account->outUsername())));
}
// create the buttons "Save and continue" and "Manual edit"
@@ -91,12 +104,14 @@
QGraphicsLinearLayout *buttonLayout = new QGraphicsLinearLayout(Qt::Horizontal);
buttonRow->setLayout(buttonLayout);
- MButton *button = new MButton(tr("<b></b>Save and continue"), this);
+ //% "Save and continue"
+ MButton *button = new MButton(qtTrId("xx_save_and_continue"), this);
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(button, SIGNAL(clicked(bool)), this, SLOT(saveAndContinue()));
buttonLayout->addItem(button);
- button= new MButton(tr("<b></b>Manual edit"), this);
+ //% "Manual edit"
+ button= new MButton(qtTrId("xx_manual_edit"), this);
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(button, SIGNAL(clicked(bool)), this, SLOT(manualEdit()));
buttonLayout->addItem (button);
@@ -111,7 +126,8 @@
if (!m_account->accountIsValid())
{
- MMessageBox message("Warning: Can't validate your account at this time. You might not be able to send or recieve email.");
+ //% "Warning: Can't validate your account at this time. You might not be able to send or recieve email."
+ MMessageBox message(qtTrId("xx_error_account_invalid"));
message.exec();
}
EmailApplication::instance()->addEmailAccount(m_account);
--- src/servercontroller.cpp
+++ src/servercontroller.cpp
@@ -69,7 +69,8 @@
void ServerController::processError(QProcess::ProcessError error)
{
- const QString errorMsg = QString("The Message server child process encountered an error (%1).").arg(static_cast<int>(error));
+ //% "The Message server child process encountered an error (%1)."
+ const QString errorMsg = QString(qtTrId("xx_message_server_error").arg(static_cast<int>(error)));
emit errorMessage(errorMsg.toLatin1());
}
--- src/src.pro
+++ src/src.pro
+TEMPLATE = app
+VERSION=0.2
+TARGET = meego-handset-email
+
+SUBDIRS = translations
+OBJECTS_DIR = .obj
+MOC_DIR = .moc
+MGEN_OUTDIR = .gen
+
+PKGCONFIG += meegotouch
+QT += dbus network
+CONFIG += qt meegotouch mobility debug
+MOBILITY += contacts
+
+INCLUDEPATH += $$(QMF_INCLUDEDIR)/qtopiamail $$(QMF_INCLUDEDIR)/qtopiamail/support $$(QMF_INCLUDEDIR)/messageserver ./src
+LIBS += -L $$(QMF_LIBDIR) -lqtopiamail -lqmfutil -lmessageserver -lseaside -lQtContacts
+
+# Paths
+M_PREFIX = /usr
+M_INSTALL_BIN = $$INSTALL_ROOT$$M_PREFIX/bin/
+M_INSTALL_DATA = $$INSTALL_ROOT$$M_PREFIX/share/
+M_THEME_DIR = $$M_INSTALL_DATA/themes/
+
+DEFINES += THEMEDIR=\\\"\"$$M_PREFIX/share/themes/base/meegotouch/$$TARGET/\"\\\"
+
+target.path = $$M_INSTALL_BIN
+
+STYLE_HEADERS += messageitemstyle.h
+
+SOURCES += main.cpp \
+ accountinfo.cpp \
+ accountitem.cpp \
+ accountsetuppage.cpp \
+ composepage.cpp \
+ contactpage.cpp \
+ conversationpage.cpp \
+ editexistingaccountpage.cpp \
+ emailapplication.cpp \
+ emaildbusadaptor.cpp \
+ emailsettingspage.cpp \
+ emailserviceconfiguration.cpp \
+ emailutils.cpp \
+ folderitem.cpp \
+ folderpage.cpp \
+ mailmanager.cpp \
+ manualaccounteditpage.cpp \
+ messageitem.cpp \
+ messageitemcreator.cpp \
+ messageitemmodel.cpp \
+ messagelistpage.cpp \
+ reviewaccountpage.cpp \
+ servercontroller.cpp \
+
+HEADERS += emailapplication.h \
+ accountinfo.h \
+ accountitem.h \
+ accountsetuppage.h \
+ composepage.h \
+ contactpage.h \
+ conversationpage.h \
+ editexistingaccountpage.h \
+ emaildbusadaptor.h \
+ emailsettingspage.h \
+ emailserviceconfiguration.h \
+ emailutils.h \
+ folderitem.h \
+ folderpage.h \
+ mailmanager.h \
+ manualaccounteditpage.h \
+ messageitem.h \
+ messageitemcreator.h \
+ messageitemmodel.h \
+ messageitemstyle.h \
+ messagelistpage.h \
+ reviewaccountpage.h \
+ servercontroller.h \
+ $$STYLE_HEADERS
+
+INSTALLS += target
--- theme/base/images
+++ theme/base/images
-(directory)
--- theme/base/images/email-address-add.png
+++ theme/base/images/email-address-add.png
-PNG
-
-
IHDR 0 0 Wù sRGB ®Î
é bKGD ÿ ÿ ÿ ½§ pHYs
×
×B(x tIMEÚÛ$x IDAThÞí1
-0W±ÉWmÎÿ¿Àkü}ª
FE)CØ0 £¹"ÔÌIC¶¼ºûXû¬öí/ ÿ%ÌläöR¶¶KÚJÜ}*Ù×EF*dÐjéßYb>4t @ àã
òv8`A= IEND®B`--- theme/base/images/email-address-delete.png
+++ theme/base/images/email-address-delete.png
-PNG
-
-
IHDR szzô sRGB ®Î
é bKGD ÿ ÿ ÿ ½§ pHYs ù¥ tIMEÚ
èAý PIDATXÃíKkQÇ´Vúh+5©-">@ÔâFÑAý+Wu+®ü E]Á±¸Ôú¨Ö&Zm«mI3ãæá8ÍLÆ»
¸;çÜÿyýÏ
¬Êª,o
{iõ½4·ÛMúfx,½0á f`СçY`3g&鳸 ëà!tÞ>w×¥;ÜýL£0
b¨õ¸ ìrqásÀg£ÿ8aÀ75Jç¡wj1ì5ß5E¼) À¤tþGà°Vémq ²1 Ö=@^
- M¡ýªVT¡öóÀ)à¼x@ L#À3 dò_Â8 ¿ÀЧÃ]qîׯ`/pY¡ÏðNÀ]Ùªi-%ð*ðølÕÚkºd°´ÇuxwÄó'À=`Lï/
û:§v< \¶è½¯ÂáÀvåàjá1PTûU2° )ðTóny¾F«SÑé6« }EmX¿2µª¦@c0ÚÛå|
-Ø¥ÃëÉpx ÏCå{QûzÒBhZmN
*ìqò+jnñå}@¤i Â*£b$ÐÁ¡t*QÏÓpÆ2ÊõQ
üqÞª]Îàèµl.º|
zG@Ro6Îõ¹«ö rÓlUUZ^Êq¾ÌózÜ^® §µ®Ès;;À-`_ÒÍ&Ìó$nV«|ÍþN3;r"®ºhIßýq°¸Ãí"¢ØfG8`F¶
½ÀàIEØ@¿£Ü~_¹1¼WÎóòÜNÑvà:#c£Ð½ÛK2^U;zÍ*
W°_`´è>i`xjfT
ð:sÅcÀ>à~¿7´6ô0®-6èØ¬ÊuMÅTÛ¹¥±KÎC¦¥ç^LÚð»kTN{N¹RÛ=åØÕMVú6üf6Ä^H<Ó%Íú]ä|©ÁÕÚÉ}ßÌ
0éBâYc$0¼ÞÛ3iô½¬ý3þå<Y©þÿßÊó+TB'>¶ IEND®B`--- theme/base/images/setting-category-background.png
+++ theme/base/images/setting-category-background.png
-PNG
-
-
IHDR o&å sRGB ®Î
é pHYs
×
×B(x tIMEÚ7
Â=< tEXtComment Created with GIMPW &IDAT×cd``øÏXþÿG322201`X± b~ âÈ8 IEND®B`--- theme/base/style/meego-handset-email.css
+++ theme/base/style/meego-handset-email.css
@@ -272,21 +272,3 @@
border-bottom: 2;
border-left: 2;
}
-
-/* email setting page */
-#settigCategory {
- preferred-size: 100% -1;
-
- margin-top: 0;
- margin-right: 0;
- margin-bottom: 10;
- margin-left: 0;
-
- padding-top: 3;
- padding-right: 3;
- padding-bottom: 3;
- padding-left: 3;
-
- background-image: setting-category-background 2 2 2 2;
- background-opacity: 0.5;
-}
--- translations
+++ translations
+(directory)
--- translations/translations.pro
+++ translations/translations.pro
+LANGUAGES = # We only create engineering English in the application package
+CATALOGNAME = meego-handset-email
+SOURCEDIR = ../src
+TRANSLATIONDIR = $$PWD
+include($$[QT_INSTALL_DATA]/mkspecs/features/meegotouch_defines.prf)
+include($$[QT_INSTALL_DATA]/mkspecs/features/meegotouch_translations.prf)
++++++ meego-handset-email.yaml
--- meego-handset-email.yaml
+++ meego-handset-email.yaml
@@ -1,6 +1,6 @@
Name: meego-handset-email
Summary: MeeGo Handset Email Client Application
-Version: 0.2.1
+Version: 0.2.2
Release: 1
Group: Applications/Internet
License: Apache License, Version 2.0
@@ -23,14 +23,14 @@
- messageserver
- meegotouch
- qtopiamail
- - qmfutil
-Provides:
- - meego-handset-email
+
Configure: none
UseAsNeeded: false
Builder: qmake
Files:
-- "%{_bindir}/meego-handset-email"
-- "%{_datadir}/dbus-1/services/meego-handset-email.service"
-- "%{_datadir}/applications/meego-handset-email.desktop"
+- "%{_bindir}/%{name}"
+- "%{_datadir}/dbus-1/services/email.service"
+- "%{_datadir}/applications/email.desktop"
+- "%{_datadir}/l10n/meegotouch/%{name}.qm"
+- "%{_datadir}/themes/base/meegotouch/%{name}"
More information about the MeeGo-commits
mailing list