summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/composemail.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index c1b58a4..9060364 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -74,4 +74,12 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
}
}
+ if ( smtpAccounts.count() > 0 ) {
+ fillValues( smtpAccountBox->currentItem() );
+ } else {
+ QMessageBox::information( 0, tr( "Problem" ),
+ tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ),
+ tr( "Ok" ) );
+ return;
+ }
connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) );
connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) );
@@ -84,12 +92,5 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
mMail = 0;
warnAttach = true;
- if ( smtpAccounts.count() > 0 ) {
- fillValues( smtpAccountBox->currentItem() );
- } else {
- QMessageBox::information( 0, tr( "Problem" ),
- tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ),
- tr( "Ok" ) );
- return;
- }
+
}
void ComposeMail::saveAsDraft()
@@ -257,4 +258,10 @@ void ComposeMail::removeAttachment()
void ComposeMail::accept()
{
+ if ( smtpAccountBox->count() == 0 ) {
+
+ reject();
+ return;
+ }
+
if (! checkBoxLater->isChecked() ) {
int yesno = QMessageBox::warning(0,tr("Stop editing message"),
@@ -328,4 +335,9 @@ void ComposeMail::reject()
//qDebug("button %d ", yesno);
if (yesno == 0) {
+ if ( toLine->text().isEmpty() ) {
+ QMessageBox::warning(0,tr("Sending mail"),
+ tr("No Receiver spezified" ) );
+ return;
+ }
saveAsDraft();
}