securitysettings/eapqtdialogs/src/eapfastinstallpacquerydialog.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 Install Pac Query Dialog implementation
    14 * Description: EAP-FAST Install PAC Query 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 <HbTranslator>
    23 #include <HbTranslator>
    23 #include <HbAction>
    24 #include <HbAction>
    24 #include <HbParameterLengthLimiter>
    25 #include <HbParameterLengthLimiter>
       
    26 
       
    27 // User includes
    25 #include "eapfastinstallpacquerydialog.h"
    28 #include "eapfastinstallpacquerydialog.h"
    26 #include "OstTraceDefinitions.h"
    29 #include "OstTraceDefinitions.h"
    27 #ifdef OST_TRACE_COMPILER_IN_USE
    30 #ifdef OST_TRACE_COMPILER_IN_USE
    28 #endif
    31 #endif
    29 
    32 
    30 // The index numbers of the button of the dialog
    33 /*!
    31 const int yesButtonIndex = 1;
    34  * \class EapFastInstallPacQueryDialog
    32 
    35  * \brief Implements EAP-FAST Install PAC Query Dialog. 
    33 /**
    36  */
    34  * The constructor
    37 
       
    38 // External function prototypes
       
    39 
       
    40 // Local constants
       
    41 
       
    42 //! The index numbers of the button of the dialog
       
    43 static const int yesButtonIndex = 1;
       
    44  
       
    45 // ======== LOCAL FUNCTIONS ========
       
    46 
       
    47 // ======== MEMBER FUNCTIONS ========
       
    48 
       
    49 /*!
       
    50  * Constructor.
       
    51  * 
       
    52  * @param [in]  parameters Parameters for the Constructor.
    35  */
    53  */
    36 EapFastInstallPacQueryDialog::EapFastInstallPacQueryDialog(const QVariantMap &parameters)
    54 EapFastInstallPacQueryDialog::EapFastInstallPacQueryDialog(const QVariantMap &parameters)
    37 :HbMessageBox("default text...",HbMessageBox::MessageTypeQuestion),
    55 :HbMessageBox(HbMessageBox::MessageTypeQuestion),
    38 mTranslator(new HbTranslator("eapprompts")),
    56 mTranslator(new HbTranslator("eapprompts")),
    39 mClose(false),
    57 mClose(false),
    40 mYesActionPressed(false)
    58 mYesActionPressed(false)
    41 {
    59 {
    42     OstTraceFunctionEntry0( EAPGTCQUERYDIALOG_EAPGTCQUERYDIALOG_ENTRY );
    60     OstTraceFunctionEntry0( EAPGTCQUERYDIALOG_EAPGTCQUERYDIALOG_ENTRY );
    46         
    64         
    47     OstTraceFunctionExit0( EAPGTCQUERYDIALOG_EAPGTCQUERYDIALOG_EXIT );
    65     OstTraceFunctionExit0( EAPGTCQUERYDIALOG_EAPGTCQUERYDIALOG_EXIT );
    48     qDebug("EapFastInstallPacQueryDialog::EapFastInstallPacQueryDialog EXIT");
    66     qDebug("EapFastInstallPacQueryDialog::EapFastInstallPacQueryDialog EXIT");
    49 }
    67 }
    50     
    68     
    51 /**
    69 /*!
    52  * The construction of the dialog
    70  * The construction of the dialog
       
    71  *
       
    72  * @param [in] parameters Parameters for the Construction of the dialog.
    53  */ 
    73  */ 
    54 void EapFastInstallPacQueryDialog::createDialog(const QVariantMap &parameters )
    74 void EapFastInstallPacQueryDialog::createDialog(const QVariantMap &parameters )
    55 {
    75 {
    56     OstTraceFunctionEntry0( EAPGTCQUERYDIALOG_CREATEDIALOG_ENTRY );
    76     OstTraceFunctionEntry0( EAPGTCQUERYDIALOG_CREATEDIALOG_ENTRY );
    57     qDebug("EapFastInstallPacQueryDialog::createDialog ENTER");
    77     qDebug("EapFastInstallPacQueryDialog::createDialog ENTER");
   114    
   134    
   115     OstTraceFunctionExit0( DUP1_EAPGTCQUERYDIALOG_CREATEDIALOG_EXIT );
   135     OstTraceFunctionExit0( DUP1_EAPGTCQUERYDIALOG_CREATEDIALOG_EXIT );
   116     qDebug("EapFastInstallPacQueryDialog::createDialog EXIT");
   136     qDebug("EapFastInstallPacQueryDialog::createDialog EXIT");
   117 }
   137 }
   118 
   138 
   119 /**
   139 /*!
   120  * Destructor
   140  * Destructor.
   121  */
   141  */
   122 EapFastInstallPacQueryDialog::~EapFastInstallPacQueryDialog()
   142 EapFastInstallPacQueryDialog::~EapFastInstallPacQueryDialog()
   123 {
   143 {
   124     OstTraceFunctionEntry0( EAPGTCQUERYDIALOG_DEAPGTCQUERYDIALOG_ENTRY );
   144     OstTraceFunctionEntry0( EAPGTCQUERYDIALOG_DEAPGTCQUERYDIALOG_ENTRY );
   125     
   145     
   126     // The dialog widgets are deleted as the dialog is deleted
   146     // The dialog widgets are deleted as the dialog is deleted
   127     
   147     
   128     OstTraceFunctionExit0( EAPGTCQUERYDIALOG_DEAPGTCQUERYDIALOG_EXIT );
   148     OstTraceFunctionExit0( EAPGTCQUERYDIALOG_DEAPGTCQUERYDIALOG_EXIT );
   129 }
   149 }
   130 
   150 
   131 /**
   151 /*!
   132  * Function is called when the Yes Action button is pressed
   152  * Function is called when the Yes Action button is pressed
   133  */
   153  */
   134 void EapFastInstallPacQueryDialog::yesPressed()
   154 void EapFastInstallPacQueryDialog::yesPressed()
   135 {
   155 {
   136     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_YESBUTTONPRESSED_ENTRY );
   156     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_YESBUTTONPRESSED_ENTRY );
   139     if ( mYesActionPressed == false ) {
   159     if ( mYesActionPressed == false ) {
   140         
   160         
   141          mYesActionPressed = true;
   161          mYesActionPressed = true;
   142             
   162             
   143          QVariantMap data;
   163          QVariantMap data;
   144          QVariant variant(yesButtonIndex);
   164          data["yesbutton"] = yesButtonIndex;
   145          data.insert("yesbutton", variant);
   165          
   146          // emit the data of the selected button and close the dialog
   166          // emit the data of the selected button and close the dialog
   147          qDebug("EapFastInstallPacQueryDialog::yesPressed: emit deviceDialogData");
   167          qDebug("EapFastInstallPacQueryDialog::yesPressed: emit deviceDialogData");
   148          emit deviceDialogData(data);   
   168          emit deviceDialogData(data);   
   149          closeDeviceDialog(true);
   169          closeDeviceDialog(true);
   150     }
   170     }
   151     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_YESBUTTONPRESSED_EXIT );
   171     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_YESBUTTONPRESSED_EXIT );
   152     qDebug("EapFastInstallPacQueryDialog::yesPressed EXIT");
   172     qDebug("EapFastInstallPacQueryDialog::yesPressed EXIT");
   153 }
   173 }
   154 
   174 
   155 /**
   175 /*!
   156  * Function is called when the No Action button is pressed
   176  * Function is called when the No Action button is pressed
   157  */
   177  */
   158 void EapFastInstallPacQueryDialog::noPressed()
   178 void EapFastInstallPacQueryDialog::noPressed()
   159 {
   179 {
   160     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_NOPRESSED_ENTRY );
   180     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_NOPRESSED_ENTRY );
   166     }   
   186     }   
   167     qDebug("EapFastInstallPacQueryDialog::noPressed EXIT");
   187     qDebug("EapFastInstallPacQueryDialog::noPressed EXIT");
   168     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_NOPRESSED_EXIT );
   188     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_NOPRESSED_EXIT );
   169 }
   189 }
   170 
   190 
   171 /**
   191 /*!
   172  * Function is called when the dialog is about to close
   192  * Function is called when the dialog is about to close
   173  * 
       
   174  */
   193  */
   175 void EapFastInstallPacQueryDialog::closingDialog()
   194 void EapFastInstallPacQueryDialog::closingDialog()
   176 {
   195 {
   177     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_CLOSINGDIALOG_ENTRY );
   196     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_CLOSINGDIALOG_ENTRY );
   178     qDebug("EapFastInstallPacQueryDialog::closingDialog ENTER");
   197     qDebug("EapFastInstallPacQueryDialog::closingDialog ENTER");
   179   
   198   
   180     qDebug("EapFastInstallPacQueryDialog::closingDialog EXIT");
   199     qDebug("EapFastInstallPacQueryDialog::closingDialog EXIT");
   181     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_CLOSINGDIALOG_EXIT );
   200     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_CLOSINGDIALOG_EXIT );
   182 }
   201 }
   183 
   202 
   184 /**
   203 /*!
   185  * Updating the dialog during its showing is not allowed.
   204  * Device dialog parameters to be set while dialog is displayed.
   186  */ 
   205  * Not supported. 
       
   206  *
       
   207  * @param [in] parameters NOT USED
       
   208  * @return true always.
       
   209  */  
   187 bool EapFastInstallPacQueryDialog::setDeviceDialogParameters
   210 bool EapFastInstallPacQueryDialog::setDeviceDialogParameters
   188                 (const QVariantMap &parameters)
   211                 (const QVariantMap &parameters)
   189 {
   212 {
   190     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   213     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   191     
   214     
   194     
   217     
   195     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   218     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   196     return true;
   219     return true;
   197 }
   220 }
   198 
   221 
   199 /**
   222 /*!
   200  * Not supported, 0 always returned
   223  * Not supported
       
   224  *
       
   225  * @return 0 always returned.
   201  */
   226  */
   202 int EapFastInstallPacQueryDialog::deviceDialogError() const
   227 int EapFastInstallPacQueryDialog::deviceDialogError() const
   203 {
   228 {
   204     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_DEVICEDIALOGERROR_ENTRY );
   229     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_DEVICEDIALOGERROR_ENTRY );
   205     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_DEVICEDIALOGERROR_EXIT);
   230     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_DEVICEDIALOGERROR_EXIT);
   206     return 0;
   231     return 0;
   207 }
   232 }
   208 
   233 
   209 /**
   234 /*!
   210  * Dialog is closed and the signal about closing is emitted
   235  * Dialog is closed and the signal about closing is emitted
       
   236  *
       
   237  * @param [in] byClient indicates when the user closes the dialog
   211  */
   238  */
   212 void EapFastInstallPacQueryDialog::closeDeviceDialog(bool byClient)
   239 void EapFastInstallPacQueryDialog::closeDeviceDialog(bool byClient)
   213 {   
   240 {   
   214     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   241     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   215     qDebug("EapFastInstallPacQueryDialog::closeDeviceDialog ENTER");
   242     qDebug("EapFastInstallPacQueryDialog::closeDeviceDialog ENTER");
   223     
   250     
   224     qDebug("EapFastInstallPacQueryDialog::closeDeviceDialog EXIT");
   251     qDebug("EapFastInstallPacQueryDialog::closeDeviceDialog EXIT");
   225     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_CLOSEDEVICEDIALOG_EXIT );
   252     OstTraceFunctionExit0( EAPFASTINSTALLPACQUERYDIALOG_CLOSEDEVICEDIALOG_EXIT );
   226 }
   253 }
   227 
   254 
   228 /**
   255 /*!
   229  * This dialog widget is returned to the caller
   256  * This dialog widget is returned to the caller
       
   257  *
       
   258  * @return this dialog widget
   230  */
   259  */
   231 HbPopup *EapFastInstallPacQueryDialog::deviceDialogWidget() const
   260 HbPopup *EapFastInstallPacQueryDialog::deviceDialogWidget() const
   232 {
   261 {
   233     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   262     OstTraceFunctionEntry0( EAPFASTINSTALLPACQUERYDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   234     qDebug("EapFastInstallPacQueryDialog::deviceDialogWidget ENTER");
   263     qDebug("EapFastInstallPacQueryDialog::deviceDialogWidget ENTER");