Revision: 201017 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 16:12:24 +0300
branchRCL_3
changeset 27 55d60436f00b
parent 21 9711e452b5e9
child 29 ae323dbb990e
child 30 d68a4b5d5885
Revision: 201017 Kit: 201019
alarmui/group/alarmui_activate.rul
alarmui/group/alarmui_snooze.rul
alarmui/group/alarmui_stop.rul
alarmui/group/alarmuisnooze.rul
alarmui/group/bld.inf
alarmui/rom/AlmAlert.iby
alarmui/src/alarmutils.cpp
calendarengines/versit2/group/Versit2.mmp
calendarengines/versit2/src/ICalValue.cpp
calendarui/calenaiwprovider/group/calenaiwprovider.mmp
calendarui/calenaiwprovider/src/calenaiwprovider.cpp
calendarui/controller/inc/calencontroller.h
calendarui/controller/inc/calenmultidbeditor.h
calendarui/controller/src/calenactionui.cpp
calendarui/controller/src/calenalarmmanager.cpp
calendarui/controller/src/calenattachmentui.cpp
calendarui/controller/src/calencmdlinelauncher.cpp
calendarui/controller/src/calencontroller.cpp
calendarui/controller/src/caleneditui.cpp
calendarui/controller/src/calenmultidbeditor.cpp
calendarui/controller/src/calenmultipledbui.cpp
calendarui/controller/src/calennotifier.cpp
calendarui/controller/src/calensettingsstate.cpp
calendarui/controller/src/calenviewmanager.cpp
calendarui/controller/src/calenviewpopulator.cpp
calendarui/editors/inc/calenunifiededitor.h
calendarui/editors/src/CalenEditorDataHandler.cpp
calendarui/editors/src/calenunifiededitor.cpp
calendarui/editors/src/calenunifiededitorcontrol.cpp
calendarui/globaldata/src/calenglobaldata.cpp
calendarui/multicaluidialog/src/multicaluidialogmodel.cpp
calendarui/organizerplugin/aiagendaplugin2/src/aicalendarplugin2focusdata.cpp
calendarui/server/CalenSvr/data/calensvrmissedalarmmanagerresource.rss
calendarui/views/src/calenmissedalarmsview.cpp
calendarui/views/src/calenmissedeventview.cpp
calendarui/views/src/calennativeview.cpp
calendarui/views/src/calentodoview.cpp
clock2/clockengines/utilities/clockecomlistener/src/clockecomlistener.cpp
clock2/clockui/plugins/clockindicatorpaneplugin/src/clockindicatorpluginlistener.cpp
clock2/clockui/uilayer/clkdatetimeview/src/clkdatetimeview.cpp
clock2/clockui/uilayer/clockalarmeditor/src/clockalarmeditorimpl.cpp
clock2/clockui/uilayer/clockmainview/inc/clockmainview.h
clock2/clockui/uilayer/clockmainview/src/clockmainview.cpp
clock2/clockui/uilayer/clockworldview/src/clockworlditemprocessor.cpp
clock2/clockui/uilayer/clockworldview/src/clockworldview.cpp
clock2/clockui/uimodel/inc/clkuiclksrvlistener.h
clock2/clockui/uimodel/src/clkuialarmlistener.cpp
clock2/clockui/uimodel/src/clkuiclksrvlistener.cpp
notepad/notepad1/LibSrc/NpdDialogBase.cpp
notepad/notepad1/LibSrc/NpdListDialog.cpp
notepad/notepad1/inc/NpdDialogBase.h
notepad/notepad1/inc/NpdDialogBase.inl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/alarmui/group/alarmui_activate.rul	Tue May 11 16:12:24 2010 +0300
@@ -0,0 +1,60 @@
+<script xmlns="http://www.nokia.com/ns/cep/script/1.0/" xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
+    <!-- If sensor settings are off, nothing needs to be done -->
+    <if>
+        <or>
+            <!-- Sensor settings are disabled -->
+            <not>
+	            <equals>
+	                <contextRef source='Sensor' type='Setting.Active' value='On'/>
+	            </equals>
+            </not>
+	        <!-- Turning interaction is disabled -->
+	        <not>
+	            <equals>
+	                <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceAlarm' value='On'/>
+	            </equals>
+	        </not>
+        </or>
+        <actions>
+            <!-- Do nothing -->
+        </actions>
+    </if>
+    
+    <!-- Enable sensor services -->
+    <elseIf>
+		<!-- Alarm is active -->
+		<not>
+            <contextUpdated>
+                <contextRef source='AlarmUI' type='State' value='Inactive'/>
+            </contextUpdated>
+		</not>
+	    <actions>
+	            <!-- Activate orientation channel (0x01) from sensor source (0x10282DF0) -->
+	            <sourceCommand uid='0x10282DF0'>
+	                <sensorCommand channelId='0x01' id='activate'/>
+	            </sourceCommand>
+	            <!-- Publish context that indicates that alarm is active -->
+	            <publishContext define='true'>
+	                <contextRef source='Alarm' type='Status.Active' value='true'/>
+	            </publishContext>
+	    </actions>
+    </elseIf>
+
+    <!-- Disable sensor services -->
+    <elseIf>
+        <!-- Alarm is not active -->
+        <contextUpdated>
+            <contextRef source='AlarmUI' type='State' value='Inactive'/>
+        </contextUpdated>
+	    <actions>
+	            <!-- Activate orientation channel (0x01) from sensor source (0x10282DF0) -->
+	            <sourceCommand uid='0x10282DF0'>
+	                <sensorCommand channelId='0x01' id='deactivate'/>
+	            </sourceCommand>
+	            <!-- Publish context that indicates that alarm is not active -->
+	            <publishContext define='true'>
+	                <contextRef source='Alarm' type='Status.Active' value='false'/>
+	            </publishContext>
+	    </actions>
+    </elseIf>
+</script>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/alarmui/group/alarmui_snooze.rul	Tue May 11 16:12:24 2010 +0300
@@ -0,0 +1,22 @@
+<script xmlns="http://www.nokia.com/ns/cep/script/1.0/" xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
+    <!-- If alarm is not active, nothing needs to be done -->
+    <if>
+        <equals>
+            <contextRef source='Alarm' type='Status.Active' value='false'/>
+        </equals>
+        <actions>
+            <!-- Do nothing -->
+        </actions>        
+    </if>
+    
+    <!-- Snooze alarm when device is turned upside down -->
+    <elseIf>
+		<contextChanged>
+		    <contextRef source='Sensor' type='Event.Orientation' value='DisplayDownwards'/>
+		</contextChanged>
+        <actions>
+           <!-- snooze the alarm -->
+            <AlarmUI.Snooze/>
+        </actions>
+    </elseIf>
+</script>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/alarmui/group/alarmui_stop.rul	Tue May 11 16:12:24 2010 +0300
@@ -0,0 +1,22 @@
+<script xmlns="http://www.nokia.com/ns/cep/script/1.0/" xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
+    <!-- If alarm is not active, nothing needs to be done -->
+    <if>
+        <equals>
+            <contextRef source='Alarm' type='Status.Active' value='false'/>
+        </equals>
+        <actions>
+            <!-- Do nothing -->
+        </actions>        
+    </if>
+    
+    <!-- Stop alarm when 'stop' command is received from alarmui -->
+    <elseIf>
+		<contextUpdated>
+		    <contextRef source='AlarmUI' type='Command' value='Stop'/>
+		</contextUpdated>
+		<actions>
+			<!-- stop the alarm -->
+			<AlarmUI.Stop/>
+		</actions>
+    </elseIf>
+</script>
\ No newline at end of file
--- a/alarmui/group/alarmuisnooze.rul	Tue Apr 27 16:36:22 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-<!-- defines a rules to snooze and stop an active alarm on a doubletap or turndown event -->
-<script xmlns="http://www.nokia.com/ns/cep/script/1.0/" xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
-
-    <!-- active sensor channels when alarm expires -->
-		<if>
-        <equals>
-            <contextRef source='Sensor' type='Setting.Active'/>
-            <string>Off</string>
-        </equals>
-        <actions>
-        </actions>
-    </if>
-    <!-- Check if we have an active alarm and we receive an event -->
-    <elseIf>
-        <and>
-            <!-- Must have an active alarm and receive new double tap event or orientation event from sensor -->
-            <!-- ...alarm is active... -->
-            <notEqual>
-                <contextRef source='AlarmUI' type='State'/>
-                <string>Inactive</string>
-            </notEqual>
-            <or>
-                <and>
-                    <!-- Check that double tap interaction is set -->
-                    <equals>
-                        <contextRef source='Sensor' type='Setting.TappingInteraction.SilenceAlarm'/>
-                        <string>On</string>
-                    </equals>
-                    <!-- ...and we receive a new doubletap event from sensors -->
-                    <contextUpdated>
-                        <contextRef source='Sensor' type='Event.DoubleTap'/>
-        	          </contextUpdated>
-                </and>
-    	          <and>
-                    <!-- Check that turning interaction is set -->
-                    <equals>
-                        <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceAlarm'/>
-                        <string>On</string>
-                    </equals>
-                    <!-- ...and previous orientation is not 'Undefined' ... -->
-                    <notEqual>
-                        <contextRef source='Sensor' type='Event.Orientation.Previous'/>
-                        <string>Undefined</string>
-                    </notEqual>
-                    <!-- ...and we receive a new orientation event from sensors... -->
-		                <contextChanged>
-		                    <contextRef source='Sensor' type='Event.Orientation'/>
-		    	          </contextChanged>
-    	        	    <equals>
-                        <contextRef source='Sensor' type='Event.Orientation'/>
-                      	<string>DisplayDownwards</string>
-    	              </equals>
-    	          </and>
-            </or>
-        </and>
-        <actions>
-           <!-- snooze the alarm -->
-            <AlarmUI.Snooze dummy='dummy'/>
-
-            <!-- request vibra feedback -->
-            <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
-        </actions>
-    </elseIf>
-    <!-- Check if we just have an active alarm -->
-    <!-- active sensor channels when alarm expires -->
-    <elseIf>
-    		<and>
-            <!-- ...alarm is active... -->
-            <contextUpdated>
-                <contextRef source='AlarmUI' type='State'/>
-            </contextUpdated>
-            <notEqual>
-                <contextRef source='AlarmUI' type='State'/>
-                <string>Inactive</string>
-            </notEqual>
-        </and>
-        <actions>
-            <!-- Activate double tap events from sensor -->
-            <publishContext>
-                <contextRef source='Sensor' type='Event' value='DoubleTap.Activate'/>
-            </publishContext>
-            <!-- Activate orientation events from sensor -->
-            <publishContext>
-                <contextRef source='Sensor' type='Event' value='Orientation.Activate'/>
-            </publishContext>
-        </actions>
-    </elseIf>
-    <!-- stop an active alarm on a 'Stop' command -->
-    <elseIf>
-        <and>
-            <!-- alarm is active... -->
-            <notEqual>
-                <contextRef source='AlarmUI' type='State'/>
-                <string>Inactive</string>
-            </notEqual>
-            <!-- ...and we got a new stop command -->
-            <contextUpdated>
-                <contextRef source='AlarmUI' type='Command'/>
-            </contextUpdated>
-            <equals>
-                <contextRef source='AlarmUI' type='Command'/>
-                <string>Stop</string>
-            </equals>
-        </and>
-        <actions>
-            <!-- stop the alarm -->
-            <AlarmUI.Stop dummy='dummy'/>
-
-            <!-- request vibra feedback -->
-            <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
-        </actions>
-    </elseIf>
-    <!-- snooze an active alarm on a 'Snooze' command -->
-    <elseIf>
-        <and>
-            <!-- alarm is active... -->
-            <notEqual>
-                <contextRef source='AlarmUI' type='State'/>
-                <string>Inactive</string>
-            </notEqual>
-            <!-- ...and we got a new stop command -->
-            <contextUpdated>
-                <contextRef source='AlarmUI' type='Command'/>
-            </contextUpdated>
-            <equals>
-                <contextRef source='AlarmUI' type='Command'/>
-                <string>Snooze</string>
-            </equals>
-        </and>
-        <actions>
-            <!-- snooze the alarm -->
-            <AlarmUI.Snooze dummy='dummy'/>
-
-            <!-- request vibra feedback -->
-            <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
-        </actions>
-    </elseIf>
-</script>    
\ No newline at end of file
--- a/alarmui/group/bld.inf	Tue Apr 27 16:36:22 2010 +0300
+++ b/alarmui/group/bld.inf	Tue May 11 16:12:24 2010 +0300
@@ -33,9 +33,15 @@
 ../inc/alarmsourcecontextdef.h  |../../inc/alarmsourcecontextdef.h
 
 // context framework scripts
