summaryrefslogtreecommitdiffabout
path: root/kmicromail/opiemail.cpp
Unidiff
Diffstat (limited to 'kmicromail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/opiemail.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 4436ad6..8ac3451 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -199,96 +199,101 @@ void OpieMail::slotSendQueued()
199 for ( it = list.first(); it; it = list.next() ) 199 for ( it = list.first(); it; it = list.next() )
200 { 200 {
201 if ( it->getType() == MAILLIB::A_SMTP ) 201 if ( it->getType() == MAILLIB::A_SMTP )
202 { 202 {
203 smtp = static_cast<SMTPaccount *>(it); 203 smtp = static_cast<SMTPaccount *>(it);
204 smtpList.append(smtp); 204 smtpList.append(smtp);
205 } 205 }
206 } 206 }
207 if (smtpList.count()==0) 207 if (smtpList.count()==0)
208 { 208 {
209 QMessageBox::information(0,i18n("Info"),i18n("Define a smtp\n account first!\n")); 209 QMessageBox::information(0,i18n("Info"),i18n("Define a smtp\n account first!\n"));
210 return; 210 return;
211 } 211 }
212 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 if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to\nsend all queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
213 return; 213 return;
214 if (smtpList.count()==1) 214 if (smtpList.count()==1)
215 { 215 {
216 smtp = smtpList.at(0); 216 smtp = smtpList.at(0);
217 } 217 }
218 else 218 else
219 { 219 {
220 smtp = 0; 220 smtp = 0;
221 selectsmtp selsmtp; 221 selectsmtp selsmtp;
222 selsmtp.setSelectionlist(&smtpList); 222 selsmtp.setSelectionlist(&smtpList);
223 selsmtp.resize( selsmtp.sizeHint() ); 223 selsmtp.resize( selsmtp.sizeHint() );
224 if ( selsmtp.exec() == QDialog::Accepted ) 224 if ( selsmtp.exec() == QDialog::Accepted )
225 { 225 {
226 smtp = selsmtp.selected_smtp(); 226 smtp = selsmtp.selected_smtp();
227 } 227 }
228 } 228 }
229 if (smtp) 229 if (smtp)
230 { 230 {
231 231
232 Global::statusMessage("Sending mails...!"); 232 Global::statusMessage("Sending mails...!");
233 SMTPwrapper * wrap = new SMTPwrapper(smtp); 233 SMTPwrapper * wrap = new SMTPwrapper(smtp);
234 if ( wrap->flushOutbox() ) 234 if ( wrap->flushOutbox() )
235 { 235 {
236 Global::statusMessage("Mails sent!"); 236 Global::statusMessage("Mails sent!");
237 } 237 }
238 delete wrap; 238 delete wrap;
239 } 239 }
240 folderView->refreshOutgoing(); 240 folderView->refreshOutgoing();
241} 241}
242 242
243void OpieMail::slotSearchMails() 243void OpieMail::slotSearchMails()
244{ 244{
245 qDebug("OpieMail::slotSearchMails():not implemented "); 245 qDebug("OpieMail::slotSearchMails():not implemented ");
246} 246}
247void OpieMail::slotEditGlobalSettings()
248{
249 KPimPrefsGlobalDialog gc ( this );
250 gc.exec();
251}
247 252
248void OpieMail::slotEditSettings() 253void OpieMail::slotEditSettings()
249{ 254{
250 255
251 KOPrefsDialog settingsDialog( this, "koprefs", true ); 256 KOPrefsDialog settingsDialog( this, "koprefs", true );
252#ifndef DESKTOP_VERSION 257#ifndef DESKTOP_VERSION
253 settingsDialog.showMaximized(); 258 settingsDialog.showMaximized();
254#endif 259#endif
255 settingsDialog.exec(); 260 settingsDialog.exec();
256 261
257 slotSetCodec( KOPrefs::instance()->mCurrentCodec ); 262 slotSetCodec( KOPrefs::instance()->mCurrentCodec );
258 // KApplication::execDialog(settingsDialog); 263 // KApplication::execDialog(settingsDialog);
259} 264}
260 265
261void OpieMail::slotEditAccounts() 266void OpieMail::slotEditAccounts()
262{ 267{
263 EditAccounts eaDialog( settings, this, 0, true ); 268 EditAccounts eaDialog( settings, this, 0, true );
264 eaDialog.slotAdjustColumns(); 269 eaDialog.slotAdjustColumns();
265#ifndef DESKTOP_VERSION 270#ifndef DESKTOP_VERSION
266 eaDialog.showMaximized(); 271 eaDialog.showMaximized();
267#endif 272#endif
268 eaDialog.exec(); 273 eaDialog.exec();
269 if ( settings ) delete settings; 274 if ( settings ) delete settings;
270 settings = new Settings(); 275 settings = new Settings();
271 276
272 folderView->populate( settings->getAccounts() ); 277 folderView->populate( settings->getAccounts() );
273} 278}
274void OpieMail::replyMail() 279void OpieMail::replyMail()
275{ 280{
276 281
277 QListViewItem*item = mailView->currentItem(); 282 QListViewItem*item = mailView->currentItem();
278 if (!item) return; 283 if (!item) return;
279 RecMailP mail = ((MailListViewItem*)item)->data(); 284 RecMailP mail = ((MailListViewItem*)item)->data();
280 RecBodyP body = folderView->fetchBody(mail); 285 RecBodyP body = folderView->fetchBody(mail);
281 286
282 QString rtext; 287 QString rtext;
283 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose 288 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
284 .arg( mail->getFrom()) 289 .arg( mail->getFrom())
285 .arg( mail->getDate()); 290 .arg( mail->getDate());
286 291
287 QString text = body->Bodytext(); 292 QString text = body->Bodytext();
288 QStringList lines = QStringList::split(QRegExp("\\n"), text); 293 QStringList lines = QStringList::split(QRegExp("\\n"), text);
289 QStringList::Iterator it; 294 QStringList::Iterator it;
290 for (it = lines.begin(); it != lines.end(); it++) 295 for (it = lines.begin(); it != lines.end(); it++)
291 { 296 {
292 rtext += "> " + *it + "\n"; 297 rtext += "> " + *it + "\n";
293 } 298 }
294 rtext += "\n"; 299 rtext += "\n";