-rw-r--r-- | kmicromail/mainwindow.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index c77345b..b19dbbe 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -1,140 +1,142 @@ | |||
1 | 1 | ||
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qvbox.h> | 4 | #include <qvbox.h> |
5 | #include <qheader.h> | 5 | #include <qheader.h> |
6 | #include <qtimer.h> | 6 | #include <qtimer.h> |
7 | #include <qlayout.h> | 7 | #include <qlayout.h> |
8 | #include <kdialog.h> | 8 | #include <kdialog.h> |
9 | #include <kiconloader.h> | 9 | #include <kiconloader.h> |
10 | #include <kapplication.h> | 10 | #include <kapplication.h> |
11 | 11 | ||
12 | #ifndef DESKTOP_VERSION | 12 | #ifdef DESKTOP_VERSION |
13 | #include <qapplication.h> | ||
14 | #else | ||
13 | #include <qpe/qpeapplication.h> | 15 | #include <qpe/qpeapplication.h> |
14 | #endif | 16 | #endif |
15 | #include "defines.h" | 17 | #include "defines.h" |
16 | #include "mainwindow.h" | 18 | #include "mainwindow.h" |
17 | #include <KDGanttMinimizeSplitter.h> | 19 | #include <KDGanttMinimizeSplitter.h> |
18 | 20 | ||
19 | 21 | ||
20 | #include <kabc/stdaddressbook.h> | 22 | #include <kabc/stdaddressbook.h> |
21 | 23 | ||
22 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 24 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
23 | : QMainWindow( parent, name ) //, flags ) | 25 | : QMainWindow( parent, name ) //, flags ) |
24 | { | 26 | { |
25 | setCaption( i18n( "KOpieMail/Pi" ) ); | 27 | setCaption( i18n( "KOpieMail/Pi" ) ); |
26 | setToolBarsMovable( false ); | 28 | setToolBarsMovable( false ); |
27 | //KABC::StdAddressBook::self(); | 29 | //KABC::StdAddressBook::self(); |
28 | toolBar = new QToolBar( this ); | 30 | toolBar = new QToolBar( this ); |
29 | menuBar = new QPEMenuBar( toolBar ); | 31 | menuBar = new QPEMenuBar( toolBar ); |
30 | mailMenu = new QPopupMenu( menuBar ); | 32 | mailMenu = new QPopupMenu( menuBar ); |
31 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); | 33 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); |
32 | settingsMenu = new QPopupMenu( menuBar ); | 34 | settingsMenu = new QPopupMenu( menuBar ); |
33 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); | 35 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); |
34 | 36 | ||
35 | addToolBar( toolBar ); | 37 | addToolBar( toolBar ); |
36 | toolBar->setHorizontalStretchable( true ); | 38 | toolBar->setHorizontalStretchable( true ); |
37 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), | 39 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), |
38 | 0, 0, this ); | 40 | 0, 0, this ); |
39 | connect(getMail, SIGNAL( activated() ), | 41 | connect(getMail, SIGNAL( activated() ), |
40 | SLOT( slotGetAllMail() ) ); | 42 | SLOT( slotGetAllMail() ) ); |
41 | getMail->addTo( mailMenu ); | 43 | getMail->addTo( mailMenu ); |
42 | 44 | ||
43 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), | 45 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), |
44 | 0, 0, this ); | 46 | 0, 0, this ); |
45 | getMail->addTo( toolBar ); | 47 | getMail->addTo( toolBar ); |
46 | getMail->addTo( mailMenu ); | 48 | getMail->addTo( mailMenu ); |
47 | connect(getMail, SIGNAL( activated() ), | 49 | connect(getMail, SIGNAL( activated() ), |
48 | SLOT( slotGetMail() ) ); | 50 | SLOT( slotGetMail() ) ); |
49 | 51 | ||
50 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), | 52 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), |
51 | 0, 0, this ); | 53 | 0, 0, this ); |
52 | composeMail->addTo( toolBar ); | 54 | composeMail->addTo( toolBar ); |
53 | composeMail->addTo( mailMenu ); | 55 | composeMail->addTo( mailMenu ); |
54 | 56 | ||
55 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , | 57 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , |
56 | 0, 0, this ); | 58 | 0, 0, this ); |
57 | sendQueued->addTo( toolBar ); | 59 | sendQueued->addTo( toolBar ); |
58 | sendQueued->addTo( mailMenu ); | 60 | sendQueued->addTo( mailMenu ); |
59 | 61 | ||
60 | /* | 62 | /* |
61 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, | 63 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, |
62 | 0, 0, this ); | 64 | 0, 0, this ); |
63 | syncFolders->addTo( toolBar ); | 65 | syncFolders->addTo( toolBar ); |
64 | syncFolders->addTo( mailMenu ); | 66 | syncFolders->addTo( mailMenu ); |
65 | */ | 67 | */ |
66 | 68 | ||
67 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , | 69 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , |
68 | 0, 0, this, 0, true ); | 70 | 0, 0, this, 0, true ); |
69 | showFolders->addTo( toolBar ); | 71 | showFolders->addTo( toolBar ); |
70 | showFolders->addTo( mailMenu ); | 72 | showFolders->addTo( mailMenu ); |
71 | showFolders->setOn( true ); | 73 | showFolders->setOn( true ); |
72 | connect(showFolders, SIGNAL( toggled(bool) ), | 74 | connect(showFolders, SIGNAL( toggled(bool) ), |
73 | SLOT( slotShowFolders(bool) ) ); | 75 | SLOT( slotShowFolders(bool) ) ); |
74 | 76 | ||
75 | /* | 77 | /* |
76 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), | 78 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), |
77 | 0, 0, this ); | 79 | 0, 0, this ); |
78 | searchMails->addTo( toolBar ); | 80 | searchMails->addTo( toolBar ); |
79 | searchMails->addTo( mailMenu ); | 81 | searchMails->addTo( mailMenu ); |
80 | */ | 82 | */ |
81 | 83 | ||
82 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); | 84 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); |
83 | deleteMails->addTo( toolBar ); | 85 | deleteMails->addTo( toolBar ); |
84 | deleteMails->addTo( mailMenu ); | 86 | deleteMails->addTo( mailMenu ); |
85 | connect( deleteMails, SIGNAL( activated() ), | 87 | connect( deleteMails, SIGNAL( activated() ), |
86 | SLOT( slotDeleteMail() ) ); | 88 | SLOT( slotDeleteMail() ) ); |
87 | 89 | ||
88 | editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") , | 90 | editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") , |
89 | 0, 0, this ); | 91 | 0, 0, this ); |
90 | editSettings->addTo( settingsMenu ); | 92 | editSettings->addTo( settingsMenu ); |
91 | connect( editSettings, SIGNAL( activated() ), | 93 | connect( editSettings, SIGNAL( activated() ), |
92 | SLOT( slotEditSettings() ) ); | 94 | SLOT( slotEditSettings() ) ); |
93 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , | 95 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , |
94 | 0, 0, this ); | 96 | 0, 0, this ); |
95 | editAccounts->addTo( settingsMenu ); | 97 | editAccounts->addTo( settingsMenu ); |
96 | 98 | ||
97 | //setCentralWidget( view ); | 99 | //setCentralWidget( view ); |
98 | 100 | ||
99 | QVBox* wrapperBox = new QVBox( this ); | 101 | QVBox* wrapperBox = new QVBox( this ); |
100 | setCentralWidget( wrapperBox ); | 102 | setCentralWidget( wrapperBox ); |
101 | 103 | ||
102 | // QWidget *view = new QWidget( wrapperBox ); | 104 | // QWidget *view = new QWidget( wrapperBox ); |
103 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox); | 105 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox); |
104 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); | 106 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); |
105 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); | 107 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); |
106 | 108 | ||
107 | folderView = new AccountView( split ); | 109 | folderView = new AccountView( split ); |
108 | folderView->header()->hide(); | 110 | folderView->header()->hide(); |
109 | folderView->setRootIsDecorated( false ); | 111 | folderView->setRootIsDecorated( false ); |
110 | folderView->addColumn( i18n( "Mailbox" ) ); | 112 | folderView->addColumn( i18n( "Mailbox" ) ); |
111 | 113 | ||
112 | //layout->addWidget( folderView ); | 114 | //layout->addWidget( folderView ); |
113 | 115 | ||
114 | mailView = new QListView( split ); | 116 | mailView = new QListView( split ); |
115 | mailView->addColumn( i18n( " " ) ); | 117 | mailView->addColumn( i18n( " " ) ); |
116 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); | 118 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); |
117 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); | 119 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); |
118 | mailView->addColumn( i18n( "Size" ),QListView::Manual); | 120 | mailView->addColumn( i18n( "Size" ),QListView::Manual); |
119 | mailView->addColumn( i18n( "Date" ),QListView::Manual); | 121 | mailView->addColumn( i18n( "Date" ),QListView::Manual); |
120 | mailView->setAllColumnsShowFocus(true); | 122 | mailView->setAllColumnsShowFocus(true); |
121 | //mailView->setSorting(-1); | 123 | //mailView->setSorting(-1); |
122 | mailView->setRootIsDecorated( false ); | 124 | mailView->setRootIsDecorated( false ); |
123 | statusWidget = new StatusWidget( wrapperBox ); | 125 | statusWidget = new StatusWidget( wrapperBox ); |
124 | statusWidget->hide(); | 126 | statusWidget->hide(); |
125 | 127 | ||
126 | //layout->addWidget( mailView ); | 128 | //layout->addWidget( mailView ); |
127 | //layout->setStretchFactor( folderView, 1 ); | 129 | //layout->setStretchFactor( folderView, 1 ); |
128 | //layout->setStretchFactor( mailView, 2 ); | 130 | //layout->setStretchFactor( mailView, 2 ); |
129 | 131 | ||
130 | slotAdjustLayout(); | 132 | slotAdjustLayout(); |
131 | #ifndef DESKTOP_VERSION | 133 | #ifndef DESKTOP_VERSION |
132 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 134 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
133 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 135 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
134 | #endif | 136 | #endif |
135 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, | 137 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, |
136 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 138 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
137 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, | 139 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, |
138 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 140 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
139 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 141 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
140 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 142 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |