Revision: 201011 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 21:29:10 +0300
branchRCL_3
changeset 13 1984aceb8774
parent 11 0f07cd1b5772
child 14 21239b3bcd78
Revision: 201011 Kit: 201013
alarmengines/missedalarmstore/src/missedalarmstore.cpp
calendarui/application/data/Calendar.rss
calendarui/application/group/Calendar.mmp
calendarui/controller/data/calencommonui.rss
calendarui/controller/inc/calenmultidbeditor.h
calendarui/controller/inc/calenmultipledbui.h
calendarui/controller/src/calenalarmmanager.cpp
calendarui/controller/src/calencmdlinelauncher.cpp
calendarui/controller/src/calenmapstate.cpp
calendarui/controller/src/calenmultidbeditor.cpp
calendarui/controller/src/calenmultipledbui.cpp
calendarui/controller/src/calennotifier.cpp
calendarui/controller/src/calenpopulationstate.cpp
calendarui/controller/src/calenstate.cpp
calendarui/controller/src/calenviewmanager.cpp
calendarui/editors/data/CalenDefaultEditorsData.rss
calendarui/editors/src/calendbfield.cpp
calendarui/editors/src/calenunifiededitor.cpp
calendarui/globaldata/inc/calencontextimpl.h
calendarui/globaldata/src/calencontextimpl.cpp
calendarui/globaldata/src/calenglobaldata.cpp
calendarui/help/data/xhtml.zip
calendarui/loc/calendar.loc
calendarui/organizerplugin/aiagendapluginengine/inc/AIAgendaPluginEngineImpl.h
calendarui/organizerplugin/aiagendapluginengine/src/AIAgendaPluginEngineImpl.cpp
calendarui/organizerplugin/aiagendapluginengine/src/CalenAsyncCommands.cpp
calendarui/server/CalenSvr/src/CalenServer.cpp
calendarui/server/CalenSvr/src/calensvrmissedalarmmanager.cpp
calendarui/server/CalenSvrClient/src/CalSvrClient.cpp
calendarui/views/group/calenviews.mmp
calendarui/views/inc/calenmissedalarmscontainer.h
calendarui/views/inc/calenmissedalarmsview.h
calendarui/views/src/calenmissedalarmscontainer.cpp
calendarui/views/src/calenmissedalarmsview.cpp
calendarui/views/src/calenmissedeventcontainer.cpp
calendarui/views/src/calenmissedeventview.cpp
calendarui/views/src/calentodocontainer.cpp
clock2/clockui/adtupdater/inc/adtupdatercontainer.h
clock2/clockui/adtupdater/src/adtupdatercontainer.cpp
clock2/clockui/utilities/data/tzdb.dbz
organizer_plat/calendar_custamization_api/inc/calencontext.h
pimappservices/calendar/client/src/calclient.cpp
pimappservices/calendar/server/src/agsasyncdelete.cpp
pimappservices/calendar/server/src/agsentrymanager.cpp
--- a/alarmengines/missedalarmstore/src/missedalarmstore.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/alarmengines/missedalarmstore/src/missedalarmstore.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -243,8 +243,8 @@
 				    {
 	                DeleteEntryAndReArrangeL( key );
 	                foundIds.Reset();
-				    }
-				return;
+	                return;
+				    }				
 				}
 			}
 	    }
--- a/calendarui/application/data/Calendar.rss	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/application/data/Calendar.rss	Wed Mar 31 21:29:10 2010 +0300
@@ -2173,11 +2173,15 @@
             {
             command = ECalenMissedEventView;
             txt = qtn_cale_opt_open;
+            //single click
+            flags = EEikMenuItemAction;
             },
 	    MENU_ITEM
             {
             command = ECalenCmdClear;
             txt = qtn_cale_mav_opt_clear;
+            //Single click 
+            flags = EEikMenuItemSpecific;
             },
 	    MENU_ITEM
             {
@@ -2376,7 +2380,6 @@
         |   EEikDialogFlagFillAppClientRect 
         |   EEikDialogFlagButtonsRight 
         |   EEikDialogFlagCbaButtons
-        |   EEikDialogFlagWait 
         |   EEikDialogFlagNoTitleBar
         |   EEikDialogFlagDontEatUpDownEvents
         |   EEikDialogFlagNotifyEsc;
@@ -2534,7 +2537,7 @@
 RESOURCE TBUF r_qtn_calendareditor_note_db_conflict_delete
     {
     //TODO need to raise loc CR
-    buf = "Calendar conflict.  This calendar has been deleted by another application.";
+    buf = qtn_cale_note_db_conflict;
     }
 
 // ---------------------------------------------------------
@@ -2547,7 +2550,7 @@
 RESOURCE TBUF r_qtn_calendareditor_note_db_conflict_update
     {
     //TODO need to raise loc CR
-    buf = "Calendar conflict.  This calendar has been updated by another application.";
+    buf = qtn_cale_note_db_modified;
     }
     
 RESOURCE MENU_BAR r_calen_multidb_menubar
--- a/calendarui/application/group/Calendar.mmp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/application/group/Calendar.mmp	Wed Mar 31 21:29:10 2010 +0300
@@ -91,7 +91,7 @@
 //   NetworkServices // For sending vCalendars?
 //   ProtServ // For connecting Agenda Server? 
 //   DRM // Calendar alarm tones are DRM protected 
-CAPABILITY      CAP_APPLICATION
+CAPABILITY      CAP_APPLICATION NetworkControl
 
 VENDORID        VID_DEFAULT
 
--- a/calendarui/controller/data/calencommonui.rss	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/data/calencommonui.rss	Wed Mar 31 21:29:10 2010 +0300
@@ -934,7 +934,7 @@
         MENU_ITEM
             {
             command = ECalenViewAttachmentCmdSave;
-            txt = qtn_cale_opt_save_attachment;
+           txt = qtn_cale_stylus_popup_save;
              //Single click
             flags = EEikMenuItemSpecific;
             },
@@ -946,7 +946,7 @@
         MENU_ITEM
             {
             command = ECalenViewAttachmentCmdRemove;
-            txt = qtn_cale_opt_remove_attachment;
+            txt = qtn_cale_stylus_popup_remove_attachment;
              //Single click 
             flags = EEikMenuItemSpecific;
             },
@@ -1113,5 +1113,47 @@
 RESOURCE TBUF r_qtn_cale_tb_custom_view 
     {
     buf = qtn_cale_opt_open;
-    }    
+    }  
+
+// ---------------------------------------------------------
+//      r_calen_multidb_editor_color_grid_dlg
+//      Color selection dialog with customized "none" text.
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_calen_multidb_editor_color_grid_dlg
+    {
+    flags = EEikDialogFlagNotifyEsc | 
+            EEikDialogFlagCbaButtons | EEikDialogFlagNoDrag | 
+            EEikDialogFlagNoBorder;
+    buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EColourGridPopup;
+            control = AVKON_HEADING
+                {
+                label = qtn_select_colour_prompt;
+                headinglayout = R_AVKON_LIST_HEADING_PANE;
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtColourSelectionGridDialog;
+            id   = ECtrlGridType;
+            control = AVKON_COLOUR_SELECTION_GRID
+                {
+                nonetext = qtn_chat_set_colour_default;
+                gridcontrol = GRID
+                    {
+                    style = R_COLOUR_SEL_GRID_STYLE_NONE;
+                    flags = EEikDlgItemTakesEnterKey;
+                    height  = 4;
+                    width = 4 ;
+                    };
+                };
+            }
+        };
+    }
 // End of File
--- a/calendarui/controller/inc/calenmultidbeditor.h	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/inc/calenmultidbeditor.h	Wed Mar 31 21:29:10 2010 +0300
@@ -23,11 +23,15 @@
 //  INCLUDES
 #include <AknForm.h>
 #include <gdi.h>
+#include <calennotificationhandler.h>
 
 class CalenAppUi;
 class CAknNavigationControlContainer;
 class CCalenController;
 class CCalCalendarInfo;
+class CCalenMultipleDbUi;
+class CCalenColourSelectionGrid;
+
 
 /**
 * Class defining Map icon picture, derived from CPicture
@@ -104,8 +108,9 @@
     /**
      * Two-phased constructor.
      */
-    static CCalenMultiDBEditor* NewL( CCalCalendarInfo& aCalendarInfo,
-            CCalenController& aController, TBool aEditFlag);
+    static CCalenMultiDBEditor* NewL(CCalenMultipleDbUi& aMultipleDbui,
+                                    CCalCalendarInfo& aCalendarInfo,
+                                    CCalenController& aController, TBool aEditFlag);
 
     /**
      * From Base class.
@@ -124,8 +129,9 @@
     /**
      * C++ constructor.
      */
-    CCalenMultiDBEditor( CCalCalendarInfo&  aCalendarInfo,
-            CCalenController& aController, TBool aEditFlag);
+    CCalenMultiDBEditor(CCalenMultipleDbUi& aMultipleDbui,
+                        CCalCalendarInfo&  aCalendarInfo,
+                        CCalenController& aController, TBool aEditFlag);
 
     
 protected:  // Functions from base classes
@@ -159,9 +165,12 @@
      */
 	void ReadDataFromFormL( TBool aContinueOnError );
 	
-	
+	void HandleDialogPageEventL( TInt aEventID );
 	
-	void HandleDialogPageEventL( TInt aEventID );
+	/*
+	 * from CAknDialog
+	 */
+	void FocusChanged(TDrawNow aDrawNow);
 	
 private:
 
@@ -234,6 +243,11 @@
 	*/
 	void SetVisiblityFieldL( TBool aStatusVal );
 	
+	/*
+	 * Load colors for grid
+	 */
+	void LoadColorsL();
+	
 	/**
 	* setup title pane for the status pane
 	* @return void 
@@ -271,13 +285,18 @@
     CCalenController& iController;
     TInt iColVal;		// Color id
     TBool iCalendarStatus;
-    TRgb iColors;
     CDbColorPicture* iPicture;
     TBool iEditFlag;
     CAknNavigationControlContainer*   iNaviContainer;
     //Sync field, EFalse then Sync off else Sync On
     TBool                             iSyncStatus;
     TCalendarConflicts                iConflict;
+    
+    CCalenMultipleDbUi&               iMultipleDbUi;
+	 
+	CArrayFixFlat<TRgb>*              iRgbColors;
+    TBool                             iNoneChoosen;
+    TRgb                              iChoosenColor;
     };
 
 #endif // CALENMULTIDBEDITOR_H
--- a/calendarui/controller/inc/calenmultipledbui.h	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/inc/calenmultipledbui.h	Wed Mar 31 21:29:10 2010 +0300
@@ -248,6 +248,8 @@
      * Async exit for the dialog
      */
     static TInt DoAsyncExit(TAny* aPtr);
+    
+    static TInt DoAsyncDeleteTemL(TAny* aPtr);
 
 
     /*
@@ -292,7 +294,21 @@
     *                   may be obtained by accessing the list box itself.
     */
     void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-
+    
+public:
+    
+    /*
+     * Updates after add/edit had been performed.
+     * Called from editor before exiting the dialog.
+     * @param aItemAdded ETure if add else edit.
+     */
+    void UpdateOnAddOrEditL(TBool aItemAdded);
+    
+    /*
+     * Exit the dialog;
+     */
+    void ExitDialogL();
+    
 private:
     CCalenMultipleDbListbox* iListBox;
     CAknsBasicBackgroundControlContext* iBgContext; //Owns
@@ -300,16 +316,19 @@
     CCalenController& iController;
     CDesCArrayFlat* iDesArray; //Owns
     TRect iRect;
-    TBool iFirstTap;
-    TBool iDialogLaunched;
     RArray<MCalenServices::TCalenIcons> iIconIndices;
     CAknIconArray* iIconList;
     RArray<TInt32> iColorUidArray;
     CAsyncCallBack* iAsyncExit;
+    CAsyncCallBack* iAsyncDeletequery;
     TInt iAsyncExitCmd;
     CCalenMultiDBEditor* iDbEditor;//Not not owned
     TBool iConflictOccured;
     TBool iIsDbEditorOpen ; 
+    
+    CCalCalendarInfo* iCalendarInfoNew;
+    CCalCalendarInfo* iCalendarInfoOriginal;
+    CCalCalendarInfo* iCalendarInfoEdited;
     };
 
 
