securitysettings/eapqtdialogs/src/eapmschapv2pwdexpirednotedialog.cpp
changeset 42 53085837e73a
parent 39 fe6b6762fccd
child 44 22d80358905b
equal deleted inserted replaced
39:fe6b6762fccd 42:53085837e73a
    14 * Description: EAP-MSCHAPv2 password expired note Dialog implementation
    14 * Description: EAP-MSCHAPv2 password expired note Dialog implementation
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 2 %
    19 * %version: 3 %
    20 */
    20 */
    21 
    21 
       
    22 // System includes
    22 #include <HbAction>
    23 #include <HbAction>
    23 #include <HbTranslator>
    24 #include <HbTranslator>
       
    25 
       
    26 // User includes
    24 #include "eapmschapv2pwdexpirednotedialog.h"
    27 #include "eapmschapv2pwdexpirednotedialog.h"
    25 #include "OstTraceDefinitions.h"
    28 #include "OstTraceDefinitions.h"
    26 #ifdef OST_TRACE_COMPILER_IN_USE
    29 #ifdef OST_TRACE_COMPILER_IN_USE
    27 #endif
    30 #endif
    28 
    31 
    29 // The index numbers of the button of the dialog
    32 /*!
    30 const int okButtonIndex = 1;
    33  * \class EapMschapv2NewPwdDialog
    31 
    34  * \brief Implements EAP-MSCHAPv2 New Password Input Dialog. 
    32 /**
    35  */
    33  * The constructor
    36 
       
    37 // External function prototypes
       
    38 
       
    39 // Local constants
       
    40 
       
    41 //! The index numbers of the button of the dialog
       
    42 static const int okButtonIndex = 1;
       
    43  
       
    44 // ======== LOCAL FUNCTIONS ========
       
    45 
       
    46 // ======== MEMBER FUNCTIONS ========
       
    47 
       
    48 /*!
       
    49  * Constructor.
       
    50  * 
       
    51  * @param [in]  parameters Parameters for the Constructor.
    34  */
    52  */
    35 EapMschapv2PwdExpNoteDialog::EapMschapv2PwdExpNoteDialog(const QVariantMap &parameters)
    53 EapMschapv2PwdExpNoteDialog::EapMschapv2PwdExpNoteDialog(const QVariantMap &parameters)
    36 :HbMessageBox("default text...",HbMessageBox::MessageTypeInformation),    
    54 :HbMessageBox("default text...",HbMessageBox::MessageTypeInformation),    
    37 mTranslator(new HbTranslator("eapprompts")),
    55 mTranslator(new HbTranslator("eapprompts")),
    38 mOkActionPressed(false)
    56 mOkActionPressed(false)
    39 {
    57 {
    40     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_EAPMSCHAPV2PWDEXPNOTEDIALOG_ENTRY );
    58     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_EAPMSCHAPV2PWDEXPNOTEDIALOG_ENTRY );
    41     qDebug("EapMschapv2PwdExpNoteDialog::EapMschapv2PwdExpNoteDialog ENTER");
    59     qDebug("EapMschapv2PwdExpNoteDialog::EapMschapv2PwdExpNoteDialog ENTER");
    42 
    60     
    43     createDialog( parameters );
    61     Q_UNUSED(parameters)
       
    62 
       
    63     createDialog();
    44     
    64     
    45     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_EAPMSCHAPV2PWDEXPNOTEDIALOG_EXIT );
    65     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_EAPMSCHAPV2PWDEXPNOTEDIALOG_EXIT );
    46     qDebug("EapMschapv2PwdExpNoteDialog::EapMschapv2PwdExpNoteDialog EXIT");
    66     qDebug("EapMschapv2PwdExpNoteDialog::EapMschapv2PwdExpNoteDialog EXIT");
    47 }
    67 }
    48     
    68     
    49 /**
    69 /*!
    50  * The construction of the dialog
    70  * The construction of the dialog
    51  */ 
    71  */ 
    52 void EapMschapv2PwdExpNoteDialog::createDialog(const QVariantMap &parameters )
    72 void EapMschapv2PwdExpNoteDialog::createDialog()
    53 {
    73 {
    54     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CREATEDIALOG_ENTRY );
    74     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CREATEDIALOG_ENTRY );
    55     qDebug("EapMschapv2PwdExpNoteDialog::createDialog ENTER");
    75     qDebug("EapMschapv2PwdExpNoteDialog::createDialog ENTER");
    56      
    76      
    57     QString text(hbTrId("txt_occ_info_eapmschapv2_password_has_expired_yo"));
    77     QString text(hbTrId("txt_occ_info_eapmschapv2_password_has_expired_yo"));
    58     
       
    59     Q_UNUSED(parameters)
       
    60         
    78         
    61     //Set the dialog to be on the screen until user reacts
    79     //Set the dialog to be on the screen until user reacts
    62     //by pressing the Action button
    80     //by pressing the Action button
    63     this->setModal(true);
    81     this->setModal(true);
    64     this->setTimeout(HbPopup::NoTimeout);
    82     this->setTimeout(HbPopup::NoTimeout);
    92    
   110    
    93     OstTraceFunctionExit0( DUP1_EAPMSCHAPV2PWDEXPNOTEDIALOG_CREATEDIALOG_EXIT );
   111     OstTraceFunctionExit0( DUP1_EAPMSCHAPV2PWDEXPNOTEDIALOG_CREATEDIALOG_EXIT );
    94     qDebug("EapMschapv2PwdExpNoteDialog::createDialog EXIT");
   112     qDebug("EapMschapv2PwdExpNoteDialog::createDialog EXIT");
    95 }
   113 }
    96 
   114 
    97 /**
   115 /*!
    98  * Destructor
   116  * Destructor
    99  */
   117  */
   100 EapMschapv2PwdExpNoteDialog::~EapMschapv2PwdExpNoteDialog()
   118 EapMschapv2PwdExpNoteDialog::~EapMschapv2PwdExpNoteDialog()
   101 {
   119 {
   102     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEAPMSCHAPV2PWDEXPNOTEDIALOG_ENTRY );
   120     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEAPMSCHAPV2PWDEXPNOTEDIALOG_ENTRY );
   104     // The dialog widgets are deleted as the dialog is deleted
   122     // The dialog widgets are deleted as the dialog is deleted
   105     
   123     
   106     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEAPMSCHAPV2PWDEXPNOTEDIALOG_EXIT );
   124     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEAPMSCHAPV2PWDEXPNOTEDIALOG_EXIT );
   107 }
   125 }
   108 
   126 
   109 /**
   127 /*!
   110  * Function is called when the Ok Action button is pressed
   128  * Function is called when the Ok Action button is pressed
   111  */
   129  */
   112 void EapMschapv2PwdExpNoteDialog::okPressed()
   130 void EapMschapv2PwdExpNoteDialog::okPressed()
   113 {
   131 {
   114     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_OKBUTTONPRESSED_ENTRY );
   132     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_OKBUTTONPRESSED_ENTRY );
   117     if ( mOkActionPressed == false ) {
   135     if ( mOkActionPressed == false ) {
   118         
   136         
   119             mOkActionPressed = true;
   137             mOkActionPressed = true;
   120             
   138             
   121             QVariantMap data;
   139             QVariantMap data;
   122             QVariant variant(okButtonIndex);
   140             data["okbutton"] = okButtonIndex;    
   123             data.insert("okbutton", variant);
   141             
   124             // emit the data of the selected button and close the dialog
   142             // emit the data of the selected button and close the dialog
   125             qDebug("EapMschapv2PwdExpNoteDialog::okPressed: emit deviceDialogData");
   143             qDebug("EapMschapv2PwdExpNoteDialog::okPressed: emit deviceDialogData");
   126             emit deviceDialogData(data);
   144             emit deviceDialogData(data);
   127     
   145     
   128             closeDeviceDialog(true);
   146             closeDeviceDialog(true);
   129     }
   147     }
   130     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_OKBUTTONPRESSED_EXIT );
   148     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_OKBUTTONPRESSED_EXIT );
   131     qDebug("EapMschapv2PwdExpNoteDialog::okPressed EXIT");
   149     qDebug("EapMschapv2PwdExpNoteDialog::okPressed EXIT");
   132 }
   150 }
   133 
   151 
   134 /**
   152 /*!
   135  * Function is called when the dialog is about to close
   153  * Function is called when the dialog is about to close
   136  * 
   154  * 
   137  */
   155  */
   138 void EapMschapv2PwdExpNoteDialog::closingDialog()
   156 void EapMschapv2PwdExpNoteDialog::closingDialog()
   139 {
   157 {
   142      
   160      
   143     qDebug("EapMschapv2PwdExpNoteDialog::closingDialog EXIT");
   161     qDebug("EapMschapv2PwdExpNoteDialog::closingDialog EXIT");
   144     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CLOSINGDIALOG_EXIT );
   162     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CLOSINGDIALOG_EXIT );
   145 }
   163 }
   146 
   164 
   147 /**
   165 /*!
   148  * Updating the dialog during its showing is not allowed.
   166  * Device dialog parameters to be set while dialog is displayed.
   149  */ 
   167  * Not supported. 
       
   168  *
       
   169  * @param [in] parameters NOT USED
       
   170  * @return true always.
       
   171  */  
   150 bool EapMschapv2PwdExpNoteDialog::setDeviceDialogParameters
   172 bool EapMschapv2PwdExpNoteDialog::setDeviceDialogParameters
   151                 (const QVariantMap &parameters)
   173                 (const QVariantMap &parameters)
   152 {
   174 {
   153     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   175     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   154     
   176     
   157     
   179     
   158     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   180     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   159     return true;
   181     return true;
   160 }
   182 }
   161 
   183 
   162 /**
   184 /*!
   163  * Not supported, 0 always returned
   185  * Not supported
       
   186  *
       
   187  * @return 0 always returned.
   164  */
   188  */
   165 int EapMschapv2PwdExpNoteDialog::deviceDialogError() const
   189 int EapMschapv2PwdExpNoteDialog::deviceDialogError() const
   166 {
   190 {
   167     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEVICEDIALOGERROR_ENTRY );
   191     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEVICEDIALOGERROR_ENTRY );
   168     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEVICEDIALOGERROR_EXIT);
   192     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEVICEDIALOGERROR_EXIT);
   169     return 0;
   193     return 0;
   170 }
   194 }
   171 
   195 
   172 /**
   196 /*!
   173  * Dialog is closed and the signal about closing is emitted
   197  * Dialog is closed and the signal about closing is emitted
       
   198  *
       
   199  * @param [in] byClient indicates when the user closes the dialog
   174  */
   200  */
   175 void EapMschapv2PwdExpNoteDialog::closeDeviceDialog(bool byClient)
   201 void EapMschapv2PwdExpNoteDialog::closeDeviceDialog(bool byClient)
   176 {   
   202 {   
   177     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   203     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   178     qDebug("EapMschapv2PwdExpNoteDialog::closeDeviceDialog ENTER");
   204     qDebug("EapMschapv2PwdExpNoteDialog::closeDeviceDialog ENTER");
   184     
   210     
   185     qDebug("EapMschapv2PwdExpNoteDialog::closeDeviceDialog EXIT");
   211     qDebug("EapMschapv2PwdExpNoteDialog::closeDeviceDialog EXIT");
   186     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CLOSEDEVICEDIALOG_EXIT );
   212     OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CLOSEDEVICEDIALOG_EXIT );
   187 }
   213 }
   188 
   214 
   189 /**
   215 /*!
   190  * This dialog widget is returned to the caller
   216  * This dialog widget is returned to the caller
       
   217  *
       
   218  * @return this dialog widget
   191  */
   219  */
   192 HbPopup *EapMschapv2PwdExpNoteDialog::deviceDialogWidget() const
   220 HbPopup *EapMschapv2PwdExpNoteDialog::deviceDialogWidget() const
   193 {
   221 {
   194     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   222     OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   195     qDebug("EapMschapv2PwdExpNoteDialog::deviceDialogWidget ENTER");
   223     qDebug("EapMschapv2PwdExpNoteDialog::deviceDialogWidget ENTER");