securitysettings/eapqtdialogs/src/eapfastprovnotsuccessnotedialog.cpp
changeset 36 c98682f98478
parent 34 ad1f037f1ac2
child 44 22d80358905b
equal deleted inserted replaced
34:ad1f037f1ac2 36:c98682f98478
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description: Fast Provisioning not successfull note Dialog implementation
    14 * Description: EAP-FAST Provisioning not successfull note Dialog implementation
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 3 %
    19 * %version: 4 %
    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 "eapfastprovnotsuccessnotedialog.h"
    27 #include "eapfastprovnotsuccessnotedialog.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 EapFastProvNotSuccessNoteDialog
    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 EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog(const QVariantMap &parameters)
    53 EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog(const QVariantMap &parameters)
    36 :HbMessageBox("default text...",HbMessageBox::MessageTypeWarning),    
    54 :HbMessageBox(HbMessageBox::MessageTypeWarning),    
    37 mTranslator(new HbTranslator("eapprompts")),
    55 mTranslator(new HbTranslator("eapprompts")),
    38 mOkActionPressed(false)
    56 mOkActionPressed(false)
    39 {
    57 {
    40     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_EAPFASTPROVNOTSUCCESSNOTEDIALOG_ENTRY );
    58     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_EAPFASTPROVNOTSUCCESSNOTEDIALOG_ENTRY );
    41     qDebug("EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog ENTER");
    59     qDebug("EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog ENTER");
    42 
    60     
    43     createDialog( parameters );
    61     Q_UNUSED(parameters)
       
    62 
       
    63     createDialog();
    44     
    64     
    45     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_EAPFASTPROVNOTSUCCESSNOTEDIALOG_EXIT );
    65     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_EAPFASTPROVNOTSUCCESSNOTEDIALOG_EXIT );
    46     qDebug("EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog EXIT");
    66     qDebug("EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog EXIT");
    47 }
    67 }
    48     
    68     
    49 /**
    69 /*!
    50  * The construction of the dialog
    70  * The construction of the dialog
    51  */ 
    71  */ 
    52 void EapFastProvNotSuccessNoteDialog::createDialog(const QVariantMap &parameters )
    72 void EapFastProvNotSuccessNoteDialog::createDialog()
    53 {
    73 {
    54     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CREATEDIALOG_ENTRY );
    74     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CREATEDIALOG_ENTRY );
    55     qDebug("EapFastProvNotSuccessNoteDialog::createDialog ENTER");
    75     qDebug("EapFastProvNotSuccessNoteDialog::createDialog ENTER");
    56      
    76      
    57     QString text(hbTrId("txt_occ_info_provisioning_not_successful_reactiv"));
    77     QString text(hbTrId("txt_occ_info_provisioning_not_successful_reactiv"));
    58     
    78          
    59     Q_UNUSED(parameters)
       
    60         
       
    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);
    65     this->setDismissPolicy(HbPopup::NoDismiss);               
    83     this->setDismissPolicy(HbPopup::NoDismiss);               
    91    
   109    
    92     OstTraceFunctionExit0( DUP1_EAPFASTPROVNOTSUCCESSNOTEDIALOG_CREATEDIALOG_EXIT );
   110     OstTraceFunctionExit0( DUP1_EAPFASTPROVNOTSUCCESSNOTEDIALOG_CREATEDIALOG_EXIT );
    93     qDebug("EapFastProvNotSuccessNoteDialog::createDialog EXIT");
   111     qDebug("EapFastProvNotSuccessNoteDialog::createDialog EXIT");
    94 }
   112 }
    95 
   113 
    96 /**
   114 /*!
    97  * Destructor
   115  * Destructor.
    98  */
   116  */
    99 EapFastProvNotSuccessNoteDialog::~EapFastProvNotSuccessNoteDialog()
   117 EapFastProvNotSuccessNoteDialog::~EapFastProvNotSuccessNoteDialog()
   100 {
   118 {
   101     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEAPFASTPROVNOTSUCCESSNOTEDIALOG_ENTRY );
   119     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEAPFASTPROVNOTSUCCESSNOTEDIALOG_ENTRY );
   102     
   120     
   103     // The dialog widgets are deleted as the dialog is deleted
   121     // The dialog widgets are deleted as the dialog is deleted
   104     
   122     
   105     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEAPFASTPROVNOTSUCCESSNOTEDIALOG_EXIT );
   123     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEAPFASTPROVNOTSUCCESSNOTEDIALOG_EXIT );
   106 }
   124 }
   107 
   125 
   108 /**
   126 /*!
   109  * Function is called when the Ok Action button is pressed
   127  * Function is called when the Ok Action button is pressed
   110  */
   128  */
   111 void EapFastProvNotSuccessNoteDialog::okPressed()
   129 void EapFastProvNotSuccessNoteDialog::okPressed()
   112 {
   130 {
   113     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_OKBUTTONPRESSED_ENTRY );
   131     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_OKBUTTONPRESSED_ENTRY );
   116     if ( mOkActionPressed == false ) {
   134     if ( mOkActionPressed == false ) {
   117         
   135         
   118             mOkActionPressed = true;
   136             mOkActionPressed = true;
   119             
   137             
   120             QVariantMap data;
   138             QVariantMap data;
   121             QVariant variant(okButtonIndex);
   139             data["okbutton"] = okButtonIndex;
   122             data.insert("okbutton", variant);
   140             
   123             // emit the data of the selected button and close the dialog
   141             // emit the data of the selected button and close the dialog
   124             qDebug("EapFastProvNotSuccessNoteDialog::okPressed: emit deviceDialogData");
   142             qDebug("EapFastProvNotSuccessNoteDialog::okPressed: emit deviceDialogData");
   125             emit deviceDialogData(data);
   143             emit deviceDialogData(data);
   126     
   144     
   127             closeDeviceDialog(true);
   145             closeDeviceDialog(true);
   128     }
   146     }
   129     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_OKBUTTONPRESSED_EXIT );
   147     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_OKBUTTONPRESSED_EXIT );
   130     qDebug("EapFastProvNotSuccessNoteDialog::okPressed EXIT");
   148     qDebug("EapFastProvNotSuccessNoteDialog::okPressed EXIT");
   131 }
   149 }
   132 
   150 
   133 /**
   151 /*!
   134  * Function is called when the dialog is about to close
   152  * Function is called when the dialog is about to close
   135  * 
   153  * 
   136  */
   154  */
   137 void EapFastProvNotSuccessNoteDialog::closingDialog()
   155 void EapFastProvNotSuccessNoteDialog::closingDialog()
   138 {
   156 {
   141      
   159      
   142     qDebug("EapFastProvNotSuccessNoteDialog::closingDialog EXIT");
   160     qDebug("EapFastProvNotSuccessNoteDialog::closingDialog EXIT");
   143     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CLOSINGDIALOG_EXIT );
   161     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CLOSINGDIALOG_EXIT );
   144 }
   162 }
   145 
   163 
   146 /**
   164 /*!
   147  * Updating the dialog during its showing is not allowed.
   165  * Device dialog parameters to be set while dialog is displayed.
   148  */ 
   166  * Not supported. 
       
   167  *
       
   168  * @param [in] parameters NOT USED
       
   169  * @return true always.
       
   170  */  
   149 bool EapFastProvNotSuccessNoteDialog::setDeviceDialogParameters
   171 bool EapFastProvNotSuccessNoteDialog::setDeviceDialogParameters
   150                 (const QVariantMap &parameters)
   172                 (const QVariantMap &parameters)
   151 {
   173 {
   152     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   174     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   153     
   175     
   156     
   178     
   157     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   179     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   158     return true;
   180     return true;
   159 }
   181 }
   160 
   182 
   161 /**
   183 /*!
   162  * Not supported, 0 always returned
   184  * Not supported
       
   185  *
       
   186  * @return 0 always returned.
   163  */
   187  */
   164 int EapFastProvNotSuccessNoteDialog::deviceDialogError() const
   188 int EapFastProvNotSuccessNoteDialog::deviceDialogError() const
   165 {
   189 {
   166     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEVICEDIALOGERROR_ENTRY );
   190     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEVICEDIALOGERROR_ENTRY );
   167     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEVICEDIALOGERROR_EXIT);
   191     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEVICEDIALOGERROR_EXIT);
   168     return 0;
   192     return 0;
   169 }
   193 }
   170 
   194 
   171 /**
   195 /*!
   172  * Dialog is closed and the signal about closing is emitted
   196  * Dialog is closed and the signal about closing is emitted
       
   197  *
       
   198  * @param [in] byClient indicates when the user closes the dialog
   173  */
   199  */
   174 void EapFastProvNotSuccessNoteDialog::closeDeviceDialog(bool byClient)
   200 void EapFastProvNotSuccessNoteDialog::closeDeviceDialog(bool byClient)
   175 {   
   201 {   
   176     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   202     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   177     qDebug("EapFastProvNotSuccessNoteDialog::closeDeviceDialog ENTER");
   203     qDebug("EapFastProvNotSuccessNoteDialog::closeDeviceDialog ENTER");
   182     
   208     
   183     qDebug("EapFastProvNotSuccessNoteDialog::closeDeviceDialog EXIT");
   209     qDebug("EapFastProvNotSuccessNoteDialog::closeDeviceDialog EXIT");
   184     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CLOSEDEVICEDIALOG_EXIT );
   210     OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CLOSEDEVICEDIALOG_EXIT );
   185 }
   211 }
   186 
   212 
   187 /**
   213 /*!
   188  * This dialog widget is returned to the caller
   214  * This dialog widget is returned to the caller
       
   215  *
       
   216  * @return this dialog widget
   189  */
   217  */
   190 HbPopup *EapFastProvNotSuccessNoteDialog::deviceDialogWidget() const
   218 HbPopup *EapFastProvNotSuccessNoteDialog::deviceDialogWidget() const
   191 {
   219 {
   192     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   220     OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   193     qDebug("EapFastProvNotSuccessNoteDialog::deviceDialogWidget ENTER");
   221     qDebug("EapFastProvNotSuccessNoteDialog::deviceDialogWidget ENTER");