-alarmuisnooze.rul           /epoc32/release/winscw/udeb/z/private/10282bc4/rules/alarmuisnooze.rul
-alarmuisnooze.rul           /epoc32/release/winscw/urel/z/private/10282bc4/rules/alarmuisnooze.rul
-alarmuisnooze.rul           /epoc32/data/z/private/10282bc4/rules/alarmuisnooze.rul
+alarmui_snooze.rul          /epoc32/release/winscw/udeb/z/private/10282bc4/rules/alarmui_snooze.rul
+alarmui_snooze.rul          /epoc32/release/winscw/urel/z/private/10282bc4/rules/alarmui_snooze.rul
+alarmui_snooze.rul          /epoc32/data/z/private/10282bc4/rules/alarmui_snooze.rul
+alarmui_activate.rul        /epoc32/release/winscw/udeb/z/private/10282bc4/rules/alarmui_activate.rul
+alarmui_activate.rul        /epoc32/release/winscw/urel/z/private/10282bc4/rules/alarmui_activate.rul
+alarmui_activate.rul        /epoc32/data/z/private/10282bc4/rules/alarmui_activate.rul
+alarmui_stop.rul            /epoc32/release/winscw/udeb/z/private/10282bc4/rules/alarmui_stop.rul
+alarmui_stop.rul            /epoc32/release/winscw/urel/z/private/10282bc4/rules/alarmui_stop.rul
+alarmui_stop.rul            /epoc32/data/z/private/10282bc4/rules/alarmui_stop.rul
 
 
 // alarm tones
--- a/alarmui/rom/AlmAlert.iby	Tue Apr 27 16:36:22 2010 +0300
+++ b/alarmui/rom/AlmAlert.iby	Tue May 11 16:12:24 2010 +0300
@@ -37,7 +37,10 @@
 
 #ifdef RD_CONTEXT_FRAMEWORK
 // Context framework scripts
-data=\epoc32\data\Z\private\10282BC4\Rules\alarmuisnooze.rul    private\10282BC4\Rules\alarmuisnooze.rul
+data=\epoc32\data\Z\private\10282BC4\Rules\alarmui_snooze.rul      private\10282BC4\Rules\alarmui_snooze.rul
+data=\epoc32\data\Z\private\10282BC4\Rules\alarmui_activate.rul    private\10282BC4\Rules\alarmui_activate.rul
+data=\epoc32\data\Z\private\10282BC4\Rules\alarmui_stop.rul        private\10282BC4\Rules\alarmui_stop.rul
+
 #endif // RD_CONTEXT_FRAMEWORK
 
 #endif  // __ALMALERT_IBY__
--- a/alarmui/src/alarmutils.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/alarmui/src/alarmutils.cpp	Tue May 11 16:12:24 2010 +0300
@@ -48,7 +48,7 @@
 #include <wakeupalarm.h>
 #include <calalarm.h> // KUidAgendaModelAlarmCategory - the alarm category id for calendar alarms
 #include <AknUtils.h>
-#include <HWRMPowerStateSDKPSKeys.h>
+#include <hwrmpowerstatesdkpskeys.h>
 
 #ifndef SYMBIAN_CALENDAR_V2
 #include <agmalarm.h> // deprecated, use CalAlarm.h when SYMBIAN_CALENDAR_V2 flag is enabled
--- a/calendarengines/versit2/group/Versit2.mmp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarengines/versit2/group/Versit2.mmp	Tue May 11 16:12:24 2010 +0300
@@ -29,6 +29,7 @@
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../../inc
+USERINCLUDE     ../../agnversit2/inc
 
 //System include macro
 APP_LAYER_SYSTEMINCLUDE
--- a/calendarengines/versit2/src/ICalValue.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarengines/versit2/src/ICalValue.cpp	Tue May 11 16:12:24 2010 +0300
@@ -26,6 +26,7 @@
 // User includes.
 #include "ICalKeyWords.h"		// Literals
 #include "ICalRuleSegment.h"	// CICalRuleSegment
+#include "CleanupPointerArray.h"   // For TCleanupPointerArray
 
 // Constants.
 
@@ -814,7 +815,7 @@
 		}
 		
 	TUint charNum(0);
-	
+	CleanupPointerArrayPushL(aRuleSegmentArray);
 	do
 		{
 		// Create a rule segment from characters charNum to nextSemiColon
@@ -847,6 +848,7 @@
 		}
 	while (charNum < iValue->Length());
 	
+	CleanupStack::Pop(&aRuleSegmentArray);
 	TRACE_EXIT_POINT;
 	}
 
--- a/calendarui/calenaiwprovider/group/calenaiwprovider.mmp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/calenaiwprovider/group/calenaiwprovider.mmp	Tue May 11 16:12:24 2010 +0300
@@ -66,6 +66,8 @@
 LIBRARY      eikctl.lib
 LIBRARY      cone.lib
 LIBRARY      bafl.lib 
+LIBRARY      eikcoctl.lib 
+LIBRARY      eikcore.lib
 
 // End of file.
 
--- a/calendarui/calenaiwprovider/src/calenaiwprovider.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/calenaiwprovider/src/calenaiwprovider.cpp	Tue May 11 16:12:24 2010 +0300
@@ -33,6 +33,8 @@
 #include <calentry.h>
 #include <bautils.h>
 #include <data_caging_path_literals.hrh>
+#include <aknnavide.h>
+#include <akntitle.h>
 
 // User inlcudes.
 #include "calenaiwprovider.h"
@@ -425,11 +427,64 @@
         User::LeaveIfError( errVal );
         }
     // Handle the command here.
+    
+    // Create settings own titlepane and navipane, and swap with existing ones
+    CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane();
+
+    // Titlepane
+    CAknTitlePane* newtp = new( ELeave ) CAknTitlePane();
+    CleanupStack::PushL( newtp );
+    CCoeControl* oldtp = sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), newtp );
+    CleanupStack::Pop( newtp ); // ownership is passed to statuspane
+    TRect oldRect( 0, 0, 0, 0 );
+    if( oldtp )
+        {
+        CleanupStack::PushL( oldtp );
+        oldRect = oldtp->Rect();
+        CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidTitle ));
+        newtp->SetContainerWindowL( *ctrl );
+        newtp->ConstructL();
+        newtp->SetRect(oldRect);
+        newtp->ActivateL();
+        }        
+
+    // NaviPane
+    CAknNavigationControlContainer* newnp = new( ELeave )CAknNavigationControlContainer();
+    CleanupStack::PushL( newnp );
+    CCoeControl* oldnp = sp->SwapControlL( TUid::Uid( EEikStatusPaneUidNavi ), newnp );
+    CleanupStack::Pop( newnp ); // ownership is passed to statuspane
+    if( oldnp )
+        {
+        CleanupStack::PushL( oldnp );
+        oldRect = oldnp->Rect();
+        CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidNavi ) );
+        newnp->SetContainerWindowL( *ctrl );
+        newnp->ConstructL();
+        newnp->SetRect( oldRect );
+        newnp->PushDefaultL();
+        newnp->ActivateL();
+        }
         
     CMultiCalUiDialog* multiCalUiDialog = CMultiCalUiDialog::NewLC( iCalEntryArray );
     errVal =  multiCalUiDialog->LaunchL();
     CleanupStack::PopAndDestroy( multiCalUiDialog );   
     
+    
+    // When setting is closed, swap back old titlepane and navipane
+   if( oldnp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidNavi), oldnp ) )
+       {
+       CleanupStack::Pop( oldnp );
+       delete newnp;
+       oldnp->ActivateL();
+       }
+
+   if( oldtp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), oldtp ) )
+       {
+       CleanupStack::Pop( oldtp );
+       delete newtp;
+       oldtp->ActivateL();
+       }
+    
     return errVal;
     
     TRACE_EXIT_POINT
--- a/calendarui/controller/inc/calencontroller.h	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/inc/calencontroller.h	Tue May 11 16:12:24 2010 +0300
@@ -330,6 +330,23 @@
         void GetAllCalendarInfoL( 
                     RPointerArray<CCalCalendarInfo>& aCalendarInfoList );
         
