application/src/PodcastAppui.cpp
changeset 104 4d1286f7f982
parent 99 41d00e97e2f7
child 115 d87e984bd8b8
equal deleted inserted replaced
103:520291e28460 104:4d1286f7f982
    27 #include "ShowEngine.h"
    27 #include "ShowEngine.h"
    28 #include "PodcastModel.h"
    28 #include "PodcastModel.h"
    29 #include "debug.h"
    29 #include "debug.h"
    30 #include "..\help\podcatcher.hlp.hrh"
    30 #include "..\help\podcatcher.hlp.hrh"
    31 #include "PodcastApp.h"
    31 #include "PodcastApp.h"
    32 
    32 #include <APGWGNAM.H>
    33 #include <HLPLCH.H>
    33 #include <HLPLCH.H>
    34 #include <avkon.hrh>
    34 #include <avkon.hrh>
    35 
    35 
    36 const TUint KDelayLaunch = 1000;
    36 const TUint KDelayLaunch = 1000;
    37 
    37 
   125             Exit();
   125             Exit();
   126             break;
   126             break;
   127             }
   127             }
   128         case EEikCmdExit:
   128         case EEikCmdExit:
   129         	{
   129         	{
   130 			TApaTask task(iEikonEnv->WsSession());
   130         	// we want to prevent red button from closing podcatcher, and
   131 			task.SetWgId(iEikonEnv->RootWin().Identifier());
   131         	// instead we send it to background
   132 			task.SendToBackground(); 
   132         	// however, we want to respect the task manager (fast swap) close
       
   133         	// command, so we check if task manager is the focussed window group
       
   134         	
       
   135         	RWsSession& ws = iEikonEnv->WsSession();
       
   136 			TInt wgid = ws.GetFocusWindowGroup();
       
   137 			CApaWindowGroupName* gn = CApaWindowGroupName::NewLC(ws, wgid);
       
   138 			TUid activeAppUid = gn->AppUid();
       
   139 			CleanupStack::PopAndDestroy(gn);
       
   140         	
       
   141 			const TUid KUidFastSwap = { 0x10207218 };
       
   142 			if (activeAppUid == KUidFastSwap)
       
   143 				{
       
   144 				// closed by task manager
       
   145 				Exit();
       
   146 				}
       
   147 			else
       
   148         		{
       
   149         		// red button pressed
       
   150 				TApaTask task(iEikonEnv->WsSession());
       
   151 				task.SetWgId(iEikonEnv->RootWin().Identifier());
       
   152 				task.SendToBackground(); 
       
   153         		}   		
   133 			break;
   154 			break;
   134         	}
   155         	}
   135 	case EPodcastHelp:
   156 	case EPodcastHelp:
   136         	{	
   157         	{	
   137         	HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), HelpContextL());
   158         	HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), HelpContextL());