equal
deleted
inserted
replaced
61 Initializes and displays the dialog |
61 Initializes and displays the dialog |
62 Signal selectionDialogClosed will be emitted when the dialog is closed |
62 Signal selectionDialogClosed will be emitted when the dialog is closed |
63 */ |
63 */ |
64 void NmMailboxSelectionDialog::open() |
64 void NmMailboxSelectionDialog::open() |
65 { |
65 { |
66 NMLOG("NmMailboxSelectionDialog::exec()"); |
66 NMLOG("NmMailboxSelectionDialog::open()"); |
67 mMailboxId = 0; |
67 mMailboxId = 0; |
68 |
68 |
69 // Initialize the UI and fetch the mailbox items into the list. |
69 // Initialize the UI and fetch the mailbox items into the list. |
70 if (initializeUi() && populateListItems()) { |
70 if (initializeUi() && populateListItems()) { |
71 mMailboxSelectionDialog->setModal(true); |
71 mMailboxSelectionDialog->setModal(true); |
78 Slot that is called when dialog is closed |
78 Slot that is called when dialog is closed |
79 */ |
79 */ |
80 void NmMailboxSelectionDialog::dialogClosed(HbAction *action) |
80 void NmMailboxSelectionDialog::dialogClosed(HbAction *action) |
81 { |
81 { |
82 Q_UNUSED(action); |
82 Q_UNUSED(action); |
83 |
83 |
84 // Store the ID of the selected mailbox into the given argument. |
84 // Store the ID of the selected mailbox into the given argument. |
85 NMLOG(QString("NmMailboxSelectionDialog::dialogClosed() return %1"). |
85 NMLOG(QString("NmMailboxSelectionDialog::dialogClosed() return %1"). |
86 arg(mMailboxId.id())); |
86 arg(mMailboxId.id())); |
87 |
87 |
88 emit selectionDialogClosed(mMailboxId); |
88 emit selectionDialogClosed(mMailboxId); |
89 } |
89 } |
90 |
90 |
91 /*! |
91 /*! |
92 Creates the view for the mailbox selection dialog. |
92 Creates the view for the mailbox selection dialog. |
162 } |
162 } |
163 |
163 |
164 NmMailboxMetaData *metaData = NULL; |
164 NmMailboxMetaData *metaData = NULL; |
165 QStandardItem *item = NULL; |
165 QStandardItem *item = NULL; |
166 |
166 |
|
167 EmailMailboxInfo mailboxInfo; |
167 for (int i = 0; i < count; ++i) { |
168 for (int i = 0; i < count; ++i) { |
168 metaData = mailboxMetaData(i); |
169 metaData = mailboxMetaData(i); |
169 |
170 |
170 if (metaData) { |
171 if (metaData) { |
171 // Implement the branded icons when possible. |
172 QString domainName = metaData->address(); |
172 const HbIcon &mailboxIcon = |
173 QString iconName = mailboxInfo.mailboxIcon(domainName); |
173 NmIcons::getIcon(NmIcons::NmIconDefaultMailbox); |
174 HbIcon mailboxIcon( iconName ); |
174 |
175 |
175 // Construct the item and append it into the list. |
176 // Construct the item and append it into the list. |
176 item = new QStandardItem(mailboxIcon.qicon(), metaData->name()); |
177 item = new QStandardItem(mailboxIcon.qicon(), metaData->name()); |
177 mContentItemModel->appendRow(item); |
178 mContentItemModel->appendRow(item); |
178 } |
179 } |