author | zautrix <zautrix> | 2005-08-22 20:51:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-22 20:51:25 (UTC) |
commit | cfda06568cbd0e67ba0188f00622b348b57b27c0 (patch) (unidiff) | |
tree | 925a3d4553eae2946cb8c588abae872b78d494f2 /kmicromail | |
parent | cb425b4c2d027d49f964368e94a52d3ba5e6aa31 (diff) | |
download | kdepimpi-cfda06568cbd0e67ba0188f00622b348b57b27c0.zip kdepimpi-cfda06568cbd0e67ba0188f00622b348b57b27c0.tar.gz kdepimpi-cfda06568cbd0e67ba0188f00622b348b57b27c0.tar.bz2 |
fixxx
-rw-r--r-- | kmicromail/composemail.cpp | 5 | ||||
-rw-r--r-- | kmicromail/mailistviewitem.cpp | 3 | ||||
-rw-r--r-- | kmicromail/mailistviewitem.h | 4 | ||||
-rw-r--r-- | kmicromail/mainwindow.cpp | 16 | ||||
-rw-r--r-- | kmicromail/mainwindow.h | 4 |
5 files changed, 19 insertions, 13 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 7b609fc..4bc4441 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp | |||
@@ -24,64 +24,65 @@ | |||
24 | 24 | ||
25 | #include <libmailwrapper/smtpwrapper.h> | 25 | #include <libmailwrapper/smtpwrapper.h> |
26 | #include <libmailwrapper/storemail.h> | 26 | #include <libmailwrapper/storemail.h> |
27 | #include <libmailwrapper/abstractmail.h> | 27 | #include <libmailwrapper/abstractmail.h> |
28 | #include <libmailwrapper/mailtypes.h> | 28 | #include <libmailwrapper/mailtypes.h> |
29 | 29 | ||
30 | /* OPIE */ | 30 | /* OPIE */ |
31 | //#include <opie2/ofiledialog.h> | 31 | //#include <opie2/ofiledialog.h> |
32 | //#include <opie2/odebug.h> | 32 | //#include <opie2/odebug.h> |
33 | #include <kfiledialog.h> | 33 | #include <kfiledialog.h> |
34 | //#include <qpe/resource.h> | 34 | //#include <qpe/resource.h> |
35 | #include <qpe/global.h> | 35 | #include <qpe/global.h> |
36 | //#include <qpe/contact.h> | 36 | //#include <qpe/contact.h> |
37 | 37 | ||
38 | 38 | ||
39 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
40 | #include <qcheckbox.h> | 40 | #include <qcheckbox.h> |
41 | #include <qiconset.h> | 41 | #include <qiconset.h> |
42 | #include <qtimer.h> | 42 | #include <qtimer.h> |
43 | #include <qmessagebox.h> | 43 | #include <qmessagebox.h> |
44 | #include <qpushbutton.h> | 44 | #include <qpushbutton.h> |
45 | #include <qmultilineedit.h> | 45 | #include <qmultilineedit.h> |
46 | #include <qlabel.h> | 46 | #include <qlabel.h> |
47 | #include <qtabwidget.h> | 47 | #include <qtabwidget.h> |
48 | #include <qlistview.h> | 48 | #include <qlistview.h> |
49 | 49 | ||
50 | //using namespace Opie::Core; | 50 | //using namespace Opie::Core; |
51 | //using namespace Opie::Ui; | 51 | //using namespace Opie::Ui; |
52 | ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal ) | 52 | ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal ) |
53 | : ComposeMailUI( parent, name, modal ) | 53 | : ComposeMailUI( parent, name, modal ) |
54 | { | 54 | { |
55 | 55 | ||
56 | topLevelWidget()->setCaption( i18n("Compose mail - Click OK to send ->") ); | ||
56 | mPickLineEdit = 0; | 57 | mPickLineEdit = 0; |
57 | mEncoding = KOPrefs::instance()->mCurrentCodeName; | 58 | mEncoding = KOPrefs::instance()->mCurrentCodeName; |
58 | //managed from opiemail now | 59 | //managed from opiemail now |
59 | //connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | 60 | //connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), |
60 | // this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 61 | // this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); |
61 | settings = sett; | 62 | settings = sett; |
62 | m_replyid = ""; | 63 | m_replyid = ""; |
63 | if ( KOPrefs::instance()->mUseKapi) { | 64 | if ( KOPrefs::instance()->mUseKapi) { |
64 | KConfig config( locateLocal("config", "kabcrc") ); | 65 | KConfig config( locateLocal("config", "kabcrc") ); |
65 | config.setGroup( "General" ); | 66 | config.setGroup( "General" ); |
66 | QString whoami_uid = config.readEntry( "WhoAmI" ); | 67 | QString whoami_uid = config.readEntry( "WhoAmI" ); |
67 | 68 | ||
68 | if ( whoami_uid.isEmpty() ) { | 69 | if ( whoami_uid.isEmpty() ) { |
69 | QMessageBox::information( 0, i18n( "Hint" ), | 70 | QMessageBox::information( 0, i18n( "Hint" ), |
70 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 71 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
71 | i18n( "Ok" ) ); | 72 | i18n( "Ok" ) ); |
72 | 73 | ||
73 | 74 | ||
74 | fillSettings(); | 75 | fillSettings(); |
75 | } else | 76 | } else |
76 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); | 77 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); |
77 | 78 | ||
78 | 79 | ||
79 | #ifdef DESKTOP_VERSION | 80 | #ifdef DESKTOP_VERSION |
80 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); | 81 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); |
81 | QStringList mails = con.emails(); | 82 | QStringList mails = con.emails(); |
82 | QString defmail = con.preferredEmail(); | 83 | QString defmail = con.preferredEmail(); |
83 | if ( mails.count() == 0) | 84 | if ( mails.count() == 0) |
84 | QMessageBox::information( 0, i18n( "Hint" ), | 85 | QMessageBox::information( 0, i18n( "Hint" ), |
85 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 86 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
86 | i18n( "Ok" ) ); | 87 | i18n( "Ok" ) ); |
87 | if (defmail.length()!=0) { | 88 | if (defmail.length()!=0) { |
@@ -194,65 +195,65 @@ void ComposeMail::saveAsDraft() | |||
194 | mail->setCC( ccLine->text() ); | 195 | mail->setCC( ccLine->text() ); |
195 | mail->setBCC( bccLine->text() ); | 196 | mail->setBCC( bccLine->text() ); |
196 | mail->setReply( replyLine->text() ); | 197 | mail->setReply( replyLine->text() ); |
197 | mail->setSubject( subjectLine->text() ); | 198 | mail->setSubject( subjectLine->text() ); |
198 | if (!m_replyid.isEmpty()) { | 199 | if (!m_replyid.isEmpty()) { |
199 | QStringList ids; | 200 | QStringList ids; |
200 | ids.append(m_replyid); | 201 | ids.append(m_replyid); |
201 | mail->setInreply(ids); | 202 | mail->setInreply(ids); |
202 | } | 203 | } |
203 | QString txt = message->text(); | 204 | QString txt = message->text(); |
204 | if ( !sigMultiLine->text().isEmpty() ) { | 205 | if ( !sigMultiLine->text().isEmpty() ) { |
205 | txt.append( "\n--\n" ); | 206 | txt.append( "\n--\n" ); |
206 | txt.append( sigMultiLine->text() ); | 207 | txt.append( sigMultiLine->text() ); |
207 | } | 208 | } |
208 | mail->setMessage( txt ); | 209 | mail->setMessage( txt ); |
209 | mail->setCharset (mEncoding); | 210 | mail->setCharset (mEncoding); |
210 | /* only use the default drafts folder name! */ | 211 | /* only use the default drafts folder name! */ |
211 | Storemail wrapper(AbstractMail::draftFolder()); | 212 | Storemail wrapper(AbstractMail::draftFolder()); |
212 | wrapper.storeMail(mail); | 213 | wrapper.storeMail(mail); |
213 | 214 | ||
214 | AttachViewItem *it = (AttachViewItem *) attList->firstChild(); | 215 | AttachViewItem *it = (AttachViewItem *) attList->firstChild(); |
215 | /* attachments we will ignore! */ | 216 | /* attachments we will ignore! */ |
216 | if ( it != 0 ) { | 217 | if ( it != 0 ) { |
217 | if ( warnAttach ) | 218 | if ( warnAttach ) |
218 | QMessageBox::warning(0,i18n("Store message"), | 219 | QMessageBox::warning(0,i18n("Store message"), |
219 | i18n("<center>Attachments will not be stored in \"Draft\" folder</center>")); | 220 | i18n("<center>Attachments will not be stored in \"Draft\" folder</center>")); |
220 | warnAttach = false; | 221 | warnAttach = false; |
221 | } | 222 | } |
222 | setStatus( i18n("Mail saved as draft!") ); | 223 | setStatus( i18n("Mail saved as draft!") ); |
223 | } | 224 | } |
224 | void ComposeMail::clearStatus() | 225 | void ComposeMail::clearStatus() |
225 | { | 226 | { |
226 | topLevelWidget()->setCaption( i18n("Compose mail") ); | 227 | topLevelWidget()->setCaption( i18n("Compose mail - Click OK to send ->") ); |
227 | } | 228 | } |
228 | void ComposeMail::setStatus( QString status ) | 229 | void ComposeMail::setStatus( QString status ) |
229 | { | 230 | { |
230 | topLevelWidget()->setCaption( status ); | 231 | topLevelWidget()->setCaption( status ); |
231 | QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ; | 232 | QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ; |
232 | } | 233 | } |
233 | void ComposeMail::pickAddress( ) | 234 | void ComposeMail::pickAddress( ) |
234 | { | 235 | { |
235 | 236 | ||
236 | QLineEdit *line = mPickLineEdit; | 237 | QLineEdit *line = mPickLineEdit; |
237 | if ( line == 0 ) | 238 | if ( line == 0 ) |
238 | return; | 239 | return; |
239 | #ifdef DESKTOP_VERSION | 240 | #ifdef DESKTOP_VERSION |
240 | //qDebug(" ComposeMail::pickAddress "); | 241 | //qDebug(" ComposeMail::pickAddress "); |
241 | QString names ;//= AddressPicker::getNames(); | 242 | QString names ;//= AddressPicker::getNames(); |
242 | 243 | ||
243 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 244 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
244 | uint i=0; | 245 | uint i=0; |
245 | for (i=0; i < list.count(); i++) { | 246 | for (i=0; i < list.count(); i++) { |
246 | if ( !list[i].preferredEmail().isEmpty()) { | 247 | if ( !list[i].preferredEmail().isEmpty()) { |
247 | if ( ! names.isEmpty() ) | 248 | if ( ! names.isEmpty() ) |
248 | names+= ","; | 249 | names+= ","; |
249 | names+= "\""+list[i].realName() +"\"<" +list[i].preferredEmail() +">"; | 250 | names+= "\""+list[i].realName() +"\"<" +list[i].preferredEmail() +">"; |
250 | 251 | ||
251 | } | 252 | } |
252 | } | 253 | } |
253 | 254 | ||
254 | 255 | ||
255 | if ( line->text().isEmpty() ) { | 256 | if ( line->text().isEmpty() ) { |
256 | line->setText( names ); | 257 | line->setText( names ); |
257 | } else if ( !names.isEmpty() ) { | 258 | } else if ( !names.isEmpty() ) { |
258 | line->setText( line->text() + ", " + names ); | 259 | line->setText( line->text() + ", " + names ); |
@@ -395,65 +396,65 @@ void ComposeMail::slotAdjustColumns() | |||
395 | tabWidget->setCurrentPage( currPage ); | 396 | tabWidget->setCurrentPage( currPage ); |
396 | } | 397 | } |
397 | 398 | ||
398 | void ComposeMail::addAttachment() | 399 | void ComposeMail::addAttachment() |
399 | { | 400 | { |
400 | QString lnk = KFileDialog::getOpenFileName( "", "Add Attachment", this ); | 401 | QString lnk = KFileDialog::getOpenFileName( "", "Add Attachment", this ); |
401 | if ( !lnk.isEmpty() ) { | 402 | if ( !lnk.isEmpty() ) { |
402 | Attachment *att = new Attachment( lnk ); | 403 | Attachment *att = new Attachment( lnk ); |
403 | (void) new AttachViewItem( attList, att ); | 404 | (void) new AttachViewItem( attList, att ); |
404 | } | 405 | } |
405 | } | 406 | } |
406 | 407 | ||
407 | void ComposeMail::removeAttachment() | 408 | void ComposeMail::removeAttachment() |
408 | { | 409 | { |
409 | if ( !attList->currentItem() ) { | 410 | if ( !attList->currentItem() ) { |
410 | QMessageBox::information( this, i18n( "Error" ), | 411 | QMessageBox::information( this, i18n( "Error" ), |
411 | i18n( "<p>Please select a File.</p>" ), | 412 | i18n( "<p>Please select a File.</p>" ), |
412 | i18n( "Ok" ) ); | 413 | i18n( "Ok" ) ); |
413 | } else { | 414 | } else { |
414 | attList->takeItem( attList->currentItem() ); | 415 | attList->takeItem( attList->currentItem() ); |
415 | } | 416 | } |
416 | } | 417 | } |
417 | 418 | ||
418 | void ComposeMail::accept() | 419 | void ComposeMail::accept() |
419 | { | 420 | { |
420 | if ( smtpAccountBox->count() == 0 ) { | 421 | if ( smtpAccountBox->count() == 0 ) { |
421 | 422 | ||
422 | reject(); | 423 | reject(); |
423 | return; | 424 | return; |
424 | } | 425 | } |
425 | 426 | ||
426 | if (! checkBoxLater->isChecked() ) { | 427 | if (! checkBoxLater->isChecked() ) { |
427 | int yesno = QMessageBox::warning(0,i18n("Stop editing message"), | 428 | int yesno = QMessageBox::warning(0, subjectLine->text().left ( 25 ), |
428 | i18n("Send this message?"), | 429 | i18n("Send this message?"), |
429 | i18n("Yes"), | 430 | i18n("Yes"), |
430 | i18n("Cancel")); | 431 | i18n("Cancel")); |
431 | 432 | ||
432 | if (yesno == 1) { | 433 | if (yesno == 1) { |
433 | return; | 434 | return; |
434 | } | 435 | } |
435 | } | 436 | } |
436 | #if 0 | 437 | #if 0 |
437 | odebug << "Sending Mail with " | 438 | odebug << "Sending Mail with " |
438 | << smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() << oendl; | 439 | << smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() << oendl; |
439 | #endif | 440 | #endif |
440 | Opie::Core::OSmartPointer<Mail> mail=new Mail; | 441 | Opie::Core::OSmartPointer<Mail> mail=new Mail; |
441 | 442 | ||
442 | SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); | 443 | SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); |
443 | mail->setMail(fromBox->currentText()); | 444 | mail->setMail(fromBox->currentText()); |
444 | 445 | ||
445 | if ( !toLine->text().isEmpty() ) { | 446 | if ( !toLine->text().isEmpty() ) { |
446 | mail->setTo( toLine->text() ); | 447 | mail->setTo( toLine->text() ); |
447 | } else { | 448 | } else { |
448 | QMessageBox::warning(0,i18n("Sending mail"), | 449 | QMessageBox::warning(0,i18n("Sending mail"), |
449 | i18n("No Receiver spezified" ) ); | 450 | i18n("No Receiver spezified" ) ); |
450 | return; | 451 | return; |
451 | } | 452 | } |
452 | 453 | ||
453 | mail->setName(senderNameEdit->text()); | 454 | mail->setName(senderNameEdit->text()); |
454 | mail->setCC( ccLine->text() ); | 455 | mail->setCC( ccLine->text() ); |
455 | mail->setBCC( bccLine->text() ); | 456 | mail->setBCC( bccLine->text() ); |
456 | mail->setReply( replyLine->text() ); | 457 | mail->setReply( replyLine->text() ); |
457 | mail->setSubject( subjectLine->text() ); | 458 | mail->setSubject( subjectLine->text() ); |
458 | if (!m_replyid.isEmpty()) { | 459 | if (!m_replyid.isEmpty()) { |
459 | QStringList ids; | 460 | QStringList ids; |
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp index 5119744..15fa148 100644 --- a/kmicromail/mailistviewitem.cpp +++ b/kmicromail/mailistviewitem.cpp | |||
@@ -1,77 +1,78 @@ | |||
1 | // CHANGED 2004-08-06 Lutz Rogowski | 1 | // CHANGED 2004-08-06 Lutz Rogowski |
2 | #include "mailistviewitem.h" | 2 | #include "mailistviewitem.h" |
3 | #include <libmailwrapper/abstractmail.h> | 3 | #include <libmailwrapper/abstractmail.h> |
4 | #include <qtextstream.h> | 4 | #include <qtextstream.h> |
5 | #include <kiconloader.h> | 5 | #include <kiconloader.h> |
6 | #include "koprefs.h" | 6 | #include "koprefs.h" |
7 | //#include <qpe/resource.h> | 7 | //#include <qpe/resource.h> |
8 | 8 | ||
9 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) | 9 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) |
10 | :QListViewItem(parent,item),mail_data() | 10 | :KListViewItem(parent,item),mail_data() |
11 | { | 11 | { |
12 | } | 12 | } |
13 | 13 | ||
14 | void MailListViewItem::showEntry() | 14 | void MailListViewItem::showEntry() |
15 | { | 15 | { |
16 | if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { | 16 | if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { |
17 | setPixmap( 0, SmallIcon ( "kmmsgreplied") ); | 17 | setPixmap( 0, SmallIcon ( "kmmsgreplied") ); |
18 | mKeyMap.insert(0, "r" ); | 18 | mKeyMap.insert(0, "r" ); |
19 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { | 19 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { |
20 | /* I think it looks nicer if there are not such a log of icons but only on mails | 20 | /* I think it looks nicer if there are not such a log of icons but only on mails |
21 | replied or new - Alwin*/ | 21 | replied or new - Alwin*/ |
22 | //setPixmap( 0,SmallIcon ("kmmsgunseen") ); | 22 | //setPixmap( 0,SmallIcon ("kmmsgunseen") ); |
23 | mKeyMap.insert(0, "s" ); | 23 | mKeyMap.insert(0, "s" ); |
24 | } else { | 24 | } else { |
25 | setPixmap( 0,SmallIcon ( "kmmsgnew") ); | 25 | setPixmap( 0,SmallIcon ( "kmmsgnew") ); |
26 | mKeyMap.insert(0, "u" ); | 26 | mKeyMap.insert(0, "u" ); |
27 | } | 27 | } |
28 | QString fsize = mail_data->MsgsizeString(); | 28 | QString fsize = mail_data->MsgsizeString(); |
29 | // 1.23 | 29 | // 1.23 |
30 | // 11.23 | 30 | // 11.23 |
31 | // 111.23 | 31 | // 111.23 |
32 | // 999.23 maxlen | 32 | // 999.23 maxlen |
33 | QString fsort; | 33 | QString fsort; |
34 | switch(fsize.length() ) { | 34 | switch(fsize.length() ) { |
35 | case 6: | 35 | case 6: |
36 | fsort = "00" + fsize ; | 36 | fsort = "00" + fsize ; |
37 | break; | 37 | break; |
38 | case 7: | 38 | case 7: |
39 | fsort = "0" + fsize ; | 39 | fsort = "0" + fsize ; |
40 | break; | 40 | break; |
41 | default: | 41 | default: |
42 | fsort = fsize ; | 42 | fsort = fsize ; |
43 | break; | 43 | break; |
44 | 44 | ||
45 | } | 45 | } |
46 | |||
46 | setText(3, fsize ); | 47 | setText(3, fsize ); |
47 | //qDebug("fsize *%s* ",fsize.latin1() ); | 48 | //qDebug("fsize *%s* ",fsize.latin1() ); |
48 | //qDebug("fsort *%s* ",fsort.latin1() ); | 49 | //qDebug("fsort *%s* ",fsort.latin1() ); |
49 | if ( fsize.right(2) == "kB" ) { | 50 | if ( fsize.right(2) == "kB" ) { |
50 | mKeyMap.insert(3, "k" + fsort); | 51 | mKeyMap.insert(3, "k" + fsort); |
51 | } else { | 52 | } else { |
52 | mKeyMap.insert(3, "M" +fsort ); | 53 | mKeyMap.insert(3, "M" +fsort ); |
53 | } | 54 | } |
54 | setText(1,mail_data->getSubject()); | 55 | setText(1,mail_data->getSubject()); |
55 | setText(2,mail_data->getFrom()); | 56 | setText(2,mail_data->getFrom()); |
56 | mKeyMap.insert(4,mail_data->getIsoDate()); | 57 | mKeyMap.insert(4,mail_data->getIsoDate()); |
57 | setText(4,mail_data->getDate()); | 58 | setText(4,mail_data->getDate()); |
58 | if ( KOPrefs::instance()->mShowToField ) | 59 | if ( KOPrefs::instance()->mShowToField ) |
59 | setText(5,mail_data->To()[0]); | 60 | setText(5,mail_data->To()[0]); |
60 | } | 61 | } |
61 | 62 | ||
62 | void MailListViewItem::storeData(const RecMailP&data) | 63 | void MailListViewItem::storeData(const RecMailP&data) |
63 | { | 64 | { |
64 | mail_data = data; | 65 | mail_data = data; |
65 | } | 66 | } |
66 | void MailListViewItem::setSortKey(int column,const QString &key) | 67 | void MailListViewItem::setSortKey(int column,const QString &key) |
67 | { | 68 | { |
68 | mKeyMap.insert(column,key); | 69 | mKeyMap.insert(column,key); |
69 | } | 70 | } |
70 | QString MailListViewItem::key(int column, bool) const | 71 | QString MailListViewItem::key(int column, bool) const |
71 | { | 72 | { |
72 | // to make is fast, we use here special cases | 73 | // to make is fast, we use here special cases |
73 | if ( column == 3 || column == 4 || column == 0) { | 74 | if ( column == 3 || column == 4 || column == 0) { |
74 | return *mKeyMap.find(column); | 75 | return *mKeyMap.find(column); |
75 | } | 76 | } |
76 | if ( column == 1 ) { | 77 | if ( column == 1 ) { |
77 | if ( text(1).left(4).lower() == "re: " ) | 78 | if ( text(1).left(4).lower() == "re: " ) |
diff --git a/kmicromail/mailistviewitem.h b/kmicromail/mailistviewitem.h index 0fd44d3..b409c9d 100644 --- a/kmicromail/mailistviewitem.h +++ b/kmicromail/mailistviewitem.h | |||
@@ -1,27 +1,27 @@ | |||
1 | // CHANGED 2004-08-06 Lutz Rogowski | 1 | // CHANGED 2004-08-06 Lutz Rogowski |
2 | #ifndef __MAILLISTVIEWITEM_H | 2 | #ifndef __MAILLISTVIEWITEM_H |
3 | #define __MAILLISTVIEWITEM_H | 3 | #define __MAILLISTVIEWITEM_H |
4 | 4 | ||
5 | #include <qlistview.h> | 5 | #include <klistview.h> |
6 | #include <libmailwrapper/mailtypes.h> | 6 | #include <libmailwrapper/mailtypes.h> |
7 | #include <libmailwrapper/maildefines.h> | 7 | #include <libmailwrapper/maildefines.h> |
8 | 8 | ||
9 | class MailListViewItem:public QListViewItem | 9 | class MailListViewItem:public KListViewItem |
10 | { | 10 | { |
11 | public: | 11 | public: |
12 | MailListViewItem(QListView * parent, MailListViewItem * after ); | 12 | MailListViewItem(QListView * parent, MailListViewItem * after ); |
13 | virtual ~MailListViewItem(){} | 13 | virtual ~MailListViewItem(){} |
14 | 14 | ||
15 | void storeData(const RecMailP&data); | 15 | void storeData(const RecMailP&data); |
16 | const RecMailP&data()const; | 16 | const RecMailP&data()const; |
17 | void showEntry(); | 17 | void showEntry(); |
18 | MAILLIB::ATYPE wrapperType(); | 18 | MAILLIB::ATYPE wrapperType(); |
19 | QString key(int column, bool) const; | 19 | QString key(int column, bool) const; |
20 | void setSortKey(int column,const QString &key); | 20 | void setSortKey(int column,const QString &key); |
21 | protected: | 21 | protected: |
22 | RecMailP mail_data; | 22 | RecMailP mail_data; |
23 | private: | 23 | private: |
24 | QMap<int,QString> mKeyMap; | 24 | QMap<int,QString> mKeyMap; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | #endif | 27 | #endif |
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index e3c5ec3..82a915e 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -1,57 +1,58 @@ | |||
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 | #include <qstatusbar.h> | 14 | #include <qstatusbar.h> |
15 | #include <kabc/stdaddressbook.h> | 15 | #include <kabc/stdaddressbook.h> |
16 | extern QStatusBar* globalSstatusBarMainWindow; | 16 | extern QStatusBar* globalSstatusBarMainWindow; |
17 | #else | 17 | #else |
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(); |
34 | #endif | 35 | #endif |
35 | setCaption( i18n( "KOpieMail/Pi" ) ); | 36 | setCaption( i18n( "KOpieMail/Pi" ) ); |
36 | setToolBarsMovable( false ); | 37 | setToolBarsMovable( false ); |
37 | //KABC::StdAddressBook::self(); | 38 | //KABC::StdAddressBook::self(); |
38 | toolBar = new QToolBar( this ); | 39 | toolBar = new QToolBar( this ); |
39 | menuBar = new QPEMenuBar( toolBar ); | 40 | menuBar = new QPEMenuBar( toolBar ); |
40 | mailMenu = new QPopupMenu( menuBar ); | 41 | mailMenu = new QPopupMenu( menuBar ); |
41 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); | 42 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); |
42 | settingsMenu = new QPopupMenu( menuBar ); | 43 | settingsMenu = new QPopupMenu( menuBar ); |
43 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); | 44 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); |
44 | 45 | ||
45 | addToolBar( toolBar ); | 46 | addToolBar( toolBar ); |
46 | toolBar->setHorizontalStretchable( true ); | 47 | toolBar->setHorizontalStretchable( true ); |
47 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), | 48 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), |
48 | 0, 0, this ); | 49 | 0, 0, this ); |
49 | connect(getMail, SIGNAL( activated() ), | 50 | connect(getMail, SIGNAL( activated() ), |
50 | SLOT( slotGetAllMail() ) ); | 51 | SLOT( slotGetAllMail() ) ); |
51 | getMail->addTo( mailMenu ); | 52 | getMail->addTo( mailMenu ); |
52 | 53 | ||
53 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), | 54 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), |
54 | 0, 0, this ); | 55 | 0, 0, this ); |
55 | getMail->addTo( toolBar ); | 56 | getMail->addTo( toolBar ); |
56 | getMail->addTo( mailMenu ); | 57 | getMail->addTo( mailMenu ); |
57 | connect(getMail, SIGNAL( activated() ), | 58 | connect(getMail, SIGNAL( activated() ), |
@@ -136,119 +137,121 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
136 | subLE = 0; | 137 | subLE = 0; |
137 | fromLE = 0; | 138 | fromLE = 0; |
138 | toLE = 0; | 139 | toLE = 0; |
139 | if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { | 140 | if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { |
140 | QWidget* infoBox = new QWidget( splithor ); | 141 | QWidget* infoBox = new QWidget( splithor ); |
141 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); | 142 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); |
142 | if ( KOPrefs::instance()->mShowInfoSub ) { | 143 | if ( KOPrefs::instance()->mShowInfoSub ) { |
143 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); | 144 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); |
144 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; | 145 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; |
145 | } | 146 | } |
146 | if ( KOPrefs::instance()->mShowInfoFrom ) { | 147 | if ( KOPrefs::instance()->mShowInfoFrom ) { |
147 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); | 148 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); |
148 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; | 149 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; |
149 | } | 150 | } |
150 | if ( KOPrefs::instance()->mShowInfoTo ) { | 151 | if ( KOPrefs::instance()->mShowInfoTo ) { |
151 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); | 152 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); |
152 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; | 153 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; |
153 | } | 154 | } |
154 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); | 155 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); |
155 | if ( !KOPrefs::instance()->mShowInfoStart ) { | 156 | if ( !KOPrefs::instance()->mShowInfoStart ) { |
156 | QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); | 157 | QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); |
157 | } | 158 | } |
158 | } | 159 | } |
159 | 160 | ||
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); |
190 | if ( subLE ) | 193 | if ( subLE ) |
191 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); | 194 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); |
192 | if ( fromLE ) | 195 | if ( fromLE ) |
193 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); | 196 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); |
194 | if ( toLE ) | 197 | if ( toLE ) |
195 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); | 198 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); |
196 | #endif | 199 | #endif |
197 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, | 200 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, |
198 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 201 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
199 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, | 202 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, |
200 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 203 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
201 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 204 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
202 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 205 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
203 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 206 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
204 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 207 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
205 | 208 | ||
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 ) |
231 | closeMail->addTo(toolBar); | 234 | closeMail->addTo(toolBar); |
232 | closeMail->addTo(mailMenu); | 235 | closeMail->addTo(mailMenu); |
233 | 236 | ||
234 | 237 | ||
235 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); | 238 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); |
236 | menuBar->insertItem( i18n( "Help" ), helpMenu ); | 239 | menuBar->insertItem( i18n( "Help" ), helpMenu ); |
237 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); | 240 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); |
238 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); | 241 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); |
239 | li->addTo(helpMenu); | 242 | li->addTo(helpMenu); |
240 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); | 243 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); |
241 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); | 244 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); |
242 | li->addTo(helpMenu); | 245 | li->addTo(helpMenu); |
243 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); | 246 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); |
244 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); | 247 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); |
245 | li->addTo(helpMenu); | 248 | li->addTo(helpMenu); |
246 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); | 249 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); |
247 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | 250 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); |
248 | menuBar->setMaximumWidth( menuBar->sizeHint().width()); | 251 | menuBar->setMaximumWidth( menuBar->sizeHint().width()); |
249 | //menuBar->setMaximumSize( menuBar->sizeHint()); | 252 | //menuBar->setMaximumSize( menuBar->sizeHint()); |
250 | #ifdef DESKTOP_VERSION | 253 | #ifdef DESKTOP_VERSION |
251 | resize ( 640, 480 ); | 254 | resize ( 640, 480 ); |
252 | #endif | 255 | #endif |
253 | } | 256 | } |
254 | 257 | ||
@@ -341,68 +344,69 @@ void MainWindow::showEtpanLicence() | |||
341 | { | 344 | { |
342 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); | 345 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); |
343 | 346 | ||
344 | } | 347 | } |
345 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 348 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
346 | { | 349 | { |
347 | qDebug("appMessage implemented by subclass"); | 350 | qDebug("appMessage implemented by subclass"); |
348 | } | 351 | } |
349 | 352 | ||
350 | void MainWindow::slotAdjustLayout() { | 353 | void MainWindow::slotAdjustLayout() { |
351 | 354 | ||
352 | /* | 355 | /* |
353 | QWidget *d = QApplication::desktop(); | 356 | QWidget *d = QApplication::desktop(); |
354 | 357 | ||
355 | if ( d->width() < d->height() ) { | 358 | if ( d->width() < d->height() ) { |
356 | layout->setDirection( QBoxLayout::TopToBottom ); | 359 | layout->setDirection( QBoxLayout::TopToBottom ); |
357 | } else { | 360 | } else { |
358 | layout->setDirection( QBoxLayout::LeftToRight ); | 361 | layout->setDirection( QBoxLayout::LeftToRight ); |
359 | } | 362 | } |
360 | */ | 363 | */ |
361 | } | 364 | } |
362 | 365 | ||
363 | void MainWindow::slotAdjustColumns() | 366 | void MainWindow::slotAdjustColumns() |
364 | { | 367 | { |
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 | } |
385 | 389 | ||
386 | void MainWindow::slotShowFolders( bool ) | 390 | void MainWindow::slotShowFolders( bool ) |
387 | { | 391 | { |
388 | qDebug("not implemented: "); | 392 | qDebug("not implemented: "); |
389 | } | 393 | } |
390 | 394 | ||
391 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 395 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
392 | { | 396 | { |
393 | qDebug("not implemented: "); | 397 | qDebug("not implemented: "); |
394 | } | 398 | } |
395 | 399 | ||
396 | void MainWindow::mailLeftClicked(QListViewItem * ) | 400 | void MainWindow::mailLeftClicked(QListViewItem * ) |
397 | { | 401 | { |
398 | qDebug("not implemented: "); | 402 | qDebug("not implemented: "); |
399 | } | 403 | } |
400 | 404 | ||
401 | void MainWindow::displayMail() | 405 | void MainWindow::displayMail() |
402 | { | 406 | { |
403 | qDebug("not implemented: "); | 407 | qDebug("not implemented: "); |
404 | } | 408 | } |
405 | 409 | ||
406 | void MainWindow::slotDeleteMail() | 410 | void MainWindow::slotDeleteMail() |
407 | { | 411 | { |
408 | qDebug("not implemented: "); | 412 | qDebug("not implemented: "); |
diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h index 6894039..178d2bb 100644 --- a/kmicromail/mainwindow.h +++ b/kmicromail/mainwindow.h | |||
@@ -1,74 +1,74 @@ | |||
1 | 1 | ||
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | #ifndef MAINWINDOW_H | 3 | #ifndef MAINWINDOW_H |
4 | #define MAINWINDOW_H | 4 | #define MAINWINDOW_H |
5 | 5 | ||
6 | #include <qmainwindow.h> | 6 | #include <qmainwindow.h> |
7 | #include <qlistview.h> | 7 | #include <klistview.h> |
8 | #include <qaction.h> | 8 | #include <qaction.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | 10 | ||
11 | #include <qtoolbar.h> | 11 | #include <qtoolbar.h> |
12 | #ifdef DESKTOP_VERSION | 12 | #ifdef DESKTOP_VERSION |
13 | #include <qmenubar.h> | 13 | #include <qmenubar.h> |
14 | #define QPEMenuBar QMenuBar | 14 | #define QPEMenuBar QMenuBar |
15 | #else | 15 | #else |
16 | #include <qpe/qpemenubar.h> | 16 | #include <qpe/qpemenubar.h> |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | #include "accountview.h" | 19 | #include "accountview.h" |
20 | #include "statuswidget.h" | 20 | #include "statuswidget.h" |
21 | 21 | ||
22 | #include <libmailwrapper/mailtypes.h> | 22 | #include <libmailwrapper/mailtypes.h> |
23 | #include <opie2/osmartpointer.h> | 23 | #include <opie2/osmartpointer.h> |
24 | 24 | ||
25 | class RecMail; | 25 | class RecMail; |
26 | 26 | ||
27 | class MainWindow : public QMainWindow | 27 | class MainWindow : public QMainWindow |
28 | { | 28 | { |
29 | Q_OBJECT | 29 | Q_OBJECT |
30 | 30 | ||
31 | public: | 31 | public: |
32 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 32 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
33 | virtual ~MainWindow(); | 33 | virtual ~MainWindow(); |
34 | 34 | ||
35 | public slots: | 35 | public slots: |
36 | virtual void slotAdjustColumns(); | 36 | virtual void slotAdjustColumns(); |
37 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 37 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
38 | virtual void slotComposeMail(); | 38 | virtual void slotComposeMail(); |
39 | 39 | ||
40 | protected slots: | 40 | protected slots: |
41 | virtual void setInfoFields(QListViewItem* ); | 41 | virtual void setInfoFields(QListViewItem* ); |
42 | virtual void slotSendQueued(); | 42 | virtual void slotSendQueued(); |
43 | virtual void slotEditAccounts(); | 43 | virtual void slotEditAccounts(); |
44 | virtual void slotShowFolders( bool show ); | 44 | virtual void slotShowFolders( bool show ); |
45 | virtual void refreshMailView(const QValueList<RecMailP>&); | 45 | virtual void refreshMailView(const QValueList<RecMailP>&); |
46 | virtual void displayMail(); | 46 | virtual void displayMail(); |
47 | virtual void slotGetMail() = 0; | 47 | virtual void slotGetMail() = 0; |
48 | virtual void slotGetAllMail() = 0; | 48 | virtual void slotGetAllMail() = 0; |
49 | virtual void slotDeleteMail(); | 49 | virtual void slotDeleteMail(); |
50 | virtual void slotDeleteAllMail() = 0; | 50 | virtual void slotDeleteAllMail() = 0; |
51 | virtual void slotSetCodec(int); | 51 | virtual void slotSetCodec(int); |
52 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 52 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
53 | virtual void slotAdjustLayout(); | 53 | virtual void slotAdjustLayout(); |
54 | virtual void slotEditSettings(); | 54 | virtual void slotEditSettings(); |
55 | virtual void slotEditGlobalSettings(); | 55 | virtual void slotEditGlobalSettings(); |
56 | virtual void mailLeftClicked( QListViewItem * ); | 56 | virtual void mailLeftClicked( QListViewItem * ); |
57 | void showLicence(); | 57 | void showLicence(); |
58 | void showAbout(); | 58 | void showAbout(); |
59 | void showEtpanLicence(); | 59 | void showEtpanLicence(); |
60 | 60 | ||
61 | protected: | 61 | protected: |
62 | QToolBar *toolBar; | 62 | QToolBar *toolBar; |
63 | StatusWidget *statusWidget; | 63 | StatusWidget *statusWidget; |
64 | QPEMenuBar *menuBar; | 64 | QPEMenuBar *menuBar; |
65 | QPopupMenu *mailMenu, *settingsMenu, *codecMenu; | 65 | QPopupMenu *mailMenu, *settingsMenu, *codecMenu; |
66 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, | 66 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, |
67 | *editSettings, *editAccounts, *syncFolders; | 67 | *editSettings, *editAccounts, *syncFolders; |
68 | AccountView *folderView; | 68 | AccountView *folderView; |
69 | QListView *mailView; | 69 | KListView *mailView; |
70 | QLineEdit* toLE,*fromLE,*subLE; | 70 | QLineEdit* toLE,*fromLE,*subLE; |
71 | //QBoxLayout *layout; | 71 | //QBoxLayout *layout; |
72 | }; | 72 | }; |
73 | 73 | ||
74 | #endif | 74 | #endif |