--- a/calendarui/controller/src/calenalarmmanager.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/src/calenalarmmanager.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -178,6 +178,7 @@
             break;
         case ECalenMissedAlarmsViewFromIdle:
             {
+            RemoveAllViewedEventsL();
             iViewManager.StartActiveStepL();
             }
             break;
@@ -572,11 +573,8 @@
     TInt missedAlarmEntryUid = context.InstanceId().iEntryLocalUid;
     TCalCollectionId colid = context.InstanceId().iColId;
     // clear missed alarm from cenrep
-    if( EFalse == ClearOneMissedAlarmL( missedAlarmEntryUid, colid ) )
-        {
-        TRACE_EXIT_POINT;
-        return;
-        }
+    
+    ClearOneMissedAlarmL( missedAlarmEntryUid, colid );
     for(TInt index = 0;index < iMissedAlarmList.Count();index++)
         {
         if( ( missedAlarmEntryUid == iMissedAlarmList[index].iEntryLocalUid ) &&
@@ -677,8 +675,9 @@
     TCalenInstanceId id = TCalenInstanceId::CreateL( *entry, inscaltime );
     id.iColId = session.CollectionIdL();
     context.SetInstanceIdL( id, context.ViewId() ); 
-		CleanupStack::PopAndDestroy( entry );
-    iMissedAlarmStore->RemoveL(*aMissedAlarmArray[0]);
+	CleanupStack::PopAndDestroy( entry );
+	iMissedAlarmList.Remove(0); //Clear the alarm list
+	iMissedAlarmStore->RemoveL(*aMissedAlarmArray[0]);
     CleanupStack::PopAndDestroy(); // aMissedAlarmArray
     
     iViewManager.StartActiveStepL();
@@ -862,10 +861,12 @@
     // get the context
     MCalenContext &context = iController.Services().Context();
     TInt missedAlarmEntryUid = context.InstanceId().iEntryLocalUid;
+    TCalCollectionId colid = context.InstanceId().iColId;
     
     for(TInt index = 0;index < iMissedAlarmList.Count();index++)
         {
-        if(missedAlarmEntryUid == iMissedAlarmList[index].iEntryLocalUid )
+        if((missedAlarmEntryUid == iMissedAlarmList[index].iEntryLocalUid ) && 
+            (colid == iMissedAlarmList[index].iColId))
             {
             // mark the missed alarm event as viewed 
             iMissedAlarmList[index].iInstanceViewed = 1;
@@ -889,6 +890,7 @@
         {
         if(iMissedAlarmList[index].iInstanceViewed)
             {
+            ClearOneMissedAlarmL( iMissedAlarmList[index].iEntryLocalUid, iMissedAlarmList[index].iColId );
             iMissedAlarmList.Remove(index);
             }
         else
@@ -987,8 +989,7 @@
     TRACE_ENTRY_POINT;
     // get the context
     MCalenContext &context = iController.Services().Context();
-    TInt deletedEntryUid = context.InstanceId().iEntryLocalUid;
-    
+    TInt deletedEntryUid = context.InstanceId().iEntryLocalUid;    
     TCalCollectionId colidFromContext = context.InstanceId().iColId;
     
     if( EFalse == ClearOneMissedAlarmL( deletedEntryUid, colidFromContext ) )
--- a/calendarui/controller/src/calencmdlinelauncher.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/src/calencmdlinelauncher.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -27,6 +27,7 @@
 #include <caleninstanceid.h>            // TCalenInstanceId
 #include <calenactionuiutils.h>
 #include <aknappui.h>
+#include <AknDlgShut.h> 
 #include "calenviewmanager.h"
 #include "calencmdlinelauncher.h"
 #include "calencontroller.h"            // CCalenController
@@ -146,7 +147,7 @@
         // using the same 'try and save whatever we can' logic that is used on a forced close
         // and then open the new editor.  We also have to prevent the focus state being updated
         // and highlighting the old entry in the day view.
-        while( AppUi().IsDisplayingDialog() )
+        if( AppUi().IsDisplayingDialog() )
             {
             iIsExitOnDlgClose = EFalse;
             // Tell the editui that whatever it was doing, it should not alter
@@ -155,31 +156,31 @@
 
             // Send a key event to the currently open dialog (viewer / editor)
             // to dismiss it
-            TKeyEvent key;
+            /*TKeyEvent key;
             key.iRepeats = 0;
             key.iCode = EKeyEscape;
             key.iModifiers = 0;
-            CCoeEnv::Static()->SimulateKeyEventL( key, EEventKey );
-            
+            CCoeEnv::Static()->SimulateKeyEventL( key, EEventKey );*/
+            AknDialogShutter::ShutDialogsL( *CEikonEnv::Static() );
             // Break is added to close the messaging editor as the messagng editor is not 
             // consuming the escape key event.
-            if( iGlobalData->CalenSendL().IsMessagingEditorOpen() )
+            /*if( iGlobalData->CalenSendL().IsMessagingEditorOpen() )
                 {
             break;
-                }
+                }*/
                  
             }
 
         // Interpret 8bit data as 16bit unicode data
         //lint -e{826} Disable the lint warning of the pointer sizes being different
-        const TText* buf = reinterpret_cast<const TText*>(aTail.Ptr());
+        const TText* buf = reinterpret_cast<const TText*> (aTail.Ptr());
         TPtrC ptr(buf, aTail.Length() / (TInt) sizeof(TText));
 
         // create cmd line parser
         CCalenCmdLineParser* parser = CCalenCmdLineParser::NewL();
-        CleanupStack::PushL( parser );
+        CleanupStack::PushL(parser);
         // parse parameters
-        parser->ParseCommandLineL( ptr );
+        parser->ParseCommandLineL(ptr);
         iCmdParameters = parser->CommandLineParameters();
         CleanupStack::PopAndDestroy(); // parser
         }
--- a/calendarui/controller/src/calenmapstate.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/src/calenmapstate.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -95,24 +95,8 @@
     switch( cmd )
     {
     case ECalenFasterAppExit:
-		{
-		// Issue map launch cancel notification
-		iController.BroadcastNotification(ECalenNotifyCancelMapLaunch);
-        SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState );
-        ActivateCurrentStateL(aStateMachine);
-        cmdUsed = ETrue;
-        break;
-   		}
-    case ECalenMissedEventViewFromIdle:
-        {
-        // Issue map launch cancel notification
-        iController.BroadcastNotification(ECalenNotifyCancelMapLaunch);
-        SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState );
-        ActivateCurrentStateL(aStateMachine);
-        cmdUsed = ETrue;
-        break;
-        }
-        
+    case ECalenDayView:    
+    case ECalenMissedEventViewFromIdle: 
     case ECalenEventViewFromAlarm:
     case ECalenEventViewFromAlarmStopOnly:
         {
--- a/calendarui/controller/src/calenmultidbeditor.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/src/calenmultidbeditor.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -29,12 +29,14 @@
 #include <hlplch.h>
 #include <calcalendarinfo.h>
 #include <Calendar.rsg>
+#include <calencommonui.rsg>
 
 #include "calenmultidbeditor.h"
 #include "calendarui_debug.h"
 #include "calendar.hrh"
 #include "calentitlepane.h"
 #include "calencontroller.h"
+#include "calenmultipledbui.h"
 
 // Constants.
 const TUint16 KIllegalChars[] = {
@@ -55,7 +57,6 @@
     0, // Array terminator
 };
 const TInt KCalenMaxELAFTextEditorLength(256);
-const TInt KCalenColorPalletteStartColor(35);
 const TInt KOne( 1 );
 const TInt KBuffLength ( 16 );
 const TInt KTen( 10 );
@@ -71,16 +72,17 @@
 // Two-phased constructor.
 // ----------------------------------------------------------------------------
 // 
-CCalenMultiDBEditor* CCalenMultiDBEditor::NewL( CCalCalendarInfo& aCalendarInfo, 
-                                 CCalenController& aController, TBool aEditFlag)
+CCalenMultiDBEditor* CCalenMultiDBEditor::NewL(
+        CCalenMultipleDbUi& aMultipleDbui, CCalCalendarInfo& aCalendarInfo,
+        CCalenController& aController, TBool aEditFlag)
     {
     TRACE_ENTRY_POINT;
 
-    CCalenMultiDBEditor* self = 
-      new(ELeave) CCalenMultiDBEditor( aCalendarInfo, aController, aEditFlag);
-    CleanupStack::PushL( self );
+    CCalenMultiDBEditor* self = new (ELeave) CCalenMultiDBEditor(
+            aMultipleDbui, aCalendarInfo, aController, aEditFlag);
+    CleanupStack::PushL(self);
     self->ConstructL();
-    CleanupStack::Pop( self );
+    CleanupStack::Pop(self);
 
     TRACE_EXIT_POINT;
     return self;
@@ -93,7 +95,14 @@
 //
 CCalenMultiDBEditor::~CCalenMultiDBEditor()
     {
-    TRACE_ENTRY_POINT;    
+    TRACE_ENTRY_POINT; 
+    
+    if(iRgbColors)
+        {
+        iRgbColors->Reset();
+        delete iRgbColors;
+        iRgbColors = NULL;
+        }
     
     if(iCalendarName)
         {
@@ -116,10 +125,12 @@
 // (other items were commented in a header).
 // -----------------------------------------------------------------------------
 //
-CCalenMultiDBEditor::CCalenMultiDBEditor( CCalCalendarInfo&  aCalendarInfo,
-        CCalenController& aController, TBool aEditFlag)
-	:iCalendarInfo( aCalendarInfo ) , iController( aController ),
-	iEditFlag( aEditFlag )
+CCalenMultiDBEditor::CCalenMultiDBEditor(CCalenMultipleDbUi& aMultipleDbui,
+        CCalCalendarInfo& aCalendarInfo, CCalenController& aController,
+        TBool aEditFlag) :
+            iCalendarInfo(aCalendarInfo), iController(
+            aController), iEditFlag(aEditFlag),
+			iMultipleDbUi(aMultipleDbui)
     {
     TRACE_ENTRY_POINT;
     
@@ -146,10 +157,10 @@
         
     //Initial color value
     iColVal = iCalendarInfo.Color().Value();  
-    iColors = TRgb(iColVal);
+    iChoosenColor = TRgb(iColVal);
         
     iPicture = new( ELeave )CDbColorPicture( TSize( 0, 0 ) );
-    iPicture->SetRgbColorsL(iColors);
+    iPicture->SetRgbColorsL(iChoosenColor);
     
     //set sync value
     // ESyncStatus
@@ -161,10 +172,51 @@
         {
         iSyncStatus = pkgSyncStatus();
         }
+    
+    LoadColorsL();
+    
     TRACE_EXIT_POINT;
     }
 
 // -----------------------------------------------------------------------------
+// CCalenMultiDBEditor::LoadColorsL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CCalenMultiDBEditor::LoadColorsL()
+    {
+    TRACE_ENTRY_POINT
+    
+    if(iRgbColors)
+        {
+        iRgbColors->Reset();
+        delete iRgbColors;
+        iRgbColors = NULL;
+        }
+    
+    iRgbColors = new(ELeave) CArrayFixFlat<TRgb>(2);
+    
+    iRgbColors->AppendL(KRgbRed);
+    iRgbColors->AppendL(KRgbDarkGray);
+    iRgbColors->AppendL(KRgbDarkRed);
+    iRgbColors->AppendL(KRgbDarkGreen);
+    iRgbColors->AppendL(KRgbDarkYellow);
+    iRgbColors->AppendL(KRgbDarkBlue);
+    iRgbColors->AppendL(KRgbDarkMagenta);
+    iRgbColors->AppendL(KRgbDarkCyan);
+    iRgbColors->AppendL(KRgbBlack);
+    iRgbColors->AppendL(KRgbGreen);
+    iRgbColors->AppendL(KRgbYellow);
+    iRgbColors->AppendL(KRgbBlue);
+    iRgbColors->AppendL(KRgbMagenta);
+    iRgbColors->AppendL(KRgbCyan);
+    iRgbColors->AppendL(KRgbGray);
+    iRgbColors->AppendL(KRgbWhite);
+    
+    TRACE_EXIT_POINT
+    }
+
+// -----------------------------------------------------------------------------
 // CCalenMultiDBEditor::ProcessCommandL
 // Process commands from the user.
 // (other items were commented in a header).
@@ -218,8 +270,6 @@
 		    else if ( ECalenMultiDbColor == IdOfFocusControl() )
 		        {
 		        GetColorL();
-		        iColors = TRgb(iColVal);
-		        GetLineByLineAndPageIndex(1,0)->DrawNow();
 		        }
 		    }
 		    break; 
@@ -227,8 +277,6 @@
 		case EAknSoftkeyOpen:
 		    {
 		    GetColorL();
-		    iColors = TRgb(iColVal);
-		    GetLineByLineAndPageIndex(1,0)->DrawNow(); 
 		    } 
 		    break;
 			
@@ -255,8 +303,6 @@
        case ECalenMultiDbColor:
           {
           GetColorL();
-          iColors = TRgb(iColVal);
-          GetLineByLineAndPageIndex(1,0)->DrawNow(); 
           }
           break;
 	  default:
@@ -314,8 +360,6 @@
         case EAknSoftkeyOpen:
             {
             GetColorL();
-            iColors = TRgb(iColVal);
-            GetLineByLineAndPageIndex(1,0)->DrawNow(); 
             } 
             break;
             
@@ -354,8 +398,6 @@
             else if ( ECalenMultiDbColor == IdOfFocusControl() )
                 {
                 GetColorL();
-                iColors = TRgb(iColVal);
-                GetLineByLineAndPageIndex(1,0)->DrawNow(); 
                 }
             }
             break;    
@@ -363,14 +405,22 @@
         case EAknSoftkeyDone:
             {
             isExitForm = SaveNoteL(aButtonId);
+            if(isExitForm)
+                {
+                iMultipleDbUi.UpdateOnAddOrEditL(!iEditFlag);
+                }
             }
             break;
         case EAknSoftkeyExit:    
         case EAknCmdExit:
             {
-            SaveNoteL(aButtonId); 
-            isExitForm = ETrue;
-            }
+            isExitForm  = SaveNoteL(aButtonId); 
+            if(isExitForm)
+                {
+                iMultipleDbUi.UpdateOnAddOrEditL(!iEditFlag);
+                }
+             iMultipleDbUi.ExitDialogL();           
+			 }
             break;
         case EAknSoftkeyQuit:
             {
@@ -577,55 +627,33 @@
 void CCalenMultiDBEditor::GetColorL()
     {  
     TRACE_ENTRY_POINT;
-      
-    TBool retVal = EFalse;
-    
-    // Array for TRgb colour values
-    CArrayFixFlat<TRgb>* colors = new( ELeave ) CArrayFixFlat<TRgb>( 8 );
-    CleanupStack::PushL( colors );
-    
-    // array of colors.
-    colors->AppendL(KRgbRed);
-    colors->AppendL(KRgbDarkGray);
-    colors->AppendL(KRgbDarkRed);
-    colors->AppendL(KRgbDarkGreen);
-    colors->AppendL(KRgbDarkYellow);
-    colors->AppendL(KRgbDarkBlue);
-    colors->AppendL(KRgbDarkMagenta);
-    colors->AppendL(KRgbDarkCyan);
-    colors->AppendL(KRgbBlack);
-    colors->AppendL(KRgbGreen);
-    colors->AppendL(KRgbYellow);
-    colors->AppendL(KRgbBlue);
-    colors->AppendL(KRgbMagenta);
-    colors->AppendL(KRgbCyan);
-    colors->AppendL(KRgbGray);
-    colors->AppendL(KRgbWhite);
-   
-    // Get current colour
-    TRgb color = KCalenColorPalletteStartColor; //iDbInfo.GetCalendarColor(); 
-    TInt startValue = iColVal;
-    TBool noneChosen = ETrue;
+    iNoneChoosen = ETrue;
     
     // Construct colour selection grid
-    CAknColourSelectionGrid *dlg = CAknColourSelectionGrid::NewL(colors, EFalse,
-            noneChosen,color );
+    CAknDialog  *dlg = CAknColourSelectionGrid::NewL(iRgbColors, EFalse,
+            iNoneChoosen,iChoosenColor );
 
-    retVal = dlg->ExecuteLD();
+    dlg->ExecuteLD(R_CALEN_MULTIDB_EDITOR_COLOR_GRID_DLG);
     
-    iColVal = KErrNotFound;
-    if ( !noneChosen  && retVal )//If something is chosen
-  	    {
-		iColVal = color.Value();
-		}    
-    else//Else set the previous color.
+    TRACE_EXIT_POINT;
+    }
+
+// ---------------------------------------------------------------------------
+// CCalenMultiDBEditor::FocusChanged
+// ---------------------------------------------------------------------------
+//
+void CCalenMultiDBEditor::FocusChanged(TDrawNow /*aDrawNow*/)
+    {
+    TRACE_ENTRY_POINT
+    
+    if(IsFocused() && !iNoneChoosen)
         {
-        iColVal = startValue;
+        iColVal = iChoosenColor.Value();
+        iPicture->SetRgbColorsL(iChoosenColor);
+        GetLineByLineAndPageIndex(1, 0)->DrawNow();
         }
-    iColors = TRgb(iColVal);
-    iPicture->SetRgbColorsL(iColors);  
-    CleanupStack::PopAndDestroy( colors );	
-	TRACE_EXIT_POINT;
+    
+    TRACE_EXIT_POINT
     }
 
 // ---------------------------------------------------------------------------
@@ -803,13 +831,13 @@
     {
     TRACE_ENTRY_POINT;
     //Initial Name value
-     TPtr summary = iCalendarName->Des();    
-      
-     CEikEdwin* edwin =
-              reinterpret_cast<CEikEdwin*>(Control(ECalenMultiDbName));
-      GetEdwinText(summary, ECalenMultiDbName);
-      
-      TRACE_EXIT_POINT;
+    TPtr summary = iCalendarName->Des();
+
+    CEikEdwin* edwin = reinterpret_cast<CEikEdwin*> (Control(
+            ECalenMultiDbName));
+    GetEdwinText(summary, ECalenMultiDbName);
+
+    TRACE_EXIT_POINT;
     }
 // ---------------------------------------------------------------------------
 // CCalenMultiDBEditor::IsNameEditedL
@@ -968,8 +996,6 @@
             case ECalenMultiDbColor:
                 {
                 GetColorL();
-                iColors = TRgb(iColVal);
-                GetLineByLineAndPageIndex(1,0)->DrawNow();
                 }
                 break;
                     
@@ -1209,6 +1235,10 @@
     TRACE_EXIT_POINT;	 
     }
 
+// -----------------------------------------------------------------------------
+// CDbColorPicture::SetRgbColorsL
+// -----------------------------------------------------------------------------
+//
 void CDbColorPicture::SetRgbColorsL(TRgb aColors)  
     {
     TRACE_ENTRY_POINT;
--- a/calendarui/controller/src/calenmultipledbui.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/src/calenmultipledbui.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -183,8 +183,7 @@
 // ----------------------------------------------------------------------------
 //
 CCalenMultipleDbUi::CCalenMultipleDbUi(CCalenController& aController) : 
-    iController(aController),
-    iDialogLaunched(EFalse)
+    iController(aController)
     {
     TRACE_ENTRY_POINT;
     TRACE_EXIT_POINT;
@@ -228,8 +227,13 @@
     notificationArray.Append(ECalenNotifyCalendarFileDeleted);
     iController.RegisterForNotificationsL(this, notificationArray);
     
+    notificationArray.Close();
+    
     iConflictOccured = EFalse;
     
+    TCallBack callBackDeleteQuery(CCalenMultipleDbUi::DoAsyncDeleteTemL, this);
+    iAsyncDeletequery = new(ELeave) CAsyncCallBack(callBackDeleteQuery,CActive::EPriorityStandard);
+    
     TRACE_EXIT_POINT;
     }
 
@@ -251,11 +255,14 @@
         }
     
     delete iBgContext;
+    iBgContext = NULL;
     
     iListBox->Reset();
-    delete iListBox; 
+    delete iListBox;
+    iListBox = NULL;
     
     delete iDesArray;
+    iDesArray = NULL;
     
     iColorUidArray.Close();
     
@@ -264,6 +271,23 @@
     
     iAsyncExit->Cancel();
     delete iAsyncExit;
+    iAsyncExit = NULL;
+    
+    iAsyncDeletequery->Cancel();
+    delete iAsyncDeletequery;
+    iAsyncDeletequery = NULL;
+        
+    if(iCalendarInfoNew)
+        {
+        delete iCalendarInfoNew;
+        iCalendarInfoNew = NULL;
+        }
+    
+    if(iCalendarInfoOriginal)
+        {
+        delete iCalendarInfoOriginal;
+        iCalendarInfoOriginal = NULL;
+        }
 
     TRACE_EXIT_POINT;
     }
@@ -324,6 +348,10 @@
 void CCalenMultipleDbUi::UpdateListboxL()
     {
     TRACE_ENTRY_POINT;
+    
+    if(!iListBox)
+        return;
+    
     iListBox->View()->SetDisableRedraw( ETrue );
     iDesArray->Reset();
     iColorUidArray.Close();
@@ -443,14 +471,23 @@
    // Set title text
     CAknTitlePane* tp = static_cast<CAknTitlePane*>(
                                  sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-
-    HBufC* titleText = StringLoader::LoadLC( R_QTN_CALE_TITLE_CALENDARS , iCoeEnv );
+    HBufC* titleText;
+    if(iIsDbEditorOpen)
+        {
+        titleText = StringLoader::LoadLC( R_QTN_CALE_TITLE_CALENDAR , iCoeEnv );
+        }
+    else
+        {
+        titleText = StringLoader::LoadLC( R_QTN_CALE_TITLE_CALENDARS , iCoeEnv );
+        }
     tp->SetTextL( *titleText );  // r_qtn_cale_title_calendars
     CleanupStack::PopAndDestroy( titleText );
     
     TRACE_EXIT_POINT;
     }
 
+   
+
 
 // ----------------------------------------------------------------------------
 // CCalenMultipleDbUi::DynInitMenuPaneL
@@ -538,15 +575,17 @@
           break;
       case ECalenCmdDelete:
           {
-          DeleteItemL();
-          }
+          iAsyncDeletequery->CallBack();
+		  }
           break;
       case ECalenCmdItemSelect:
+      case ECalenCmdShow:
           {
           DoSelectionL(ETrue);
           }
           break;
       case ECalenCmdItemDeselect:
+      case ECalenCmdHide:
           {
           DoSelectionL(EFalse);
           }
@@ -558,18 +597,6 @@
           iAsyncExit->CallBack();
           }
           break;
-     case ECalenCmdShow:
-          {
-          DoSelectionL( ETrue );
-          }
-          break;
-
-      case ECalenCmdHide:   
-          {
-          DoSelectionL( EFalse );
-          }
-          break;             
-          
       default:
           break;
       }
@@ -606,49 +633,88 @@
 TInt CCalenMultipleDbUi::AddItemL()
     {
     TRACE_ENTRY_POINT
-    TInt retValue = KErrNotFound;
+    TInt retValue = 0;
+    
+    if(iCalendarInfoNew)
+        {
+        delete iCalendarInfoNew;
+        iCalendarInfoNew = NULL;
+        }
     
-    CCalCalendarInfo* calendarInfo = CCalCalendarInfo::NewL();
-    calendarInfo->SetNameL(KNullDesC16);
-    calendarInfo->SetColor(255);
-    calendarInfo->SetEnabled(ETrue);
-    iDbEditor = CCalenMultiDBEditor::NewL( *calendarInfo, iController, EFalse );
+    iCalendarInfoNew = CCalCalendarInfo::NewL();
+    iCalendarInfoNew->SetNameL(KNullDesC16);
+    iCalendarInfoNew->SetColor(255);
+    iCalendarInfoNew->SetEnabled(ETrue);
+    iDbEditor = CCalenMultiDBEditor::NewL(*this,*iCalendarInfoNew, iController, EFalse );
   
-    iDialogLaunched = ETrue;
+    //Async dialog
     retValue = iDbEditor->ExecuteLD();
     iDbEditor = NULL;
-    iDialogLaunched = EFalse; 
-    
+     
     if(EAknCmdExit == retValue )
         {
         iController.BroadcastNotification(ECalenNotifyRealExit);
         }
     
-    HBufC* calendarName = calendarInfo->NameL().AllocLC();
-    calendarName->Des().Trim();
-    if(calendarName->Length() > 0)
+    TRACE_EXIT_POINT
+    return retValue;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CCalenMultipleDbUi::UpdateAddOrEditL
+// ----------------------------------------------------------------------------
+//
+void CCalenMultipleDbUi::UpdateOnAddOrEditL(TBool aItemAdded)
+    {
+    TRACE_ENTRY_POINT
+    
+    if(aItemAdded)
         {
-        
         // Set calendar properties for new calendar being created.
-        SetCalendarAddPropertiesL(*calendarInfo);
-        
-        iController.AddCalendarL(calendarInfo);
-        
-        UpdateListboxL();
-        
+        SetCalendarAddPropertiesL(*iCalendarInfoNew);
+       
+        iController.AddCalendarL(iCalendarInfoNew);
+        iCalendarInfoNew = NULL;
+       
         //Highlight the newly created list item
         iListBox->ScrollToMakeItemVisible(iListBox->BottomItemIndex());
         iListBox->SetCurrentItemIndexAndDraw(iDesArray->Count()-1);
         }
-    else 
+    else
         {
-        delete calendarInfo;
+        //Before checking for changes , check if any conflict occured i.e calendar updated / deleted.
+        //if there is conflict iConflictOccured = true then skip below condition.
+        if (!iConflictOccured && iCalendarInfoOriginal &&
+                CheckForChangesL(*iCalendarInfoOriginal,
+                *iCalendarInfoEdited))
+            {
+            // update the calendar properties such as modification time, sync status.
+            SetCalendarUpdatePropertiesL(*iCalendarInfoEdited);
+            
+            iController.UpdateCalendarL(iCalendarInfoEdited);
+            }
+
+        iConflictOccured = EFalse;
+        delete iCalendarInfoOriginal,iCalendarInfoOriginal = NULL;
         }
-    
-    CleanupStack::PopAndDestroy(calendarName);  
+    iIsDbEditorOpen = EFalse ; //iIsDbEditorOpen should be set before calling UpdateListboxL() 
+    UpdateListboxL();
     
     TRACE_EXIT_POINT
-    return retValue;
+    }
+
+// ----------------------------------------------------------------------------
+// CCalenMultipleDbUi::ExitDialogL
+// Edit item from listbox 
+// ----------------------------------------------------------------------------
+//
+void CCalenMultipleDbUi::ExitDialogL()
+    {
+    TRACE_ENTRY_POINT
+    iAsyncExitCmd = EAknSoftkeyExit;
+    iAsyncExit->CallBack();
+    TRACE_EXIT_POINT
     }
 
 // ----------------------------------------------------------------------------
@@ -661,60 +727,41 @@
     TRACE_ENTRY_POINT
     TInt retValue = KErrNotFound;
     TInt currentIndex = iListBox->CurrentItemIndex();
-    TInt listCount = iListBox->Model()->ItemTextArray()->MdcaCount();
-
+    
     RPointerArray<CCalCalendarInfo> calendarInfoList;
     iController.GetAllCalendarInfoL(calendarInfoList);
     CleanupClosePushL(calendarInfoList);
     
-    CCalCalendarInfo* calendarInfoedited = calendarInfoList[currentIndex];
+    iCalendarInfoEdited = calendarInfoList[currentIndex];
+    
+    CleanupStack::PopAndDestroy(&calendarInfoList);
     
     //Take a copy of original before editing
-    CCalCalendarInfo* calendarInfoOriginal = CCalCalendarInfo::NewL();
-    CleanupStack::PushL(calendarInfoOriginal);
-    calendarInfoOriginal->SetNameL(calendarInfoedited->NameL());
-    calendarInfoOriginal->SetColor(calendarInfoedited->Color());
-    calendarInfoOriginal->SetEnabled(calendarInfoedited->Enabled());
+    if(iCalendarInfoOriginal)
+        {
+        delete iCalendarInfoOriginal;
+        iCalendarInfoOriginal = NULL;
+        }
+    iCalendarInfoOriginal = CCalCalendarInfo::NewL();
+    
+    iCalendarInfoOriginal->SetNameL(iCalendarInfoEdited->NameL());
+    iCalendarInfoOriginal->SetColor(iCalendarInfoEdited->Color());
+    iCalendarInfoOriginal->SetEnabled(iCalendarInfoEdited->Enabled());
     TBuf8<KBuffLength> keyBuff;
     TBool syncstatus = EFalse;
     keyBuff.Zero();
     keyBuff.AppendNum( ESyncStatus ); 
     TPckgC<TBool> pckgSyncStatusValue(syncstatus);
-    pckgSyncStatusValue.Set(calendarInfoedited->PropertyValueL( keyBuff ));
-    calendarInfoOriginal->SetPropertyL( keyBuff, pckgSyncStatusValue );                
+    pckgSyncStatusValue.Set(iCalendarInfoEdited->PropertyValueL( keyBuff ));
+    iCalendarInfoOriginal->SetPropertyL( keyBuff, pckgSyncStatusValue );                
 
-    iDbEditor = CCalenMultiDBEditor::NewL(*calendarInfoedited, iController,
+    iDbEditor = CCalenMultiDBEditor::NewL(*this,*iCalendarInfoEdited, iController,
             ETrue);
 
-    iDialogLaunched = ETrue;
+    //Async dialog
     retValue = iDbEditor->ExecuteLD();
     iDbEditor = NULL;
-    iDialogLaunched = EFalse;
-
-    //Before checking for changes , check if any conflict occured i.e calendar updated / deleted.
-    //if there is conflict iConflictOccured = true then skip below condition.
-    if (!iConflictOccured && CheckForChangesL(*calendarInfoOriginal,
-            *calendarInfoedited))
-        {
-        // update the calendar properties such as modification time, sync status.
-        SetCalendarUpdatePropertiesL(*calendarInfoedited);
-        
-        iController.UpdateCalendarL(calendarInfoedited);
-        }
-
-    iConflictOccured = EFalse;
-
-    UpdateListboxL();
-
-    //If conflict occured i.e calendar deleted check for list count before and after
-    //and update focus accordingly
-    if (listCount != iListBox->Model()->ItemTextArray()->MdcaCount())
-        {
-        ReAdjustListItemFocusL(currentIndex);
-        }
-
-    CleanupStack::PopAndDestroy(calendarInfoOriginal);
-    CleanupStack::PopAndDestroy(&calendarInfoList);
+    
     return retValue;
     TRACE_EXIT_POINT
     }
@@ -840,7 +887,7 @@
         {
         if( aKeyEvent.iCode == EKeyEscape )
             {
-            TryExitL( EKeyNo );
+            TryExitL( EKeyEscape );
             return exitCode; // Chain this one up to the main app so it closes calendar app.
             }
          else if(aType == EEventKey && TChar(aKeyEvent.iCode).IsPrint() )
@@ -919,16 +966,12 @@
            }
            break;
        case EAknSoftkeyBack:
+       case EKeyEscape:
            {
            iController.BroadcastNotification(ECalenNotifyDeleteInstanceView);
            okExit = ETrue;
            }
            break;
-	   case EKeyEscape:
-           {
-           okExit = ETrue;
-           }
-           break;
        default:
            {
            okExit = CAknDialog::OkToExitL(aButtonId);
@@ -1126,6 +1169,19 @@
     TRACE_EXIT_POINT
     return 0;
     }
+// ----------------------------------------------------------------------------
+// CCalenMultipleDbUi::CallBackForDeleteItemL
+// (other items were commented in a header).
+// ----------------------------------------------------------------------------
+//
+TInt CCalenMultipleDbUi::DoAsyncDeleteTemL(TAny* aPtr)
+    {
+    TRACE_ENTRY_POINT
+    CCalenMultipleDbUi* self = static_cast<CCalenMultipleDbUi*>(aPtr);
+    self->DeleteItemL();
+    TRACE_EXIT_POINT
+    return 0;
+    }
 
 // ----------------------------------------------------------------------------
 // CCalenMultipleDbUi::CreateButtonL
@@ -1353,7 +1409,7 @@
                {
                iIsDbEditorOpen = ETrue ;
                ProcessCommandL( ECalenCmdEdit );
-               iIsDbEditorOpen = EFalse ;
+               
                }
            }
        }
