securitysettings/eapqtdialogs/src/eapquerydialog.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: EAP query Dialog implementation
    14 * Description: EAP Challenge query 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 <HbLabel>
    23 #include <HbLabel>
    23 #include <HbAction>
    24 #include <HbAction>
    24 #include <HbTranslator>
    25 #include <HbTranslator>
    25 #include <HbParameterLengthLimiter>
    26 #include <HbParameterLengthLimiter>
       
    27 
       
    28 // User includes
    26 #include "eapquerydialog.h"
    29 #include "eapquerydialog.h"
    27 #include "OstTraceDefinitions.h"
    30 #include "OstTraceDefinitions.h"
    28 #ifdef OST_TRACE_COMPILER_IN_USE
    31 #ifdef OST_TRACE_COMPILER_IN_USE
    29 #endif
    32 #endif
    30 
    33 
    31 // The index numbers of the button of the dialog
    34 /*!
    32 const int okButtonIndex = 1;
    35  * \class EapQueryDialog
    33 
    36  * \brief Implements EAP Challenge query Dialog. 
    34 /**
    37  */
    35  * The constructor
    38 
       
    39 // External function prototypes
       
    40 
       
    41 // Local constants
       
    42 
       
    43 //! The index numbers of the button of the dialog
       
    44 static const int okButtonIndex = 1;
       
    45  
       
    46 // ======== LOCAL FUNCTIONS ========
       
    47 
       
    48 // ======== MEMBER FUNCTIONS ========
       
    49 
       
    50 /*!
       
    51  * Constructor.
       
    52  * 
       
    53  * @param [in]  parameters Parameters for the Constructor.
    36  */
    54  */
    37 EapQueryDialog::EapQueryDialog(const QVariantMap &parameters)
    55 EapQueryDialog::EapQueryDialog(const QVariantMap &parameters)
    38 :mTranslator(new HbTranslator("eapprompts")),
    56 :mTranslator(new HbTranslator("eapprompts")),
    39 mOkActionPressed(false)    
    57 mOkActionPressed(false)    
    40 {
    58 {
    45     
    63     
    46     OstTraceFunctionExit0( EAPQUERYDIALOG_EAPQUERYDIALOG_EXIT );
    64     OstTraceFunctionExit0( EAPQUERYDIALOG_EAPQUERYDIALOG_EXIT );
    47     qDebug("EapQueryDialog::EapQueryDialog EXIT");
    65     qDebug("EapQueryDialog::EapQueryDialog EXIT");
    48 }
    66 }
    49 
    67 
    50     
    68 /*!
    51 /**
       
    52  * The construction of the dialog
    69  * The construction of the dialog
       
    70  *
       
    71  * @param [in] parameters Parameters for the Construction of the dialog.
    53  */ 
    72  */ 
    54 void EapQueryDialog::createDialog(const QVariantMap &parameters )
    73 void EapQueryDialog::createDialog(const QVariantMap &parameters )
    55 {
    74 {
    56     OstTraceFunctionEntry0( EAPQUERYDIALOG_CREATEDIALOG_ENTRY );
    75     OstTraceFunctionEntry0( EAPQUERYDIALOG_CREATEDIALOG_ENTRY );
    57     qDebug("EapQueryDialog::createDialog ENTER");
    76     qDebug("EapQueryDialog::createDialog ENTER");
   120    
   139    
   121     OstTraceFunctionExit0( DUP1_EAPQUERYDIALOG_CREATEDIALOG_EXIT );
   140     OstTraceFunctionExit0( DUP1_EAPQUERYDIALOG_CREATEDIALOG_EXIT );
   122     qDebug("EapQueryDialog::createDialog EXIT");
   141     qDebug("EapQueryDialog::createDialog EXIT");
   123 }
   142 }
   124 
   143 
   125 /**
   144 /*!
   126  * Destructor
   145  * Destructor.
   127  */
   146  */
   128 EapQueryDialog::~EapQueryDialog()
   147 EapQueryDialog::~EapQueryDialog()
   129 {
   148 {
   130     OstTraceFunctionEntry0( EAPQUERYDIALOG_DEAPQUERYDIALOG_ENTRY );
   149     OstTraceFunctionEntry0( EAPQUERYDIALOG_DEAPQUERYDIALOG_ENTRY );
   131     
   150     
   132     // The dialog widgets are deleted as the dialog is deleted
   151     // The dialog widgets are deleted as the dialog is deleted
   133     
   152     
   134     OstTraceFunctionExit0( EAPQUERYDIALOG_DEAPQUERYDIALOG_EXIT );
   153     OstTraceFunctionExit0( EAPQUERYDIALOG_DEAPQUERYDIALOG_EXIT );
   135 }
   154 }
   136 
   155 
   137 /**
   156 /*!
   138  * Function is called when the Ok Action button is pressed
   157  * Function is called when the Ok Action button is pressed
   139  */
   158  */
   140 void EapQueryDialog::okPressed()
   159 void EapQueryDialog::okPressed()
   141 {
   160 {
   142     OstTraceFunctionEntry0( EAPQUERYDIALOG_OKPRESSED_ENTRY );
   161     OstTraceFunctionEntry0( EAPQUERYDIALOG_OKPRESSED_ENTRY );
   145     if ( mOkActionPressed == false ) {
   164     if ( mOkActionPressed == false ) {
   146         
   165         
   147             mOkActionPressed = true;
   166             mOkActionPressed = true;
   148             
   167             
   149             QVariantMap data;
   168             QVariantMap data;
   150             QVariant variant(okButtonIndex);
   169             data["okbutton"] = okButtonIndex;
   151             data.insert("okbutton", variant);
   170             
   152             // emit the data of the selected button and close the dialog
   171             // emit the data of the selected button and close the dialog
   153             qDebug("EapQueryDialog::okPressed: emit deviceDialogData");
   172             qDebug("EapQueryDialog::okPressed: emit deviceDialogData");
   154             emit deviceDialogData(data);
   173             emit deviceDialogData(data);
   155     
   174     
   156             closeDeviceDialog(true);
   175             closeDeviceDialog(true);
   157     }
   176     }
   158     OstTraceFunctionExit0( EAPQUERYDIALOG_OKPRESSED_EXIT );
   177     OstTraceFunctionExit0( EAPQUERYDIALOG_OKPRESSED_EXIT );
   159     qDebug("EapQueryDialog::okPressed EXIT");
   178     qDebug("EapQueryDialog::okPressed EXIT");
   160 }
   179 }
   161 
   180 
   162 /**
   181 /*!
   163  * Function is called when the dialog is about to close
   182  * Function is called when the dialog is about to close
   164  * 
       
   165  */
   183  */
   166 void EapQueryDialog::closingDialog()
   184 void EapQueryDialog::closingDialog()
   167 {
   185 {
   168     OstTraceFunctionEntry0( EAPQUERYDIALOG_CLOSINGDIALOG_ENTRY );
   186     OstTraceFunctionEntry0( EAPQUERYDIALOG_CLOSINGDIALOG_ENTRY );
   169     qDebug("EapQueryDialog::closingDialog ENTER");
   187     qDebug("EapQueryDialog::closingDialog ENTER");
   170  
   188  
   171     qDebug("EapQueryDialog::closingDialog EXIT");
   189     qDebug("EapQueryDialog::closingDialog EXIT");
   172     OstTraceFunctionExit0( EAPQUERYDIALOG_CLOSINGDIALOG_EXIT );
   190     OstTraceFunctionExit0( EAPQUERYDIALOG_CLOSINGDIALOG_EXIT );
   173 }
   191 }
   174 
   192 
   175 /**
   193 /*!
   176  * Updating the dialog during its showing is not allowed.
   194  * Device dialog parameters to be set while dialog is displayed.
   177  */ 
   195  * Not supported. 
       
   196  *
       
   197  * @param [in] parameters NOT USED
       
   198  * @return true always.
       
   199  */  
   178 bool EapQueryDialog::setDeviceDialogParameters
   200 bool EapQueryDialog::setDeviceDialogParameters
   179                 (const QVariantMap &parameters)
   201                 (const QVariantMap &parameters)
   180 {
   202 {
   181     OstTraceFunctionEntry0( EAPQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   203     OstTraceFunctionEntry0( EAPQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   182     
   204     
   185     
   207     
   186     OstTraceFunctionExit0( EAPQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   208     OstTraceFunctionExit0( EAPQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   187     return true;
   209     return true;
   188 }
   210 }
   189 
   211 
   190 /**
   212 /*!
   191  * Not supported, 0 always returned
   213  * Not supported
       
   214  *
       
   215  * @return 0 always returned.
   192  */
   216  */
   193 int EapQueryDialog::deviceDialogError() const
   217 int EapQueryDialog::deviceDialogError() const
   194 {
   218 {
   195     OstTraceFunctionEntry0( EAPQUERYDIALOG_DEVICEDIALOGERROR_ENTRY );
   219     OstTraceFunctionEntry0( EAPQUERYDIALOG_DEVICEDIALOGERROR_ENTRY );
   196     OstTraceFunctionExit0( EAPQUERYDIALOG_DEVICEDIALOGERROR_EXIT);
   220     OstTraceFunctionExit0( EAPQUERYDIALOG_DEVICEDIALOGERROR_EXIT);
   197     return 0;
   221     return 0;
   198 }
   222 }
   199 
   223 
   200 /**
   224 /*!
   201  * Dialog is closed and the signal about closing is emitted
   225  * Dialog is closed and the signal about closing is emitted
       
   226  *
       
   227  * @param [in] byClient indicates when the user closes the dialog
   202  */
   228  */
   203 void EapQueryDialog::closeDeviceDialog(bool byClient)
   229 void EapQueryDialog::closeDeviceDialog(bool byClient)
   204 {   
   230 {   
   205     OstTraceFunctionEntry0( EAPQUERYDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   231     OstTraceFunctionEntry0( EAPQUERYDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   206     qDebug("EapQueryDialog::closeDeviceDialog ENTER");
   232     qDebug("EapQueryDialog::closeDeviceDialog ENTER");
   212     
   238     
   213     qDebug("EapQueryDialog::closeDeviceDialog EXIT");
   239     qDebug("EapQueryDialog::closeDeviceDialog EXIT");
   214     OstTraceFunctionExit0( EAPQUERYDIALOG_CLOSEDEVICEDIALOG_EXIT );
   240     OstTraceFunctionExit0( EAPQUERYDIALOG_CLOSEDEVICEDIALOG_EXIT );
   215 }
   241 }
   216 
   242 
   217 /**
   243 /*!
   218  * This dialog widget is returned to the caller
   244  * This dialog widget is returned to the caller
       
   245  *
       
   246  * @return this dialog widget
   219  */
   247  */
   220 HbPopup *EapQueryDialog::deviceDialogWidget() const
   248 HbPopup *EapQueryDialog::deviceDialogWidget() const
   221 {
   249 {
   222     OstTraceFunctionEntry0( EAPQUERYDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   250     OstTraceFunctionEntry0( EAPQUERYDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   223     qDebug("EapQueryDialog::deviceDialogWidget ENTER");
   251     qDebug("EapQueryDialog::deviceDialogWidget ENTER");