-rw-r--r-- | noncore/net/mail/opiemail.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 7c6d314..1bc81e4 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -108,6 +108,7 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) | |||
108 | setup_signalblocking(); | 108 | setup_signalblocking(); |
109 | settings = new Settings(); | 109 | settings = new Settings(); |
110 | folderView->populate( settings->getAccounts() ); | 110 | folderView->populate( settings->getAccounts() ); |
111 | connect(folderView,SIGNAL(refreshMenues(int)),this,SLOT(refreshMenu(int))); | ||
111 | } | 112 | } |
112 | 113 | ||
113 | OpieMail::~OpieMail() | 114 | OpieMail::~OpieMail() |
@@ -386,3 +387,43 @@ void OpieMail::reEditMail() | |||
386 | compose.slotAdjustColumns(); | 387 | compose.slotAdjustColumns(); |
387 | QPEApplication::execDialog( &compose ); | 388 | QPEApplication::execDialog( &compose ); |
388 | } | 389 | } |
390 | |||
391 | void OpieMail::refreshMenu(int m_isFolder) | ||
392 | { | ||
393 | if (QApplication::desktop()->width()<330) { | ||
394 | mailMenu->setItemEnabled(m_ServerMenuId,m_isFolder&1); | ||
395 | mailMenu->setItemEnabled(m_FolderMenuId,m_isFolder&2); | ||
396 | } else { | ||
397 | menuBar->setItemEnabled(m_ServerMenuId,m_isFolder&1); | ||
398 | menuBar->setItemEnabled(m_FolderMenuId,m_isFolder&2); | ||
399 | } | ||
400 | |||
401 | QMap<int,QString>::ConstIterator it; | ||
402 | QMap<int,QString> server_entries=folderView->currentServerMenu(); | ||
403 | QMap<int,QString> folder_entries=folderView->currentFolderMenu(); | ||
404 | |||
405 | int id; | ||
406 | unsigned int i; | ||
407 | for (i=0; i<folderMenu->count();++i) { | ||
408 | id = folderMenu->idAt(i); | ||
409 | folderMenu->setItemEnabled(id,false); | ||
410 | } | ||
411 | for (it=folder_entries.begin();it!=folder_entries.end();++it) { | ||
412 | folderMenu->changeItem(it.key(),it.data()); | ||
413 | folderMenu->setItemEnabled(it.key(),true); | ||
414 | } | ||
415 | for (i=0; i<serverMenu->count();++i) { | ||
416 | id = serverMenu->idAt(i); | ||
417 | serverMenu->setItemEnabled(id,false); | ||
418 | } | ||
419 | for (it=server_entries.begin();it!=server_entries.end();++it) { | ||
420 | serverMenu->changeItem(it.key(),it.data()); | ||
421 | serverMenu->setItemEnabled(it.key(),true); | ||
422 | } | ||
423 | } | ||
424 | |||
425 | void OpieMail::serverSelected(int m_isFolder) | ||
426 | { | ||
427 | mailView->clear(); | ||
428 | refreshMenu(m_isFolder); | ||
429 | } | ||