--- a/calendarui/controller/src/calennotifier.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/src/calennotifier.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -815,6 +815,7 @@
 			default:
 				break;
 			}
+		context.ResetCalendarFileName();
 		}
 
 	TRACE_EXIT_POINT;
--- a/calendarui/controller/src/calenpopulationstate.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/src/calenpopulationstate.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -99,14 +99,6 @@
         RequestCallbackL( handler, aCommand );
         cmdUsed = ETrue;
         }
-    
-    else if( ECalenEventView == cmd )
-        {
-        SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState );
-        ActivateCurrentStateL(aStateMachine);
-        RequestCallbackL( handler, aCommand );
-        cmdUsed = ETrue;
-        }
 
     TRACE_EXIT_POINT;
     return cmdUsed;
--- a/calendarui/controller/src/calenstate.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/src/calenstate.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -128,9 +128,11 @@
         case ECalenNotifyAppBackgrounded:
         	{
         	CCalenStateMachine::TCalenStateIndex cachedState = aStateMachine.GetCurrentState();
-        	if(cachedState != CCalenStateMachine::ECalenMapState) // Never send calendar to background state in MapState as maps will 
-        	                                                        // launched in cahin mode not in stand alone mode
-        	    {
+        	// Never send calendar to background state in MapState as maps will
+        	// launched in cahin mode not in stand alone mode
+        	if((cachedState != CCalenStateMachine::ECalenMapState) &&
+        		(cachedState != CCalenStateMachine::ECalenPopulationState))
+        		{
                 aStateMachine.SetCurrentState(CCalenStateMachine::ECalenBackgroundState);
                 aStateMachine.SetCurrentPreviousState(cachedState);
                 iOutstandingNotifications.InsertL(aNotification);
--- a/calendarui/controller/src/calenviewmanager.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/controller/src/calenviewmanager.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -891,8 +891,10 @@
 		}
 	
 	// set the previous view id
-	iPreviousViewId.iViewUid = cachePreviousViewId;
-	
+	if(cachePreviousViewId != KUidCalenEventView) 
+	    {
+        iPreviousViewId.iViewUid = cachePreviousViewId; 
+	    }	
 	TRACE_EXIT_POINT;
     }
 
@@ -1514,7 +1516,14 @@
         // the event view 
         if(iPreviousViewId.iViewUid != KNullUid)
             {
-            RequestActivationL(iPreviousViewId.iViewUid);   
+            if(iPreviousToDayView.iViewUid != KNullUid)
+                {
+                RequestActivationL(iPreviousViewId.iViewUid, KUidCalenShowBackCba);
+                }
+            else
+                {
+                RequestActivationL(iPreviousViewId.iViewUid);
+                }
             }
         }
     else
