cmmanager/cmmgr/Framework/Src/cmdlg.cpp
branchRCL_3
changeset 24 c45d4fe2ff0a
parent 19 22c3c67e5001
child 26 0a9e01492035
equal deleted inserted replaced
19:22c3c67e5001 24:c45d4fe2ff0a
   110     , iExitReason( KDialogUserExit )
   110     , iExitReason( KDialogUserExit )
   111     , iEscapeArrived( EFalse )
   111     , iEscapeArrived( EFalse )
   112     , iExitduringProcessing( EFalse )
   112     , iExitduringProcessing( EFalse )
   113     , iBackduringProcessing( EFalse )
   113     , iBackduringProcessing( EFalse )
   114     , iDestDlg( aDestDlg )
   114     , iDestDlg( aDestDlg )
       
   115     , iPluginExitExceptionally( EFalse )
   115     {
   116     {
   116     }
   117     }
   117     
   118     
   118 // ---------------------------------------------------------------------------
   119 // ---------------------------------------------------------------------------
   119 // CCmDlg::~CCmDlg
   120 // CCmDlg::~CCmDlg
   134     if ( iTitlePane )
   135     if ( iTitlePane )
   135         {
   136         {
   136         // set old text back, if we have it...
   137         // set old text back, if we have it...
   137         if ( iOldTitleText )
   138         if ( iOldTitleText )
   138             {
   139             {
   139             if ( iExitReason == KDialogUserBack )
   140             if ( iExitReason == KDialogUserBack || iPluginExitExceptionally  )
   140                 {
   141                 {
   141                 TRAP_IGNORE( iTitlePane->SetTextL( *iOldTitleText ) );
   142                 TRAP_IGNORE( iTitlePane->SetTextL( *iOldTitleText ) );
   142                 }
   143                 }
   143             delete iOldTitleText; iOldTitleText = NULL;
   144             delete iOldTitleText; iOldTitleText = NULL;
   144             }
   145             }
   480                 iExitduringProcessing = ETrue;
   481                 iExitduringProcessing = ETrue;
   481                 if( aButtonId == KDialogUserExit )
   482                 if( aButtonId == KDialogUserExit )
   482                     {
   483                     {
   483                     retVal = ETrue;
   484                     retVal = ETrue;
   484                     } 
   485                     } 
       
   486                 
       
   487                 if ( iPluginExitExceptionally )
       
   488                     {
       
   489                     retVal = ETrue;
       
   490                     }
   485                 }
   491                 }
   486             break;
   492             break;
   487             }
   493             }
   488         }
   494         }
   489     return retVal;
   495     return retVal;
  1139             }
  1145             }
  1140     
  1146     
  1141         CleanupStack::PopAndDestroy( dest );
  1147         CleanupStack::PopAndDestroy( dest );
  1142         HandleListboxDataChangeL();                             
  1148         HandleListboxDataChangeL();                             
  1143         }
  1149         }
  1144     else
       
  1145         {
       
  1146         CleanupStack::PopAndDestroy( &destArray );
       
  1147         User::Leave( KErrCancel );
       
  1148         }
       
  1149 
  1150 
  1150     CleanupStack::PopAndDestroy( &destArray );
  1151     CleanupStack::PopAndDestroy( &destArray );
  1151     }
  1152     }
  1152 
  1153 
  1153 // --------------------------------------------------------------------------
  1154 // --------------------------------------------------------------------------
  1224                                             *( CurrentCML() ) );
  1225                                             *( CurrentCML() ) );
  1225         CleanupStack::PopAndDestroy( dest );
  1226         CleanupStack::PopAndDestroy( dest );
  1226         iCmDestinationImpl->UpdateL();                            
  1227         iCmDestinationImpl->UpdateL();                            
  1227 
  1228 
  1228         HandleListboxDataChangeL();
  1229         HandleListboxDataChangeL();
       
  1230         iListbox->HandleItemRemovalL();
  1229         }
  1231         }
  1230 
  1232 
  1231     CleanupStack::PopAndDestroy( &destArray );
  1233     CleanupStack::PopAndDestroy( &destArray );
  1232     }
  1234     }
  1233 
  1235 
  1273         if ( !CurrentCmInUseL() )
  1275         if ( !CurrentCmInUseL() )
  1274             {
  1276             {
  1275             TInt ret = cm->RunSettingsL();
  1277             TInt ret = cm->RunSettingsL();
  1276             if ( ret == KDialogUserExit )
  1278             if ( ret == KDialogUserExit )
  1277                 {
  1279                 {
  1278                 TryExitL( KDialogUserExit );
  1280                 if( IsExceptionExitL() )
       
  1281                     {
       
  1282                     iPluginExitExceptionally = ETrue;
       
  1283                     TryExitL( KDialogUserBack );
       
  1284                     }
       
  1285                 else
       
  1286                     {
       
  1287                     TryExitL( KDialogUserExit );
       
  1288                     }
  1279                 }
  1289                 }
  1280             else
  1290             else
  1281                 {
  1291                 {
  1282                 if ( ret == KDialogUserDeleteConfirmed )
  1292                 if ( ret == KDialogUserDeleteConfirmed )
  1283                     {
  1293                     {
  1673             selected = count - 1; // index, so --
  1683             selected = count - 1; // index, so --
  1674             }
  1684             }
  1675         if ( selected >= 0 )
  1685         if ( selected >= 0 )
  1676             {
  1686             {
  1677             iListbox->ScrollToMakeItemVisible( selected);
  1687             iListbox->ScrollToMakeItemVisible( selected);
  1678             iListbox->SetCurrentItemIndexAndDraw( selected );            
       
  1679             }
  1688             }
  1680         }
  1689         }
  1681     }
  1690     }
  1682     
  1691     
  1683 
  1692 
  2001         }
  2010         }
  2002     
  2011     
  2003     // Update list box
  2012     // Update list box
  2004     HandleListboxDataChangeL();
  2013     HandleListboxDataChangeL();
  2005     }
  2014     }
       
  2015 
       
  2016 // --------------------------------------------------------------------------
       
  2017 // CCmDlg::IsExceptionExitL
       
  2018 // --------------------------------------------------------------------------
       
  2019 //
       
  2020 TBool CCmDlg::IsExceptionExitL()
       
  2021     {
       
  2022     TBool retV( EFalse );
       
  2023  
       
  2024     if (iCmDestinationImpl)
       
  2025         {
       
  2026         // If the destination that is currently working on disappears
       
  2027         // with some reason then go back to parent view
       
  2028         if( !iCmManager->DestinationStillExistedL( iCmDestinationImpl ) )
       
  2029             {
       
  2030             retV = ETrue;
       
  2031             }
       
  2032         }
       
  2033     
       
  2034     return retV;
       
  2035     }