emailuis/nmailui/src/nmmailboxselectiondialog.cpp
changeset 23 2dc6caa42ec3
parent 18 578830873419
child 27 9ba4404ef423
--- a/emailuis/nmailui/src/nmmailboxselectiondialog.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmmailboxselectiondialog.cpp	Fri May 14 15:41:10 2010 +0300
@@ -58,28 +58,35 @@
 
 
 /*!
-    Initializes and displays the dialog.
-
-    \param mailboxId Where the ID of the selected mailbox is stored.
-    \return True if the user selected a mailbox, false otherwise.
+    Initializes and displays the dialog
+    Signal selectionDialogClosed will be emitted when the dialog is closed
 */
-bool NmMailboxSelectionDialog::exec(NmId& mailboxId)
+void NmMailboxSelectionDialog::open()
 {
     NMLOG("NmMailboxSelectionDialog::exec()");
     mMailboxId = 0;
 
     // Initialize the UI and fetch the mailbox items into the list.
     if (initializeUi() && populateListItems()) {
-        // The UI is ready. Do display the dialog.
-        mMailboxSelectionDialog->exec();
-
-        // Store the ID of the selected mailbox into the given argument.
-        mailboxId = mMailboxId;
+		mMailboxSelectionDialog->setModal(true);
+        mMailboxSelectionDialog->open(this,SLOT(dialogClosed(HbAction*)));
+        mMailboxSelectionDialog->show();
     }
-
-    return (mMailboxId != 0);
 }
 
+/*!
+    Slot that is called when dialog is closed
+ */
+void NmMailboxSelectionDialog::dialogClosed(HbAction *action)
+{
+    Q_UNUSED(action);
+    
+    // Store the ID of the selected mailbox into the given argument.
+    NMLOG(QString("NmMailboxSelectionDialog::dialogClosed() return %1").
+        arg(mMailboxId.id()));
+    
+    emit selectionDialogClosed(mMailboxId);
+}
 
 /*!
     Creates the view for the mailbox selection dialog.