201017_1
authorhgs
Fri, 14 May 2010 03:48:25 +0300
changeset 38 b4618f2cf6ac
parent 23 2dc6caa42ec3
child 39 b0b89ca206b5
201017_1
emailuis/nmailui/src/nmmessagelistview.cpp
emailuis/nmframeworkadapter/src/nmfwaaddattachmentsoperation.cpp
emailuis/nmframeworkadapter/src/nmfwaremoveattachmentoperation.cpp
ipsservices/nmimapclientplugin/inc/nmimapclientplugin.h
ipsservices/nmimapclientplugin/src/nmimapclientplugin.cpp
ipsservices/nmpopclientplugin/inc/nmpopclientplugin.h
ipsservices/nmpopclientplugin/src/nmpopclientplugin.cpp
--- a/emailuis/nmailui/src/nmmessagelistview.cpp	Fri May 14 15:41:10 2010 +0300
+++ b/emailuis/nmailui/src/nmmessagelistview.cpp	Fri May 14 03:48:25 2010 +0300
@@ -597,12 +597,12 @@
             break;
         case NmFolderSent:
             {
-            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_sent_items"));
+            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_sent"));
             }
             break;
         case NmFolderDeleted:
             {
-            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_deleted_items"));
+            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_deleted"));
             }
             break;
         case NmFolderInbox:
--- a/emailuis/nmframeworkadapter/src/nmfwaaddattachmentsoperation.cpp	Fri May 14 15:41:10 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwaaddattachmentsoperation.cpp	Fri May 14 03:48:25 2010 +0300
@@ -60,7 +60,7 @@
 }
 
 /*!
-    Called after base object construction, runs the
+    Called after base object construction via timer event, runs the
     async operation.
     
     \sa NmOperation
@@ -109,10 +109,7 @@
         HBufC *fileName = NmConverter::qstringToHBufCLC(mFileList.first());
         mRequestId = mFSMessage->AddNewAttachmentL(*fileName, *this);
         CleanupStack::PopAndDestroy(fileName);   
-    } else {
-        completeOperation(NmNoError);
     }
-        
 }
 
 /*!
--- a/emailuis/nmframeworkadapter/src/nmfwaremoveattachmentoperation.cpp	Fri May 14 15:41:10 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwaremoveattachmentoperation.cpp	Fri May 14 03:48:25 2010 +0300
@@ -53,7 +53,7 @@
 }
 
 /*!
-    Called after base object construction, runs the
+    Called after base object construction via timer event, runs the
     async operation.
     
     \sa NmOperation
@@ -83,22 +83,16 @@
         
     // Search through all attachments from message and remove attachment
     // if message part match.
-    bool found(false);
     for (int i=0; i<attachments.Count(); ++i) {
         if (mAttachmentPartId.id() == attachments[i]->GetPartId().GetNmId().id()) {
             mRequestId = msg->RemoveChildPartL(attachments[i]->GetPartId(),*this);
-            found = true;
             break;
         }
     }
-    attachments.ResetAndDestroy();   
+    attachments.ResetAndDestroy();
+    
     delete msg;
     msg = NULL;
-    // if attachment is not found, request to plugin is not made
-    // and the operation should be completed here
-    if (!found) {
-        completeOperation(NmNotFoundError);
-    }
 }
 
 /*!
--- a/ipsservices/nmimapclientplugin/inc/nmimapclientplugin.h	Fri May 14 15:41:10 2010 +0300
+++ b/ipsservices/nmimapclientplugin/inc/nmimapclientplugin.h	Fri May 14 03:48:25 2010 +0300
@@ -21,7 +21,7 @@
 #include "nmbaseclientplugin.h"
 #include "nmuiextensioninterface.h"
 #include "nmuienginedef.h"
-#include "nmactionrequest.h"
+#include "nmactionrequest.h" 
 
 class NmUiEngine;
 class NmSettingsViewLauncher;
@@ -47,11 +47,12 @@
     void switchToStandardFolderOutbox();
     void switchToStandardFolderDrafts();
     void switchToStandardFolderSent();
-
+    
 protected:
     virtual quint32 pluginId();
-
+    
 private:
+    NmUiEngine *mUiEngine; // Singleton instance
     NmActionRequest mListOptionsMenuRequest;
     NmSettingsViewLauncher *mSettingsViewLauncher; // owned
 };
--- a/ipsservices/nmimapclientplugin/src/nmimapclientplugin.cpp	Fri May 14 15:41:10 2010 +0300
+++ b/ipsservices/nmimapclientplugin/src/nmimapclientplugin.cpp	Fri May 14 03:48:25 2010 +0300
@@ -33,9 +33,11 @@
     Constructs a new NmImapClientPlugin.
  */
 NmImapClientPlugin::NmImapClientPlugin()
