-rw-r--r-- | kmicromail/mainwindow.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index e3c5ec3..82a915e 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -18,16 +18,17 @@ extern QStatusBar* globalSstatusBarMainWindow; | |||
18 | #include <qpe/qpeapplication.h> | 18 | #include <qpe/qpeapplication.h> |
19 | #include <klocale.h> | 19 | #include <klocale.h> |
20 | #endif | 20 | #endif |
21 | #include "defines.h" | 21 | #include "defines.h" |
22 | #include "koprefs.h" | 22 | #include "koprefs.h" |
23 | #include "mainwindow.h" | 23 | #include "mainwindow.h" |
24 | #include "mailistviewitem.h" | 24 | #include "mailistviewitem.h" |
25 | #include <KDGanttMinimizeSplitter.h> | 25 | #include <KDGanttMinimizeSplitter.h> |
26 | #include <libkdepim/kpimglobalprefs.h> | ||
26 | 27 | ||
27 | #include "koprefs.h" | 28 | #include "koprefs.h" |
28 | 29 | ||
29 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 30 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
30 | : QMainWindow( parent, name ) //, flags ) | 31 | : QMainWindow( parent, name ) //, flags ) |
31 | { | 32 | { |
32 | #ifdef DESKTOP_VERSION | 33 | #ifdef DESKTOP_VERSION |
33 | globalSstatusBarMainWindow = statusBar(); | 34 | globalSstatusBarMainWindow = statusBar(); |
@@ -160,30 +161,32 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
160 | 161 | ||
161 | folderView = new AccountView( split ); | 162 | folderView = new AccountView( split ); |
162 | folderView->header()->hide(); | 163 | folderView->header()->hide(); |
163 | folderView->setRootIsDecorated( false ); | 164 | folderView->setRootIsDecorated( false ); |
164 | folderView->addColumn( i18n( "Mailbox" ) ); | 165 | folderView->addColumn( i18n( "Mailbox" ) ); |
165 | 166 | ||
166 | //layout->addWidget( folderView ); | 167 | //layout->addWidget( folderView ); |
167 | 168 | ||
168 | mailView = new QListView( split ); | 169 | mailView = new KListView( split ); |
169 | mailView->addColumn( i18n( " " ) ); | 170 | mailView->addColumn( i18n( " " ) ); |
170 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); | 171 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); |
171 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); | 172 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); |
172 | mailView->addColumn( i18n( "Size" ),QListView::Manual); | 173 | mailView->addColumn( i18n( "Size" ),QListView::Manual); |
173 | mailView->addColumn( i18n( "Date" ),QListView::Manual); | 174 | mailView->addColumn( i18n( "Date" ),QListView::Manual); |
174 | if ( KOPrefs::instance()->mShowToField ) | 175 | if ( KOPrefs::instance()->mShowToField ) |
175 | mailView->addColumn( i18n( "To" ),QListView::Manual); | 176 | mailView->addColumn( i18n( "To" ),QListView::Manual); |
176 | mailView->setAllColumnsShowFocus(true); | 177 | mailView->setAllColumnsShowFocus(true); |
177 | //mailView->setSorting(-1); | 178 | //mailView->setSorting(-1); |
178 | mailView->setRootIsDecorated( false ); | 179 | mailView->setRootIsDecorated( false ); |
179 | statusWidget = new StatusWidget( wrapperBox ); | 180 | statusWidget = new StatusWidget( wrapperBox ); |
180 | statusWidget->hide(); | 181 | statusWidget->hide(); |
181 | 182 | mailView->setSelectionMode( QListView::Multi ); | |
183 | mailView->setMultiSelection( true); | ||
184 | mailView->setAlternateBackground(KPimGlobalPrefs::instance()->mAlternateColor ); | ||
182 | //layout->addWidget( mailView ); | 185 | //layout->addWidget( mailView ); |
183 | //layout->setStretchFactor( folderView, 1 ); | 186 | //layout->setStretchFactor( folderView, 1 ); |
184 | //layout->setStretchFactor( mailView, 2 ); | 187 | //layout->setStretchFactor( mailView, 2 ); |
185 | 188 | ||
186 | slotAdjustLayout(); | 189 | slotAdjustLayout(); |
187 | #ifndef DESKTOP_VERSION | 190 | #ifndef DESKTOP_VERSION |
188 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 191 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
189 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 192 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
@@ -206,25 +209,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
206 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, | 209 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, |
207 | SLOT( setInfoFields(QListViewItem*) ) ); | 210 | SLOT( setInfoFields(QListViewItem*) ) ); |
208 | 211 | ||
209 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 212 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
210 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 213 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
211 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 214 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
212 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 215 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
213 | //mailView->setMultiSelection ( true ); | 216 | //mailView->setMultiSelection ( true ); |
214 | mailView->setSelectionMode( QListView::Extended ); | 217 | //mailView->setSelectionMode( QListView::Extended ); |
215 | QValueList<int> list; | 218 | QValueList<int> list; |
216 | int fw = 100; | 219 | int fw = 100; |
217 | if ( QApplication::desktop()->width() > 320 ) | 220 | if ( QApplication::desktop()->width() > 320 ) |
218 | fw = 50; | 221 | fw = 50; |
219 | list.append( fw ); | 222 | list.append( fw ); |
220 | list.append( 100 ); | 223 | list.append( 100 ); |
221 | split->setSizes( list ); | 224 | split->setSizes( list ); |
222 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 225 | QTimer::singleShot( 100, this, SLOT( slotAdjustColumns() ) ); |
223 | mailView->setShowSortIndicator ( true ); | 226 | mailView->setShowSortIndicator ( true ); |
224 | QLabel *spacer = new QLabel( toolBar ); | 227 | QLabel *spacer = new QLabel( toolBar ); |
225 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 228 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
226 | toolBar->setStretchableWidget( spacer ); | 229 | toolBar->setStretchableWidget( spacer ); |
227 | 230 | ||
228 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); | 231 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); |
229 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); | 232 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); |
230 | if ( QApplication::desktop()->width() > 320 ) | 233 | if ( QApplication::desktop()->width() > 320 ) |
@@ -365,20 +368,21 @@ void MainWindow::slotAdjustColumns() | |||
365 | bool hidden = folderView->isHidden(); | 368 | bool hidden = folderView->isHidden(); |
366 | if ( hidden ) folderView->show(); | 369 | if ( hidden ) folderView->show(); |
367 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 370 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
368 | if ( hidden ) folderView->hide(); | 371 | if ( hidden ) folderView->hide(); |
369 | 372 | ||
370 | mailView->setColumnWidth( 0, 10 ); | 373 | mailView->setColumnWidth( 0, 10 ); |
371 | mailView->setColumnWidth( 1, 100 ); | 374 | mailView->setColumnWidth( 1, 100 ); |
372 | mailView->setColumnWidth( 2, 100 ); | 375 | mailView->setColumnWidth( 2, 100 ); |
373 | mailView->setColumnWidth( 3, 50 ); | 376 | mailView->setColumnWidth( 3, 70 ); |
374 | mailView->setColumnWidth( 4, 120 ); | 377 | mailView->setColumnWidth( 4, 170 ); |
375 | if ( KOPrefs::instance()->mShowToField ) | 378 | if ( KOPrefs::instance()->mShowToField ) |
376 | mailView->setColumnWidth( 5, 100 ); | 379 | mailView->setColumnWidth( 5, 100 ); |
380 | mailView->setColumnAlignment( 3, AlignRight); | ||
377 | } | 381 | } |
378 | 382 | ||
379 | void MainWindow::slotEditSettings() | 383 | void MainWindow::slotEditSettings() |
380 | { | 384 | { |
381 | } | 385 | } |
382 | void MainWindow::slotEditGlobalSettings() | 386 | void MainWindow::slotEditGlobalSettings() |
383 | { | 387 | { |
384 | } | 388 | } |