connectionutilities/ConnectionDialogs/DisconnectDlg/src/DisconnectDlgUi.cpp
branchRCL_3
changeset 57 05bc53fe583b
parent 26 0a9e01492035
child 58 83ca720e2b9a
equal deleted inserted replaced
55:fc7b30ed2058 57:05bc53fe583b
    17 *
    17 *
    18 */
    18 */
    19 
    19 
    20 
    20 
    21 // INCLUDE FILES
    21 // INCLUDE FILES
    22 #include <e32property.h>
       
    23 #include <ScreensaverInternalPSKeys.h>
       
    24 #include <coreapplicationuisdomainpskeys.h>
       
    25 #include "DisconnectDlgUi.h"
    22 #include "DisconnectDlgUi.h"
    26 #include "ActiveDisconnectDlgPlugin.h"
    23 #include "ActiveDisconnectDlgPlugin.h"
    27 #include "ConnectionModel.h"
    24 #include "ConnectionModel.h"
    28 #include "QueryDisconnectDlgDialog.h"
    25 #include "QueryDisconnectDlgDialog.h"
    29 #include "ConnectionDialogsUidDefs.h"
    26 #include "ConnectionDialogsUidDefs.h"
    30 #include "ConnectionDialogsLogger.h"
    27 #include "ConnectionDialogsLogger.h"
    31 
    28 
    32 #include <bautils.h>
    29 #include <bautils.h>
    33 #include <textresolver.h>
    30 #include <textresolver.h>
    34 
    31 
    35 #include <DisconnectDlg.rsg>
    32 #include <disconnectdlg.rsg>
    36 #include <data_caging_path_literals.hrh>
    33 #include <data_caging_path_literals.hrh>
    37 
    34 
    38 
    35 
    39 // CONSTANTS
    36 // CONSTANTS
    40 
    37 
   252                                   TInt aReplySlot,
   249                                   TInt aReplySlot,
   253                                   const RMessagePtr2& aMessage )
   250                                   const RMessagePtr2& aMessage )
   254     { 
   251     { 
   255     CLOG_ENTERFN("CDisconnectDialogUi::StartL");        
   252     CLOG_ENTERFN("CDisconnectDialogUi::StartL");        
   256       
   253       
   257     TInt err( KErrNone );
       
   258     TInt screenSaverOn( 0 );
       
   259     
       
   260     // Cancel the dialog if screensaver is on.
       
   261     err = RProperty::Get( KPSUidScreenSaver, 
       
   262             KScreenSaverOn, 
       
   263             screenSaverOn );
       
   264 
       
   265     TBool autolockOn( EFalse );
       
   266 #ifdef RD_STARTUP_CHANGE
       
   267     TInt autolockStatus( 0 );
       
   268     // Cancel the dialog if Autolock is on.
       
   269     err |= RProperty::Get( KPSUidCoreApplicationUIs, 
       
   270             KCoreAppUIsAutolockStatus, 
       
   271             autolockStatus );
       
   272     autolockOn = autolockStatus > EAutolockOff;
       
   273 #endif
       
   274 
       
   275     if ( err == KErrNone && ( screenSaverOn > 0 || autolockOn ) )
       
   276         {
       
   277         // Screen saver or Autolock is active. Cancel the dialog. 
       
   278         aMessage.Complete( KErrCancel );
       
   279         return;
       
   280         }
       
   281     
       
   282     iStarted = ETrue;
   254     iStarted = ETrue;
   283 
   255 
   284     TPckgBuf<TDisconnectConnectionPrefs> passedInfo;
   256     TPckgBuf<TDisconnectConnectionPrefs> passedInfo;
   285     passedInfo.Copy( aBuffer );
   257     passedInfo.Copy( aBuffer );
   286     iConnectionPrefs = passedInfo();
   258     iConnectionPrefs = passedInfo();
   288     iReplySlot = aReplySlot;    
   260     iReplySlot = aReplySlot;    
   289     iMessage = aMessage;
   261     iMessage = aMessage;
   290     
   262     
   291     CLOG_WRITEF(_L( "iCntPrefs.iPrompt: %d" ), iConnectionPrefs.iPrompt );
   263     CLOG_WRITEF(_L( "iCntPrefs.iPrompt: %d" ), iConnectionPrefs.iPrompt );
   292     
   264     
   293     err = KErrNone;    
   265     TInt err( KErrNone );    
   294     TRAP( err, iActivePlugin = CActiveDisconnectDlgPlugin::NewL( this ) ); 
   266     TRAP( err, iActivePlugin = CActiveDisconnectDlgPlugin::NewL( this ) ); 
   295     
   267     
   296     if ( err )
   268     if ( err )
   297         {
   269         {
   298         delete iActivePlugin;
   270         delete iActivePlugin;