emailuis/nmailui/src/nmutilities.cpp
changeset 27 9ba4404ef423
parent 23 2dc6caa42ec3
child 30 759dc5235cdb
equal deleted inserted replaced
23:2dc6caa42ec3 27:9ba4404ef423
   269 {
   269 {
   270     bool openSettings(false);
   270     bool openSettings(false);
   271     // nothing to do in successfull or cancelled case
   271     // nothing to do in successfull or cancelled case
   272     if(event.mCompletionCode != NmNoError && event.mCompletionCode != NmCancelError) {
   272     if(event.mCompletionCode != NmNoError && event.mCompletionCode != NmCancelError) {
   273         if(event.mOperationType == Synch && event.mCompletionCode == NmAuthenticationError) {
   273         if(event.mOperationType == Synch && event.mCompletionCode == NmAuthenticationError) {
   274             openSettings = displayQuestionNote(hbTrId("txt_mail_dialog_address_or_password_incorrect"));
   274 /*
       
   275  * Commented out temporarily, because of wk18 HbDialog API deprecation.
       
   276  *         openSettings = displayQuestionNote(hbTrId("txt_mail_dialog_address_or_password_incorrect"));
       
   277  */
   275         }
   278         }
   276         if(event.mOperationType == Synch && event.mCompletionCode == NmServerConnectionError) {
   279         if(event.mOperationType == Synch && event.mCompletionCode == NmServerConnectionError) {
   277             openSettings = displayQuestionNote(hbTrId("txt_mail_dialog_server_settings_incorrect"));
   280 /*
       
   281  * Commented out temporarily, because of wk18 HbDialog API deprecation.
       
   282  *         openSettings = displayQuestionNote(hbTrId("txt_mail_dialog_server_settings_incorrect"));
       
   283  */
   278         }
   284         }
   279         // following applies to all operation/event types
   285         // following applies to all operation/event types
   280         if(event.mCompletionCode == NmConnectionError) {
   286         if(event.mCompletionCode == NmConnectionError) {
   281             displayWarningNote(hbTrId("txt_mail_dialog_mail_connection_error"));
   287             displayWarningNote(hbTrId("txt_mail_dialog_mail_connection_error"));
   282         }
   288         }
   283     }
   289     }
   284     return openSettings;
   290     return openSettings;
   285 }
   291 }
   286 
   292 
   287 /*!
   293 /*!
   288     displays a note with Yes/No buttons. Note has no timeout, i.e. it has to be dismissed manually
   294     Displays a note with Yes/No buttons. Note has no timeout, i.e. it has to be dismissed manually.
   289     returns boolean whether primaryaction was taken (Left button ("Yes") pressed)
   295     Returns pointer to dialog so that caller can take ownership and handle deletion.
   290 */
   296     Parameter 'receiver' is the object and 'member' is the slot where user selection is passed. 
   291 bool NmUtilities::displayQuestionNote(QString noteText)
   297 */
   292 {
   298 HbMessageBox* NmUtilities::displayQuestionNote(
   293 	HbMessageBox::warning(noteText);
   299     QString noteText, QObject* receiver, const char* member)
   294 	return true;
   300 {
   295 	/*
       
   296 	 * Commented out because of exec() deprecation. Will be fixed later...
       
   297 	 * 
       
   298     bool ret(false);
       
   299     HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
   301     HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
   300     messageBox->setText(noteText);
   302     messageBox->setText(noteText);
   301     messageBox->setTimeout(HbMessageBox::NoTimeout); // note has to be dismissed manually
   303     messageBox->setTimeout(HbMessageBox::NoTimeout); // Note has to be dismissed manually
   302     HbAction *action = messageBox->exec();
   304     messageBox->open(receiver, member);
   303     if(action == messageBox->primaryAction()) {
   305     return messageBox;
   304         ret=true; // primary/left button was pressed
       
   305     }
       
   306     delete messageBox;
       
   307     return ret;
       
   308     */
       
   309 }
   306 }
   310 
   307 
   311 /*!
   308 /*!
   312  * displays an error note with no buttons. Note dismisses itself after NmShortInterval.
   309  * displays an error note with no buttons. Note dismisses itself after NmShortInterval.
   313  */
   310  */