summaryrefslogtreecommitdiffabout
path: root/kmicromail/composemail.cpp
Unidiff
Diffstat (limited to 'kmicromail/composemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/composemail.cpp66
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
@@ -49,30 +49,30 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
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)
@@ -84,14 +84,14 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
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() ) {
@@ -110,15 +110,15 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
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
@@ -169,21 +169,21 @@ void ComposeMail::saveAsDraft()
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}
181void ComposeMail::clearStatus() 181void ComposeMail::clearStatus()
182{ 182{
183 topLevelWidget()->setCaption( tr("Compose mail") ); 183 topLevelWidget()->setCaption( i18n("Compose mail") );
184} 184}
185void ComposeMail::setStatus( QString status ) 185void 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}
@@ -225,15 +225,15 @@ void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameLis
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) {
@@ -352,15 +352,15 @@ void ComposeMail::addAttachment()
352 } 352 }
353} 353}
354 354
355void ComposeMail::removeAttachment() 355void 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
366void ComposeMail::accept() 366void ComposeMail::accept()
@@ -369,16 +369,16 @@ void ComposeMail::accept()
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
@@ -390,14 +390,14 @@ void ComposeMail::accept()
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() );
@@ -432,22 +432,22 @@ void ComposeMail::accept()
432 QDialog::accept(); 432 QDialog::accept();
433} 433}
434 434
435void ComposeMail::reject() 435void 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 ");