+        /**
+         * @brief sets the flag if the calendar application is launched
+         *  from external application.
+         * 
+         * @param aFlag The flag to be set.
+         */
+        void SetLaunchFromExternalApp( TBool aFlag );
+        
+        /**
+         * @brief Checks whether the calendar application is launched
+         * from external application.
+         * 
+         * @return ETrue If the calendar application is launched from
+         * external application else EFalse.
+         */
+        TBool IsLaunchFromExternalApp();
+        
     private:  // Construction and destruction
         /**
          * C++ constructor
@@ -416,6 +433,7 @@
         TInt iResourceFileOffset;
         CAsyncCallBack* iSystemTimeChangedMsgDelayer;   
         TBool iFasterApp;
+        TBool iLaunchFromExternalApp;
     };
 
 #endif // CALENCONTROLLER_H
--- a/calendarui/controller/inc/calenmultidbeditor.h	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/inc/calenmultidbeditor.h	Tue May 11 16:12:24 2010 +0300
@@ -255,6 +255,14 @@
 	void SetTitlePaneL();  
 	
     void SetSyncFieldL( TBool aSyncVal );
+    
+    /**
+     * @breif Checks if the Flash File System storage will fall below
+     *        Critical Level. Warning will be displayed if storage
+     *        is below Critical Level.
+     * @return ETrue : Below critical level
+     */
+    TBool CheckSpaceBelowCriticalLevelL();
  protected:
 
 	/**
--- a/calendarui/controller/src/calenactionui.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/calenactionui.cpp	Tue May 11 16:12:24 2010 +0300
@@ -37,6 +37,8 @@
 #include "calennotifier.h"
 #include "calenmultipledbui.h"
 #include "calenattachmentui.h"
+#include "CalenUid.h"
+#include "calenviewmanager.h"
 
 // ----------------------------------------------------------------------------
 // CCalenActionUi::NewL
@@ -304,8 +306,9 @@
         PIM_TRAPD_HANDLE( retValue = dlg->ExecuteLD( R_CALEN_MULTIPLEDB_DIALOG ) );
         notifier.ResumeSettingsNotifications();
         
-        // Unhide the toolbar when settings is closed
-        if(toolbar)
+        // Unhide the toolbar when manage calendar view is closed
+        TUid activeViewUid = iController.ViewManager().CurrentView();
+        if(toolbar && (activeViewUid != KUidCalenMissedAlarmsView ) &&(activeViewUid != KUidCalenMissedEventView ) )
             {
             toolbar->SetToolbarVisibilityL(ETrue); 
             }
@@ -414,7 +417,8 @@
     notifier.ResumeSettingsNotifications();
     
     // Unhide the toolbar when settings is closed
-    if(toolbar)
+    TUid activeViewUid = iController.ViewManager().CurrentView();
+    if(toolbar && (activeViewUid != KUidCalenMissedAlarmsView ) &&(activeViewUid != KUidCalenMissedEventView ) )
         {
         toolbar->SetToolbarVisibilityL(ETrue); 
         }
--- a/calendarui/controller/src/calenalarmmanager.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/calenalarmmanager.cpp	Tue May 11 16:12:24 2010 +0300
@@ -46,7 +46,7 @@
 #include "calensetting.h"
 #include "calencontextfwlistener.h"
 #include "CleanupResetAndDestroy.h"
-#include "CalenAttachmentModel.h"
+#include "calenattachmentmodel.h"
 
 static const TUint32 KMaxMissedAlarms = 10;
 
@@ -1167,9 +1167,11 @@
     else if( iPreviousToEventViewUid!=KNullUid && 
             ( iPreviousToEventViewUid!= KUidCalenEventView || iPreviousToEventViewUid != KUidCalenMissedEventView ) )
         {
+        iViewManager.SetRepopulation(EFalse);
         TVwsViewId previousViewId(KUidCalendar, iPreviousToEventViewUid) ;
         iController.ViewManager().RequestActivationL(previousViewId);
         iPreviousToEventViewUid = KNullUid;
+        iViewManager.SetRepopulation(ETrue);
         }
 	else
 		{
--- a/calendarui/controller/src/calenattachmentui.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/calenattachmentui.cpp	Tue May 11 16:12:24 2010 +0300
@@ -45,8 +45,6 @@
 #include "CleanupResetAndDestroy.h"
 #include "calenviewmanager.h"
 
-//_LIT16( KTextDataType, ".txt" );
-const TInt KCalenAttachmentOverhead = 1024;
 
 // ----------------------------------------------------------------------------
 // CCalenAttachmentUi::NewL
--- a/calendarui/controller/src/calencmdlinelauncher.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/calencmdlinelauncher.cpp	Tue May 11 16:12:24 2010 +0300
@@ -258,6 +258,7 @@
             if( iController.ViewManager().ViewsActivated() )
                 {
                 iController.IssueCommandL( command );
+                iController.SetLaunchFromExternalApp( ETrue );
                 }
             else
                 {
--- a/calendarui/controller/src/calencontroller.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/calencontroller.cpp	Tue May 11 16:12:24 2010 +0300
@@ -1133,5 +1133,33 @@
     iGlobalData->GetAllCalendarInfoL(aCalendarInfoList);
     TRACE_EXIT_POINT;
     }
+
+// -----------------------------------------------------------------------------
+// CCalenController::SetLaunchFromExternalApp
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CCalenController::SetLaunchFromExternalApp( TBool aFlag )
+    {
+    TRACE_ENTRY_POINT;
+    
+    iLaunchFromExternalApp = aFlag;
+    TRACE_EXIT_POINT;
+    }
+
+// -----------------------------------------------------------------------------
+// CCalenController::SetLaunchFromExternalApp
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CCalenController::IsLaunchFromExternalApp()
+    {
+    TRACE_ENTRY_POINT;
+    TRACE_EXIT_POINT;
+    
+    return iLaunchFromExternalApp;
+    }
 // End of file
 
--- a/calendarui/controller/src/caleneditui.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/caleneditui.cpp	Tue May 11 16:12:24 2010 +0300
@@ -521,7 +521,8 @@
     isEditorActive = EFalse;
     
     // Unhide the toolbar when settings is closed
-    if(toolbar)
+    TUid activeViewUid = iController.ViewManager().CurrentView();
+    if(toolbar && (activeViewUid != KUidCalenMissedAlarmsView ) &&(activeViewUid != KUidCalenMissedEventView ) )
         {
         toolbar->SetToolbarVisibilityL(ETrue); 
         }
@@ -556,7 +557,7 @@
                 {
                 // Show saved note for new entries
                 TInt res;
-                if( aEntry->EntryTypeL() == CCalEntry::ETodo )
+                if( context.InstanceId().iType == CCalEntry::ETodo )
                     {
                     res = R_QTN_CALE_NOTE_TODO_SAVED;
                     }
--- a/calendarui/controller/src/calenmultidbeditor.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/calenmultidbeditor.cpp	Tue May 11 16:12:24 2010 +0300
@@ -30,6 +30,8 @@
 #include <calcalendarinfo.h>
 #include <Calendar.rsg>
 #include <calencommonui.rsg>
+#include <sysutil.h>
+#include <ErrorUI.h>
 
 #include "calenmultidbeditor.h"
 #include "calendarui_debug.h"
@@ -665,6 +667,12 @@
 TBool CCalenMultiDBEditor::SaveNoteL( TInt aButtonId )
 	{
     TRACE_ENTRY_POINT;
+    
+    if( CheckSpaceBelowCriticalLevelL() )
+        {
+        TRACE_EXIT_POINT;
+        return EFalse; 
+        }
 
     if (Conflict() == CCalenMultiDBEditor::EConflictDelete)
         {
@@ -1202,6 +1210,32 @@
     CleanupStack::PopAndDestroy( syncString );    
     TRACE_EXIT_POINT;
     }
+
+// -----------------------------------------------------------------------------
+// CheckSpaceBelowCriticalLevelL
+// Checks if the Flash File System storage will fall below critical level. 
+// If there is not enough space, display an error message and return EFalse.
+// Return ETrue otherwise.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CCalenMultiDBEditor::CheckSpaceBelowCriticalLevelL()
+    {
+    TRACE_ENTRY_POINT;
+    
+    TBool retcode(EFalse);
+    if ( SysUtil::FFSSpaceBelowCriticalLevelL( &( iCoeEnv->FsSession() ) ) )
+        {
+        CErrorUI* errorUi = CErrorUI::NewLC();
+        errorUi->ShowGlobalErrorNoteL( KErrDiskFull );
+        CleanupStack::PopAndDestroy( errorUi ); 
+        retcode = ETrue;
+        }
+    TRACE_EXIT_POINT;
+    return retcode;
+    }
+
+
 // -----------------------------------------------------------------------------
 // CDbColorPicture::CDbColorPicture
 // C++ Constructor
--- a/calendarui/controller/src/calenmultipledbui.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/calenmultipledbui.cpp	Tue May 11 16:12:24 2010 +0300
@@ -665,7 +665,7 @@
   
     //Async dialog
     retValue = iDbEditor->ExecuteLD();
-    iDbEditor = NULL;
+    //iDbEditor = NULL;
      
     if(EAknCmdExit == retValue )
         {
@@ -684,6 +684,8 @@
 void CCalenMultipleDbUi::UpdateOnAddOrEditL(TBool aItemAdded)
     {
     TRACE_ENTRY_POINT
+	
+	iDbEditor = NULL;
     
     if(aItemAdded)
         {
@@ -776,7 +778,7 @@
 
     //Async dialog
     retValue = iDbEditor->ExecuteLD();
-    iDbEditor = NULL;
+    //iDbEditor = NULL;
     
     return retValue;
     TRACE_EXIT_POINT
--- a/calendarui/controller/src/calennotifier.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/calennotifier.cpp	Tue May 11 16:12:24 2010 +0300
@@ -793,9 +793,6 @@
 
                 if (err == KErrNone && markAsdelete)
                     {
-                    //BroadcastNotification(ECalenNotifyCloseDialog);
-                    BroadcastNotification(ECalenNotifyDeleteInstanceView);
-                    BroadcastNotification(ECalenNotifyCalendarFileDeleted);
                     iFilnameDeleted = aCalendarInfoChangeEntries[index]->FileNameL().AllocL();
                     iAsyncCallback->CallBack();
                     }
@@ -831,7 +828,10 @@
 void CCalenNotifier::AsyncRemoveCalendarL()
     {
     TRACE_ENTRY_POINT
+    BroadcastNotification(ECalenNotifyDeleteInstanceView);
     iGlobalData->RemoveCalendarL(iFilnameDeleted->Des());
+    BroadcastNotification(ECalenNotifyCalendarFileDeleted);
+                       
     delete iFilnameDeleted;
     iFilnameDeleted = NULL;
     TRACE_EXIT_POINT
--- a/calendarui/controller/src/calensettingsstate.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/calensettingsstate.cpp	Tue May 11 16:12:24 2010 +0300
@@ -153,6 +153,8 @@
             ActivateCurrentStateL(aStateMachine);
             }
             break;
+        case ECalenNotifySettingsChanged:
+            break;
         default:
             // default is defer all other notifications when we are in setting state
             iOutstandingNotifications.InsertL(aNotification);
--- a/calendarui/controller/src/calenviewmanager.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/calenviewmanager.cpp	Tue May 11 16:12:24 2010 +0300
@@ -702,7 +702,7 @@
     // check for iAvoidRepopulation to avoid repopulation whenever
     // 1) Application comes to foreground
     // 2) Applictaion is opened after fake exit
-    if(!iAvoidRepopulation)
+    if(!iAvoidRepopulation || iController.IsLaunchFromExternalApp() )
         {
         TRAPD(error,StartActiveStepL());
         if(error!=KErrNone)
@@ -1734,25 +1734,6 @@
             CleanupStack::PopAndDestroy(repository);  
             }
         }
-    else // If default view is native view, then activate it
-        {
-        iAvoidRepopulation = EFalse;
-        // In case of launching missed event view or missed alarms view, there
-        // is no need to activate default view.
-        if( ( iCurrentViewId.iViewUid.iUid != KCalenMissedEventViewUidValue ) && 
-                          ( iCurrentViewId.iViewUid.iUid != KCalenMissedAlarmsViewUidValue ) )
-            {
-            // Find the default view in the view cycle list
-            TInt position = iViewInfoArray.Find(
-                    defaultViewUid, CCalenViewInfo::ViewInfoIdentifier );
-            if( position != KErrNotFound )
-                {
-                TVwsViewId targetViewId( KUidCalendar, defaultViewUid);
-                RequestActivationL(targetViewId);
-                iViewCycleIndex = position;
-                }
-            }
-        }
     
     TRACE_EXIT_POINT;
     }
--- a/calendarui/controller/src/calenviewpopulator.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/controller/src/calenviewpopulator.cpp	Tue May 11 16:12:24 2010 +0300
@@ -26,6 +26,9 @@
 #include "calenglobaldata.h"
 #include "calennotifier.h"
 
+#include <eikenv.h> // For CEikonEnv
+#include <apgtask.h>
+
 // ----------------------------------------------------------------------------
 // CCalenViewPopulator::NewL
 // 1st phase of construction
@@ -192,6 +195,16 @@
         	{
         	iPopulatingView = NULL;
             iController.Notifier().BroadcastNotification( ECalenNotifyViewPopulationComplete );
+            
+            if( iController.IsLaunchFromExternalApp() )
+                {
+                CEikonEnv* eikenv = CEikonEnv::Static();
+                iController.SetLaunchFromExternalApp( EFalse );
+                const TUid KCalendarAppUID = { 0x10005901 };
+                TApaTaskList taskList( eikenv->WsSession() );
+                TApaTask task = taskList.FindApp( KCalendarAppUID );
+                task.BringToForeground();
+                }
         	}
             break;
         default:
--- a/calendarui/editors/inc/calenunifiededitor.h	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/editors/inc/calenunifiededitor.h	Tue May 11 16:12:24 2010 +0300
@@ -502,6 +502,7 @@
          */
         void GetAttachmentNamesL(RPointerArray<HBufC>& aAttachmentNames);
         
