calendarui/editors/src/CalenDescription.cpp
branchRCL_3
changeset 12 38571fd2a704
parent 5 42814f902fe6
child 67 1539a383d7b6
--- a/calendarui/editors/src/CalenDescription.cpp	Fri Feb 19 22:49:53 2010 +0200
+++ b/calendarui/editors/src/CalenDescription.cpp	Fri Mar 12 15:42:35 2010 +0200
@@ -192,12 +192,6 @@
     TBool processed = EFalse;
     switch( aCommandId )
         {
-        case ECalenCmdShowDescription:
-            {
-            ShowL();
-            processed = ETrue;
-            break;
-            }
         case ECalenCmdAddDescriptionNew:
             {
             AddNewL();
@@ -210,6 +204,28 @@
             processed = ETrue;
             break;
             }
+        case ECalenCmdAddDescription:
+            {
+            if(EntryHasDescription())
+                {
+                ShowL();
+                processed = ETrue;
+                }
+            else
+                {
+                processed = HandleAddDescriptionL();
+                }
+            
+            break;
+            }
+
+        case ECalenCmdShowDescription:
+            {
+
+            ShowL();
+            processed = ETrue;
+            break;
+            }
         case ECalenCmdRemoveDescription:
             {
             RemoveL();
@@ -583,4 +599,46 @@
     TRACE_EXIT_POINT;
     return desc;
     }
+
+// ----------------------------------------------------------------------------
+// CCalenDescription::HandleAddDescriptionL
+// Handles the command ECalenAddDescription
+// ----------------------------------------------------------------------------
+// 
+TBool CCalenDescription::HandleAddDescriptionL()
+    {
+    TRACE_ENTRY_POINT;
+    
+    TBool processed = EFalse;
+    TInt selectedIndex(0);
+    CAknListQueryDialog* dlg = new (ELeave) CAknListQueryDialog(&selectedIndex);
+    dlg->PrepareLC( R_DESCRIPTION_LIST_QUERY );
+    
+    if(dlg->RunLD())
+        {
+        switch(selectedIndex)
+            {
+            case 0:             //ECalenCmdAddDescriptionNew
+                {
+//                iCheck = 0;
+                AddNewL();
+                processed = ETrue;
+                break;
+                }
+            case 1:             //ECalenCmdAddDescriptionExisting
+                {
+//                iCheck = 1;
+                AddMemoL();
+                processed = ETrue;
+                break;
+                }
+            default:
+                break;
+            }
+        }
+    
+    TRACE_EXIT_POINT;
+    
+    return processed;   
+    }
 //  End of File