Diffstat (limited to 'noncore/net/mail/accountview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.cpp | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index faa42c3..1183704 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp @@ -32,55 +32,74 @@ AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) SLOT( slotMouseClicked(QListViewItem*) ) ); m_currentItem = 0; } AccountView::~AccountView() { imapAccounts.clear(); mhAccounts.clear(); } void AccountView::slotSelectionChanged(QListViewItem*item) { - odebug << "AccountView: Selection changed" << oendl; if (!item) { emit serverSelected(0); return; } AccountViewItem *view = static_cast<AccountViewItem *>(item); - emit serverSelected(view->isServer()); } +QMap<int,QString> AccountView::currentServerMenu()const +{ + QMap<int,QString> smap; + AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); + if (!view)return smap; + smap = view->serverMenu(); + return smap; +} + +QMap<int,QString> AccountView::currentFolderMenu()const +{ + QMap<int,QString> fmap; + AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); + if (!view)return fmap; + fmap = view->folderMenu(); + return fmap; +} + void AccountView::slotContextMenu(int id) { AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); if (!view) return; - view->contextMenuSelected(id); + bool del = view->contextMenuSelected(id); + if (!del && view->isServer()!=2) { + emit refreshMenues(view->isServer()); + } } -void AccountView::slotRightButton(int button, QListViewItem * item,const QPoint&,int) +void AccountView::slotRightButton(int, QListViewItem * item,const QPoint&,int) { m_rightPressed = true; if (!item) return; AccountViewItem *view = static_cast<AccountViewItem *>(item); QPopupMenu*m = view->getContextMenu(); if (!m) return; connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); m->setFocus(); m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); delete m; } -void AccountView::slotLeftButton(int button, QListViewItem * item,const QPoint&,int) +void AccountView::slotLeftButton(int, QListViewItem *,const QPoint&,int) { m_rightPressed = false; } void AccountView::slotMouseClicked(QListViewItem*item) { if (m_rightPressed) return; if (!item || m_currentItem == item) return; /* ### ToDo check settings if on single tab it should open */ m_currentItem = item; refresh(m_currentItem); } |