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 e159b73..f68467c 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -175,129 +175,129 @@ void OpieMail::slotwriteMail(const QString&name,const QString&email)
175void OpieMail::slotComposeMail() 175void OpieMail::slotComposeMail()
176{ 176{
177 if ( mPendingEmail == QString::null && mPendingName == QString::null) 177 if ( mPendingEmail == QString::null && mPendingName == QString::null)
178 slotwriteMail2( QString () ); 178 slotwriteMail2( QString () );
179 else { 179 else {
180 if ( mPendingEmail == QString::null ) 180 if ( mPendingEmail == QString::null )
181 slotwriteMail2( mPendingName ); 181 slotwriteMail2( mPendingName );
182 else 182 else
183 slotwriteMail( mPendingName, mPendingEmail ); 183 slotwriteMail( mPendingName, mPendingEmail );
184 } 184 }
185 //slotwriteMail(0l,0l); 185 //slotwriteMail(0l,0l);
186} 186}
187 187
188void OpieMail::slotSendQueued() 188void OpieMail::slotSendQueued()
189{ 189{
190 SMTPaccount *smtp = 0; 190 SMTPaccount *smtp = 0;
191 191
192 QList<Account> list = settings->getAccounts(); 192 QList<Account> list = settings->getAccounts();
193 QList<SMTPaccount> smtpList; 193 QList<SMTPaccount> smtpList;
194 smtpList.setAutoDelete(false); 194 smtpList.setAutoDelete(false);
195 Account *it; 195 Account *it;
196 for ( it = list.first(); it; it = list.next() ) 196 for ( it = list.first(); it; it = list.next() )
197 { 197 {
198 if ( it->getType() == MAILLIB::A_SMTP ) 198 if ( it->getType() == MAILLIB::A_SMTP )
199 { 199 {
200 smtp = static_cast<SMTPaccount *>(it); 200 smtp = static_cast<SMTPaccount *>(it);
201 smtpList.append(smtp); 201 smtpList.append(smtp);
202 } 202 }
203 } 203 }
204 if (smtpList.count()==0) 204 if (smtpList.count()==0)
205 { 205 {
206 QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n")); 206 QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n"));
207 return; 207 return;
208 } 208 }
209 if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) 209 if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
210 return; 210 return;
211 if (smtpList.count()==1) 211 if (smtpList.count()==1)
212 { 212 {
213 smtp = smtpList.at(0); 213 smtp = smtpList.at(0);
214 } 214 }
215 else 215 else
216 { 216 {
217 smtp = 0; 217 smtp = 0;
218 selectsmtp selsmtp; 218 selectsmtp selsmtp;
219 selsmtp.setSelectionlist(&smtpList); 219 selsmtp.setSelectionlist(&smtpList);
220#ifndef DESKTOP_VERSION 220#ifndef DESKTOP_VERSION
221 selsmtp.showMaximized(); 221 selsmtp.showMaximized();
222#endif 222#endif
223 if ( selsmtp.exec() == QDialog::Accepted ) 223 if ( selsmtp.exec() == QDialog::Accepted )
224 { 224 {
225 smtp = selsmtp.selected_smtp(); 225 smtp = selsmtp.selected_smtp();
226 } 226 }
227 } 227 }
228 if (smtp) 228 if (smtp)
229 { 229 {
230 230
231 Global::statusMessage("Sending mails...!"); 231 Global::statusMessage("Sending mails...!");
232 SMTPwrapper * wrap = new SMTPwrapper(smtp); 232 SMTPwrapper * wrap = new SMTPwrapper(smtp);
233 if ( wrap->flushOutbox() ) 233 if ( wrap->flushOutbox() )
234 { 234 {
235 Global::statusMessage("Mails sent!"); 235 Global::statusMessage("Mails sent!");
236 } 236 }
237 delete wrap; 237 delete wrap;
238 } 238 }
239 // pending refresh list view, if outgoing is displayed 239 folderView->refreshOutgoing();
240} 240}
241 241
242void OpieMail::slotSearchMails() 242void OpieMail::slotSearchMails()
243{ 243{
244 qDebug("OpieMail::slotSearchMails():not implemented "); 244 qDebug("OpieMail::slotSearchMails():not implemented ");
245} 245}
246 246
247void OpieMail::slotEditSettings() 247void OpieMail::slotEditSettings()
248{ 248{
249 249
250 KOPrefsDialog settingsDialog( this, "koprefs", true ); 250 KOPrefsDialog settingsDialog( this, "koprefs", true );
251#ifndef DESKTOP_VERSION 251#ifndef DESKTOP_VERSION
252 settingsDialog.showMaximized(); 252 settingsDialog.showMaximized();
253#endif 253#endif
254 settingsDialog.exec(); 254 settingsDialog.exec();
255 255
256 slotSetCodec( KOPrefs::instance()->mCurrentCodec ); 256 slotSetCodec( KOPrefs::instance()->mCurrentCodec );
257 // KApplication::execDialog(settingsDialog); 257 // KApplication::execDialog(settingsDialog);
258} 258}
259 259
260void OpieMail::slotEditAccounts() 260void OpieMail::slotEditAccounts()
261{ 261{
262 EditAccounts eaDialog( settings, this, 0, true ); 262 EditAccounts eaDialog( settings, this, 0, true );
263 eaDialog.slotAdjustColumns(); 263 eaDialog.slotAdjustColumns();
264#ifndef DESKTOP_VERSION 264#ifndef DESKTOP_VERSION
265 eaDialog.showMaximized(); 265 eaDialog.showMaximized();
266#endif 266#endif
267 eaDialog.exec(); 267 eaDialog.exec();
268 if ( settings ) delete settings; 268 if ( settings ) delete settings;
269 settings = new Settings(); 269 settings = new Settings();
270 270
271 folderView->populate( settings->getAccounts() ); 271 folderView->populate( settings->getAccounts() );
272} 272}
273void OpieMail::replyMail() 273void OpieMail::replyMail()
274{ 274{
275 275
276 QListViewItem*item = mailView->currentItem(); 276 QListViewItem*item = mailView->currentItem();
277 if (!item) return; 277 if (!item) return;
278 RecMailP mail = ((MailListViewItem*)item)->data(); 278 RecMailP mail = ((MailListViewItem*)item)->data();
279 RecBodyP body = folderView->fetchBody(mail); 279 RecBodyP body = folderView->fetchBody(mail);
280 280
281 QString rtext; 281 QString rtext;
282 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose 282 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
283 .arg( mail->getFrom()) 283 .arg( mail->getFrom())
284 .arg( mail->getDate()); 284 .arg( mail->getDate());
285 285
286 QString text = body->Bodytext(); 286 QString text = body->Bodytext();
287 QStringList lines = QStringList::split(QRegExp("\\n"), text); 287 QStringList lines = QStringList::split(QRegExp("\\n"), text);
288 QStringList::Iterator it; 288 QStringList::Iterator it;
289 for (it = lines.begin(); it != lines.end(); it++) 289 for (it = lines.begin(); it != lines.end(); it++)
290 { 290 {
291 rtext += "> " + *it + "\n"; 291 rtext += "> " + *it + "\n";
292 } 292 }
293 rtext += "\n"; 293 rtext += "\n";
294 294
295 QString prefix; 295 QString prefix;
296 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; 296 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = "";
297 else prefix = "Re: "; // no i18n on purpose 297 else prefix = "Re: "; // no i18n on purpose
298 298
299 Settings *settings = new Settings(); 299 Settings *settings = new Settings();
300 ComposeMail composer( settings ,this, 0, true); 300 ComposeMail composer( settings ,this, 0, true);
301 if (mail->Replyto().isEmpty()) { 301 if (mail->Replyto().isEmpty()) {
302 composer.setTo( mail->getFrom()); 302 composer.setTo( mail->getFrom());
303 } else { 303 } else {