+        TBool iCheck;
     protected:
         /**
          * From CEikDialog
--- a/calendarui/editors/src/CalenEditorDataHandler.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/editors/src/CalenEditorDataHandler.cpp	Tue May 11 16:12:24 2010 +0300
@@ -790,7 +790,22 @@
         case ERepeatDaily:
         case ERepeatWorkdays:
             {
-            TTimeIntervalDays durDays = Edited().EndDateTime().DaysFrom( Edited().StartDateTime() );
+            TTime startDate = Edited().StartDateTime();
+            TTime endDate = Edited().EndDateTime();
+            // In case AllDay event end at "12:00am" 24/06/2009. 
+            // editor should display EndDate as 23/06/2009.
+            if(Edited().IsAllDayEvent())
+                {
+                if( endDate > startDate )
+                    {
+                    endDate -= TTimeIntervalDays( 1 );
+                    if( endDate < startDate )
+                        {
+                        endDate = startDate;
+                        }
+                    }
+                }
+            TTimeIntervalDays durDays = endDate.DaysFrom( startDate);
             isError = durDays >= TTimeIntervalDays(1);
             break;
             }
--- a/calendarui/editors/src/calenunifiededitor.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/editors/src/calenunifiededitor.cpp	Tue May 11 16:12:24 2010 +0300
@@ -288,7 +288,7 @@
     
     isReplaceLocation = EFalse;
     
-   
+    iCheck = EFalse;
     TCallBack callback(CCalenUnifiedEditor::AsyncProcessCommandL,this);
     iAsyncCallback = new(ELeave) CAsyncCallBack(callback,CActive::EPriorityStandard);
     
@@ -601,6 +601,7 @@
              if( iServices->EntryViewL(colId) )
                  {
                  PIM_TRAPD_HANDLE( TryToSaveNoteOnForcedExitL() );
+                 iCheck = EFalse;
                  }
              if(EAknSoftkeyExit == aButtonId)
                  iServices->IssueCommandL(aButtonId);
@@ -1471,7 +1472,7 @@
 // (other items were commented in a header).
 // -----------------------------------------------------------------------------
 //
-void CCalenUnifiedEditor::TryInsertSendMenuL( TInt aResourceId, CEikMenuPane* aMenuPane )
+void CCalenUnifiedEditor::TryInsertSendMenuL( TInt /*aResourceId*/, CEikMenuPane* aMenuPane )
     {
     TRACE_ENTRY_POINT;
 
@@ -1925,16 +1926,20 @@
         
         TTime startDate = Edited().StartDateTime();
         TTime endDate = Edited().EndDateTime();
+        TTimeIntervalDays differenceInTime = endDate.DaysFrom(startDate); // fix for AllDayEntry issue
         
         if( startDate == CalenDateUtils::BeginningOfDay( startDate ) &&
                 endDate == CalenDateUtils::BeginningOfDay( endDate ) )
             {
-            TTimeIntervalDays differenceInTime = endDate.DaysFrom(startDate); // fix for AllDayEntry issue
             if( CCalEntry::EAppt == Edited().EntryType() && startDate != endDate && differenceInTime.Int() >= 1 )
                 {
                 Edited().SetEntryType( CCalEntry::EEvent );
                 }
             }
+        if(differenceInTime.Int() == 0 && (CCalEntry::EAppt == Edited().EntryType() || CCalEntry::EEvent == Edited().EntryType()))
+            {
+            Edited().SetEntryType( CCalEntry::EAppt ); //changed
+            }
         
         switch ( EditorDataHandler().ShouldSaveOrDeleteOrDoNothingL() ) 
             {
@@ -2245,7 +2250,7 @@
 void CCalenUnifiedEditor::TryToSaveNoteOnForcedExitL()
     {
     TRACE_ENTRY_POINT;
-    
+    iCheck = ETrue;
     if( EntryStillExistsL() == EEntryOk )
         {
         if( CheckSpaceBelowCriticalLevelL() )
@@ -3002,6 +3007,7 @@
     if( attachmentCount )
         {
         RPointerArray<HBufC> attachmentNames;
+        CleanupResetAndDestroyPushL(attachmentNames);
         GetAttachmentNamesL(attachmentNames);
         attachmentCount = attachmentNames.Count();            
         TInt attachmentLength(0);        
@@ -3026,7 +3032,7 @@
         
         // Cleanup
         delete attachmentNamesString;
-        attachmentNames.ResetAndDestroy();
+        CleanupStack::PopAndDestroy(&attachmentNames);
         }
     
     TRACE_EXIT_POINT;
--- a/calendarui/editors/src/calenunifiededitorcontrol.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/editors/src/calenunifiededitorcontrol.cpp	Tue May 11 16:12:24 2010 +0300
@@ -1151,7 +1151,8 @@
             TTime startDate = iUnifiedEditor.Edited().StartDateTime();
             startDate = CalenDateUtils::BeginningOfDay( startDate );
             iUnifiedEditor.Edited().SetStartDateTimeL(startDate);
-            if( result >= startDate )
+
+            if( result >= startDate && (!iUnifiedEditor.iCheck ) || iUnifiedEditor.Edited().EntryType() == CCalEntry::EEvent)
                 {
                 result += TTimeIntervalDays( KOneDay );
                 }
--- a/calendarui/globaldata/src/calenglobaldata.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/globaldata/src/calenglobaldata.cpp	Tue May 11 16:12:24 2010 +0300
@@ -48,7 +48,7 @@
 #include <CalendarInternalCRKeys.h>
 #include <calenmulticalutil.h>
 
-#include <BAUTILS.H>
+#include <bautils.h>
 #include <calensvrmissedalarmmanagerresource.rsg>
 // Default Calendar database path
 _LIT( KCalendarDatabaseFilePath, "c:calendar" );
@@ -1394,6 +1394,7 @@
                 
                 // Set the modification time as home time.
                 keyBuff.Zero();
+                keyBuff.AppendNum(EModificationTime);
                 TTime modificationTime;
                 modificationTime.HomeTime();
                 TPckgC<TTime> pkgModificationTime(modificationTime);
@@ -1499,6 +1500,7 @@
                     RPointerArray<CCalCalendarInfo>& aCalendarInfoList )
 	{
 	TRACE_ENTRY_POINT;
+	CleanupClosePushL(aCalendarInfoList);
     RFs fsSession;
     CleanupClosePushL( fsSession );
     RResourceFile resourceFile;
@@ -1545,6 +1547,7 @@
 	        
 	    }
 	 CleanupStack::PopAndDestroy(2);
+	 CleanupStack::Pop(&aCalendarInfoList);
 	TRACE_EXIT_POINT;
 	}
 
--- a/calendarui/multicaluidialog/src/multicaluidialogmodel.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/multicaluidialog/src/multicaluidialogmodel.cpp	Tue May 11 16:12:24 2010 +0300
@@ -25,6 +25,7 @@
 // user include.
 #include "multicaluidialogmodel.h"
 #include "calendarui_debug.h"
+#include "cleanupresetanddestroy.h"
 
 // ----------------------------------------------------------------------------
 // CMultiCalUiDialogModel::CMultiCalUiDialogModel
@@ -260,6 +261,7 @@
     {
     TRACE_ENTRY_POINT;
 
+    CleanupResetAndDestroyPushL(aCalCopyEntries);
     for (TInt i = 0; i < iCalEntries.Count(); i++)
         {
         const CCalEntry* sourceEntry = iCalEntries[i];
@@ -281,7 +283,7 @@
 
         CleanupStack::Pop(copyEntry);
         }
-
+    CleanupStack::Pop(&aCalCopyEntries);
     TRACE_EXIT_POINT;;
     }
 
--- a/calendarui/organizerplugin/aiagendaplugin2/src/aicalendarplugin2focusdata.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/organizerplugin/aiagendaplugin2/src/aicalendarplugin2focusdata.cpp	Tue May 11 16:12:24 2010 +0300
@@ -44,7 +44,6 @@
         {
         const TUid dummyUID = { 0x0 };
         task.SendMessage( dummyUID, tailBuf );
-        task.BringToForeground();
         }
     else  // Launch Calendar into day view
         {
--- a/calendarui/server/CalenSvr/data/calensvrmissedalarmmanagerresource.rss	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/server/CalenSvr/data/calensvrmissedalarmmanagerresource.rss	Tue May 11 16:12:24 2010 +0300
@@ -47,6 +47,7 @@
     imagefile         = AVKON_ICON_FILE;     // Image file name (including path).
     imageid           = EMbmAvkonQgn_note_alarm_calendar; // Image id.
     imagemask         = EMbmAvkonQgn_note_alarm_calendar_mask;
+    flags             = EAknNoteLeftSoftkeyWhenTapped;
     }
 
 RESOURCE TBUF r_missed_alarm_group_singular {buf = qtn_notif_miss_cale_event_group;}
--- a/calendarui/views/src/calenmissedalarmsview.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/views/src/calenmissedalarmsview.cpp	Tue May 11 16:12:24 2010 +0300
@@ -133,11 +133,15 @@
                 
                 RedrawStatusPaneL();
                 UpdateCbaL();
+                
+                //no tool bar in missed alarms view
+                MCalenToolbar* toolbar = iServices.ToolbarOrNull();
+	       	    if(toolbar && toolbar->IsVisible())
+	       	        {
+                    toolbar->SetToolbarVisibilityL(EFalse);  
+	       	        } 
+	       	    nextStep = CCalenView::EDone;
 	       	    }
-       	    
-       	 
-
-        	nextStep = CCalenView::EDone;
         	}
         	break;	
         }
