-rw-r--r-- | kmicromail/composemail.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 9efa932..9b799b3 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp | |||
@@ -74,66 +74,66 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
74 | QStringList::ConstIterator sit = mails.begin(); | 74 | QStringList::ConstIterator sit = mails.begin(); |
75 | for (;sit!=mails.end();++sit) { | 75 | for (;sit!=mails.end();++sit) { |
76 | if ( (*sit)==defmail) | 76 | if ( (*sit)==defmail) |
77 | continue; | 77 | continue; |
78 | fromBox->insertItem((*sit)); | 78 | fromBox->insertItem((*sit)); |
79 | } | 79 | } |
80 | senderNameEdit->setText(con.formattedName()); | 80 | senderNameEdit->setText(con.formattedName()); |
81 | #endif | 81 | #endif |
82 | Config cfg( "mail" ); | 82 | Config cfg( "mail" ); |
83 | cfg.setGroup( "Compose" ); | 83 | cfg.setGroup( "Compose" ); |
84 | checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); | 84 | checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); |
85 | 85 | ||
86 | attList->addColumn( tr( "Name" ) ); | 86 | attList->addColumn( tr( "Name" ) ); |
87 | attList->addColumn( tr( "Size" ) ); | 87 | attList->addColumn( tr( "Size" ) ); |
88 | QList<Account> accounts = settings->getAccounts(); | 88 | QList<Account> accounts = settings->getAccounts(); |
89 | 89 | ||
90 | Account *it; | 90 | Account *it; |
91 | for ( it = accounts.first(); it; it = accounts.next() ) { | 91 | for ( it = accounts.first(); it; it = accounts.next() ) { |
92 | if ( it->getType()==MAILLIB::A_SMTP ) { | 92 | if ( it->getType()==MAILLIB::A_SMTP ) { |
93 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); | 93 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); |
94 | smtpAccountBox->insertItem( smtp->getAccountName() ); | 94 | smtpAccountBox->insertItem( smtp->getAccountName() ); |
95 | smtpAccounts.append( smtp ); | 95 | smtpAccounts.append( smtp ); |
96 | } | 96 | } |
97 | } | 97 | } |
98 | if ( smtpAccounts.count() > 0 ) { | ||
99 | fillValues( smtpAccountBox->currentItem() ); | ||
100 | } else { | ||
101 | QMessageBox::information( 0, tr( "Problem" ), | ||
102 | tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ), | ||
103 | tr( "Ok" ) ); | ||
104 | return; | ||
105 | } | ||
106 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); | ||
107 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); | 98 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); |
108 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); | 99 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); |
109 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); | 100 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); |
110 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); | 101 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); |
111 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); | 102 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); |
112 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); | 103 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); |
113 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); | 104 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); |
114 | mMail = 0; | 105 | mMail = 0; |
115 | warnAttach = true; | 106 | warnAttach = true; |
107 | if ( smtpAccounts.count() > 0 ) { | ||
108 | fillValues( smtpAccountBox->currentItem() ); | ||
109 | } else { | ||
110 | QMessageBox::information( 0, tr( "Problem" ), | ||
111 | tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ), | ||
112 | tr( "Ok" ) ); | ||
113 | return; | ||
114 | } | ||
115 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); | ||
116 | 116 | ||
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | 120 | ||
121 | void ComposeMail::saveAsDraft() | 121 | void ComposeMail::saveAsDraft() |
122 | { | 122 | { |
123 | 123 | ||
124 | Opie::Core::OSmartPointer<Mail> mail= new Mail(); | 124 | Opie::Core::OSmartPointer<Mail> mail= new Mail(); |
125 | mail->setMail(fromBox->currentText()); | 125 | mail->setMail(fromBox->currentText()); |
126 | mail->setTo( toLine->text() ); | 126 | mail->setTo( toLine->text() ); |
127 | mail->setName(senderNameEdit->text()); | 127 | mail->setName(senderNameEdit->text()); |
128 | mail->setCC( ccLine->text() ); | 128 | mail->setCC( ccLine->text() ); |
129 | mail->setBCC( bccLine->text() ); | 129 | mail->setBCC( bccLine->text() ); |
130 | mail->setReply( replyLine->text() ); | 130 | mail->setReply( replyLine->text() ); |
131 | mail->setSubject( subjectLine->text() ); | 131 | mail->setSubject( subjectLine->text() ); |
132 | if (!m_replyid.isEmpty()) { | 132 | if (!m_replyid.isEmpty()) { |
133 | QStringList ids; | 133 | QStringList ids; |
134 | ids.append(m_replyid); | 134 | ids.append(m_replyid); |
135 | mail->setInreply(ids); | 135 | mail->setInreply(ids); |
136 | } | 136 | } |
137 | QString txt = message->text(); | 137 | QString txt = message->text(); |
138 | if ( !sigMultiLine->text().isEmpty() ) { | 138 | if ( !sigMultiLine->text().isEmpty() ) { |
139 | txt.append( "\n--\n" ); | 139 | txt.append( "\n--\n" ); |