I'm not sure why KPluginDlg is not there, because it was a KMM class. <br>You could check if it actually wasn't ported from the KDE3 version.<br><br><br><br><div class="gmail_quote">On Tue, Oct 27, 2009 at 5:06 PM, Cristian Oneț <span dir="ltr"><<a href="mailto:onet.cristian@gmail.com">onet.cristian@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">SVN commit 1041330 by conet:<br>
<br>
Some cleanup and ported the online plugin selection code to KDE4.<br>
Since KPluginDlg seems to have been removed use a popup menu to let the user select the online plugin if there is more that one of them (it's not such a nice solution but it will be OK for now - at least the action can be used now).<br>
<br>
M +24 -22 kmymoney2.cpp<br>
<br>
<br>
--- trunk/playground/office/kmymoney/kmymoney2/kmymoney2.cpp #1041329:1041330<br>
@@ -1022,11 +1022,6 @@<br>
<br>
// Initialization of progress bar taken from KDevelop ;-)<br>
d->m_progressBar = new QProgressBar(statusBar());<br>
- //FIXME: Port to KDE4<br>
- //progressBar->setFrameStyle(Q3Frame::NoFrame | Q3Frame::Plain);<br>
- //progressBar->setMargin(0);<br>
- //progressBar->setLineWidth(0);<br>
- //progressBar->setBackgroundMode(QWidget::PaletteBackground);<br>
statusBar()->addWidget(d->m_progressBar);<br>
d->m_progressBar->setFixedHeight(d->m_progressBar->sizeHint().height() - 8);<br>
<br>
@@ -6508,8 +6503,6 @@<br>
<br>
void KMyMoney2App::slotAccountMapOnline(void)<br>
{<br>
- #warning "port to kde4"<br>
-#if 0<br>
// no account selected<br>
if(d->m_selectedAccount.id().isEmpty())<br>
return;<br>
@@ -6525,10 +6518,7 @@<br>
}<br>
}<br>
<br>
- // if we have more than one provider display a dialog to select the current providers<br>
- KPluginDlg dlg(this);<br>
- dlg.setCaption(i18n("Select online banking plugin"));<br>
- dlg.closeButton->hide();<br>
+ // if we have more than one provider let the user select the current provider<br>
QString provider;<br>
QMap<QString, KMyMoneyPlugin::OnlinePlugin*>::const_iterator it_p;<br>
switch(d->m_onlinePlugins.count()) {<br>
@@ -6538,15 +6528,28 @@<br>
provider = d->m_onlinePlugins.begin().key();<br>
break;<br>
default:<br>
- for(it_p = d->m_onlinePlugins.begin(); it_p != d->m_onlinePlugins.end(); ++it_p) {<br>
- QStringList protocolList;<br>
- (*it_p)->protocols(protocolList);<br>
- new K3ListViewItem(dlg.d->m_listView, it_p.key(), "Loaded", protocolList.join(", "));<br>
- }<br>
- if(dlg.exec() == QDialog::Accepted) {<br>
- if(dlg.d->m_listView->selectedItem()) {<br>
- provider = dlg.d->m_listView->selectedItem()->text(0);<br>
+ {<br>
+ QMenu popup(this);<br>
+ popup.setTitle(i18n("Select online banking plugin"));<br>
+<br>
+ // Populate the pick list with all the provider<br>
+ for (it_p = d->m_onlinePlugins.constBegin(); it_p != d->m_onlinePlugins.constEnd(); ++it_p) {<br>
+ popup.addAction(it_p.key())->setData(it_p.key());<br>
}<br>
+<br>
+ QAction *item = popup.actions()[0];<br>
+ if (item) {<br>
+ popup.setActiveAction(item);<br>
+ }<br>
+<br>
+ // cancelled<br>
+ if ((item = popup.exec(QCursor::pos(), item)) == 0) {<br>
+ return;<br>
+ }<br>
+<br>
+ // We need to create a valid date in the month selected so we can find out how many days are<br>
+ // in the month.<br>
+ provider = item->data().toString();<br>
}<br>
break;<br>
}<br>
@@ -6555,8 +6558,8 @@<br>
return;<br>
<br>
// find the provider<br>
- it_p = d->m_onlinePlugins.find(provider);<br>
- if(it_p != d->m_onlinePlugins.end()) {<br>
+ it_p = d->m_onlinePlugins.constFind(provider);<br>
+ if(it_p != d->m_onlinePlugins.constEnd()) {<br>
// plugin found, call it<br>
MyMoneyKeyValueContainer settings;<br>
if((*it_p)->mapAccount(d->m_selectedAccount, settings)) {<br>
@@ -6573,7 +6576,6 @@<br>
}<br>
}<br>
}<br>
-#endif<br>
}<br>
<br>
void KMyMoney2App::slotAccountUpdateOnlineAll(void)<br>
</blockquote></div><br>