@@ -241,34 +245,20 @@
             break;
         case ECalenCmdGotoCalendar:            
             {
-            MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
-            if(toolbar)
-             {
-             toolbar->SetToolbarVisibilityL(ETrue);  
-             } 
             iHighlightedRowNumber = 0;
-            iServices.IssueCommandL(aCommand);
+			iServices.IssueCommandL(aCommand);
             }
             break;
         case EAknSoftkeyBack:
         case EAknSoftkeyClose:
             {
-            MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
-            if(toolbar)
-             {
-             toolbar->SetToolbarVisibilityL(ETrue);  
-             } 
             iHighlightedRowNumber = 0;
-            iServices.IssueNotificationL(ECalenNotifyMissedAlarmViewClosed);
-            }
+			iServices.IssueNotificationL(ECalenNotifyMissedAlarmViewClosed);
+			}
             break;
         case EAknSoftkeyExit:
             {
-            MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
-            if(toolbar)
-             {
-             toolbar->SetToolbarVisibilityL(ETrue);  
-             } 
+         
             CCalenNativeView::HandleCommandL(aCommand);
             }
             break;
@@ -315,13 +305,7 @@
     
     UpdateCbaL();
     
-    // Hide the toolbar.
-    MCalenToolbar* toolbar = iServices.ToolbarOrNull();
-    if(toolbar)
-        {
-        toolbar->SetToolbarVisibilityL(EFalse);  
-        }  
-    
+   
     TRACE_EXIT_POINT;
     }
 
@@ -333,6 +317,11 @@
 void CCalenMissedAlarmsView::DoDeactivateImpl()
     {
     TRACE_ENTRY_POINT;
+    MCalenToolbar* toolbar = iServices.ToolbarOrNull();
+    if(toolbar)
+        {
+        toolbar->SetToolbarVisibilityL(ETrue);  
+        } 
     
     TRACE_EXIT_POINT;
     }
--- a/calendarui/views/src/calenmissedeventview.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/views/src/calenmissedeventview.cpp	Tue May 11 16:12:24 2010 +0300
@@ -151,6 +151,13 @@
         	{
         	cnt->CompletePopulationL();
         	RedrawStatusPaneL();
+        	
+        	//no tool bar in missed event view
+        	MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
+        	    if(toolbar && toolbar->IsVisible())
+        	      {
+        	      toolbar->SetToolbarVisibilityL(EFalse);  
+        	      } 
         	nextStep = CCalenView::EDone;
         	}
         	break;
@@ -234,12 +241,7 @@
         }
     
     UpdateCbaL();
-    //no tool bar in missed event view
-    MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
-    if(toolbar)
-      {
-      toolbar->SetToolbarVisibilityL(EFalse);  
-      } 
+    
    
     TRACE_EXIT_POINT;
     }
@@ -254,6 +256,11 @@
     TRACE_ENTRY_POINT;
     
     iPreviousViewId.iViewUid = KNullUid;
+    MCalenToolbar* toolbar = iServices.ToolbarOrNull(); 
+    if(toolbar)
+        {
+        toolbar->SetToolbarVisibilityL(ETrue);  
+        }
 
         
     TRACE_EXIT_POINT;
@@ -316,21 +323,13 @@
         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;
--- a/calendarui/views/src/calennativeview.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/views/src/calennativeview.cpp	Tue May 11 16:12:24 2010 +0300
@@ -797,17 +797,7 @@
 	    DoDeactivate();	
 	    }
 
-    if (!iNaviContainer)
-        {
-        CEikStatusPane* sp = StatusPane();
-        iNaviContainer =
-            static_cast<CAknNavigationControlContainer*>(
-                        sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
-        }
-
-    iNaviContainer->Pop();
-
-    if( AknLayoutUtils::PenEnabled() )
+     if( AknLayoutUtils::PenEnabled() )
         {
         MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull();
         if(toolbarImpl)
--- a/calendarui/views/src/calentodoview.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/views/src/calentodoview.cpp	Tue May 11 16:12:24 2010 +0300
@@ -425,7 +425,10 @@
             }
             break;
         case ECalenShowCalendars:            
-               ClearMarkedToDoItems();              
+			SaveCurrentItemIndexL();
+            Container()->MarkAllL( EFalse ); 
+			CCalenNativeView::HandleCommandL( aCommand );
+			break;
         default:
             SaveCurrentItemIndexL();
             CCalenNativeView::HandleCommandL( aCommand );
@@ -930,6 +933,7 @@
             
             if(colIdArray.Count() > 0)
                 {
+                colIdArray.Close();
                 if( !iServices.InstanceViewL(colIdArray) )
                     {
                     TRACE_EXIT_POINT;
@@ -943,6 +947,7 @@
                 }
             else
                 {
+                colIdArray.Close();
                 if( !iServices.InstanceViewL() )
                     {
                     TRACE_EXIT_POINT;
@@ -954,7 +959,6 @@
                     return CCalenView::EKeepGoing;
                     }
                 }
-            colIdArray.Reset();
             }
             // else fall through...
         case ERequestedInstanceView:
--- a/clock2/clockengines/utilities/clockecomlistener/src/clockecomlistener.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/clock2/clockengines/utilities/clockecomlistener/src/clockecomlistener.cpp	Tue May 11 16:12:24 2010 +0300
@@ -179,12 +179,16 @@
     {
     __PRINTS( "CClockEComListener::Start - Entry" );
     
-    // Start the active object and listen for changes in the ECOM registry.
-    if( iEComSession )
+    if (!IsActive())
         {
-        iEComSession->NotifyOnChange( iStatus );
+       // Start the active object and listen for changes in the ECOM registry.
+        if( iEComSession )
+            {
+            iEComSession->NotifyOnChange( iStatus );
+            SetActive();
+            }
         }
-    SetActive();
+ 
     
     __PRINTS( "CClockEComListener::Start - Exit" );
     }
--- a/clock2/clockui/plugins/clockindicatorpaneplugin/src/clockindicatorpluginlistener.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/clock2/clockui/plugins/clockindicatorpaneplugin/src/clockindicatorpluginlistener.cpp	Tue May 11 16:12:24 2010 +0300
@@ -67,10 +67,7 @@
 //
 CClockIndicatorPluginListener::~CClockIndicatorPluginListener()
 	{
-	if( IsActive() )
-		{
-		Cancel();
-		}
+	Cancel();
 	}
 
 // ---------------------------------------------------------
@@ -97,7 +94,7 @@
 //
 void CClockIndicatorPluginListener::DoCancel()
 	{
-	// No implementation yet.
+    iPanePlugin->NotifyChangeCancel();
 	}
 
 // ---------------------------------------------------------
@@ -133,7 +130,7 @@
 	// First cancel all requests
 	Cancel();
 	
-	iPanePlugin->NotifyChangeCancel();
+	//iPanePlugin->NotifyChangeCancel();
 	}
 	
 // End of file