--- a/calendarui/editors/data/CalenDefaultEditorsData.rss	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/editors/data/CalenDefaultEditorsData.rss	Wed Mar 31 21:29:10 2010 +0300
@@ -365,6 +365,25 @@
             }
         };
     }
+    RESOURCE DIALOG r_calen_db_change_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_YES_NO;
+    items = 
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationQueryLayout;
+                label = qtn_calen_db_change_del_exeptions;
+                };
+            }
+        };
+    }
+
 
 RESOURCE TBUF r_qtn_cale_inote_desc_del_memo
     {
@@ -1015,7 +1034,7 @@
 //
 RESOURCE TBUF r_qtn_calen_editor_date_of_birth
     {
-    buf = qtn_cale_label_date;
+    buf = qtn_cale_viewer_date; 
     }
 
 // ---------------------------------------------------------
--- a/calendarui/editors/src/calendbfield.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/editors/src/calendbfield.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -18,6 +18,7 @@
 // system includes
 #include <AknPopupField.h>
 #include <AknQueryValueText.h>
+#include <AknQueryDialog.h>
 #include <badesca.h>
 #include <calentry.h>
 #include <centralrepository.h>
@@ -219,6 +220,25 @@
             ReadDataFromFormL( continueOnError );
             iUnifiedEditor.EditorDataHandler().SetCalendarFieldEditedL(IsCalendarEdited()
                                                             ,iPreviousColId,iCurrentColId);
+            //Check the child entries for the repeated entry
+            //The entry which is changing the calendar having any childs 
+            //show this information note to the user.  
+            CCalEntry& originalEntry = iUnifiedEditor.EditorDataHandler().Entry();
+            RPointerArray<CCalEntry> childEntries;
+            CleanupClosePushL(childEntries);
+            iServices->EntryViewL(iPreviousColId)->FetchL(originalEntry.UidL(), childEntries);            
+            if(IsCalendarEdited() && (childEntries.Count() > 1))
+                {
+                CAknQueryDialog* dlg = CAknQueryDialog::NewL();
+                if( !dlg->ExecuteLD( R_CALEN_DB_CHANGE_QUERY ) )
+                    {
+                    iCurrentColId = iPreviousColId;
+                    SetDataToEditorL();                    
+                    iUnifiedEditor.UpdateFormL();
+                    }
+                }            
+            CleanupStack::PopAndDestroy( &childEntries );
+            
             break;
             }
         default: 
