author | alwin <alwin> | 2005-03-12 22:14:03 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-12 22:14:03 (UTC) |
commit | 3cb4c3983ee738f3221ecb4cb154ea1252d69d64 (patch) (unidiff) | |
tree | 13357c046fd618b10546ad6d21992826eab3ad01 /noncore/net/mail/mainwindow.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/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 81c8fee..3689352 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -21,7 +21,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
21 | setToolBarsMovable( false ); | 21 | setToolBarsMovable( false ); |
22 | 22 | ||
23 | toolBar = new QToolBar( this ); | 23 | toolBar = new QToolBar( this ); |
24 | |||
25 | menuBar = new QMenuBar( toolBar ); | 24 | menuBar = new QMenuBar( toolBar ); |
26 | 25 | ||
27 | mailMenu = new QPopupMenu( menuBar ); | 26 | mailMenu = new QPopupMenu( menuBar ); |
@@ -30,8 +29,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
30 | settingsMenu = new QPopupMenu( menuBar ); | 29 | settingsMenu = new QPopupMenu( menuBar ); |
31 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); | 30 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); |
32 | 31 | ||
33 | serverMenu = new QPopupMenu( menuBar ); | 32 | if (QApplication::desktop()->width()<330) { |
34 | m_ServerMenuId = menuBar->insertItem( tr( "Server" ), serverMenu ); | 33 | serverMenu = new QPopupMenu( mailMenu ); |
34 | folderMenu = new QPopupMenu( mailMenu ); | ||
35 | m_ServerMenuId = mailMenu->insertItem( tr( "Server" ), serverMenu ); | ||
36 | m_FolderMenuId = mailMenu->insertItem( tr( "Folder" ), folderMenu ); | ||
37 | } else { | ||
38 | serverMenu = new QPopupMenu( menuBar ); | ||
39 | folderMenu = new QPopupMenu( menuBar ); | ||
40 | m_FolderMenuId = menuBar->insertItem( tr( "Folder" ), folderMenu ); | ||
41 | m_ServerMenuId = menuBar->insertItem( tr( "Server" ), serverMenu ); | ||
42 | } | ||
35 | serverMenu->insertItem(tr("Disconnect"),SERVER_MENU_DISCONNECT); | 43 | serverMenu->insertItem(tr("Disconnect"),SERVER_MENU_DISCONNECT); |
36 | serverMenu->insertItem(tr("Set on/offline"),SERVER_MENU_OFFLINE); | 44 | serverMenu->insertItem(tr("Set on/offline"),SERVER_MENU_OFFLINE); |
37 | serverMenu->insertSeparator(); | 45 | serverMenu->insertSeparator(); |
@@ -40,14 +48,11 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
40 | serverMenu->insertSeparator(); | 48 | serverMenu->insertSeparator(); |
41 | serverMenu->insertItem(tr("(Un-)Subscribe groups"),SERVER_MENU_SUBSCRIBE); | 49 | serverMenu->insertItem(tr("(Un-)Subscribe groups"),SERVER_MENU_SUBSCRIBE); |
42 | 50 | ||
43 | folderMenu = new QPopupMenu( menuBar ); | ||
44 | m_FolderMenuId = menuBar->insertItem( tr( "Folder" ), folderMenu ); | ||
45 | folderMenu->insertItem(tr("Refresh headerlist"),FOLDER_MENU_REFRESH_HEADER); | 51 | folderMenu->insertItem(tr("Refresh headerlist"),FOLDER_MENU_REFRESH_HEADER); |
46 | folderMenu->insertItem(tr("Delete all mails"),FOLDER_MENU_DELETE_ALL_MAILS); | 52 | folderMenu->insertItem(tr("Delete all mails"),FOLDER_MENU_DELETE_ALL_MAILS); |
47 | folderMenu->insertItem(tr("New subfolder"),FOLDER_MENU_NEW_SUBFOLDER); | 53 | folderMenu->insertItem(tr("New subfolder"),FOLDER_MENU_NEW_SUBFOLDER); |
48 | folderMenu->insertItem(tr("Delete folder"),FOLDER_MENU_DELETE_FOLDER); | 54 | folderMenu->insertItem(tr("Delete folder"),FOLDER_MENU_DELETE_FOLDER); |
49 | folderMenu->insertItem(tr("Move/Copie all mails"),FOLDER_MENU_MOVE_MAILS); | 55 | folderMenu->insertItem(tr("Move/Copie all mails"),FOLDER_MENU_MOVE_MAILS); |
50 | |||
51 | menuBar->setItemEnabled(m_ServerMenuId,false); | 56 | menuBar->setItemEnabled(m_ServerMenuId,false); |
52 | menuBar->setItemEnabled(m_FolderMenuId,false); | 57 | menuBar->setItemEnabled(m_FolderMenuId,false); |
53 | 58 | ||
@@ -173,11 +178,9 @@ MainWindow::~MainWindow() | |||
173 | { | 178 | { |
174 | } | 179 | } |
175 | 180 | ||
176 | void MainWindow::serverSelected(int m_isFolder) | 181 | void MainWindow::serverSelected(int) |
177 | { | 182 | { |
178 | mailView->clear(); | 183 | odebug << "slotShowFolders not reached" << oendl; |
179 | menuBar->setItemEnabled(m_ServerMenuId,m_isFolder&1); | ||
180 | menuBar->setItemEnabled(m_FolderMenuId,m_isFolder&2); | ||
181 | } | 184 | } |
182 | 185 | ||
183 | void MainWindow::systemMessage( const QCString& msg, const QByteArray& data ) | 186 | void MainWindow::systemMessage( const QCString& msg, const QByteArray& data ) |