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