--- a/calendarui/editors/src/calenunifiededitor.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/editors/src/calenunifiededitor.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -569,6 +569,15 @@
              // Intentional fall through to EEikBidCancel below
              iEntryUiOutParams.iAction = ENoAction;
              iEntryUiOutParams.iSpare = 0;
+             MCalenContext& context = iServices->Context();
+             HBufC* fileNamePtr = context.GetCalAlarmEntryFileNameL();             
+             TCalLocalUid localUid = context.CalAlarmLocalUidL();           
+             if (fileNamePtr != NULL && !fileNamePtr->CompareF(iGlobalData->GetCalFileNameForCollectionId(context.InstanceId().iColId)) 
+                     && localUid == context.InstanceId().iEntryLocalUid)
+                 {
+                 context.ResetCalAlarmEntryFileName();
+                 break;
+                 }
              // Fall through...
              }
          case ECalenEditSeries:
@@ -658,8 +667,8 @@
 TKeyResponse CCalenUnifiedEditor::OfferKeyEventL( const TKeyEvent& aKeyEvent,
                                                   TEventCode aType )
     {
-    TRACE_ENTRY_POINT;
-    TBool isMapIconHandled = EFalse;
+    
+     TRACE_ENTRY_POINT;
     TKeyResponse keyResponse( EKeyWasNotConsumed );
     TInt ctrlid=IdOfFocusControl();
    
@@ -696,102 +705,18 @@
                 keyResponse = EKeyWasConsumed;
                 break;
             case EKeyEnter: // For Enter key
+            case EKeyDelete: // For Delete key
 				{
 				keyResponse = CAknForm::OfferKeyEventL(aKeyEvent,aType); // Let framework handle the key event
-				// when enter key is pressed on subject line or on location line, call AddPictureL to recalculate the map icon position properly
-				// as location field could habe moved up or down
-				if(ctrlid == ECalenEditorPlace || ctrlid == ECalenEditorSubject)
-					{
-					CCalGeoValue* geoValue = iEditorDataHandler->Entry().GeoValueL();
-					if(geoValue)
-						{
-						isMapIconHandled = ETrue;
-						AddPictureL();
-						delete geoValue;
-						}
-					}
-				}
-				break;
-			case EKeyDelete:
-				{
-				if(ctrlid == ECalenEditorPlace)
-					{
-					CCalGeoValue* geoValue = iEditorDataHandler->Entry().GeoValueL();
-					if(geoValue)
-						{
-						CEikRichTextEditor* locationControl = static_cast<CEikRichTextEditor*>(Control(ECalenEditorPlace));
-						CRichText* text = locationControl->RichText();
-						TPtrC ptr = text->Read(0,text->DocumentLength());
-						TInt pos = ptr.Locate(TChar(CEditableText::EPictureCharacter));
-						if(locationControl->CursorPos() == pos)
-							{
-							isMapIconHandled = ETrue;
-							keyResponse = EKeyWasConsumed;
-							delete geoValue;
-							break;
-							}
-						delete geoValue;
-						}
-					}
-					keyResponse = CAknForm::OfferKeyEventL(aKeyEvent,aType); // Let framework handle the key event
 				}
 				break;
 			case EKeyBackspace:  // For back space character
 				{
-				if(ctrlid == ECalenEditorPlace)
-					{
-					CCalGeoValue* geoValue = iEditorDataHandler->Entry().GeoValueL();
-					if(geoValue)
-						{
-						CEikRichTextEditor* locationControl = static_cast<CEikRichTextEditor*>(Control(ECalenEditorPlace));
-						CRichText* text = locationControl->RichText();
-						TPtrC ptr = text->Read(0,text->DocumentLength());
-						TInt pos = ptr.Locate(TChar(CEditableText::EPictureCharacter));
-						TInt curpos = locationControl->CursorPos();
-						
-						// When only one visible character is there and picture byte is there at second position, then
-						// empty the location field and redraw the map icon
-						if(text->DocumentLength() <= 2) 
-							{
-							TBuf<1> newLocation;
-							SetEdwinTextL(ECalenEditorPlace, &newLocation);
-							keyResponse = EKeyWasConsumed;
-							delete geoValue;
-							isMapIconHandled = ETrue;
-							AddPictureL();
-							break;
-							}
-						//  when cursor position is at the end, then since, picture byte is at the end
-						// delete last but one character (for user, it looks as if last visible character is being deleted)
-						// and redraw the icon
-						 else if( curpos == pos + 1)
-							{
-							text->DeleteL(text->DocumentLength() - 2,1);
-							
-							AddPictureL();
-							locationControl->SetCursorPosL(curpos - 1, EFalse);
-							isMapIconHandled = ETrue;
-							keyResponse = EKeyWasConsumed;
-							delete geoValue;
-							break;
-							}
-						delete geoValue;
-						}
-					}
-				// This is to handle backspaces in subject field when there nore that one lines,
-				// location field will move up, hence, need to redraw the map icon
-				else if(ctrlid == ECalenEditorSubject)
+				if(ctrlid == ECalenEditorPlace || ECalenEditorSubject)
 					{
 					keyResponse = CAknForm::OfferKeyEventL(aKeyEvent,aType);
-					CCalGeoValue* geoValue = iEditorDataHandler->Entry().GeoValueL();
-					if(geoValue)
-						{
-						AddPictureL();
-						isMapIconHandled = ETrue;
-						delete geoValue;
-						}
-					break;
 					}
+				break;
 				}
             case EKeyLeftArrow:
             case EKeyRightArrow:
@@ -810,19 +735,6 @@
             default:
                 {
                 keyResponse = CAknForm::OfferKeyEventL(aKeyEvent,aType); 
-                if(!isMapIconHandled)
-                    {
-                    if((ctrlid == ECalenEditorPlace) || (ctrlid == ECalenEditorSubject))
-                        {
-                        CCalGeoValue* geoValue = iEditorDataHandler->Entry().GeoValueL();
-                        if(geoValue)
-                            {
-                            isMapIconHandled = ETrue;
-                            AddPictureL();
-                            delete geoValue;
-                            }
-                        }
-                    }
                 }
                 break;
             }
@@ -1065,12 +977,7 @@
     TRACE_ENTRY_POINT;
     
     SetEditableL(ETrue);
-    CCalGeoValue* geoValue = iEditorDataHandler->Entry().GeoValueL();
-	if(geoValue)
-		{
-		AddPictureL();	
-		delete geoValue;	
-		}
+
     TCallBack callback( LocaleCallback, this );
     iLocaleChangeNotifier =
         CEnvironmentChangeNotifier::NewL( EActivePriorityLogonA, callback );
@@ -1332,14 +1239,6 @@
 
     CCoeControl::HandleResourceChange( aType );
     
-    CCalGeoValue* geoValue = NULL;
-	TRAP_IGNORE(geoValue = iEditorDataHandler->Entry().GeoValueL());	
-	if(geoValue)
-		{
-		TRAP_IGNORE(AddPictureL());	
-		delete geoValue;	
-		}
-		
     TRACE_EXIT_POINT;
     }
 
@@ -2709,7 +2608,6 @@
 			{
 			isReplaceLocation = EFalse;
 			StoreLocationDetailsToEntryL(landmark);
-			AddPictureL(0);
 			}
 		}
 		
@@ -2733,7 +2631,6 @@
 	if(userResponse)
 		{
 		StoreLocationDetailsToEntryL(landmark);
-		AddPictureL();
 		}
 		
 	TRACE_EXIT_POINT;	
@@ -2797,7 +2694,6 @@
             break;
         }
         StoreLocationDetailsToEntryL(landmark);
-        AddPictureL(0);
         
     TRACE_EXIT_POINT;   
     }
@@ -2848,7 +2744,6 @@
         ShowAddressUpdatedNoticeL();
         }
 	 
-	PreLayoutDynInitL();
 	
 	TRACE_EXIT_POINT;	
 	}
@@ -3174,14 +3069,7 @@
 void CCalenUnifiedEditor::LineChangedL( TInt /* aControlId */ )
     {
     TRACE_ENTRY_POINT;
-    
-    CCalGeoValue* geoValue = iEditorDataHandler->Entry().GeoValueL();
-	if(geoValue)
-		{
-		AddPictureL();	
-		delete geoValue;	
-		}
-		
+
     SetMskFromResourceL();
     TRACE_EXIT_POINT;
     }
@@ -3342,51 +3230,6 @@
     TRACE_EXIT_POINT;
     }
 
-// -----------------------------------------------------------------------------
-// CCalenUnifiedEditor::AddPictureL
-// Adds Map icon onto the editors
-// -----------------------------------------------------------------------------
-//      
-void CCalenUnifiedEditor::AddPictureL(TInt isNotFirstTime)
-    {
-    TRACE_ENTRY_POINT;
-    return;
-    
-    // Instantiate CMapIconPicture object 300x300 twips in size
-    CEikRichTextEditor* locationControl = static_cast<CEikRichTextEditor*>(Control(ECalenEditorPlace));
-    
-    CRichText* text = locationControl->RichText();
-    if(isNotFirstTime)
-        {
-        TPtrC ptr = text->Read(0,text->DocumentLength());
-        TInt pos = ptr.Locate(TChar(CEditableText::EPictureCharacter));
-        if(pos != -1) // If picture found, delete it so that it cna be drawn at new place
-            {
-            TRAP_IGNORE(text->DeleteL(pos,1));
-            }
-        }
-    
-    // Get the rect of the caption of ECalenEditorPlace control
-    CEikLabel* label = this->ControlCaption(ECalenEditorPlace);
-    TRect rect = label->Rect();
-    
-    CMapsIconPicture* picture = new( ELeave )CMapsIconPicture(/* TSize( 300, 300 )*/ *iServices, rect );
-    CleanupStack::PushL(picture);
-    //Prepare the picture header, which will be inserted into the rich text
-    TPictureHeader header;
-    header.iPicture = TSwizzle<CPicture>(picture);
-    
-    // Position where we insert picture is not valid as it always draws icon depending the rect we provide
-    
-        text->InsertL(text->DocumentLength(), header);
-        
-    locationControl->HandleTextChangedL();
-    CleanupStack::Pop(); // picture
-    
-    Control(ECalenEditorPlace)->DrawNow();
-    
-    TRACE_EXIT_POINT;   
-    }
 
 // -----------------------------------------------------------------------------
 // CCalenUnifiedEditor::AttachmentNamesL
--- a/calendarui/globaldata/inc/calencontextimpl.h	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/globaldata/inc/calencontextimpl.h	Wed Mar 31 21:29:10 2010 +0300
@@ -214,6 +214,32 @@
 	* @brief Resets calendar file name in context
 	*/
     void ResetCalendarFileName();
+    /**
+    * @brief Set calendar file name of Alarm entry in context
+    */    
+    void SetCalAlarmEntryFileNameL(const TDesC& aName);
+    
+    /**
+    * @brief Get calendar filename 
+    * 
+    * @return HBufC pointer to calendar filename of Alarm entry
+    */
+    HBufC* GetCalAlarmEntryFileNameL() const;
+    
+    /**
+    * @brief Resets Alarm Entry calendar file name in context
+    */ 
+    void ResetCalAlarmEntryFileName();
+    
+    /**
+    * @brief set Alarm Entry LocalUid in context
+    */ 
+    void SetCalAlarmEntryLocalUid(TCalLocalUid aLocalId);
+    
+    /**
+    * @brief Get Alarm Entry LocalUid from context
+    */ 
+    TCalLocalUid CalAlarmLocalUidL() const;
 
 private:  // Data
     MCalenContextChangeObserver* iObserver;
@@ -227,6 +253,8 @@
     // Multiple context ids
     RArray<TCalenInstanceId> iMutlipleContextIds;
     HBufC* iCalenFileName;
+    HBufC* iCalAlarmEntryFileName;
+    TCalLocalUid iCalAlarmLocalUid;
     };
 
 #endif // CALENCONTEXTIMPL_H
