-rw-r--r-- | kmicromail/composemail.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index ca4f247..c1b58a4 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp | |||
@@ -40,14 +40,14 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
40 | settings = s; | 40 | settings = s; |
41 | m_replyid = ""; | 41 | m_replyid = ""; |
42 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); | 42 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); |
43 | QStringList mails = con.emails(); | 43 | QStringList mails = con.emails(); |
44 | QString defmail = con.preferredEmail(); | 44 | QString defmail = con.preferredEmail(); |
45 | if ( mails.count() == 0) | 45 | if ( mails.count() == 0) |
46 | QMessageBox::information( parentWidget(), tr( "Hint" ), | 46 | QMessageBox::information( 0, tr( "Hint" ), |
47 | tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!" ), | 47 | tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
48 | tr( "Ok" ) ); | 48 | tr( "Ok" ) ); |
49 | if (defmail.length()!=0) { | 49 | if (defmail.length()!=0) { |
50 | fromBox->insertItem(defmail); | 50 | fromBox->insertItem(defmail); |
51 | } | 51 | } |
52 | QStringList::ConstIterator sit = mails.begin(); | 52 | QStringList::ConstIterator sit = mails.begin(); |
53 | for (;sit!=mails.end();++sit) { | 53 | for (;sit!=mails.end();++sit) { |
@@ -70,30 +70,30 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
70 | if ( it->getType()==MAILLIB::A_SMTP ) { | 70 | if ( it->getType()==MAILLIB::A_SMTP ) { |
71 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); | 71 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); |
72 | smtpAccountBox->insertItem( smtp->getAccountName() ); | 72 | smtpAccountBox->insertItem( smtp->getAccountName() ); |
73 | smtpAccounts.append( smtp ); | 73 | smtpAccounts.append( smtp ); |
74 | } | 74 | } |
75 | } | 75 | } |
76 | if ( smtpAccounts.count() > 0 ) { | ||
77 | fillValues( smtpAccountBox->currentItem() ); | ||
78 | } else { | ||
79 | QMessageBox::information( parentWidget(), tr( "Problem" ), | ||
80 | tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail." ), | ||
81 | tr( "Ok" ) ); | ||
82 | return; | ||
83 | } | ||
84 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); | 76 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); |
85 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); | 77 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); |
86 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); | 78 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); |
87 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); | 79 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); |
88 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); | 80 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); |
89 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); | 81 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); |
90 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); | 82 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); |
91 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); | 83 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); |
92 | mMail = 0; | 84 | mMail = 0; |
93 | warnAttach = true; | 85 | warnAttach = true; |
86 | if ( smtpAccounts.count() > 0 ) { | ||
87 | fillValues( smtpAccountBox->currentItem() ); | ||
88 | } else { | ||
89 | QMessageBox::information( 0, tr( "Problem" ), | ||
90 | tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ), | ||
91 | tr( "Ok" ) ); | ||
92 | return; | ||
93 | } | ||
94 | } | 94 | } |
95 | void ComposeMail::saveAsDraft() | 95 | void ComposeMail::saveAsDraft() |
96 | { | 96 | { |
97 | 97 | ||
98 | Opie::Core::OSmartPointer<Mail> mail= new Mail(); | 98 | Opie::Core::OSmartPointer<Mail> mail= new Mail(); |
99 | mail->setMail(fromBox->currentText()); | 99 | mail->setMail(fromBox->currentText()); |
@@ -317,14 +317,14 @@ void ComposeMail::accept() | |||
317 | QDialog::accept(); | 317 | QDialog::accept(); |
318 | } | 318 | } |
319 | 319 | ||
320 | void ComposeMail::reject() | 320 | void ComposeMail::reject() |
321 | { | 321 | { |
322 | //qDebug("ComposeMail::reject() "); | 322 | //qDebug("ComposeMail::reject() "); |
323 | int yesno = QMessageBox::warning(0,tr("Stop editing message"), | 323 | int yesno = QMessageBox::warning(0,tr("Store message?"), |
324 | tr("Store message into drafts?"), | 324 | tr("Store message into drafts?\n"), |
325 | tr("Yes"), | 325 | tr("Yes"), |
326 | tr("No")); | 326 | tr("No")); |
327 | 327 | ||
328 | //qDebug("button %d ", yesno); | 328 | //qDebug("button %d ", yesno); |
329 | if (yesno == 0) { | 329 | if (yesno == 0) { |
330 | saveAsDraft(); | 330 | saveAsDraft(); |