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 | |||
@@ -12,51 +12,56 @@ | |||
12 | #include "mainwindow.h" | 12 | #include "mainwindow.h" |
13 | 13 | ||
14 | using namespace Opie::Core; | 14 | using namespace Opie::Core; |
15 | 15 | ||
16 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 16 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
17 | : QMainWindow( parent, name, flags ) | 17 | : QMainWindow( parent, name, flags ) |
18 | { | 18 | { |
19 | 19 | ||
20 | setCaption( tr( "Mail" ) ); | 20 | setCaption( tr( "Mail" ) ); |
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 ); |
28 | menuBar->insertItem( tr( "Mail" ), mailMenu ); | 27 | menuBar->insertItem( tr( "Mail" ), mailMenu ); |
29 | 28 | ||
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(); |
38 | serverMenu->insertItem(tr("Refresh folder list"),SERVER_MENU_REFRESH_FOLDER); | 46 | serverMenu->insertItem(tr("Refresh folder list"),SERVER_MENU_REFRESH_FOLDER); |
39 | serverMenu->insertItem(tr("Create new folder"),SERVER_MENU_CREATE_FOLDER); | 47 | serverMenu->insertItem(tr("Create new folder"),SERVER_MENU_CREATE_FOLDER); |
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 | ||
54 | addToolBar( toolBar ); | 59 | addToolBar( toolBar ); |
55 | toolBar->setHorizontalStretchable( true ); | 60 | toolBar->setHorizontalStretchable( true ); |
56 | 61 | ||
57 | QLabel *spacer = new QLabel( toolBar ); | 62 | QLabel *spacer = new QLabel( toolBar ); |
58 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 63 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
59 | toolBar->setStretchableWidget( spacer ); | 64 | toolBar->setStretchableWidget( spacer ); |
60 | 65 | ||
61 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, | 66 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, |
62 | 0, 0, this ); | 67 | 0, 0, this ); |
@@ -164,29 +169,27 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
164 | m_sysChannel = new QCopChannel( "QPE/System", this ); | 169 | m_sysChannel = new QCopChannel( "QPE/System", this ); |
165 | connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), | 170 | connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), |
166 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); | 171 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); |
167 | #endif | 172 | #endif |
168 | 173 | ||
169 | QTimer::singleShot( 10, this, SLOT( slotAdjustColumns() ) ); | 174 | QTimer::singleShot( 10, this, SLOT( slotAdjustColumns() ) ); |
170 | } | 175 | } |
171 | 176 | ||
172 | MainWindow::~MainWindow() | 177 | 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 ) |
184 | { | 187 | { |
185 | int _newrotation; | 188 | int _newrotation; |
186 | QDataStream stream( data, IO_ReadOnly ); | 189 | QDataStream stream( data, IO_ReadOnly ); |
187 | if ( msg == "setCurrentRotation(int)" ) | 190 | if ( msg == "setCurrentRotation(int)" ) |
188 | { | 191 | { |
189 | stream >> _newrotation; | 192 | stream >> _newrotation; |
190 | if (m_Rotate != _newrotation) { | 193 | if (m_Rotate != _newrotation) { |
191 | slotAdjustLayout(); | 194 | slotAdjustLayout(); |
192 | m_Rotate = _newrotation; | 195 | m_Rotate = _newrotation; |