--- a/calendarui/globaldata/src/calencontextimpl.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/globaldata/src/calencontextimpl.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -85,6 +85,11 @@
 CCalenContextImpl::~CCalenContextImpl()
     {
     TRACE_ENTRY_POINT;
+    if(iCalAlarmEntryFileName)
+        {
+        delete iCalAlarmEntryFileName;
+        iCalAlarmEntryFileName = NULL;
+        }
     TRACE_EXIT_POINT;
     }
 
@@ -506,4 +511,69 @@
     TRACE_EXIT_POINT;
     }
 
+// -----------------------------------------------------------------------------
+// CCalenContextImpl::SetCalAlarmEntryFileNameL
+// Set calendar file name of Alarm entry
+// ----------------------------------------------------------------------------- 
+void CCalenContextImpl::SetCalAlarmEntryFileNameL(const TDesC& aName)
+    {
+    TRACE_ENTRY_POINT
+    if (iCalAlarmEntryFileName)
+        {
+        delete iCalAlarmEntryFileName;
+        iCalAlarmEntryFileName = NULL;
+        }
+    iCalAlarmEntryFileName = aName.AllocL();
+    TRACE_EXIT_POINT   
+    }
+
+// -----------------------------------------------------------------------------
+// CCalenContextImpl::GetCalAlarmEntryFileNameL
+// Get calendar file name of Alarm entry
+// ----------------------------------------------------------------------------- 
+HBufC* CCalenContextImpl::GetCalAlarmEntryFileNameL() const
+    {
+    TRACE_ENTRY_POINT     
+    TRACE_EXIT_POINT 
+    
+    return iCalAlarmEntryFileName;   
+    }
+
+// -----------------------------------------------------------------------------
+// CCalenContextImpl::ResetCalAlarmEntryFileName
+// Resets Alarm Entry file name in context
+// ----------------------------------------------------------------------------- 
+void CCalenContextImpl::ResetCalAlarmEntryFileName()
+    {
+    TRACE_ENTRY_POINT    
+    if(iCalAlarmEntryFileName)
+        {
+        delete iCalAlarmEntryFileName;
+        iCalAlarmEntryFileName = NULL;
+        }
+        
+    TRACE_EXIT_POINT 
+    }
+// -----------------------------------------------------------------------------
+// CCalenContextImpl::ResetCalAlarmEntryFileName
+// set Alarm Entry LocalUid in context
+// ----------------------------------------------------------------------------- 
+void  CCalenContextImpl::SetCalAlarmEntryLocalUid(TCalLocalUid aLocalId)
+    {
+    TRACE_ENTRY_POINT   
+    iCalAlarmLocalUid = aLocalId;
+    TRACE_EXIT_POINT 
+    }
+    
+ 
+// -----------------------------------------------------------------------------
+// CCalenContextImpl::ResetCalAlarmEntryFileName
+// Get Alarm Entry LocalUid from context
+// ----------------------------------------------------------------------------- 
+TCalLocalUid CCalenContextImpl::CalAlarmLocalUidL() const
+    {
+    TRACE_ENTRY_POINT  
+    TRACE_EXIT_POINT 
+    return iCalAlarmLocalUid;
+    }
 // End of file
--- a/calendarui/globaldata/src/calenglobaldata.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/globaldata/src/calenglobaldata.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -1369,8 +1369,17 @@
                 // Mark the CalFile as Hidden
                 caleninfo->SetEnabled( EFalse );
                             
+                
+                TBuf8<KBuffLength> keyBuff;
+                
+                // Set the modification time as home time.
+                keyBuff.Zero();
+                TTime modificationTime;
+                modificationTime.HomeTime();
+                TPckgC<TTime> pkgModificationTime(modificationTime);
+                caleninfo->SetPropertyL(keyBuff, pkgModificationTime);
+                
                 // Set the SyncStatus to False
-                TBuf8<KBuffLength> keyBuff;
                 keyBuff.Zero();
                 keyBuff.AppendNum( ESyncStatus );
                 TBool syncstatus( EFalse );
Binary file calendarui/help/data/xhtml.zip has changed
--- a/calendarui/loc/calendar.loc	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/loc/calendar.loc	Wed Mar 31 21:29:10 2010 +0300
@@ -2628,5 +2628,10 @@
 //l:popup_note_wait_window
 //
 #define qtn_todo_wait_updating_status_notes  "Updating status"
+
+//d:Confirmation text when a repeated entry which has exceptions, moving the data base.
+//l:popup_note_window
+//
+#define qtn_calen_db_change_del_exeptions "Exceptions will be deleted, Want to continue?"
         
 // End of File
--- a/calendarui/organizerplugin/aiagendapluginengine/inc/AIAgendaPluginEngineImpl.h	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/organizerplugin/aiagendapluginengine/inc/AIAgendaPluginEngineImpl.h	Wed Mar 31 21:29:10 2010 +0300
@@ -22,7 +22,6 @@
 // INCLUDES
 #include "CalEngineCallback.h"
 #include "CalenEngine.h"
-#include "CalSvrClient.h"
 #include "PropertyObserver.h"
 
 #include <calfilechangenotification.h>
@@ -37,7 +36,6 @@
 // CLASS DECLARATION
 NONSHARABLE_CLASS( CAIAgendaPluginEngineImpl ) : public CBase,
                                                  public MCalenEngineListener,
-                                                 public MCalSvrAgendaUpdateListener,
                                                  public MPropertyChangeHandler,
                                                  public MCalFileChangeObserver
                                                  
@@ -115,13 +113,6 @@
      **/
     void HandleError(TInt aError);
 
- public:  // From MCalSvrAgendaUpdateListener
-    /**
-     * ?member_description.
-     * @since Series 60 2.6
-     **/
-    void CalendarServerInitialized(void);
-
 public:  // From MPropertyChangeHandler
     /**
      * ?member_description.
@@ -267,9 +258,6 @@
     // ?one_line_short_description_of_data
     RPointerArray<CCalInstance> iInstanceArray;
 
-    // Calendar server session
-    RCalSvrSession iSession;
-
     // ?one_line_short_description_of_data
     MPluginDataChangeObserver& iDataChangeObserver;
 
--- a/calendarui/organizerplugin/aiagendapluginengine/src/AIAgendaPluginEngineImpl.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/organizerplugin/aiagendapluginengine/src/AIAgendaPluginEngineImpl.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -51,8 +51,6 @@
 {
     TRACE_ENTRY_POINT;
     
-    iSession.ConnectL();
-
     if( iObserverType == ECalendarObserver || iObserverType == ECalendarAndTodoObserver )
     {
         TCallBack environmentChangeCallBack( EnvironmentChangeCallBack, this );
@@ -157,7 +155,6 @@
     iInstanceArray.ResetAndDestroy();
     iInstanceArray.Close();
 
-    iSession.Close();
     
     TRACE_EXIT_POINT;
 }
@@ -182,9 +179,9 @@
     {
         case EDBOffline:
         {
-            iDBState = EDBInitializing;
-            iSession.Initialize( *this );
-        }
+            iDBState = EDBInitialized;
+            StateMachine();
+         }
         break;
 
         case EDBInitialized:
@@ -556,7 +553,6 @@
     delete iCalendarEngine;
     iCalendarEngine = NULL;
 
-    iSession.Uninitialize();
     
     TRACE_EXIT_POINT;
 }
@@ -880,22 +876,6 @@
 }
 
 // ---------------------------------------------------------
-// CAIAgendaPluginEngineImpl::CalendarServerInitialized
-// ?implementation_description
-// (other items were commented in a header).
-// ---------------------------------------------------------
-//
-void CAIAgendaPluginEngineImpl::CalendarServerInitialized(void)
-{
-    TRACE_ENTRY_POINT;
-    
-    iDBState = EDBInitialized;  // EDBInitializing -> EDBInitialized
-    StateMachine();
-    
-    TRACE_EXIT_POINT;
-}
-
-// ---------------------------------------------------------
 // CAIAgendaPluginEngineImpl::EnvironmentChangeCallBack
 // ?implementation_description
 // (other items were commented in a header).
--- a/calendarui/organizerplugin/aiagendapluginengine/src/CalenAsyncCommands.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/organizerplugin/aiagendapluginengine/src/CalenAsyncCommands.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -95,11 +95,13 @@
     TRACE_ENTRY_POINT;
     
     TRequestStatus* pStat = &iStatus;
-    User::RequestComplete( pStat, KErrNone );
-
     if( IsAdded() )
         {
-        SetActive();
+        if (!IsActive())
+            {
+            SetActive();
+            }
+        User::RequestComplete( pStat, KErrNone );
         }
     
     TRACE_EXIT_POINT;
--- a/calendarui/server/CalenSvr/src/CalenServer.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/server/CalenSvr/src/CalenServer.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -545,7 +545,7 @@
     keyBuff.Zero();
     keyBuff.AppendNum(ESyncStatus);
 
-    TBool status = EFalse;
+    TBool status = ETrue;
     TPckgC<TBool> pkgSyncStatus(status);
     aCalendarInfo.SetPropertyL(keyBuff, pkgSyncStatus);
     
--- a/calendarui/server/CalenSvr/src/calensvrmissedalarmmanager.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/server/CalenSvr/src/calensvrmissedalarmmanager.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -237,16 +237,18 @@
 	    }
 	else
 	    {
-		if(iNumOfMissedAlarms > TInt(newCount))
+		/*if(iNumOfMissedAlarms > TInt(newCount))
 		    {
 		    iShowSoftNotification = EFalse;
 		    }
 		else
 		    {
 		    iShowSoftNotification = ETrue;
-		    }
+		    }*/
 		
+	// changes done for missing popup in idle screen when alarm expires in editor mode
 		iNumOfMissedAlarms = TInt(newCount);
+		iShowSoftNotification = ETrue;
 	    }
 	
 	TRACE_EXIT_POINT;
