cellular/PsetNotesUi/Src/PsuiQueryDialog.cpp
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #include "psuiquerydialog.h" 
    20 #include "PsuiQueryDialog.h"
    21 
    21 
    22 // ================= MEMBER FUNCTIONS =======================
    22 // ================= MEMBER FUNCTIONS =======================
    23 
    23 
    24 // C++ default constructor can NOT contain any code, that
    24 // C++ default constructor can NOT contain any code, that
    25 // might leave.
    25 // might leave.
    26 //
    26 //
    27 CPsuiQueryDialog::CPsuiQueryDialog( CAknQueryDialog::TTone aTone ) :
    27 CPsuiQueryDialog::CPsuiQueryDialog( CAknQueryDialog::TTone aTone ) :
    28     CAknQueryDialog( aTone ) 
    28 	CAknQueryDialog( aTone ) 
    29     {
    29     {
    30     }
    30     }
    31 
    31 
    32 // ---------------------------------------------------------------------------
    32 // ---------------------------------------------------------------------------
    33 // Symbian OS two-phased constructor.
    33 // Symbian OS two-phased constructor.
    51 // ---------------------------------------------------------------------------
    51 // ---------------------------------------------------------------------------
    52 //
    52 //
    53 TKeyResponse CPsuiQueryDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent,
    53 TKeyResponse CPsuiQueryDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent,
    54     TEventCode aType )
    54     TEventCode aType )
    55     {
    55     {
    56     if ( ( aKeyEvent.iScanCode == EStdKeyNo || aKeyEvent.iCode == EKeyNo  ) &&
    56     const TBool noKeyReleased = 
    57          aType == EEventKeyUp )
    57         ( aKeyEvent.iScanCode == EStdKeyNo || aKeyEvent.iCode == EKeyNo  ) &&
    58         {
    58           aType == EEventKeyUp;    
    59         // End -key was pressed, so exit this query dialog
    59     const TBool escPressed = aKeyEvent.iCode == EKeyEscape;
    60         TryExitL( EKeyNo );
    60     
    61         }
    61     // AknDialogShutter sends esc keys so dismiss dialog 
       
    62 	if ( noKeyReleased || escPressed )
       
    63 		{
       
    64 		// End -key was pressed, so exit this query dialog
       
    65 		TryExitL( EKeyNo ); 
       
    66 		RDebug::Printf("PSETNOTESUI: exiting dialog");
       
    67 		return EKeyWasConsumed;
       
    68 		}
    62 
    69 
    63     return EKeyWasNotConsumed;
    70 	return EKeyWasNotConsumed;
    64     }
    71     }
    65 
    72 
    66 // ---------------------------------------------------------------------------
    73 // ---------------------------------------------------------------------------
    67 // CPsuiQueryDialog::OkToExitL
    74 // CPsuiQueryDialog::OkToExitL
    68 // ---------------------------------------------------------------------------
    75 // ---------------------------------------------------------------------------
    69 //
    76 //
    70 TBool CPsuiQueryDialog::OkToExitL( TInt /*aCommand*/ )
    77 TBool CPsuiQueryDialog::OkToExitL( TInt /*aCommand*/ )
    71     {
    78     {
    72     // Dismiss query
    79 	// Dismiss query
    73     return ETrue;
    80     return ETrue;
    74     }
    81     }
    75 
    82 
    76 // End of File
    83 // End of File