-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 89530ab..9a37510 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <qtimer.h> | 4 | #include <qtimer.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | #include <qtextstream.h> | ||
7 | 8 | ||
8 | #include <qpe/qpeapplication.h> | 9 | #include <qpe/qpeapplication.h> |
9 | #include <qpe/resource.h> | 10 | #include <qpe/resource.h> |
@@ -93,6 +94,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
93 | mailView->addColumn( tr( "" ) ); | 94 | mailView->addColumn( tr( "" ) ); |
94 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); | 95 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); |
95 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); | 96 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); |
97 | mailView->addColumn( tr( "Size" ),QListView::Manual); | ||
96 | mailView->addColumn( tr( "Date" )); | 98 | mailView->addColumn( tr( "Date" )); |
97 | mailView->setAllColumnsShowFocus(true); | 99 | mailView->setAllColumnsShowFocus(true); |
98 | mailView->setSorting(-1); | 100 | mailView->setSorting(-1); |
@@ -136,6 +138,7 @@ void MainWindow::slotAdjustColumns() | |||
136 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); | 138 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); |
137 | mailView->setColumnWidth( 2, 80 ); | 139 | mailView->setColumnWidth( 2, 80 ); |
138 | mailView->setColumnWidth( 3, 50 ); | 140 | mailView->setColumnWidth( 3, 50 ); |
141 | mailView->setColumnWidth( 4, 50 ); | ||
139 | } | 142 | } |
140 | 143 | ||
141 | void MainWindow::slotShowFolders( bool show ) | 144 | void MainWindow::slotShowFolders( bool show ) |
@@ -202,13 +205,46 @@ void MailListViewItem::showEntry() | |||
202 | if ( mail_data.getFlags().testBit( FLAG_ANSWERED ) == true) { | 205 | if ( mail_data.getFlags().testBit( FLAG_ANSWERED ) == true) { |
203 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgreplied") ); | 206 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgreplied") ); |
204 | } else if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { | 207 | } else if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { |
205 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); | 208 | /* I think it looks nicer if there are not such a log of icons but only on mails |
209 | replied or new - Alwin*/ | ||
210 | //setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); | ||
206 | } else { | 211 | } else { |
207 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgnew") ); | 212 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgnew") ); |
208 | } | 213 | } |
214 | double s = mail_data.Msgsize(); | ||
215 | int w; | ||
216 | w=0; | ||
217 | |||
218 | while (s>1024) { | ||
219 | s/=1024; | ||
220 | ++w; | ||
221 | if (w>=2) break; | ||
222 | } | ||
223 | |||
224 | QString q=""; | ||
225 | QString fsize=""; | ||
226 | switch(w) { | ||
227 | case 1: | ||
228 | q="k"; | ||
229 | break; | ||
230 | case 2: | ||
231 | q="M"; | ||
232 | break; | ||
233 | default: | ||
234 | break; | ||
235 | } | ||
236 | |||
237 | { | ||
238 | QTextOStream o(&fsize); | ||
239 | if (w>0) o.precision(2); else o.precision(0); | ||
240 | o.setf(QTextStream::fixed); | ||
241 | o << s << " " << q << "Byte"; | ||
242 | } | ||
243 | |||
209 | setText(1,mail_data.getSubject()); | 244 | setText(1,mail_data.getSubject()); |
210 | setText(2,mail_data.getFrom()); | 245 | setText(2,mail_data.getFrom()); |
211 | setText(3,mail_data.getDate()); | 246 | setText(3,fsize); |
247 | setText(4,mail_data.getDate()); | ||
212 | } | 248 | } |
213 | 249 | ||
214 | void MailListViewItem::storeData(const RecMail&data) | 250 | void MailListViewItem::storeData(const RecMail&data) |