-: mListOptionsMenuRequest(NULL),
+: mUiEngine(NULL),
+mListOptionsMenuRequest(NULL),
 mSettingsViewLauncher(NULL)
 {
+    mUiEngine = NmUiEngine::instance();
 }
 
 /*!
@@ -108,7 +110,7 @@
             // Set active action
             NmFolderType curFolderType(NmFolderOther);
             if (mUiEngine) {
-                curFolderType = mUiEngine->folderTypeById(request.mailboxId(),request.folderId());
+            curFolderType = mUiEngine->folderTypeById(request.mailboxId(),request.folderId());
             }
             switch (curFolderType){
                 case NmFolderInbox: {
--- a/ipsservices/nmpopclientplugin/inc/nmpopclientplugin.h	Fri May 14 15:41:10 2010 +0300
+++ b/ipsservices/nmpopclientplugin/inc/nmpopclientplugin.h	Fri May 14 03:48:25 2010 +0300
@@ -21,7 +21,7 @@
 #include "nmbaseclientplugin.h"
 #include "nmuiextensioninterface.h"
 #include "nmuienginedef.h"
-#include "nmactionrequest.h"
+#include "nmactionrequest.h" 
 
 class NmUiEngine;
 class NmSettingsViewLauncher;
@@ -47,11 +47,12 @@
     void switchToStandardFolderOutbox();
     void switchToStandardFolderDrafts();
     void switchToStandardFolderSent();
-
+        
 protected:
     virtual quint32 pluginId();
 
 private:
+    NmUiEngine *mUiEngine; // Singleton instance
     NmActionRequest mListOptionsMenuRequest;
     NmSettingsViewLauncher *mSettingsViewLauncher; // owned
 };
--- a/ipsservices/nmpopclientplugin/src/nmpopclientplugin.cpp	Fri May 14 15:41:10 2010 +0300
+++ b/ipsservices/nmpopclientplugin/src/nmpopclientplugin.cpp	Fri May 14 03:48:25 2010 +0300
@@ -34,9 +34,11 @@
  */
 NmPopClientPlugin::NmPopClientPlugin()
 : mSettingsViewLauncher(NULL),
+mUiEngine(NULL),
 mListOptionsMenuRequest(NULL)
 {
     NMLOG("NmPopClientPlugin::NmPopClientPlugin()-->");
+    mUiEngine = NmUiEngine::instance();
     NMLOG("<--NmPopClientPlugin::NmPopClientPlugin()");
 }
 
@@ -74,24 +76,24 @@
         NMLOG(QString("request.mailboxId().pluginId32()=%1").arg(request.mailboxId().pluginId32()));
         return;
     }
-
+    
     // Get the NmBaseClientPlugin implementation of the UI actions.
     NmBaseClientPlugin::getActions(request, actionList);