--- a/clock2/clockui/uilayer/clkdatetimeview/src/clkdatetimeview.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/clock2/clockui/uilayer/clkdatetimeview/src/clkdatetimeview.cpp	Tue May 11 16:12:24 2010 +0300
@@ -1758,16 +1758,7 @@
 //
 void CClkDateTimeView::HandleTimeCmdL()
     {
-    if( iExtension->GetActiveProtocol() )
-		{
-   
-		// User pressed Yes. We disable Automatic time update here.
-		iDateTimeInfo.iNITZ = EFalse;
-		iSrvModel->DeActivateAllProtocols();
-		iExtension->SetActiveProtocol( EFalse );
-       	ShowAutomaticTimeUpdateOffNoteL();
-		}
-
+    
     // User to be notified whether DST rollover happens in a day or has happen within a day if he tries to change the time.
 	TBool dstStatus = CheckForDSTChangesL();
 	
@@ -1778,6 +1769,15 @@
 	    CAknTimeSettingPage* dlg = new ( ELeave ) CAknTimeSettingPage( R_DATE_TIME_TIME_PAGE, newTime );
 	    if( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) )
 	        {
+	    
+            if( iExtension->GetActiveProtocol() )
+                {
+                // User pressed Yes. We disable Automatic time update here.
+                iDateTimeInfo.iNITZ = EFalse;
+                iSrvModel->DeActivateAllProtocols();
+                iExtension->SetActiveProtocol( EFalse );
+                ShowAutomaticTimeUpdateOffNoteL();
+                }
 	        TTime current;
 	        current.HomeTime();
 	        TDateTime cTime( current.DateTime() );
--- a/clock2/clockui/uilayer/clockalarmeditor/src/clockalarmeditorimpl.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/clock2/clockui/uilayer/clockalarmeditor/src/clockalarmeditorimpl.cpp	Tue May 11 16:12:24 2010 +0300
@@ -299,19 +299,6 @@
     
     // Set the alarm, here we connect to the alarm server and set the alarm.
     SetAlarmL();
-
-    // Check if DST rule gets applied in 24hrs. If so we don't display the remaining time.
-    TBool displayRemainingTime( ETrue );
-    if( !iAlarmForEditing )
-        {
-        displayRemainingTime = CheckForDstChangesL();
-        }
-    
-    // Don't display the remaining time if dst changes are applicable.
-    if( displayRemainingTime )
-        {
-        DisplayRemainingTimeL();
-        }
     
     // Save the previous alarm time value.
     SetPreviousAlarmTimeL( iAlarmInfo.iAlarmTime );
@@ -955,10 +942,8 @@
 	
     // Here we connect to the alarm server to set the alarm. We don't need to use the alarm model
     // as the alarm editor doesn't need any notification from the alarm server about changes.
-    RASCliSession alarmSrvSes;
     TASShdAlarm newAlarm;
     // Connect to the alarm server.
-    User::LeaveIfError( alarmSrvSes.Connect() );
         
     // Build the alarm properties from the info provided.
     newAlarm.Category()           = KAlarmClockOne;
@@ -976,13 +961,12 @@
 #endif
     
     // This will add the alarm with the alarm server.
-    alarmSrvSes.AlarmAdd( newAlarm );
+	iAlarmSrvSes.AlarmAdd( newAlarm );
     
 	// Save the new alarm id.
     iAlarmId = newAlarm.Id();
     
     // Close the session with alarmserver.
-    alarmSrvSes.Close();
     
     // Update the alarm info.
     GetAlarmInformationL( iAlarmId, iAlarmInfo );
--- a/clock2/clockui/uilayer/clockmainview/inc/clockmainview.h	Tue Apr 27 16:36:22 2010 +0300
+++ b/clock2/clockui/uilayer/clockmainview/inc/clockmainview.h	Tue May 11 16:12:24 2010 +0300
@@ -175,6 +175,18 @@
 		*/
         void ResetAlarmL();
         
+        /**
+         * @brief Checks if DST changes will be applied in the next 24 hours.
+         * @return TBool ETrue if remaining time note has to be displayed.
+         */
+        TBool CheckForDstChangesL();
+        
+        /**
+        * @brief Displays the remaining time for the alarm to expire.
+        */
+        void DisplayRemainingTimeL();
+
+        
 	private:		// Data
 	
 		/**
--- a/clock2/clockui/uilayer/clockmainview/src/clockmainview.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/clock2/clockui/uilayer/clockmainview/src/clockmainview.cpp	Tue May 11 16:12:24 2010 +0300
@@ -41,6 +41,18 @@
 #include "clock_debug.h"
 
 // Constants
+const TInt KMaxCharsInNote( 32 );
+const TInt KZerothRule( 0 );
+const TInt KDaysInWeek( 7 );
+const TInt KOneMinuteInMicrosecond( 1000000 * 60 );
+const TInt KOneHourInMinute( 60 );
+const TInt KOneMinute( 1 );
+const TInt KOneHour( 1 );
+const TInt KNoDifference( 0 );
+
+_LIT( KDateTimeFormatter, "%-B%:0%J%:1%T%:3%+B" );  // For the date and time displayed in the rollover note.
+
+
 
 // Literals
 
@@ -183,6 +195,11 @@
         // Update the latest alarm details.
         iAlarmModel->ClockAlarmInfo( iAlarmId, iAlarmInfo );
         
+        if(CheckForDstChangesL())
+            {
+            DisplayRemainingTimeL();
+            }
+
         // First update the model with the latest alarm id.
         iAlarmModel->SaveLatestAlarmId( iAlarmId );
         
@@ -399,6 +416,11 @@
         // Update the latest alarm details.
         iAlarmModel->ClockAlarmInfo( iAlarmId, iAlarmInfo );
         
+		if(CheckForDstChangesL())
+            {
+            DisplayRemainingTimeL();
+            }
+
         // First update the model with the latest alarm id.
         iAlarmModel->SaveLatestAlarmId( iAlarmId );
         
@@ -879,4 +901,334 @@
     return static_cast< CClockAppUi* > ( AppUi() );
     }
 
+// ---------------------------------------------------------
+// CClockAlarmEditorImpl::DisplayRemainingTimeL
+// rest of the details are commented in the header
+// ---------------------------------------------------------
+//
+void CClockMainView::DisplayRemainingTimeL()
+    {
+    __PRINTS( "CClockAlarmEditorImpl::DisplayRemainingTimeL - Entry" );
+    
+    HBufC* stringHolder( NULL );
+
+    TTime currentTime;
+    currentTime.HomeTime();     
+
+    TTime alarmTime = iAlarmInfo.iOrigExpiryTime;
+    TBool oneDayDifference( EFalse );    
+
+    // Check for the day of the alarm.
+    if( currentTime < alarmTime )
+        {
+        currentTime += TTimeIntervalDays( 1 );
+        // Check if the alarm is for the current day.
+        oneDayDifference = ( currentTime < alarmTime )? ETrue : EFalse;
+        }
+
+    TInt alarmDay( alarmTime.DayNoInWeek() );
+    const TInt KTimeStringLength( 10 );
+    TBuf< KTimeStringLength > timeString;
+
+    HBufC* timeFormat = StringLoader::LoadLC( R_QTN_TIME_USUAL_WITH_ZERO, iCoeEnv );
+    CleanupStack::Pop( timeFormat );
+
+    alarmTime.FormatL( timeString, *timeFormat );
+
+    CDesCArrayFlat* stringArray = new( ELeave ) CDesCArrayFlat( 2 );
+    CDesCArrayFlat* workDaysList = iCoeEnv->ReadDesCArrayResourceL( R_CLOCK_WEEK_DAYS_ARRAY );
+
+    // The day on which alarm is set.
+    stringArray->AppendL( ( *workDaysList )[ alarmDay ] );
+    // The time string.
+    stringArray->AppendL( timeString );
+
+    // Choose the appropriate Repeat type.
+    switch( iAlarmInfo.iRepeat )
+        {
+        case EAlarmRepeatDefintionRepeatNext24Hours:
+        case EAlarmRepeatDefintionRepeatOnce:
+            {
+            if( oneDayDifference )
+                {
+                stringHolder = StringLoader::LoadLC( R_QTN_CLOCK_ALARM_NOTE_ONCE_NEXT, *stringArray, iEikonEnv );
+                }
+            }
+            break;
+        
+        case EAlarmRepeatDefintionRepeatDaily:
+            {
+            stringHolder = StringLoader::LoadLC( R_QTN_CLOCK_ALARM_NOTE_DAY_CLK, timeString, iEikonEnv );
+            }
+            break;
+            
+        case EAlarmRepeatDefintionRepeatWeekly:
+            {
+            stringHolder = StringLoader::LoadLC( R_QTN_CLOCK_ALARM_NOTE_WEEK_CLK, *stringArray, iEikonEnv );
+            }
+            break;
+            
+        case EAlarmRepeatDefintionRepeatWorkday:
+            {
+            stringHolder = StringLoader::LoadLC( R_QTN_CLOCK_ALARM_NOTE_WDAY_CLK, timeString, iEikonEnv );
+            }
+            break;
+            
+        default:
+            {
+            // No implementation yet.
+            }
+            break;
+        }
+    
+    // Cleanup.
+    delete timeFormat;
+    delete stringArray;
+    delete workDaysList;        
+
+    // Need to show the confirmation note.
+    if( ( EAlarmStatusEnabled == iAlarmInfo.iStatus ) && stringHolder )
+        {
+        // TODO: to be verified todo this or not.
+        CAknConfirmationNote* confirmationNote = new( ELeave ) CAknConfirmationNote( ETrue );
+
+        TPtr stringHolderPtr = stringHolder->Des();
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion( stringHolderPtr );    
+
+        confirmationNote->ExecuteLD( *stringHolder );
+
+        // Cleanup
+        CleanupStack::PopAndDestroy( stringHolder );
+        } 
+
+    // Dislpay the second note.
+    if( !oneDayDifference )
+        {
+        TTime homeTime;
+        homeTime.HomeTime();
+
+        TDateTime currentDate( homeTime.DateTime() );
+        TDateTime alarmDate( iAlarmInfo.iAlarmTime.DateTime() );
+
+        alarmDate.SetYear( currentDate.Year() );
+        alarmDate.SetMonth( currentDate.Month() );
+        alarmDate.SetDay( currentDate.Day() );
+
+        TTime newAlarmTime( alarmDate );
+
+        if( newAlarmTime < homeTime )
+            {
+            newAlarmTime += TTimeIntervalDays( 1 );
+            }
+
+        // Construct the remaining time.            
+        TTimeIntervalMicroSeconds remainingTime( newAlarmTime.MicroSecondsFrom( homeTime ) );
+        TInt64 tempInt = ( remainingTime.Int64() ) / KOneMinuteInMicrosecond;
+        TInt remainingMinutes = I64INT( tempInt );
+
+        CArrayFix< TInt >* timeArray = new( ELeave ) CArrayFixFlat< TInt >( 2 );
+        CleanupStack::PushL( timeArray );
+
+        TInt remainingHours( remainingMinutes / KOneHourInMinute );
+
+        remainingMinutes -= remainingHours * KOneHourInMinute;
+
+        timeArray->AppendL( remainingHours );
+        timeArray->AppendL( remainingMinutes );
+
+        // Alarm is with in 1 day. Choose the appropriate strings to be displayed.
+        switch( remainingHours )
+            {
+            case KOneMinute:
+                {
+                if( KOneMinute == remainingMinutes )
+                    {
+                    stringHolder = StringLoader::LoadLC( R_CLOCK_ALARM_CONF_SINGULAR, *timeArray, iEikonEnv );
+                    }
+                else
+                    {
+                    stringHolder = StringLoader::LoadLC( R_CLOCK_ALARM_CONF_HOUR_SEV_MIN, *timeArray, iEikonEnv );
+                    }
+                }
+                break;
+                
+            default:
+                {
+                if( KOneMinute == remainingMinutes )
+                    {
+                    stringHolder = StringLoader::LoadLC( R_CLOCK_ALARM_CONF_SEV_HOURS_MIN, *timeArray, iEikonEnv );
+                    }
+                else
+                    {
+                    stringHolder = StringLoader::LoadLC( R_CLOCK_ALARM_CONF_PLURAL, *timeArray, iEikonEnv );
+                    }
+                }
+                break;
+            }
+        
+        // TODO: to be verified todo this or not.
+        if( ( EAlarmStatusEnabled == iAlarmInfo.iStatus )  && stringHolder )
+            {
+            CAknConfirmationNote* confirmationNote = new( ELeave ) CAknConfirmationNote( ETrue );
+
+            TPtr stringHolderPtr = stringHolder->Des();
+            AknTextUtils::DisplayTextLanguageSpecificNumberConversion( stringHolderPtr );    
+
+            confirmationNote->ExecuteLD( *stringHolder ); 
+            }
+
+        // Cleanup.        
+        CleanupStack::PopAndDestroy( stringHolder );
+        CleanupStack::PopAndDestroy( timeArray );
+        }
+    
+    __PRINTS( "CClockAlarmEditorImpl::DisplayRemainingTimeL - Exit" );
+    }
+
+// ---------------------------------------------------------
+// CClockAlarmEditorImpl::CheckForDstChangesL
+// rest of the details are commented in the header
+// ---------------------------------------------------------
+//
+TBool CClockMainView::CheckForDstChangesL()
+    {
+    __PRINTS( "CClockAlarmEditorImpl::CheckForDstChangesL - Entry" );
+    
+    // User to be notified whether DST rollover happens in a day or 
+    // has happen within a day if he tries to change the time.
+    TBool returnValue( ETrue );
+    
+    // Establish connection with RTz to get the timezone ID
+    RTz tzHandle;
+    User::LeaveIfError( tzHandle.Connect() );
+    CleanupClosePushL( tzHandle );
+
+    // The timezone ID (current)
+    CTzId* currentTZId = tzHandle.GetTimeZoneIdL();
+    CleanupStack::PushL( currentTZId );
+
+    // The current time in UTC
+    TTime currentTime;
+    currentTime.UniversalTime();
+
+    // hometime (local time)
+    TTime homeTime;
+    homeTime.HomeTime();
+
+    //(Year, Month, Day, Hour, Minute, Second, Micrsecond)
+    TDateTime dateTime( homeTime.DateTime().Year(), EJanuary, 1, FALSE, FALSE, FALSE, FALSE );
+
+    TTime tempTime( dateTime ); 
+
+    // Get the current rules for the timezone
+    CTzRules* currentRules = tzHandle.GetTimeZoneRulesL( *currentTZId, tempTime, currentTime, ETzUtcTimeReference );
+    CleanupStack::PushL( currentRules );
+
+    // CVTzActualisedRules encapsulates the rules for a specific year.
+    // Every year has a dummy rule and further DST rules if DST is applicable (if Ohlson provides them)
+    CVTzActualisedRules *vActualisedRules = CVTzActualisedRules::NewL(
+            homeTime.DateTime().Year(), 
+            homeTime.DateTime().Year());
+    CleanupStack::PushL( vActualisedRules );
+
+    // The dummy rule is always the begining of the year.
+    // For example there is only 1 rule for India/NewDelhi but USA/Atlanta has 3 rules.
+    currentRules->GetActualisedRulesL( *vActualisedRules );
+
+    const TInt ruleCount( vActualisedRules->Count() );
+    TInt ruleMatchIndex( KNoDifference );
+
+    TTimeIntervalSeconds secondsDifference;
+    TTime ruleMatchTime;
+
+    // Fetch lowest time offset for the year residing at aTime. 
+    // This is used to determine if DST is on.
+    for( TInt ruleIndex( FALSE ); ruleIndex < ruleCount; ++ruleIndex )
+        {
+        const TVTzActualisedRule& actualisedRule = ( *vActualisedRules )[ ruleIndex ];
+
+        // Only check for the same year as requested (aTime)
+        if( actualisedRule.iTimeOfChange.DateTime().Year() == homeTime.DateTime().Year() )
+            {               
+            iAlarmInfo.iAlarmTime.SecondsFrom( actualisedRule.iTimeOfChange, secondsDifference );
+            // Considering the time reference is important as America (North & South) uses
+            // the Wall time (local time) reference where as whole of Europe refers to time
+            // in terms of UTC time. Correspondingly, the choise of local time or utc time 
+            // has to be made.
+            TTime ruleTime;
+
+            if( ETzUtcTimeReference == actualisedRule.iTimeReference )
+                {
+                ruleTime = currentTime;
+                }
+            else if( ETzWallTimeReference == actualisedRule.iTimeReference )
+                {
+                ruleTime = homeTime;
+                }
+            else if( ETzStdTimeReference == actualisedRule.iTimeReference )
+                {
+                // TODO: Testing so far hasn't encountered a rule in this time reference. 
+                // If in case an error is found, corresponding code can be added here.
+                // No support from symbian for this.
+                }
+
+            TDateTime sevenDays( FALSE, EJanuary, KDaysInWeek, FALSE, FALSE, FALSE, FALSE );
+            TTime tempTime( sevenDays );
+            TTime newTime( ruleTime.Int64() + tempTime.Int64() );
+
+            TTimeIntervalDays temp;
+            temp = newTime.DaysFrom( ruleTime );
+
+            if( ( secondsDifference.Int() >= KNoDifference ) &&
+                ( newTime > iAlarmInfo.iAlarmTime ) && 
+                ( actualisedRule.iTimeOfChange < iAlarmInfo.iAlarmTime ) && 
+                ( ruleTime < actualisedRule.iTimeOfChange ) )
+                {
+                // If there is a match, save the index and break.
+                // We've got the rule and there's no need to continue with other rules.
+                ruleMatchIndex = ruleIndex;
+                ruleMatchTime = actualisedRule.iTimeOfChange;
+                break;
+                }
+            }
+        }
+
+    if( ruleMatchIndex > KZerothRule )
+        {
+        // There's a match, display the information note about DST change.
+        TTime displayTime;
+        TTimeIntervalHours oneHour( KOneHour );         
+
+        displayTime = iAlarmInfo.iAlarmTime;
+
+        TBuf< KMaxCharsInNote > dateTimeString;
+
+        // dateString will have "11:59 pm" - as above, but no seconds
+        displayTime.FormatL( dateTimeString, KDateTimeFormatter );
+
+        // If This note is displayed,
+        CAknInformationNote* informationNote = new( ELeave ) CAknInformationNote( ETrue );
+
+        HBufC* noteText = StringLoader::LoadLC(
+                R_QTN_CLOCK_NOTE_ALARM_DST_ROLLOVER, 
+                dateTimeString, 
+                iCoeEnv);               
+        TInt error = informationNote->ExecuteLD( noteText->Des() );
+
+        // Don't display the second note. Not necessary to show both notes.
+        returnValue = ETrue;
+        CleanupStack::PopAndDestroy( noteText );                                
+        } 
+
+    tzHandle.Close();
+    CleanupStack::PopAndDestroy( vActualisedRules);
+    CleanupStack::PopAndDestroy( currentRules );
+    CleanupStack::PopAndDestroy( currentTZId );
+    CleanupStack::PopAndDestroy( &tzHandle );
+    
+    __PRINTS( "CClockAlarmEditorImpl::CheckForDstChangesL - Exit" );
+
+    return returnValue;
+    }
+
 // End of file
--- a/clock2/clockui/uilayer/clockworldview/src/clockworlditemprocessor.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/clock2/clockui/uilayer/clockworldview/src/clockworlditemprocessor.cpp	Tue May 11 16:12:24 2010 +0300
@@ -177,17 +177,17 @@
     {
     __PRINTS( "CClockWorldItemProcessor::DoAsyncCallback - Entry" );
     
-    if( !IsActive() )
+    if( IsAdded() )
         {
-        if( IsAdded() )
+        if( !IsActive() )
             {
             // Make sure this is the last Active Object in the list
             Deque();
             CActiveScheduler::Add( this );
+            TRequestStatus* status = &iStatus;
+            User::RequestComplete( status, KErrNone );
+            SetActive();       
             }
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, KErrNone );
-        SetActive();       
         }
     
     __PRINTS( "CClockWorldItemProcessor::DoAsyncCallback - Exit" );
--- a/clock2/clockui/uilayer/clockworldview/src/clockworldview.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/clock2/clockui/uilayer/clockworldview/src/clockworldview.cpp	Tue May 11 16:12:24 2010 +0300
@@ -633,7 +633,10 @@
     
     if( aForeground  && iContainer )
         {
-        RestartTimerL();
+        if( iTimer )
+            {
+            RestartTimerL();
+            }
 
         RClkSrvInterface clockServerClt;
         // Connect to clockserver
--- a/clock2/clockui/uimodel/inc/clkuiclksrvlistener.h	Tue Apr 27 16:36:22 2010 +0300
+++ b/clock2/clockui/uimodel/inc/clkuiclksrvlistener.h	Tue May 11 16:12:24 2010 +0300
@@ -47,6 +47,11 @@
         */
         CClkUiClkSrvListener( RClkSrvInterface& aClkSrvSes, CClkUiClkSrvModel& aClkSrvModel, TInt& aWhatChanged, TInt& aWhoChanged, TInt aListenerPriority );
         
+        /**
+         * Destructor
+         */
+        ~CClkUiClkSrvListener();
+        
     public:         // Functions from base classes.
         
         /**
--- a/clock2/clockui/uimodel/src/clkuialarmlistener.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/clock2/clockui/uimodel/src/clkuialarmlistener.cpp	Tue May 11 16:12:24 2010 +0300
@@ -45,7 +45,7 @@
 //
 CClkUiMdlAlarmListener::~CClkUiMdlAlarmListener()
     {
-    // No implementation yet.
+    Cancel();
     }
 
 // ---------------------------------------------------------
--- a/clock2/clockui/uimodel/src/clkuiclksrvlistener.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/clock2/clockui/uimodel/src/clkuiclksrvlistener.cpp	Tue May 11 16:12:24 2010 +0300
@@ -43,6 +43,16 @@
     }
 
 // ---------------------------------------------------------
+// CClkUiClkSrvListener::~CClkUiClkSrvListener
+// rest of the details are commented in the header
+// ---------------------------------------------------------
+//
+CClkUiClkSrvListener::~CClkUiClkSrvListener()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------
 // CClkUiClkSrvListener::DoStart
 // rest of the details are commented in the header
 // ---------------------------------------------------------
--- a/notepad/notepad1/LibSrc/NpdDialogBase.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/notepad/notepad1/LibSrc/NpdDialogBase.cpp	Tue May 11 16:12:24 2010 +0300
@@ -482,7 +482,11 @@
     TInt index(0);
     aMenuPane.ItemAndPos( aCommandId, index );
 	aSendUi.AddSendMenuItemL( aMenuPane, index+1, ENotepadCmdSend/*, TSendingCapabilities()*/ );
