author | alwin <alwin> | 2005-03-12 22:14:03 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-12 22:14:03 (UTC) |
commit | 3cb4c3983ee738f3221ecb4cb154ea1252d69d64 (patch) (side-by-side diff) | |
tree | 13357c046fd618b10546ad6d21992826eab3ad01 /noncore/net/mail/opiemail.cpp | |
parent | 9dddeb81d7db5da718f3f467bb1511b7e72b9caa (diff) | |
download | opie-3cb4c3983ee738f3221ecb4cb154ea1252d69d64.zip opie-3cb4c3983ee738f3221ecb4cb154ea1252d69d64.tar.gz opie-3cb4c3983ee738f3221ecb4cb154ea1252d69d64.tar.bz2 |
rework of the structure of the main menues, them depends now on state of current selected folder/server
on small screens some "Folder" and "Server" menu will get submenus of the menu-item "Mail" cause lack of space on screen - have no other idea.
Diffstat (limited to 'noncore/net/mail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-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 @@ -105,12 +105,13 @@ void ValueExplode::splitit() OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) : MainWindow( parent, name, WStyle_ContextHelp ) { setup_signalblocking(); settings = new Settings(); folderView->populate( settings->getAccounts() ); + connect(folderView,SIGNAL(refreshMenues(int)),this,SLOT(refreshMenu(int))); } OpieMail::~OpieMail() { if (settings) delete settings; } @@ -383,6 +384,46 @@ void OpieMail::reEditMail() ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); compose.slotAdjustColumns(); QPEApplication::execDialog( &compose ); } + +void OpieMail::refreshMenu(int m_isFolder) +{ + if (QApplication::desktop()->width()<330) { + mailMenu->setItemEnabled(m_ServerMenuId,m_isFolder&1); + mailMenu->setItemEnabled(m_FolderMenuId,m_isFolder&2); + } else { + menuBar->setItemEnabled(m_ServerMenuId,m_isFolder&1); + menuBar->setItemEnabled(m_FolderMenuId,m_isFolder&2); + } + + QMap<int,QString>::ConstIterator it; + QMap<int,QString> server_entries=folderView->currentServerMenu(); + QMap<int,QString> folder_entries=folderView->currentFolderMenu(); + + int id; + unsigned int i; + for (i=0; i<folderMenu->count();++i) { + id = folderMenu->idAt(i); + folderMenu->setItemEnabled(id,false); + } + for (it=folder_entries.begin();it!=folder_entries.end();++it) { + folderMenu->changeItem(it.key(),it.data()); + folderMenu->setItemEnabled(it.key(),true); + } + for (i=0; i<serverMenu->count();++i) { + id = serverMenu->idAt(i); + serverMenu->setItemEnabled(id,false); + } + for (it=server_entries.begin();it!=server_entries.end();++it) { + serverMenu->changeItem(it.key(),it.data()); + serverMenu->setItemEnabled(it.key(),true); + } +} + +void OpieMail::serverSelected(int m_isFolder) +{ + mailView->clear(); + refreshMenu(m_isFolder); +} |