-
+    
     // Append POP plugin specific actions
     switch (request.menuType()) {
     case NmActionOptionsMenu:
-        {
+        {      
         if (request.contextView()==NmActionContextViewMessageList){
             mListOptionsMenuRequest = request;
             // Create sub-menu for standard folders selection
             HbMenu *standardFolders = new HbMenu();
-            NmAction *inboxAction = new NmAction(0);
+            NmAction *inboxAction = new NmAction(0);            
             inboxAction->setObjectName("popclientplugin_folders_inbox");
             inboxAction->setText(hbTrId("txt_mail_opt_folders_inbox"));
             inboxAction->setCheckable(true);
             connect(inboxAction, SIGNAL(triggered()), this, SLOT(switchToStandardFolderInbox()));
-            standardFolders->addAction(inboxAction);
+            standardFolders->addAction(inboxAction);           
             NmAction *outboxAction = new NmAction(0);
             outboxAction->setObjectName("popclientplugin_folders_outbox");
             outboxAction->setText(hbTrId("txt_mail_opt_folders_outbox"));
@@ -109,12 +111,12 @@
             sentAction->setText(hbTrId("txt_mail_opt_folders_sent"));
             sentAction->setCheckable(true);
             connect(sentAction, SIGNAL(triggered()), this, SLOT(switchToStandardFolderSent()));
-            standardFolders->addAction(sentAction);
+            standardFolders->addAction(sentAction);          
             // Set active action
             NmFolderType curFolderType(NmFolderOther);
             if (mUiEngine) {
-                curFolderType = mUiEngine->folderTypeById(request.mailboxId(),request.folderId());
-            }
+            curFolderType = mUiEngine->folderTypeById(request.mailboxId(),request.folderId());   
+            } 
             switch (curFolderType){
                 case NmFolderInbox: {
                     inboxAction->setChecked(true);
@@ -123,7 +125,7 @@
                 case NmFolderOutbox: {
                     outboxAction->setChecked(true);
                     break;
-                }
+                } 
                 case NmFolderDrafts: {
                     draftsAction->setChecked(true);
                     break;
@@ -133,20 +135,20 @@
                     break;
                 }
             }
-
+            
             // Add folders selection with sub-menu
-            NmAction *foldersAction = new NmAction(0);
+            NmAction *foldersAction = new NmAction(0); 
             foldersAction->setObjectName("baseclientplugin_folders");
             foldersAction->setText(hbTrId("txt_mail_opt_folders"));
             foldersAction->setMenu(standardFolders);
-            actionList.append(foldersAction);
+            actionList.append(foldersAction);        
             }
         }
         break;
     default:
         break;
-    }
-
+    }     
+    
     NMLOG("<--NmPopClientPlugin::getActions()");
 }
 
@@ -184,12 +186,12 @@
 
         mSettingsViewLauncher->launchSettingsView(id, mailbox->name());
     }
-
+ 
     NMLOG("<--NmPopClientPlugin::settings()");
 }
 
 /*!
-    Private slot to switch message list contents
+    Private slot to switch message list contents 
     to standard folder inbox
 */
 void NmPopClientPlugin::switchToStandardFolderInbox()
@@ -198,13 +200,13 @@
         NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderInbox);
         NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
                                   NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
-                                  folderId);
+                                  folderId); 
         mListOptionsMenuRequest.observer()->handleActionCommand(response);
     }
 }
 
 /*!
-    Private slot to switch message list contents
+    Private slot to switch message list contents 
     to standard folder outbox
 */
 void NmPopClientPlugin::switchToStandardFolderOutbox()
@@ -213,13 +215,13 @@
         NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderOutbox);
         NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
                                   NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
-                                  folderId);
+                                  folderId); 
         mListOptionsMenuRequest.observer()->handleActionCommand(response);
-    }
+    }   
 }
 
 /*!
-    Private slot to switch message list contents
+    Private slot to switch message list contents 
     to standard folder drafts
 */
 void NmPopClientPlugin::switchToStandardFolderDrafts()
@@ -228,13 +230,13 @@
         NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderDrafts);
         NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
                                   NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
-                                  folderId);
+                                  folderId); 
         mListOptionsMenuRequest.observer()->handleActionCommand(response);
     }
 }
 
 /*!
-    Private slot to switch message list contents
+    Private slot to switch message list contents 
     to standard folder sent
 */
 void NmPopClientPlugin::switchToStandardFolderSent()
@@ -243,7 +245,7 @@
         NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderSent);
         NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
                                   NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
-                                  folderId);
+                                  folderId); 
         mListOptionsMenuRequest.observer()->handleActionCommand(response);
     }
 }