-rw-r--r-- | kmicromail/opiemail.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 197f7ec..b701446 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -160,113 +160,111 @@ void OpieMail::slotwriteMail(const QString&name,const QString&email) | |||
160 | else | 160 | else |
161 | { | 161 | { |
162 | compose.setTo(email); | 162 | compose.setTo(email); |
163 | } | 163 | } |
164 | } | 164 | } |
165 | compose.slotAdjustColumns(); | 165 | compose.slotAdjustColumns(); |
166 | #ifndef DESKTOP_VERSION | 166 | #ifndef DESKTOP_VERSION |
167 | compose.showMaximized(); | 167 | compose.showMaximized(); |
168 | #endif | 168 | #endif |
169 | 169 | ||
170 | mCurrentComposer = &compose; | 170 | mCurrentComposer = &compose; |
171 | compose.exec(); | 171 | compose.exec(); |
172 | mCurrentComposer = 0; | 172 | mCurrentComposer = 0; |
173 | folderView->refreshOutgoing(); | 173 | folderView->refreshOutgoing(); |
174 | raise(); | 174 | raise(); |
175 | } | 175 | } |
176 | 176 | ||
177 | void OpieMail::slotComposeMail() | 177 | void OpieMail::slotComposeMail() |
178 | { | 178 | { |
179 | if ( mPendingEmail == QString::null && mPendingName == QString::null) | 179 | if ( mPendingEmail == QString::null && mPendingName == QString::null) |
180 | slotwriteMail2( QString () ); | 180 | slotwriteMail2( QString () ); |
181 | else { | 181 | else { |
182 | if ( mPendingEmail == QString::null ) | 182 | if ( mPendingEmail == QString::null ) |
183 | slotwriteMail2( mPendingName ); | 183 | slotwriteMail2( mPendingName ); |
184 | else | 184 | else |
185 | slotwriteMail( mPendingName, mPendingEmail ); | 185 | slotwriteMail( mPendingName, mPendingEmail ); |
186 | } | 186 | } |
187 | //slotwriteMail(0l,0l); | 187 | //slotwriteMail(0l,0l); |
188 | } | 188 | } |
189 | 189 | ||
190 | void OpieMail::slotSendQueued() | 190 | void OpieMail::slotSendQueued() |
191 | { | 191 | { |
192 | SMTPaccount *smtp = 0; | 192 | SMTPaccount *smtp = 0; |
193 | 193 | ||
194 | QList<Account> list = settings->getAccounts(); | 194 | QList<Account> list = settings->getAccounts(); |
195 | QList<SMTPaccount> smtpList; | 195 | QList<SMTPaccount> smtpList; |
196 | smtpList.setAutoDelete(false); | 196 | smtpList.setAutoDelete(false); |
197 | Account *it; | 197 | Account *it; |
198 | for ( it = list.first(); it; it = list.next() ) | 198 | for ( it = list.first(); it; it = list.next() ) |
199 | { | 199 | { |
200 | if ( it->getType() == MAILLIB::A_SMTP ) | 200 | if ( it->getType() == MAILLIB::A_SMTP ) |
201 | { | 201 | { |
202 | smtp = static_cast<SMTPaccount *>(it); | 202 | smtp = static_cast<SMTPaccount *>(it); |
203 | smtpList.append(smtp); | 203 | smtpList.append(smtp); |
204 | } | 204 | } |
205 | } | 205 | } |
206 | if (smtpList.count()==0) | 206 | if (smtpList.count()==0) |
207 | { | 207 | { |
208 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n")); | 208 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp\n account first!\n")); |
209 | return; | 209 | return; |
210 | } | 210 | } |
211 | if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) | 211 | if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to\nsend all queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) |
212 | return; | 212 | return; |
213 | if (smtpList.count()==1) | 213 | if (smtpList.count()==1) |
214 | { | 214 | { |
215 | smtp = smtpList.at(0); | 215 | smtp = smtpList.at(0); |
216 | } | 216 | } |
217 | else | 217 | else |
218 | { | 218 | { |
219 | smtp = 0; | 219 | smtp = 0; |
220 | selectsmtp selsmtp; | 220 | selectsmtp selsmtp; |
221 | selsmtp.setSelectionlist(&smtpList); | 221 | selsmtp.setSelectionlist(&smtpList); |
222 | #ifndef DESKTOP_VERSION | 222 | selsmtp.resize( selsmtp.sizeHint() ); |
223 | selsmtp.showMaximized(); | ||
224 | #endif | ||
225 | if ( selsmtp.exec() == QDialog::Accepted ) | 223 | if ( selsmtp.exec() == QDialog::Accepted ) |
226 | { | 224 | { |
227 | smtp = selsmtp.selected_smtp(); | 225 | smtp = selsmtp.selected_smtp(); |
228 | } | 226 | } |
229 | } | 227 | } |
230 | if (smtp) | 228 | if (smtp) |
231 | { | 229 | { |
232 | 230 | ||
233 | Global::statusMessage("Sending mails...!"); | 231 | Global::statusMessage("Sending mails...!"); |
234 | SMTPwrapper * wrap = new SMTPwrapper(smtp); | 232 | SMTPwrapper * wrap = new SMTPwrapper(smtp); |
235 | if ( wrap->flushOutbox() ) | 233 | if ( wrap->flushOutbox() ) |
236 | { | 234 | { |
237 | Global::statusMessage("Mails sent!"); | 235 | Global::statusMessage("Mails sent!"); |
238 | } | 236 | } |
239 | delete wrap; | 237 | delete wrap; |
240 | } | 238 | } |
241 | folderView->refreshOutgoing(); | 239 | folderView->refreshOutgoing(); |
242 | } | 240 | } |
243 | 241 | ||
244 | void OpieMail::slotSearchMails() | 242 | void OpieMail::slotSearchMails() |
245 | { | 243 | { |
246 | qDebug("OpieMail::slotSearchMails():not implemented "); | 244 | qDebug("OpieMail::slotSearchMails():not implemented "); |
247 | } | 245 | } |
248 | 246 | ||
249 | void OpieMail::slotEditSettings() | 247 | void OpieMail::slotEditSettings() |
250 | { | 248 | { |
251 | 249 | ||
252 | KOPrefsDialog settingsDialog( this, "koprefs", true ); | 250 | KOPrefsDialog settingsDialog( this, "koprefs", true ); |
253 | #ifndef DESKTOP_VERSION | 251 | #ifndef DESKTOP_VERSION |
254 | settingsDialog.showMaximized(); | 252 | settingsDialog.showMaximized(); |
255 | #endif | 253 | #endif |
256 | settingsDialog.exec(); | 254 | settingsDialog.exec(); |
257 | 255 | ||
258 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | 256 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); |
259 | // KApplication::execDialog(settingsDialog); | 257 | // KApplication::execDialog(settingsDialog); |
260 | } | 258 | } |
261 | 259 | ||
262 | void OpieMail::slotEditAccounts() | 260 | void OpieMail::slotEditAccounts() |
263 | { | 261 | { |
264 | EditAccounts eaDialog( settings, this, 0, true ); | 262 | EditAccounts eaDialog( settings, this, 0, true ); |
265 | eaDialog.slotAdjustColumns(); | 263 | eaDialog.slotAdjustColumns(); |
266 | #ifndef DESKTOP_VERSION | 264 | #ifndef DESKTOP_VERSION |
267 | eaDialog.showMaximized(); | 265 | eaDialog.showMaximized(); |
268 | #endif | 266 | #endif |
269 | eaDialog.exec(); | 267 | eaDialog.exec(); |
270 | if ( settings ) delete settings; | 268 | if ( settings ) delete settings; |
271 | settings = new Settings(); | 269 | settings = new Settings(); |
272 | 270 | ||