-	aMenuPane.SetItemSpecific(ENotepadCmdSend, ETrue);
+	
+    if ( IsNoteListDialog() )
+        {
+        aMenuPane.SetItemSpecific( ENotepadCmdSend, ETrue );
+        }	
     }
 
 // -----------------------------------------------------------------------------
@@ -869,8 +873,7 @@
 // -----------------------------------------------------------------------------
 
 void CNotepadDialogBase::CCreateAndAppendFiles::StartAttachingL()
-	{
-	iStatus = KRequestPending;
+    {
 	if( iCount < iTotalCount )
 		iAttaching = ETrue;
 	else
@@ -879,20 +882,39 @@
 	
 	if( iAttaching )
 		{
-		TInt tempInt = iKeys[iCount];
-		HBufC* buf = iModel.ContentByKeyL(tempInt);
+        TInt tempInt = iKeys[iCount];
+        HBufC* buf = iModel.ContentByKeyL(tempInt);
 		
         CleanupStack::PushL(buf);
         iText->Reset();
-        iText->InsertL(0, *buf);
+
+        TRAPD( err, iText->InsertL( 0, *buf ) );
+    
+        if( err != KErrNone )
+            {
+            Cancel();
+            
+            if ( iProgressBar )
+                {
+                EndProgressDialog();
+                }
+            // release the member in advance to avoid memory-consumed erupted when endless send Notes by Messaging.			
+            ReleaseMemory();		  	
+        
+            User::LeaveIfError( err );
+            }
+        
         iFiles->AppendL(*iText);
  
         User::LeaveIfError( array->At(iCount).Open( iFs, iFiles->iSendFileName, EFileRead ) );
-   		imessageData->AppendAttachmentHandleL( array->At(iCount));
+        imessageData->AppendAttachmentHandleL( array->At(iCount));
 		
-		iCount++;
+        iCount++;
+    
         CleanupStack::PopAndDestroy(); // buf
-		}
+        }
+	
+	iStatus = KRequestPending;
 	SetActive();
 	TRequestStatus* status = &iStatus;
 	User::RequestComplete(status,KErrNone);
@@ -934,38 +956,9 @@
 			    
 			iListDialog->ClearSaveOrMarkedListItemsL(!iCanceled );   
 			iCanceled = EFalse;
-
-			if(iFiles)		
-			{
-				delete iFiles;
-			 	iFiles =NULL;
-			}
 			
-			if(iText)
-			{
-				delete iText;
-				iText =NULL;
-			}
-			
-			if(imessageData)
-			{
-			
-			delete imessageData;
-			imessageData =NULL;	
-			}
-			
-			if(array)
-			{
-			array->Reset();
-
-			delete array;
-			array =NULL;
-			}
-			
-			
-			iKeys.Close();
-
-			iFs.Close();
+			// release the member in advance in case of memory-consumed erupted when endless send Notes by Messaging.	
+			ReleaseMemory();
 			
 			RFs fs;
 			User::LeaveIfError(fs.Connect());
@@ -1000,4 +993,40 @@
 		}
 
 	}
