clientprovisioning/cpqtsp/src/CpMessage.cpp
changeset 30 d3981f4fe6a4
child 62 03849bd79877
equal deleted inserted replaced
27:516a867811c3 30:d3981f4fe6a4
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Bio control for Provisioning documents.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include <CpMessage.h>
       
    21 #include <HbMessageBox>
       
    22 #include <CWPBioControl.h>
       
    23 
       
    24 // ----------------------------------------------------------------------------
       
    25 // CpMessage::CpMessage
       
    26 // Description: Construtor
       
    27 // ----------------------------------------------------------------------------
       
    28 
       
    29 CpMessage::CpMessage(CWPBioControl* bioControl)
       
    30     {    
       
    31     iBioControl = bioControl;
       
    32     }
       
    33 
       
    34 // ----------------------------------------------------------------------------
       
    35 // CpMessage::~CpMessage
       
    36 // Description: Destructor
       
    37 // ----------------------------------------------------------------------------
       
    38 
       
    39 CpMessage::~CpMessage()
       
    40     {    
       
    41     }
       
    42 
       
    43 // ----------------------------------------------------------------------------
       
    44 // CpMessage::inValidPinMessage
       
    45 // Description: inValidPinMessage
       
    46 // ----------------------------------------------------------------------------
       
    47 
       
    48 
       
    49 void CpMessage::inValidPinMessage()
       
    50     {
       
    51     HbMessageBox *box = new HbMessageBox(hbTrId("code error"),HbMessageBox::MessageTypeWarning);
       
    52     box->setAttribute(Qt::WA_DeleteOnClose);
       
    53     box->open();
       
    54     }
       
    55 
       
    56 // ----------------------------------------------------------------------------
       
    57 // CpMessage::saveSettingMessage
       
    58 // Description: saveSettingMessage
       
    59 // ----------------------------------------------------------------------------
       
    60 
       
    61 
       
    62 void CpMessage::saveSettingMessage()
       
    63     {
       
    64     HbMessageBox *box = new HbMessageBox(hbTrId("txt_device_update_info_settings_are_already_saved"),HbMessageBox::MessageTypeQuestion);
       
    65     box->setAttribute(Qt::WA_DeleteOnClose);
       
    66     box->setTimeout(HbPopup::NoTimeout);
       
    67     box->open(this,SLOT(saveSettingDialogClosed(HbAction*)));
       
    68     }
       
    69 
       
    70 // ----------------------------------------------------------------------------
       
    71 // CpMessage::saveSettingDialogClosed
       
    72 // Description: saveSettingDialogClosed
       
    73 // ----------------------------------------------------------------------------
       
    74 
       
    75 void CpMessage::saveSettingDialogClosed(HbAction *action)
       
    76 {
       
    77     HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
       
    78     if(action == dlg->actions().at(0))
       
    79     {
       
    80       iBioControl->DoSaveL();
       
    81       iBioControl->SaveSettingStatus(); 
       
    82     }    
       
    83  }
       
    84 
       
    85 // ----------------------------------------------------------------------------
       
    86 // CpMessage::settingNotSaved
       
    87 // Description: settingNotSaved
       
    88 // ----------------------------------------------------------------------------
       
    89 
       
    90 
       
    91 void CpMessage::settingNotSaved()
       
    92     {
       
    93     HbMessageBox *box = new HbMessageBox(hbTrId("txt_device_update_info_settings_could_not_be_saved"),HbMessageBox::MessageTypeInformation);
       
    94     box->setAttribute(Qt::WA_DeleteOnClose);
       
    95     box->setTimeout(HbPopup::NoTimeout);
       
    96     //box->open(this,SLOT(saveSettingDialogClosed(HbAction*)));
       
    97     box->open();
       
    98     }
       
    99     
       
   100 // ----------------------------------------------------------------------------
       
   101 // CpMessage::setAsDefault
       
   102 // Description: setAsDefault
       
   103 // ----------------------------------------------------------------------------
       
   104 
       
   105 void CpMessage::setAsDefault()
       
   106     {
       
   107     HbMessageBox *box = new HbMessageBox(hbTrId("txt_device_update_info_set_the_received_settings"),HbMessageBox::MessageTypeQuestion);
       
   108     box->setAttribute(Qt::WA_DeleteOnClose);
       
   109     box->setTimeout(HbPopup::NoTimeout);
       
   110     box->clearActions(); 
       
   111 		HbAction * action1 = new HbAction(hbTrId("txt_device_update_button_set_as_default"));
       
   112 		HbAction * action2 = new HbAction(hbTrId("txt_common_button_cancel"));	
       
   113 		box->addAction(action1);
       
   114 		box->addAction(action2);	
       
   115     box->open(this,SLOT(setAsDefaultDialogClosed(HbAction*)));
       
   116         
       
   117     }
       
   118 
       
   119 // ----------------------------------------------------------------------------
       
   120 // CpMessage::setAsDefaultDialogClosed
       
   121 // Description: setAsDefaultDialogClosed
       
   122 // ----------------------------------------------------------------------------
       
   123 
       
   124 void CpMessage::setAsDefaultDialogClosed(HbAction *action)
       
   125 {
       
   126     HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
       
   127     if(action == dlg->actions().at(0))
       
   128     {
       
   129       iBioControl->saveDefaultSetting();      
       
   130     }    
       
   131  }    
       
   132 
       
   133 // ----------------------------------------------------------------------------
       
   134 // CpMessage::autheticationFailure
       
   135 // Description: autheticationFailure
       
   136 // ----------------------------------------------------------------------------
       
   137 
       
   138 void CpMessage::autheticationFailure()
       
   139     {
       
   140         HbMessageBox *box = new HbMessageBox(hbTrId("txt_device_update_info_verification_failed_and_mes"),HbMessageBox::MessageTypeWarning);
       
   141         box->setAttribute(Qt::WA_DeleteOnClose);
       
   142         box->setTimeout(HbPopup::NoTimeout);
       
   143         box->open(this,SLOT(autheticationFailureDialogClosed(HbAction*)));                    
       
   144     }
       
   145 
       
   146 // ----------------------------------------------------------------------------
       
   147 // CpMessage::autheticationFailureDialogClosed
       
   148 // Description: autheticationFailureDialogClosed
       
   149 // ----------------------------------------------------------------------------
       
   150 
       
   151 void CpMessage::autheticationFailureDialogClosed(HbAction *action)
       
   152 {
       
   153     HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
       
   154     if(action == dlg->actions().at(0))
       
   155     {
       
   156       iBioControl->authenticationFailed();      
       
   157     }    
       
   158  }    
       
   159 
       
   160 // ----------------------------------------------------------------------------
       
   161 // CpMessage::senderUnknown
       
   162 // Description: senderUnknown
       
   163 // ----------------------------------------------------------------------------
       
   164 
       
   165 void CpMessage::senderUnknown()
       
   166     {
       
   167     HbMessageBox *box = new HbMessageBox(hbTrId("txt_device_update_info_ender_of_the_message_is_unt"),HbMessageBox::MessageTypeQuestion);
       
   168     box->setAttribute(Qt::WA_DeleteOnClose);
       
   169     box->setTimeout(HbPopup::NoTimeout);
       
   170     box->clearActions(); 
       
   171 		HbAction * action1 = new HbAction(hbTrId("txt_common_button_continue"));
       
   172 		HbAction * action2 = new HbAction(hbTrId("txt_common_button_cancel"));	
       
   173 		box->addAction(action1);
       
   174 		box->addAction(action2);	
       
   175     box->open(this,SLOT(senderUnknownDialogClosed(HbAction*)));
       
   176     }
       
   177 
       
   178 // ----------------------------------------------------------------------------
       
   179 // CpMessage::senderUnknownDialogClosed
       
   180 // Description: senderUnknownDialogClosed
       
   181 // ----------------------------------------------------------------------------
       
   182 
       
   183 void CpMessage::senderUnknownDialogClosed(HbAction *action)
       
   184 {
       
   185     HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
       
   186     if(action == dlg->actions().at(0))
       
   187     {
       
   188       iBioControl->senderUnknownContinue();      
       
   189     }    
       
   190     else
       
   191     {
       
   192       iBioControl->senderUnknownCancel();      
       
   193     }
       
   194  }