securitysettings/eapqtdialogs/src/eapfastprovwaitnotedialog.cpp
branchRCL_3
changeset 19 c74b3d9f6b9e
parent 18 bad0cc58d154
equal deleted inserted replaced
18:bad0cc58d154 19:c74b3d9f6b9e
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Fast Provisioning Wait Notification Dialog implementation
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 4 %
       
    20 */
       
    21 
       
    22 // System includes
       
    23 #include <HbTranslator>
       
    24 
       
    25 // User includes
       
    26 #include "eapfastprovwaitnotedialog.h"
       
    27 #include "OstTraceDefinitions.h"
       
    28 #ifdef OST_TRACE_COMPILER_IN_USE
       
    29 #include "eapfastprovwaitnotedialogTraces.h"
       
    30 #endif
       
    31 
       
    32 /*!
       
    33  * \class EapFastProvWaitNoteDialog
       
    34  * \brief Implements Fast Provisioning Wait Notification Dialog. 
       
    35  */
       
    36 
       
    37 // External function prototypes
       
    38 
       
    39 // Local constants
       
    40  
       
    41 // ======== LOCAL FUNCTIONS ========
       
    42 
       
    43 // ======== MEMBER FUNCTIONS ========
       
    44 
       
    45 /*!
       
    46  * Constructor.
       
    47  * 
       
    48  * @param [in]  parameters Parameters for the Constructor.
       
    49  */
       
    50 EapFastProvWaitNoteDialog::EapFastProvWaitNoteDialog(const QVariantMap &parameters)
       
    51 :mTranslator(new HbTranslator("eapprompts"))
       
    52 {
       
    53     OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_EAPFASTPROVWAITNOTEDIALOG_ENTRY );
       
    54     qDebug("EapFastProvWaitNoteDialog::EapFastProvWaitNoteDialog ENTER");
       
    55 
       
    56     createDialog( parameters );
       
    57         
       
    58     OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_EAPFASTPROVWAITNOTEDIALOG_EXIT );
       
    59     qDebug("EapFastProvWaitNoteDialog::EapFastProvWaitNoteDialog EXIT");
       
    60 }
       
    61    
       
    62 /*!
       
    63  * The construction of the dialog
       
    64  *
       
    65  * @param [in] parameters Parameters for the Construction of the dialog.
       
    66  */ 
       
    67 void EapFastProvWaitNoteDialog::createDialog(const QVariantMap &parameters )
       
    68 {
       
    69     OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_CREATEDIALOG_ENTRY );
       
    70     qDebug("EapFastProvWaitNoteDialog::createDialog ENTER");
       
    71     
       
    72     QString mainText;    
       
    73     QString key("notificationtxt");
       
    74     
       
    75     bool authProvWaitNote = false;
       
    76     
       
    77     //Get the needed information from parameters that indicates to type of the dialog
       
    78     //which is either a authenticated or a unauthenticated 
       
    79     if ( parameters.empty() == false ) {
       
    80         if ( parameters.contains(key) ) {
       
    81             QVariant variant = parameters.value(key);
       
    82             authProvWaitNote = variant.toBool();
       
    83             }
       
    84         }      
       
    85     
       
    86     if ( authProvWaitNote ) {
       
    87         mainText = QString(hbTrId("txt_occ_dpopinfo_authenticated_provisioning_in_pro"));       
       
    88     } else {
       
    89         mainText = QString(hbTrId("txt_occ_dpopinfo_unauthenticated_provisioning_in_p"));
       
    90     }
       
    91        
       
    92     // Set the dialog to be on the screen for 4 seconds.
       
    93     this->setTimeout(4000);
       
    94     this->setTitle(mainText);  
       
    95    
       
    96     // Connect the about to close and hide signals, so that we are able to inform 
       
    97     // the caller that the dialog was closed        
       
    98     bool connected = connect(this, SIGNAL(aboutToClose()), this, SLOT(closingDialog()));
       
    99     Q_ASSERT(connected == true);
       
   100     connected = connect(this, SIGNAL(aboutToHide()), this, SLOT(closingDialog()));
       
   101     Q_ASSERT(connected == true);
       
   102    
       
   103     OstTraceFunctionExit0( DUP1_EAPFASTPROVWAITNOTEDIALOG_CREATEDIALOG_EXIT );
       
   104     qDebug("EapFastProvWaitNoteDialog::createDialog EXIT");
       
   105 }
       
   106 
       
   107 /*!
       
   108  * Destructor.
       
   109  */
       
   110 EapFastProvWaitNoteDialog::~EapFastProvWaitNoteDialog()
       
   111 {
       
   112     OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_DEAPFASTPROVWAITNOTEDIALOG_ENTRY );
       
   113     qDebug("EapFastProvWaitNoteDialog::~EapFastProvWaitNoteDialog ENTER");
       
   114     
       
   115     // The dialog widgets are deleted as the dialog is deleted
       
   116 
       
   117     qDebug("EapFastProvWaitNoteDialog::~EapFastProvWaitNoteDialog EXIT");
       
   118     OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_DEAPFASTPROVWAITNOTEDIALOG_EXIT );
       
   119 }
       
   120 
       
   121 /*!
       
   122  * Function is called when the dialog is about to close
       
   123  */
       
   124 void EapFastProvWaitNoteDialog::closingDialog()
       
   125 {
       
   126     OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_CLOSINGDIALOG_ENTRY );
       
   127     qDebug("EapFastProvWaitNoteDialog::closingDialog ENTER");
       
   128  
       
   129     closeDeviceDialog(false);
       
   130     
       
   131     qDebug("EapFastProvWaitNoteDialog::closingDialog EXIT");
       
   132     OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_CLOSINGDIALOG_EXIT );
       
   133 }
       
   134 
       
   135 /*!
       
   136  * Device dialog parameters to be set while dialog is displayed.
       
   137  * Not supported. 
       
   138  *
       
   139  * @param [in] parameters NOT USED
       
   140  * @return true always.
       
   141  */  
       
   142 bool EapFastProvWaitNoteDialog::setDeviceDialogParameters
       
   143                 (const QVariantMap &parameters)
       
   144 {
       
   145     OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
       
   146     
       
   147     Q_UNUSED(parameters)
       
   148     // changing the dialog after presenting it is not supported.
       
   149     
       
   150     OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
       
   151     return true;
       
   152 }
       
   153 
       
   154 /*!
       
   155  * Not supported
       
   156  *
       
   157  * @return 0 always returned.
       
   158  */
       
   159 int EapFastProvWaitNoteDialog::deviceDialogError() const
       
   160 {
       
   161     OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_DEVICEDIALOGERROR_ENTRY );
       
   162     OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_DEVICEDIALOGERROR_EXIT);
       
   163     return 0;
       
   164 }
       
   165 
       
   166 /*!
       
   167  * Dialog is closed and the signal about closing is emitted
       
   168  *
       
   169  * @param [in] byClient indicates when the user closes the dialog
       
   170  */
       
   171 void EapFastProvWaitNoteDialog::closeDeviceDialog(bool byClient)
       
   172 {   
       
   173     OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_CLOSEDEVICEDIALOG_ENTRY );
       
   174     qDebug("EapFastProvWaitNoteDialog::closeDeviceDialog ENTER");
       
   175         
       
   176     Q_UNUSED(byClient)
       
   177     
       
   178     emit deviceDialogClosed();
       
   179     
       
   180     qDebug("EapFastProvWaitNoteDialog::closeDeviceDialog EXIT");
       
   181     OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_CLOSEDEVICEDIALOG_EXIT );
       
   182 }
       
   183 
       
   184 /*!
       
   185  * This dialog widget is returned to the caller
       
   186  *
       
   187  * @return this dialog widget
       
   188  */
       
   189 HbPopup *EapFastProvWaitNoteDialog::deviceDialogWidget() const
       
   190 {
       
   191     OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_DEVICEDIALOGWIDGET_ENTRY );
       
   192     qDebug("EapFastProvWaitNoteDialog::deviceDialogWidget ENTER");
       
   193     
       
   194     qDebug("EapFastProvWaitNoteDialog::deviceDialogWidget EXIT");
       
   195     OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_DEVICEDIALOGWIDGET_EXIT );
       
   196     
       
   197     return const_cast<EapFastProvWaitNoteDialog*>(this);
       
   198 }
       
   199