photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerslideshow.cpp
branchRCL_3
changeset 25 191387a8b767
parent 22 2dac0fdba72b
child 47 f9e827349359
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerslideshow.cpp	Wed Apr 14 15:57:24 2010 +0300
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerslideshow.cpp	Tue Apr 27 16:37:53 2010 +0300
@@ -56,16 +56,18 @@
 // ---------------------------------------------------------------------------
 //
 EXPORT_C CGlxCommandHandlerSlideshow* CGlxCommandHandlerSlideshow::NewL(
-    MGlxMediaListProvider* aMediaListProvider, TBool aStepBack, TBool aHasToolbarItem )
-    {
-    TRACER( "CGlxCommandHandlerSlideshow::NewL" );
-    CGlxCommandHandlerSlideshow* self = new ( ELeave )
-    	CGlxCommandHandlerSlideshow(aMediaListProvider, aStepBack, aHasToolbarItem);
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
+		MGlxMediaListProvider* aMediaListProvider, TBool aStepBack,
+		TBool aHasToolbarItem, const TDesC& aFileName)
+	{
+	TRACER( "CGlxCommandHandlerSlideshow::NewL" );
+	CGlxCommandHandlerSlideshow* self =
+			new (ELeave) CGlxCommandHandlerSlideshow(aMediaListProvider,
+					aStepBack, aHasToolbarItem);
+	CleanupStack::PushL(self);
+	self->ConstructL(aFileName);
+	CleanupStack::Pop(self);
+	return self;
+	}
 
 // ---------------------------------------------------------------------------
 // C++ default constructor can NOT contain any code, that
@@ -79,66 +81,61 @@
     // Do nothing
     }
  
+
 // ---------------------------------------------------------------------------
 // Symbian 2nd phase constructor can leave.
 // ---------------------------------------------------------------------------
 //
-void CGlxCommandHandlerSlideshow::ConstructL()
-    {
-    TRACER( "CGlxCommandHandlerSlideshow::ConstructL" );
-    
-    // Get a handle 
-    iUiUtility = CGlxUiUtility::UtilityL();
+void CGlxCommandHandlerSlideshow::ConstructL(const TDesC& aFileName)
+	{
+	TRACER( "CGlxCommandHandlerSlideshow::ConstructL" );
 
-    // Load resource file
-	TParse parse;
-    parse.Set(KGlxUiUtilitiesResource, &KDC_APP_RESOURCE_DIR, NULL);
-    TFileName resourceFile;
-    resourceFile.Append(parse.FullName());
-    CGlxResourceUtilities::GetResourceFilenameL(resourceFile);  
-   	iResourceOffset = CCoeEnv::Static()->AddResourceFileL( resourceFile );
+	// Get a handle 
+	iUiUtility = CGlxUiUtility::UtilityL();
+
+	iResourceOffset = CCoeEnv::Static()->AddResourceFileL(aFileName);
+
+	iShowInToolbar = ETrue;
 
-    iShowInToolbar = ETrue;
-
-   	// Add supported commands with filter fields
-   	// Play slideshow forwards
-   	TCommandInfo info( EGlxCmdSlideshowPlay );
-   	// Disable for static items and dont enable empty slideshow
-    info.iMinSelectionLength = 1;
-   	// Enable only for albums that have more than one item
-    info.iMinSlideshowPlayableContainedItemCount = 1;
-    // Disable for animated GIFs
-    info.iDisallowAnimatedGIFs = ETrue;
-    // Disable DRM protected content
-    info.iDisallowDRM = ETrue;
-    // Note: cannot just require all to be images as user can also start 
-    // slideshow for a whole album from list view and in that case
-    // selection contains a container
+	// Add supported commands with filter fields
+	// Play slideshow forwards
+	TCommandInfo info(EGlxCmdSlideshowPlay);
+	// Disable for static items and dont enable empty slideshow
+	info.iMinSelectionLength = 1;
+	// Enable only for albums that have more than one item
+	info.iMinSlideshowPlayableContainedItemCount = 1;
+	// Disable for animated GIFs
+	info.iDisallowAnimatedGIFs = ETrue;
+	// Disable DRM protected content
+	info.iDisallowDRM = ETrue;
+	// Note: cannot just require all to be images as user can also start 
+	// slideshow for a whole album from list view and in that case
+	// selection contains a container
 	// Disable all videos
 	TMPXGeneralCategory categoryFilter = EMPXVideo;
 	// Disable the command for videos
 	TCommandInfo::TCategoryRule categoryRule = TCommandInfo::EForbidAll;
 	info.iCategoryFilter = categoryFilter;
 	info.iCategoryRule = categoryRule;
-   	AddCommandL( info );
-   	
-    // new info to get the default filters
-   	TCommandInfo info_show_always( EGlxCmdSlideshowSettings );
-   	// Disable for empty views and views with only static items
-    info_show_always.iMinSelectionLength = 1;
-   	// slideshow settings
-   	AddCommandL( info_show_always );
+	AddCommandL(info);
+
+	// new info to get the default filters
+	TCommandInfo info_show_always(EGlxCmdSlideshowSettings);
+	// Disable for empty views and views with only static items
+	info_show_always.iMinSelectionLength = 1;
+	// slideshow settings
+	AddCommandL(info_show_always);
 
-   	// Menu
-   	info_show_always.iCommandId = EGlxCmdSlideshow;
-   	AddCommandL( info_show_always );
+	// Menu
+	info_show_always.iCommandId = EGlxCmdSlideshow;
+	AddCommandL(info_show_always);
 
-    // Dummy command to get UPnP state
-    TCommandInfo infoUpnpState( EGlxCmdShowViaUpnpStateChanged );
-    AddCommandL( infoUpnpState );
+	// Dummy command to get UPnP state
+	TCommandInfo infoUpnpState(EGlxCmdShowViaUpnpStateChanged);
+	AddCommandL(infoUpnpState);
 
-   	// Buffer
-   	iBufFlat = CBufFlat::NewL( KShwDefaultBufferSize );
+	// Buffer
+	iBufFlat = CBufFlat::NewL(KShwDefaultBufferSize);
 	}
 
 // ---------------------------------------------------------------------------
@@ -278,6 +275,8 @@
 			// Activating and deactivating the HUI within the Settings 
 			// Dialog class will cause a Cone 8 panic.
 			
+			iAvkonAppUi->ProcessCommandL(EGlxCmdDialogLaunched);
+			
 			// hide HUI display
 			CGlxUiUtility::HideAlfDisplayL();
 				{