--- a/calendarui/server/CalenSvrClient/src/CalSvrClient.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/server/CalenSvrClient/src/CalSvrClient.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -182,8 +182,8 @@
     {
     TRACE_ENTRY_POINT;
     
-    __ASSERT_ALWAYS(!iInitializer->IsActive(), User::Invariant());
-    if(!iInitializer->IsActive())
+    //__ASSERT_ALWAYS(!iInitializer->IsActive(), User::Invariant());
+    if(!(iInitializer->IsActive()) && (KRequestPending != iInitializer->iStatus.Int()))
         {
         iInitializer->Initialize(&aListener);
         }
--- a/calendarui/views/group/calenviews.mmp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/views/group/calenviews.mmp	Wed Mar 31 21:29:10 2010 +0300
@@ -160,7 +160,7 @@
 LIBRARY aknnotify.lib
 
 
-CAPABILITY      CAP_GENERAL_DLL
+CAPABILITY      CAP_GENERAL_DLL NetworkControl
 
 VENDORID        VID_DEFAULT
 
--- a/calendarui/views/inc/calenmissedalarmscontainer.h	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/views/inc/calenmissedalarmscontainer.h	Wed Mar 31 21:29:10 2010 +0300
@@ -23,6 +23,7 @@
 #include<coecntrl.h>
 #include<missedalarm.h>
 #include<missedalarmstore.h>
+#include <eiklbo.h>
 #include <caleninstanceid.h>            // TCalenInstanceId
 
 #include "calencontainer.h"
@@ -38,6 +39,7 @@
  * Class declaration for Missed alarms container
  */
 NONSHARABLE_CLASS(CCalenMissedAlarmsContainer) : public CCalenContainer
+									, public MEikListBoxObserver
     {
     public:
         
@@ -141,6 +143,13 @@
         void CreateIconIndicesL( RArray<MCalenServices::TCalenIcons>& aIndexArray );
         
         /**
+          * Handles list box events.
+          * @param aListBox   The originating list box.
+          * @param aEventType A code for the event.
+          */
+         void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+        
+        /**
          * This method is called after pointer event in Navi
          * decoration object.
          * @param aDirection right or left
--- a/calendarui/views/inc/calenmissedalarmsview.h	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/views/inc/calenmissedalarmsview.h	Wed Mar 31 21:29:10 2010 +0300
@@ -166,35 +166,6 @@
 	 	 */
 	 	void UpdateCbaL();
      	
-private: 
- 	    /**
- 	     * Create missed alarms view toolbar buttons
- 	     * @ aIcon Icon of the toolbar button
- 	     * @ aText Text to be displayed on toolbar item
- 	     * @ aTooltipID Tool tip Id of the toolbar button
- 	     * @ aToolbar refrence to the calendar toolbar
- 	     */
- 	    CAknButton* CreateButtonL( CGulIcon* aIcon, 
- 	                               const TDesC& aText,
- 	                               TInt aTooltipID,
- 	                               CAknToolbar& aToolbar );
- 	    
- 	    /**
- 	     * Remove missed alarms view's toolbar buttons 
- 	     */                           
- 	    void RemoveToolbarButtonsL();
- 	    
- 	    /**
- 	     * Adds missed alarms view's toolbar buttons 
- 	     */
- 	    void AddToolbarButtonsL();
- 	    
- 	    /**
- 	     * Dim clear and clear all toolbar buttons when there are no
- 	     * missed alarm entries to clear 
- 	     */
- 	    void DimClearAndClearAllButtons();
- 	    
      private: //data members
         TInt iMissedAlarmsCount;
         
--- a/calendarui/views/src/calenmissedalarmscontainer.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/views/src/calenmissedalarmscontainer.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -139,7 +139,7 @@
     iListBox->CreateScrollBarFrameL(ETrue);
     iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
             CEikScrollBarFrame::EAuto);
-
+    iListBox->SetListBoxObserver( this ); // single click changes MK
     // set the model array
     iListBox->Model()->SetItemTextArray(iListBoxItemArray);
 
@@ -461,38 +461,31 @@
         {
         case TPointerEvent::EButton1Down:
             {
-            TInt oldCursor = iListBox->View()->CurrentItemIndex();
-            iListBox->HandlePointerEventL(aPointerEvent);
-            TInt newCursor = iListBox->View()->CurrentItemIndex();
-
-            if (oldCursor != newCursor)
+            TBool isItem (iListBox->View()->XYPosToItemIndex(aPointerEvent.iPosition, pointerIndex));
+            
+            if(isItem && MissedAlarmsCount() > 0)
                 {
-                // set the context
-                iHighlightedRowNumber = newCursor;
-                SetContextFromMissedAlarmEntryL(newCursor);
-                iFirstTap = EFalse;
+                iHighlightedRowNumber = iListBox->View()->CurrentItemIndex(); 
+                SetContextFromMissedAlarmEntryL(iListBox->View()->CurrentItemIndex());
                 }
-            else
-                {
-                iFirstTap = ETrue;
-                }
+            
             break;
             }
         case TPointerEvent::EDrag:
             {
-            iListBox->HandlePointerEventL(aPointerEvent);
+            /*iListBox->HandlePointerEventL(aPointerEvent);
             if (iFirstTap && index != iListBox->CurrentItemIndex())
                 {
                 iFirstTap = EFalse;
-                }
+                }*/
             break;
             }
 
         case TPointerEvent::EButton1Up:
             {
-            if (iFirstTap)
+           // if (iFirstTap)
                 {
-                iView->HandleCommandL(ECalenMissedEventView);
+               // iView->HandleCommandL(ECalenMissedEventView);
                 }
             break;
             }
@@ -500,6 +493,11 @@
             break;
         }
 
+   if ( aPointerEvent.iType != TPointerEvent::EButtonRepeat )
+        {
+        iListBox->HandlePointerEventL( aPointerEvent );
+        }
+  
     TRACE_EXIT_POINT;
     }
 
@@ -952,4 +950,43 @@
     return KErrNotFound;
     }
 
+
+void CCalenMissedAlarmsContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, 
+                                                      TListBoxEvent aEventType)
+    {
+    TRACE_ENTRY_POINT;
+    switch( aEventType )
+        {
+        // Single click integration
+        case EEventItemSingleClicked:
+            {
+             iHighlightedRowNumber = iListBox->View()->CurrentItemIndex();
+            
+              SetContextFromMissedAlarmEntryL(iListBox->View()->CurrentItemIndex());
+            //Handle listbox item selection event
+           // iListBox->HandlePointerEventL(aPointerEvent);
+            if(iView->MenuBar()->IsDisplayed() == EFalse)
+                {
+                iView->HandleCommandL( ECalenMissedEventView );
+                }
+            break;
+            }
+            
+        // Single click integration
+        case EEventEnterKeyPressed:
+            {
+            iHighlightedRowNumber = iListBox->View()->CurrentItemIndex();
+            
+              SetContextFromMissedAlarmEntryL(iListBox->View()->CurrentItemIndex());
+            iView->HandleCommandL( ECalenMissedEventView );
+            break;
+            }
+        default:
+            break;
+        };
+    TRACE_EXIT_POINT;
+    }
+
+
+
 // End of File
--- a/calendarui/views/src/calenmissedalarmsview.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/views/src/calenmissedalarmsview.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -131,11 +131,7 @@
        	    RedrawStatusPaneL();
        	    UpdateCbaL();
        	    
-       	    // dim clear and clear all buttons
-       	    if(Container()->MissedAlarmsCount()==0)
-       	        {
-       	        DimClearAndClearAllButtons();
-       	        }
+       	 
 
         	nextStep = CCalenView::EDone;
         	}
@@ -234,8 +230,18 @@
 		    break;
 		    }
         case ECalenCmdClearAll:
+            {
+            iHighlightedRowNumber = 0;
+            iServices.IssueCommandL(aCommand);
+            }
+            break;
         case ECalenCmdGotoCalendar:            
             {
+            MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
+            if(toolbar)
+             {
+             toolbar->SetToolbarVisibilityL(ETrue);  
+             } 
             iHighlightedRowNumber = 0;
             iServices.IssueCommandL(aCommand);
             }
@@ -243,10 +249,25 @@
         case EAknSoftkeyBack:
         case EAknSoftkeyClose:
             {
+            MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
+            if(toolbar)
+             {
+             toolbar->SetToolbarVisibilityL(ETrue);  
+             } 
             iHighlightedRowNumber = 0;
             iServices.IssueNotificationL(ECalenNotifyMissedAlarmViewClosed);
             }
             break;
+        case EAknSoftkeyExit:
+            {
+            MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
+            if(toolbar)
+             {
+             toolbar->SetToolbarVisibilityL(ETrue);  
+             } 
+            CCalenNativeView::HandleCommandL(aCommand);
+            }
+            break;
         default:
             CCalenNativeView::HandleCommandL(aCommand);
             break;
@@ -290,8 +311,12 @@
     
     UpdateCbaL();
     
-    // Draw Missed Alarm toolbar by adding clear, clearall and gotocalendar buttons
-    AddToolbarButtonsL();
+    // Hide the toolbar.
+    MCalenToolbar* toolbar = iServices.ToolbarOrNull();
+    if(toolbar)
+        {
+        toolbar->SetToolbarVisibilityL(EFalse);  
+        }  
     
     TRACE_EXIT_POINT;
     }
@@ -305,10 +330,6 @@
     {
     TRACE_ENTRY_POINT;
     
-    // Remove the toolbar buttons from Missed Alarm View and
-    // enable native view toolbar buttons
-    TRAP_IGNORE(RemoveToolbarButtonsL());
-    
     TRACE_EXIT_POINT;
     }
 
@@ -485,159 +506,4 @@
 	return static_cast<CCalenMissedAlarmsContainer*>( iContainer );
 	}
 
-// ----------------------------------------------------------------------------
-// CCalenMissedAlarmsView::AddToolbarButtonsL
-// Adds missed alarms view's toolbar buttons 
-// ----------------------------------------------------------------------------
-//
-void CCalenMissedAlarmsView::AddToolbarButtonsL()
-    {
-    TRACE_ENTRY_POINT;
-    
-    // Get the existing toolbar from MCalenservices
-    MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull();
-    
-    if(toolbarImpl)  // If toolbar exists
-        {
-        CAknToolbar& toolbar = toolbarImpl->Toolbar();
-        
-        // Create the new buttons for Missed alarm view toolbar
-        // If layout is mirrored the button order is reversed.
-        // For Non mirrored layouts each button is appended to the toolbar
-        // For mirrored layouts each button is inserted at index 0.
-        TBool mirrored( AknLayoutUtils::LayoutMirrored() );
-        
-        CAknButton* button = NULL;
-        CGulIcon* icon = NULL;
-
-        // First button: Clear
-        icon = iServices.GetIconL( MCalenServices::ECalenClearMissedAlarms );
-        // put icon onto cleanup stack before its 
-        // ownership is transferred to CAknButton
-        button = CreateButtonL( icon, _L(""), R_CALE_MAV_TB_CLEAR, toolbar );
-        if( mirrored )
-            {
-            // Insert the button at index 0
-            toolbar.AddItemL( button, EAknCtButton, ECalenCmdClear, 0, 0 );
-            }
-        else
-            {
-            // Append the button
-            toolbar.AddItemL( button, EAknCtButton, ECalenCmdClear, 0, 0 );
-            }
-        
-        // Second button: Clear All
-        icon = iServices.GetIconL( MCalenServices::ECalenClearAllMissedAlarms );
-        // put icon onto cleanup stack before its
-        // ownership is transferred to CAknButton
-        button = CreateButtonL( icon, _L(""), R_CALE_MAV_TB_CLEARALL, toolbar );
-        if( mirrored )
-            {
-            // Insert the button at index 0
-            toolbar.AddItemL( button, EAknCtButton, ECalenCmdClearAll, 0, 0 );
-            }
-        else
-            {
-            // Append the button
-            toolbar.AddItemL( button, EAknCtButton, ECalenCmdClearAll, 0, 1 );
-            }
-        
-        // Third button: Go To Calendar
-        icon = iServices.GetIconL( MCalenServices::ECalenDayViewIcon );
-        // put icon onto cleanup stack before its
-        // ownership is transferred to CAknButton
-        button = CreateButtonL( icon, _L(""), R_CALE_MAV_TB_GOTO_CALE, toolbar );
-        if( mirrored )
-            {
-            // Insert the button at index 0
-            toolbar.AddItemL( button, EAknCtButton, ECalenCmdGotoCalendar, 0, 0 );
-            }
-        else
-            {
-            // Append the button
-            toolbar.AddItemL( button, EAknCtButton, ECalenCmdGotoCalendar, 0, 2 );
-            }
-        }
-    TRACE_EXIT_POINT;
-    }
-
-// ----------------------------------------------------------------------------
-// CCalenMissedAlarmsView::RemoveToolbarButtonsL
-// Removes the missed alarm view's toolbar buttons 
-// ----------------------------------------------------------------------------
-//
-void CCalenMissedAlarmsView::RemoveToolbarButtonsL()
-    {
-    TRACE_ENTRY_POINT;
-    
-    MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull();
-    if(toolbarImpl) // If toolbar exists
-        {
-        CAknToolbar& toolbar = toolbarImpl->Toolbar();
-        if(&toolbar)
-            {
-            // Remove the Missed alarm view's toolbar buttons
-            toolbar.RemoveItem(ECalenCmdClear); // Clear button
-            toolbar.RemoveItem(ECalenCmdClearAll);  // Clear All button
-            toolbar.RemoveItem(ECalenCmdGotoCalendar);  // Go To calendar button
-            }
-        }
-    
-    TRACE_EXIT_POINT;
-    }
-    
-// ----------------------------------------------------------------------------
-// CCalenMissedAlarmsView::CreateButtonL
-// Create missed alarms view toolbar buttons
-// ----------------------------------------------------------------------------
-CAknButton* CCalenMissedAlarmsView::CreateButtonL( CGulIcon* aIcon, 
-                                                   const TDesC& aText,
-                                                   TInt aTooltipID,
-                                                   CAknToolbar& aToolbar )
-    {
-    TRACE_ENTRY_POINT;
-
-    TInt flags = 0;
-    CAknButton* button = NULL;
-    
-    CleanupStack::PushL( aIcon );
-    HBufC* tooltipText = StringLoader::LoadLC( aTooltipID );
-    CleanupStack::Pop( tooltipText );
-    // put icon onto cleanup stack before its ownership is transferred to CAknButton
-    CleanupStack::Pop( aIcon );
-    CleanupStack::PushL( tooltipText );
-    button = CAknButton::NewL( aIcon, NULL, NULL, NULL, aText, 
-                               tooltipText->Des(), flags, 0 );
-    CleanupStack::PopAndDestroy( tooltipText );
-
-    button->SetIconScaleMode( EAspectRatioNotPreserved );
-    button->SetFocusing( EFalse );
-    button->SetBackground( &aToolbar );
-
-    TRACE_EXIT_POINT;
-    return button;
-    }    
-
-// ----------------------------------------------------------------------------
-// CCalenMissedAlarmsView::DimClearAndClearAllButtons
-// Dim clear and clear all toolbar buttons when there are no
-// missed alarm entries to clear
-// ----------------------------------------------------------------------------
-void CCalenMissedAlarmsView::DimClearAndClearAllButtons()
-    {
-    TRACE_ENTRY_POINT;
-    
-    MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull();
-    if(toolbarImpl) 
-        {
-        CAknToolbar& toolbar = toolbarImpl->Toolbar();
-
-        // dim clear and clear all toolbar buttons
-        toolbar.SetItemDimmed(ECalenCmdClear,ETrue,ETrue);
-        toolbar.SetItemDimmed(ECalenCmdClearAll,ETrue,ETrue);
-        }
-
-    TRACE_EXIT_POINT;
-    }
-
 // end of file	
