author | zautrix <zautrix> | 2004-10-23 19:32:41 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-23 19:32:41 (UTC) |
commit | 94df6192e59b7d4c69e2fb43ef2c39db08bb1c39 (patch) (unidiff) | |
tree | 28956adbf73a61010d98deb27d83b324cb285471 /kmicromail/composemail.cpp | |
parent | 52b6fc17c0dcd1f13f701f698e0305440f26fc3e (diff) | |
download | kdepimpi-94df6192e59b7d4c69e2fb43ef2c39db08bb1c39.zip kdepimpi-94df6192e59b7d4c69e2fb43ef2c39db08bb1c39.tar.gz kdepimpi-94df6192e59b7d4c69e2fb43ef2c39db08bb1c39.tar.bz2 |
compile fixes
-rw-r--r-- | kmicromail/composemail.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 946e97d..35ad367 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp | |||
@@ -47,34 +47,34 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
47 | settings = s; | 47 | settings = s; |
48 | m_replyid = ""; | 48 | m_replyid = ""; |
49 | if ( KOPrefs::instance()->mUseKapi) { | 49 | if ( KOPrefs::instance()->mUseKapi) { |
50 | KConfig config( locateLocal("config", "kabcrc") ); | 50 | KConfig config( locateLocal("config", "kabcrc") ); |
51 | config.setGroup( "General" ); | 51 | config.setGroup( "General" ); |
52 | QString whoami_uid = config.readEntry( "WhoAmI" ); | 52 | QString whoami_uid = config.readEntry( "WhoAmI" ); |
53 | 53 | ||
54 | if ( whoami_uid.isEmpty() ) { | 54 | if ( whoami_uid.isEmpty() ) { |
55 | QMessageBox::information( 0, tr( "Hint" ), | 55 | QMessageBox::information( 0, i18n( "Hint" ), |
56 | tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 56 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
57 | tr( "Ok" ) ); | 57 | i18n( "Ok" ) ); |
58 | 58 | ||
59 | 59 | ||
60 | fillSettings(); | 60 | fillSettings(); |
61 | } else | 61 | } else |
62 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); | 62 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); |
63 | 63 | ||
64 | 64 | ||
65 | #ifdef DESKTOP_VERSION | 65 | #ifdef DESKTOP_VERSION |
66 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); | 66 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); |
67 | QStringList mails = con.emails(); | 67 | QStringList mails = con.emails(); |
68 | QString defmail = con.preferredEmail(); | 68 | QString defmail = con.preferredEmail(); |
69 | if ( mails.count() == 0) | 69 | if ( mails.count() == 0) |
70 | QMessageBox::information( 0, tr( "Hint" ), | 70 | QMessageBox::information( 0, i18n( "Hint" ), |
71 | tr( "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" ), |
72 | tr( "Ok" ) ); | 72 | i18n( "Ok" ) ); |
73 | if (defmail.length()!=0) { | 73 | if (defmail.length()!=0) { |
74 | fromBox->insertItem(defmail); | 74 | fromBox->insertItem(defmail); |
75 | } | 75 | } |
76 | QStringList::ConstIterator sit = mails.begin(); | 76 | QStringList::ConstIterator sit = mails.begin(); |
77 | for (;sit!=mails.end();++sit) { | 77 | for (;sit!=mails.end();++sit) { |
78 | if ( (*sit)==defmail) | 78 | if ( (*sit)==defmail) |
79 | continue; | 79 | continue; |
80 | fromBox->insertItem((*sit)); | 80 | fromBox->insertItem((*sit)); |
@@ -82,18 +82,18 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
82 | senderNameEdit->setText(con.formattedName()); | 82 | senderNameEdit->setText(con.formattedName()); |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | } else { | 85 | } else { |
86 | fillSettings(); | 86 | fillSettings(); |
87 | } | 87 | } |
88 | checkBoxLater->setChecked( KOPrefs::instance()->mSendLater ); | 88 | checkBoxLater->setChecked( KOPrefs::instance()->mSendLater ); |
89 | 89 | ||
90 | attList->addColumn( tr( "Name" ) ); | 90 | attList->addColumn( i18n( "Name" ) ); |
91 | attList->addColumn( tr( "Size" ) ); | 91 | attList->addColumn( i18n( "Size" ) ); |
92 | QList<Account> accounts = settings->getAccounts(); | 92 | QList<Account> accounts = settings->getAccounts(); |
93 | 93 | ||
94 | if ( QApplication::desktop()->width() < 320 ) | 94 | if ( QApplication::desktop()->width() < 320 ) |
95 | smtpAccountBox->setMaximumWidth( 80 ); | 95 | smtpAccountBox->setMaximumWidth( 80 ); |
96 | Account *it; | 96 | Account *it; |
97 | for ( it = accounts.first(); it; it = accounts.next() ) { | 97 | for ( it = accounts.first(); it; it = accounts.next() ) { |
98 | if ( it->getType()==MAILLIB::A_SMTP ) { | 98 | if ( it->getType()==MAILLIB::A_SMTP ) { |
99 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); | 99 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); |
@@ -108,19 +108,19 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
108 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); | 108 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); |
109 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); | 109 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); |
110 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); | 110 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); |
111 | mMail = 0; | 111 | mMail = 0; |
112 | warnAttach = true; | 112 | warnAttach = true; |
113 | if ( smtpAccounts.count() > 0 ) { | 113 | if ( smtpAccounts.count() > 0 ) { |
114 | fillValues( smtpAccountBox->currentItem() ); | 114 | fillValues( smtpAccountBox->currentItem() ); |
115 | } else { | 115 | } else { |
116 | QMessageBox::information( 0, tr( "Problem" ), | 116 | QMessageBox::information( 0, i18n( "Problem" ), |
117 | tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ), | 117 | i18n( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ), |
118 | tr( "Ok" ) ); | 118 | i18n( "Ok" ) ); |
119 | return; | 119 | return; |
120 | } | 120 | } |
121 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); | 121 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); |
122 | message->setFont ( KOPrefs::instance()->mComposeFont ); | 122 | message->setFont ( KOPrefs::instance()->mComposeFont ); |
123 | message->setWordWrap (QMultiLineEdit::WidgetWidth); | 123 | message->setWordWrap (QMultiLineEdit::WidgetWidth); |
124 | #ifndef DESKTOP_VERSION | 124 | #ifndef DESKTOP_VERSION |
125 | QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold ); | 125 | QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold ); |
126 | #endif | 126 | #endif |
@@ -167,25 +167,25 @@ void ComposeMail::saveAsDraft() | |||
167 | /* only use the default drafts folder name! */ | 167 | /* only use the default drafts folder name! */ |
168 | Storemail wrapper(AbstractMail::draftFolder()); | 168 | Storemail wrapper(AbstractMail::draftFolder()); |
169 | wrapper.storeMail(mail); | 169 | wrapper.storeMail(mail); |
170 | 170 | ||
171 | AttachViewItem *it = (AttachViewItem *) attList->firstChild(); | 171 | AttachViewItem *it = (AttachViewItem *) attList->firstChild(); |
172 | /* attachments we will ignore! */ | 172 | /* attachments we will ignore! */ |
173 | if ( it != 0 ) { | 173 | if ( it != 0 ) { |
174 | if ( warnAttach ) | 174 | if ( warnAttach ) |
175 | QMessageBox::warning(0,tr("Store message"), | 175 | QMessageBox::warning(0,i18n("Store message"), |
176 | tr("<center>Attachments will not be stored in \"Draft\" folder</center>")); | 176 | i18n("<center>Attachments will not be stored in \"Draft\" folder</center>")); |
177 | warnAttach = false; | 177 | warnAttach = false; |
178 | } | 178 | } |
179 | setStatus( tr("Mail saved as draft!") ); | 179 | setStatus( i18n("Mail saved as draft!") ); |
180 | } | 180 | } |
181 | void ComposeMail::clearStatus() | 181 | void ComposeMail::clearStatus() |
182 | { | 182 | { |
183 | topLevelWidget()->setCaption( tr("Compose mail") ); | 183 | topLevelWidget()->setCaption( i18n("Compose mail") ); |
184 | } | 184 | } |
185 | void ComposeMail::setStatus( QString status ) | 185 | void ComposeMail::setStatus( QString status ) |
186 | { | 186 | { |
187 | topLevelWidget()->setCaption( status ); | 187 | topLevelWidget()->setCaption( status ); |
188 | QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ; | 188 | QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ; |
189 | } | 189 | } |
190 | void ComposeMail::pickAddress( ) | 190 | void ComposeMail::pickAddress( ) |
191 | { | 191 | { |
@@ -223,19 +223,19 @@ void ComposeMail::pickAddress( ) | |||
223 | void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) | 223 | void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) |
224 | { | 224 | { |
225 | //qDebug("ComposeMail::insertAttendees "); | 225 | //qDebug("ComposeMail::insertAttendees "); |
226 | raise(); | 226 | raise(); |
227 | 227 | ||
228 | if ( mPickLineEdit == 0 ) { //whoami received | 228 | if ( mPickLineEdit == 0 ) { //whoami received |
229 | QString defmail = uidList[0]; | 229 | QString defmail = uidList[0]; |
230 | if ( emailList.count() == 0 ) | 230 | if ( emailList.count() == 0 ) |
231 | QMessageBox::information( 0, tr( "Hint" ), | 231 | QMessageBox::information( 0, i18n( "Hint" ), |
232 | tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 232 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
233 | tr( "Ok" ) ); | 233 | i18n( "Ok" ) ); |
234 | if (defmail.length()!=0) { | 234 | if (defmail.length()!=0) { |
235 | fromBox->insertItem(defmail); | 235 | fromBox->insertItem(defmail); |
236 | } | 236 | } |
237 | QStringList::ConstIterator sit = emailList.begin(); | 237 | QStringList::ConstIterator sit = emailList.begin(); |
238 | int pref = 0; | 238 | int pref = 0; |
239 | for (;sit!=emailList.end();++sit) { | 239 | for (;sit!=emailList.end();++sit) { |
240 | if ( (*sit)==defmail) | 240 | if ( (*sit)==defmail) |
241 | continue; | 241 | continue; |
@@ -350,37 +350,37 @@ void ComposeMail::addAttachment() | |||
350 | Attachment *att = new Attachment( lnk ); | 350 | Attachment *att = new Attachment( lnk ); |
351 | (void) new AttachViewItem( attList, att ); | 351 | (void) new AttachViewItem( attList, att ); |
352 | } | 352 | } |
353 | } | 353 | } |
354 | 354 | ||
355 | void ComposeMail::removeAttachment() | 355 | void ComposeMail::removeAttachment() |
356 | { | 356 | { |
357 | if ( !attList->currentItem() ) { | 357 | if ( !attList->currentItem() ) { |
358 | QMessageBox::information( this, tr( "Error" ), | 358 | QMessageBox::information( this, i18n( "Error" ), |
359 | tr( "<p>Please select a File.</p>" ), | 359 | i18n( "<p>Please select a File.</p>" ), |
360 | tr( "Ok" ) ); | 360 | i18n( "Ok" ) ); |
361 | } else { | 361 | } else { |
362 | attList->takeItem( attList->currentItem() ); | 362 | attList->takeItem( attList->currentItem() ); |
363 | } | 363 | } |
364 | } | 364 | } |
365 | 365 | ||
366 | void ComposeMail::accept() | 366 | void ComposeMail::accept() |
367 | { | 367 | { |
368 | if ( smtpAccountBox->count() == 0 ) { | 368 | if ( smtpAccountBox->count() == 0 ) { |
369 | 369 | ||
370 | reject(); | 370 | reject(); |
371 | return; | 371 | return; |
372 | } | 372 | } |
373 | 373 | ||
374 | if (! checkBoxLater->isChecked() ) { | 374 | if (! checkBoxLater->isChecked() ) { |
375 | int yesno = QMessageBox::warning(0,tr("Stop editing message"), | 375 | int yesno = QMessageBox::warning(0,i18n("Stop editing message"), |
376 | tr("Send this message?"), | 376 | i18n("Send this message?"), |
377 | tr("Yes"), | 377 | i18n("Yes"), |
378 | tr("Cancel")); | 378 | i18n("Cancel")); |
379 | 379 | ||
380 | if (yesno == 1) { | 380 | if (yesno == 1) { |
381 | return; | 381 | return; |
382 | } | 382 | } |
383 | } | 383 | } |
384 | #if 0 | 384 | #if 0 |
385 | odebug << "Sending Mail with " | 385 | odebug << "Sending Mail with " |
386 | << smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() << oendl; | 386 | << smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() << oendl; |
@@ -388,18 +388,18 @@ void ComposeMail::accept() | |||
388 | Opie::Core::OSmartPointer<Mail> mail=new Mail; | 388 | Opie::Core::OSmartPointer<Mail> mail=new Mail; |
389 | 389 | ||
390 | SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); | 390 | SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); |
391 | mail->setMail(fromBox->currentText()); | 391 | mail->setMail(fromBox->currentText()); |
392 | 392 | ||
393 | if ( !toLine->text().isEmpty() ) { | 393 | if ( !toLine->text().isEmpty() ) { |
394 | mail->setTo( toLine->text() ); | 394 | mail->setTo( toLine->text() ); |
395 | } else { | 395 | } else { |
396 | QMessageBox::warning(0,tr("Sending mail"), | 396 | QMessageBox::warning(0,i18n("Sending mail"), |
397 | tr("No Receiver spezified" ) ); | 397 | i18n("No Receiver spezified" ) ); |
398 | return; | 398 | return; |
399 | } | 399 | } |
400 | 400 | ||
401 | mail->setName(senderNameEdit->text()); | 401 | mail->setName(senderNameEdit->text()); |
402 | mail->setCC( ccLine->text() ); | 402 | mail->setCC( ccLine->text() ); |
403 | mail->setBCC( bccLine->text() ); | 403 | mail->setBCC( bccLine->text() ); |
404 | mail->setReply( replyLine->text() ); | 404 | mail->setReply( replyLine->text() ); |
405 | mail->setSubject( subjectLine->text() ); | 405 | mail->setSubject( subjectLine->text() ); |
@@ -430,26 +430,26 @@ void ComposeMail::accept() | |||
430 | 430 | ||
431 | 431 | ||
432 | QDialog::accept(); | 432 | QDialog::accept(); |
433 | } | 433 | } |
434 | 434 | ||
435 | void ComposeMail::reject() | 435 | void ComposeMail::reject() |
436 | { | 436 | { |
437 | //qDebug("ComposeMail::reject() "); | 437 | //qDebug("ComposeMail::reject() "); |
438 | int yesno = QMessageBox::warning(0,tr("Store message?"), | 438 | int yesno = QMessageBox::warning(0,i18n("Store message?"), |
439 | tr("Store message into drafts?\n"), | 439 | i18n("Store message into drafts?\n"), |
440 | tr("Yes"), | 440 | i18n("Yes"), |
441 | tr("No")); | 441 | i18n("No")); |
442 | 442 | ||
443 | //qDebug("button %d ", yesno); | 443 | //qDebug("button %d ", yesno); |
444 | if (yesno == 0) { | 444 | if (yesno == 0) { |
445 | if ( toLine->text().isEmpty() ) { | 445 | if ( toLine->text().isEmpty() ) { |
446 | QMessageBox::warning(0,tr("Sending mail"), | 446 | QMessageBox::warning(0,i18n("Sending mail"), |
447 | tr("No Receiver spezified" ) ); | 447 | i18n("No Receiver spezified" ) ); |
448 | return; | 448 | return; |
449 | } | 449 | } |
450 | saveAsDraft(); | 450 | saveAsDraft(); |
451 | } | 451 | } |
452 | if (yesno == 2) { | 452 | if (yesno == 2) { |
453 | qDebug("return "); | 453 | qDebug("return "); |
454 | return; | 454 | return; |
455 | } | 455 | } |