+
+// -----------------------------------------------------------------------------
+// CNotepadDialogBase::CCreateAndAppendFiles::PrepareToClose
+// -----------------------------------------------------------------------------
+void CNotepadDialogBase::CCreateAndAppendFiles::ReleaseMemory()
+    {
+    if( iFiles )		
+        {
+        delete iFiles;
+        iFiles = NULL;
+        }
+
+    if( iText )
+        {
+        delete iText;
+        iText = NULL;
+        }
+
+    if( imessageData )
+        {	
+        delete imessageData;
+        imessageData = NULL;	
+        }
+
+    if( array )
+        {
+        array->Reset();
+
+        delete array;
+        array = NULL;
+        }
+
+    iKeys.Close();
+    iFs.Close();	
+    }
+
 // End of File  
--- a/notepad/notepad1/LibSrc/NpdListDialog.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/notepad/notepad1/LibSrc/NpdListDialog.cpp	Tue May 11 16:12:24 2010 +0300
@@ -64,6 +64,9 @@
 #include "NpdApi.h"
 #include "NpdLibPanic.h"
 
+//number of fixed item
+//currently, Notepad application have one fixed "New Note" item in main view. 
+const TInt KNumberOfFixedItem = 1; 
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -872,7 +875,7 @@
 		}
     iModel->SyncL(EFalse);
     CNotepadDialogBase::DynInitMenuPaneL( aResourceId, aMenuPane );
-    const TInt memoCount( iModel->MdcaCount() - 1 );
+    const TInt memoCount( iModel->MdcaCount() - KNumberOfFixedItem );
    	const TInt markCount(iListBox->SelectionIndexes()->Count());
 	TInt index;
 	switch (aResourceId )
@@ -1726,17 +1729,16 @@
 //
 void CNotepadListDialog::HandleMarkListDynInitMenuPane( TInt aResourceId, CEikMenuPane *aMenu, CEikListBox *aListBox )
 	{
+    TInt numofNotes = aListBox->Model()->NumberOfItems() - KNumberOfFixedItem;
+    
 	if ( aResourceId == R_MENUPANE_MARKABLE_LIST_IMPLEMENTATION )
 		{
 		TInt currentItemIndex = aListBox->View()->CurrentItemIndex();
 		TBool markHidden = aListBox->View()->ItemIsSelected( currentItemIndex ) || currentItemIndex == 0;
 		TBool unmarkHidden =
 				!aListBox->View()->ItemIsSelected(currentItemIndex) || currentItemIndex == 0;
-		TBool markAllHidden = aListBox->Model()->NumberOfItems() == 0
-				|| aListBox->SelectionIndexes()->Count()
-						== aListBox->Model()->NumberOfItems() - 1;
-		TBool unmarkAllHidden = aListBox->Model()->NumberOfItems() == 0
-				|| aListBox->SelectionIndexes()->Count() == 0;
+		TBool markAllHidden = ( numofNotes == 0 ) || ( aListBox->SelectionIndexes()->Count() == numofNotes );
+		TBool unmarkAllHidden = ( numofNotes == 0 ) || ( aListBox->SelectionIndexes()->Count() == 0 );
 		aMenu->SetItemDimmed(EAknCmdMark, markHidden);
 		aMenu->SetItemDimmed(EAknCmdUnmark, unmarkHidden);
 		aMenu->SetItemDimmed(EAknMarkAll, markAllHidden);
@@ -1744,7 +1746,7 @@
 		}
 	if ( aResourceId == R_MENUPANE_MARKABLE_LIST_EDIT_LIST_IMPLEMENTATION )
 		{
-		TBool editListHidden = aListBox->Model()->NumberOfItems() == 0;
+		TBool editListHidden = numofNotes == 0;
 
 		aMenu->SetItemDimmed(EAknCmdEditListMenu, editListHidden);
 		}
--- a/notepad/notepad1/inc/NpdDialogBase.h	Tue Apr 27 16:36:22 2010 +0300
+++ b/notepad/notepad1/inc/NpdDialogBase.h	Tue May 11 16:12:24 2010 +0300
@@ -186,6 +186,13 @@
         * @return ETrue if this is a modeless dialog, otherwize EFalse.
         */
         inline TBool IsModeless();
+        
+        /**
+        * Check whether this dialog is for Notepad application ListDialog.
+        *
+        * @return ETrue if this is for for Notepad application ListDialog, otherwize EFalse.
+        */
+        inline TBool IsNoteListDialog() const;
 
         /**
         * Set iTitle text to title pane.
@@ -386,7 +393,14 @@
 				void DialogDismissedL( TInt aButtonId );
                 void RunL();
                 void DoCancel();
-            private: // data
+                
+            private:
+				/**
+		        * release memory allocated in the phase of appending Notes to Messaging.
+		        */                
+                void ReleaseMemory();
+                
+    private: // data
 				CSendUi& iSendAppUi;
 				TInt iCommandId;
 				CNotepadModel& iModel;
--- a/notepad/notepad1/inc/NpdDialogBase.inl	Tue Apr 27 16:36:22 2010 +0300
+++ b/notepad/notepad1/inc/NpdDialogBase.inl	Tue May 11 16:12:24 2010 +0300
@@ -67,4 +67,13 @@
     return iBaseFlags & ENotepadSendUiDelayedExit;
     }
 
+// -----------------------------------------------------------------------------
+// CNotepadDialogBase::IsNoteListDialog
+// -----------------------------------------------------------------------------
+//
+inline TBool CNotepadDialogBase::IsNoteListDialog() const
+    {
+    return iResId == R_NOTEPAD_LIST_DIALOG_ORG;
+    }
+
 // End of file