--- a/calendarui/views/src/calenmissedeventcontainer.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/views/src/calenmissedeventcontainer.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -754,7 +754,9 @@
 		        AddRepeatFieldL();
 		        }
 		        
-		    iTitleTextId = R_CALEN_EVENT_VIEW_DAY_TITLE;  			
+		
+		    iTitleTextId = R_CALEN_EVENT_VIEW_ALLDAY_TITLE;
+		    
  			}
             break;
 
--- a/calendarui/views/src/calenmissedeventview.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/views/src/calenmissedeventview.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -234,10 +234,13 @@
         }
     
     UpdateCbaL();
-    
-    // Draw even viewer toolbar by adding Edit, Delete and Send buttons
-	AddToolbarButtonsL();
-	
+    //no tool bar in missed event view
+    MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
+    if(toolbar)
+      {
+      toolbar->SetToolbarVisibilityL(EFalse);  
+      } 
+   
     TRACE_EXIT_POINT;
     }
 
@@ -252,9 +255,7 @@
     
     iPreviousViewId.iViewUid = KNullUid;
 
-    // Remove the toolbar buttons for event viewer before exiting from event view
-    TRAP_IGNORE(RemoveToolbarButtonsL());
-    
+        
     TRACE_EXIT_POINT;
     }
 
@@ -315,9 +316,24 @@
         case EAknSoftkeyClose:   
         case EAknSoftkeyBack:
 			{
+			MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
+            if(toolbar)
+             {
+             toolbar->SetToolbarVisibilityL(ETrue);  
+             } 
 	        iServices.IssueNotificationL(ECalenNotifyMissedEventViewClosed);
 			break;
 			}
+        case EAknSoftkeyExit: 
+            {
+            MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
+            if(toolbar)
+             {
+             toolbar->SetToolbarVisibilityL(ETrue);  
+             }             
+            CCalenNativeView::HandleCommandL(aCommand);
+            }
+            break;
         default:
             if(cnt->GetFindItemMenu()->CommandIsValidL(aCommand))
                 {
@@ -372,7 +388,7 @@
             	{
 	            if(cnt->IsEventHasMapLocationL() || cnt->IsEventHasNoLocationTextL())
 		            {
-		            aMenuPane->DeleteMenuItem( ECalenGetLocationAndSave );
+		            aMenuPane->DeleteMenuItem( ECalenGetLocationAndReplace );
 		            }
 		        if(!cnt->IsEventHasMapLocationL())
 			        {
@@ -384,6 +400,10 @@
 	            aMenuPane->DeleteMenuItem( ECalenGetLocationAndReplace );
 	            aMenuPane->DeleteMenuItem( ECalenShowLocation );	
 	            }
+			//as no toolbar in missedeventview no need to handle thees commands
+		  	aMenuPane->DeleteMenuItem( ECalenCmdPromptThenEdit );
+		  	aMenuPane->DeleteMenuItem( ECalenDeleteCurrentEntry ); 
+		  	aMenuPane->DeleteMenuItem( ECalenSend );
 		    break;
 		  	}
 		 default:
--- a/calendarui/views/src/calentodocontainer.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/calendarui/views/src/calentodocontainer.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -21,6 +21,8 @@
 #include <aknlists.h>
 #include <AknsUtils.h>
 #include <avkon.mbg>
+#include <aknbutton.h>
+#include <akntoolbar.h>
 #include <calalarm.h>
 #include <calentry.h>
 #include <calinstance.h>
@@ -944,6 +946,29 @@
     // set marked todo items info
     static_cast<CCalenTodoView*>( iView )->SetMarkedToDoItems(newArray);
     
+    MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull();
+    if( MarkedCount() )
+        {
+        if(toolbarImpl) 
+          {
+            CAknToolbar& toolbar = toolbarImpl->Toolbar();
+
+            // dim clear and clear all toolbar buttons
+            toolbar.SetItemDimmed(ECalenNewMeeting,ETrue,ETrue);
+          }
+
+        }
+    else
+        {
+        if(toolbarImpl) 
+             {
+               CAknToolbar& toolbar = toolbarImpl->Toolbar();
+
+               // dim clear and clear all toolbar buttons
+               toolbar.SetItemDimmed(ECalenNewMeeting,EFalse,ETrue);
+             }
+        }
+    
     CleanupStack::Pop( newArray );
 
     TRACE_EXIT_POINT;
@@ -982,6 +1007,29 @@
         // when all the todo items are unmarked,clear all marked todo items info from View
         static_cast<CCalenTodoView*>( iView )->ClearMarkedToDoItems();
         }
+    
+    MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull();
+    if( MarkedCount() )
+           {
+           if(toolbarImpl) 
+             {
+               CAknToolbar& toolbar = toolbarImpl->Toolbar();
+
+               // dim clear and clear all toolbar buttons
+               toolbar.SetItemDimmed(ECalenNewMeeting,ETrue,ETrue);
+             }
+
+           }
+       else
+           {
+           if(toolbarImpl) 
+                {
+                  CAknToolbar& toolbar = toolbarImpl->Toolbar();
+
+                  // dim clear and clear all toolbar buttons
+                  toolbar.SetItemDimmed(ECalenNewMeeting,EFalse,ETrue);
+                }
+           }
 
     TRACE_EXIT_POINT;
     }
--- a/clock2/clockui/adtupdater/inc/adtupdatercontainer.h	Mon Mar 15 12:40:18 2010 +0200
+++ b/clock2/clockui/adtupdater/inc/adtupdatercontainer.h	Wed Mar 31 21:29:10 2010 +0300
@@ -287,7 +287,13 @@
          * @param  aTimeZoneId Carry the timezoneid of which DST status is required
          * @return TBool
          */
-         TBool IsDstOnL( TInt aTimeZoneId );         
+         TBool IsDstOnL( TInt aTimeZoneId );
+         
+         /**
+          * @brief  Checks whether predictiveapplcation enable key is on/off.
+          * @return TBool
+          */
+         TBool PredictiveTimeEnabled();
   
 	private:       //Data members
 		
--- a/clock2/clockui/adtupdater/src/adtupdatercontainer.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/clock2/clockui/adtupdater/src/adtupdatercontainer.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -294,7 +294,7 @@
 	{
 	__PRINTS( "CAdtUpdaterContainer::InformAboutNwUpdate - Entry" );
 
-	if( IsFirstBoot() &&  IsSimPresent() && IsNitzPluginActive() )
+	if( IsFirstBoot() &&  IsSimPresent() && IsNitzPluginActive() && PredictiveTimeEnabled())
 		{
 		__PRINTS( "First boot, sim is present and auto time update is ON" );
 		
@@ -315,7 +315,7 @@
 		// Start the timer	
 		iPeriodic->Start( KTimeout, KInterval, timerCallBack );
 		}
-	else if( IsFirstBoot() )
+	else if( IsFirstBoot()&& PredictiveTimeEnabled() )
 		{	
 		__PRINTS( "First boot, normal boot sequence" );
 		
@@ -327,7 +327,7 @@
 		// Exit the application.
 		iAdtUpdaterAppUi->Exit();
 		}
-	else if( !RTCStatus() && !HiddenReset() )
+	else if( !RTCStatus() && !HiddenReset() && PredictiveTimeEnabled())
 		{
 		__PRINTS( "RTC invalid or Hidden Reset" );
 		
@@ -1535,4 +1535,25 @@
     
     return TBool( showQueries ); 
     }
+
+// ---------------------------------------------------------------------------
+// CAdtUpdaterContainer::PredictiveTimeEnabled()
+// Rest of the details are commented in headers.
+// ---------------------------------------------------------------------------
+TBool CAdtUpdaterContainer::PredictiveTimeEnabled()
+     {
+     TInt value( EPredictiveTimeEnabled );
+     CRepository* repository(NULL);
+     
+     TRAPD( err, repository = CRepository::NewL( KCRUidStartupConf ) );
+
+     if ( err == KErrNone )
+         {
+         err = repository->Get( KPredictiveTimeAndCountrySelection, value );
+         }
+     delete repository;
+ 
+     return value;
+     } 
+
 // End of file
Binary file clock2/clockui/utilities/data/tzdb.dbz has changed
--- a/organizer_plat/calendar_custamization_api/inc/calencontext.h	Mon Mar 15 12:40:18 2010 +0200
+++ b/organizer_plat/calendar_custamization_api/inc/calencontext.h	Wed Mar 31 21:29:10 2010 +0300
@@ -22,6 +22,7 @@
 // INCLUDES
 #include <e32base.h>
 #include <e32cmn.h>
+#include <calcommon.h>
 
 // FORWARD DECLARATIONS
 class TVwsViewId;
@@ -214,6 +215,32 @@
 		* @brief Resets calendar file name in context
 		*/
 		virtual void ResetCalendarFileName() = 0;
+		/**
+	    * @brief Set calendar file name of Alarm entry in context
+	    */		
+		virtual void SetCalAlarmEntryFileNameL(const TDesC& aName) = 0;
+		
+	 	/**
+	   	* @brief Get calendar filename 
+	   	* 
+	   	* @return HBufC pointer to calendar filename of Alarm entry
+	   	*/
+		virtual HBufC* GetCalAlarmEntryFileNameL() const = 0;
+		
+		/**
+	   	* @brief Resets Alarm Entry calendar file name in context
+	   	*/ 
+		virtual void ResetCalAlarmEntryFileName() = 0;
+		
+		/**
+	   	* @brief set Alarm Entry LocalUid in context
+	   	*/ 
+		virtual void SetCalAlarmEntryLocalUid(TCalLocalUid aLocalId) = 0;
+    
+	    /**
+	   	* @brief Get Alarm Entry LocalUid from context
+	   	*/ 
+	    virtual TCalLocalUid CalAlarmLocalUidL() const = 0;
     };
 
 #endif // CALENCONTEXT_H
--- a/pimappservices/calendar/client/src/calclient.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/pimappservices/calendar/client/src/calclient.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -35,8 +35,6 @@
 #include "calcalendarinfoimpl.h"
 #include "agmfilechangenotification.h"
 
-const TUint KDefaultMessageSlots = 3;
-
 _LIT(KAgendaMutex, "AgnMutex");
 
 //
@@ -205,7 +203,7 @@
 	
 TInt RAgendaServ::DoConnect()
 	{
-	return CreateSession(KAgendaServerName,Version(), KDefaultMessageSlots);
+	return CreateSession(KAgendaServerName,Version());
 	}
 
 
--- a/pimappservices/calendar/server/src/agsasyncdelete.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/pimappservices/calendar/server/src/agsasyncdelete.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -288,7 +288,11 @@
 			for (TInt i = 0; i < KCount && todelete; ++i)
 				{
 				const CAgnSimpleEntry* KChildEntry = iModel.GetSimpleEntryFromIndexes(KChildIds[i].ChildId());
-				todelete = FallInTimeRangeL(*KChildEntry);
+				if(KChildEntry != NULL)
+				    {
+                    todelete = FallInTimeRangeL(*KChildEntry);
+				    }
+				
 				}
 			}
 
--- a/pimappservices/calendar/server/src/agsentrymanager.cpp	Mon Mar 15 12:40:18 2010 +0200
+++ b/pimappservices/calendar/server/src/agsentrymanager.cpp	Wed Mar 31 21:29:10 2010 +0300
@@ -574,7 +574,7 @@
 		}
 	CleanupStack::PopAndDestroy();
 	iLastRestored = type;
-	return (count);
+	return (buffer->Count());
 	}
 
 CAgnEntry* CAgnEntryManager::SearchBuffers(const TAgnEntryId& aEntryId, TInt& aPos)