messagingapp/msgui/msgapp/src/msglistview.cpp
changeset 56 f42d9a78f435
parent 48 4f501b74aeb1
child 62 fdbe8253b596
--- a/messagingapp/msgui/msgapp/src/msglistview.cpp	Wed Aug 18 00:46:12 2010 +0530
+++ b/messagingapp/msgui/msgapp/src/msglistview.cpp	Tue Aug 31 18:53:38 2010 +0530
@@ -55,6 +55,7 @@
 //Localized constants
 
 #define LOC_DIALOG_DELETE_CONVERSATION hbTrId("txt_messaging_dialog_delete_conversation")
+#define LOC_DIALOG_UNABLE_TO_DELETE_CONVERSATION hbTrId("txt_messaging_dialog_unable_to_delete_conversation")
 
 //itemspecific menu
 #define LOC_OPEN hbTrId("txt_common_menu_open")
@@ -225,10 +226,28 @@
 #ifdef _DEBUG_TRACES_
     qDebug() << "Inside MsgListView::deleteItem";
 #endif
-    //confirmation dialog.
-    HbMessageBox::question(LOC_DIALOG_DELETE_CONVERSATION,
-                           this,SLOT(onDialogDeleteMsg(HbAction*)),
-                           HbMessageBox::Delete | HbMessageBox::Cancel);    
+    QModelIndex index = mMsgList->currentIndex();
+    if (index.isValid())
+    {
+        int sendState = index.data(SendingState).toInt();
+        if(ConvergedMessage::Sending == sendState)
+        {
+            //confirmation dialog.
+            HbMessageBox::information(LOC_DIALOG_UNABLE_TO_DELETE_CONVERSATION,
+                0,0,
+                HbMessageBox::Ok);      
+        }
+        // not in sending state and hence can be deleted.
+        else
+        {
+            //confirmation dialog.
+            HbMessageBox::question(LOC_DIALOG_DELETE_CONVERSATION,
+                this,SLOT(onDialogDeleteMsg(HbAction*)),
+                HbMessageBox::Delete | HbMessageBox::Cancel);       
+        }
+
+    }
+    
 #ifdef _DEBUG_TRACES_	
     qDebug() << " Leaving MsgConversationView::deleteItem";
 #endif