summaryrefslogtreecommitdiffabout
path: root/kmicromail/opiemail.cpp
Unidiff
Diffstat (limited to 'kmicromail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/opiemail.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 18a5600..c20c7ce 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -230,129 +230,129 @@ void OpieMail::slotSearchMails()
230} 230}
231 231
232void OpieMail::slotEditSettings() 232void OpieMail::slotEditSettings()
233{ 233{
234 234
235 KOPrefsDialog settingsDialog( this, "koprefs", true ); 235 KOPrefsDialog settingsDialog( this, "koprefs", true );
236#ifndef DESKTOP_VERSION 236#ifndef DESKTOP_VERSION
237 settingsDialog.showMaximized(); 237 settingsDialog.showMaximized();
238#endif 238#endif
239 settingsDialog.exec(); 239 settingsDialog.exec();
240 240
241 slotSetCodec( KOPrefs::instance()->mCurrentCodec ); 241 slotSetCodec( KOPrefs::instance()->mCurrentCodec );
242 // KApplication::execDialog(settingsDialog); 242 // KApplication::execDialog(settingsDialog);
243} 243}
244 244
245void OpieMail::slotEditAccounts() 245void OpieMail::slotEditAccounts()
246{ 246{
247 EditAccounts eaDialog( settings, this, 0, true ); 247 EditAccounts eaDialog( settings, this, 0, true );
248 eaDialog.slotAdjustColumns(); 248 eaDialog.slotAdjustColumns();
249#ifndef DESKTOP_VERSION 249#ifndef DESKTOP_VERSION
250 eaDialog.showMaximized(); 250 eaDialog.showMaximized();
251#endif 251#endif
252 eaDialog.exec(); 252 eaDialog.exec();
253 if ( settings ) delete settings; 253 if ( settings ) delete settings;
254 settings = new Settings(); 254 settings = new Settings();
255 255
256 folderView->populate( settings->getAccounts() ); 256 folderView->populate( settings->getAccounts() );
257} 257}
258void OpieMail::replyMail() 258void OpieMail::replyMail()
259{ 259{
260 260
261 QListViewItem*item = mailView->currentItem(); 261 QListViewItem*item = mailView->currentItem();
262 if (!item) return; 262 if (!item) return;
263 RecMailP mail = ((MailListViewItem*)item)->data(); 263 RecMailP mail = ((MailListViewItem*)item)->data();
264 RecBodyP body = folderView->fetchBody(mail); 264 RecBodyP body = folderView->fetchBody(mail);
265 265
266 QString rtext; 266 QString rtext;
267 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose 267 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
268 .arg( mail->getFrom()) 268 .arg( mail->getFrom())
269 .arg( mail->getDate()); 269 .arg( mail->getDate());
270 270
271 QString text = body->Bodytext(); 271 QString text = body->Bodytext();
272 QStringList lines = QStringList::split(QRegExp("\\n"), text); 272 QStringList lines = QStringList::split(QRegExp("\\n"), text);
273 QStringList::Iterator it; 273 QStringList::Iterator it;
274 for (it = lines.begin(); it != lines.end(); it++) 274 for (it = lines.begin(); it != lines.end(); it++)
275 { 275 {
276 rtext += "> " + *it + "\n"; 276 rtext += "> " + *it + "\n";
277 } 277 }
278 rtext += "\n"; 278 rtext += "\n";
279 279
280 QString prefix; 280 QString prefix;
281 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; 281 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = "";
282 else prefix = "Re: "; // no i18n on purpose 282 else prefix = "Re: "; // no i18n on purpose
283 283
284 Settings *settings = new Settings(); 284 Settings *settings = new Settings();
285 ComposeMail composer( settings ,this, 0, true); 285 ComposeMail composer( settings ,this, 0, true);
286 if (mail->Replyto().isEmpty()) { 286 if (mail->Replyto().isEmpty()) {
287 composer.setTo( mail->getFrom()); 287 composer.setTo( mail->getFrom());
288 } else { 288 } else {
289 composer.setTo( mail->Replyto()); 289 composer.setTo( mail->Replyto());
290 } 290 }
291 composer.setSubject( prefix + mail->getSubject()); 291 composer.setSubject( prefix + mail->getSubject());
292 composer.setMessage( rtext ); 292 composer.setMessage( rtext );
293 composer.setInReplyTo( mail->Msgid()); 293 composer.setInReplyTo( mail->Msgid());
294 294 composer.setCharset( body->getCharset() );
295 if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) 295 if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
296 { 296 {
297 mail->Wrapper()->answeredMail(mail); 297 mail->Wrapper()->answeredMail(mail);
298 } 298 }
299 delete settings; 299 delete settings;
300 300
301} 301}
302void OpieMail::displayMail() 302void OpieMail::displayMail()
303{ 303{
304 QListViewItem*item = mailView->currentItem(); 304 QListViewItem*item = mailView->currentItem();
305 if (!item) return; 305 if (!item) return;
306 RecMailP mail = ((MailListViewItem*)item)->data(); 306 RecMailP mail = ((MailListViewItem*)item)->data();
307 RecBodyP body = folderView->fetchBody(mail); 307 RecBodyP body = folderView->fetchBody(mail);
308 ViewMail readMail( this,"", Qt::WType_Modal ); 308 ViewMail readMail( this,"", Qt::WType_Modal );
309 readMail.setBody( body ); 309 readMail.setBody( body );
310 readMail.setMail( mail ); 310 readMail.setMail( mail );
311#ifndef DESKTOP_VERSION 311#ifndef DESKTOP_VERSION
312 readMail.showMaximized(); 312 readMail.showMaximized();
313#else 313#else
314 readMail.resize( 640, 480); 314 readMail.resize( 640, 480);
315#endif 315#endif
316 readMail.exec(); 316 readMail.exec();
317 317
318 if ( readMail.deleted ) 318 if ( readMail.deleted )
319 { 319 {
320 folderView->refreshCurrent(); 320 folderView->refreshCurrent();
321 } 321 }
322 else 322 else
323 { 323 {
324 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 324 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
325 } 325 }
326} 326}
327void OpieMail::slotGetAllMail() 327void OpieMail::slotGetAllMail()
328{ 328{
329 QListViewItem * item = folderView->firstChild(); 329 QListViewItem * item = folderView->firstChild();
330 while ( item ){ 330 while ( item ){
331 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 331 ((AccountViewItem *)item)->contextMenuSelected( 101 );
332 item = item->nextSibling (); 332 item = item->nextSibling ();
333 } 333 }
334} 334}
335void OpieMail::slotGetMail() 335void OpieMail::slotGetMail()
336{ 336{
337 QListViewItem * item = folderView->currentItem(); 337 QListViewItem * item = folderView->currentItem();
338 if ( ! item ) return; 338 if ( ! item ) return;
339 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 339 ((AccountViewItem *)item)->contextMenuSelected( 101 );
340} 340}
341void OpieMail::slotDeleteMail() 341void OpieMail::slotDeleteMail()
342{ 342{
343 if (!mailView->currentItem()) return; 343 if (!mailView->currentItem()) return;
344 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); 344 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
345 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 345 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
346 { 346 {
347 mail->Wrapper()->deleteMail( mail ); 347 mail->Wrapper()->deleteMail( mail );
348 folderView->refreshCurrent(); 348 folderView->refreshCurrent();
349 } 349 }
350} 350}
351void OpieMail::slotDeleteAllMail() 351void OpieMail::slotDeleteAllMail()
352{ 352{
353 353
354 QValueList<RecMailP> t; 354 QValueList<RecMailP> t;
355 if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 355 if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
356 { 356 {
357 MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); 357 MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
358 while ( item ) { 358 while ( item ) {