summaryrefslogtreecommitdiffabout
path: root/kmicromail
Unidiff
Diffstat (limited to 'kmicromail') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/editaccounts.cpp12
-rw-r--r--kmicromail/opiemail.cpp8
-rw-r--r--kmicromail/selectsmtp.cpp2
3 files changed, 16 insertions, 6 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp
index 8253c91..f1075c0 100644
--- a/kmicromail/editaccounts.cpp
+++ b/kmicromail/editaccounts.cpp
@@ -336,169 +336,181 @@ IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name,
336 ComboBox1->insertItem( "Only if available", 0 ); 336 ComboBox1->insertItem( "Only if available", 0 );
337 ComboBox1->insertItem( "Always, Negotiated", 1 ); 337 ComboBox1->insertItem( "Always, Negotiated", 1 );
338 ComboBox1->insertItem( "Connect on secure port", 2 ); 338 ComboBox1->insertItem( "Connect on secure port", 2 );
339 ComboBox1->insertItem( "Run command instead", 3 ); 339 ComboBox1->insertItem( "Run command instead", 3 );
340 CommandEdit->hide(); 340 CommandEdit->hide();
341 ComboBox1->setCurrentItem( data->ConnectionType() ); 341 ComboBox1->setCurrentItem( data->ConnectionType() );
342} 342}
343 343
344void IMAPconfig::slotConnectionToggle( int index ) 344void IMAPconfig::slotConnectionToggle( int index )
345{ 345{
346 if ( index == 2 ) 346 if ( index == 2 )
347 { 347 {
348 portLine->setText( IMAP_SSL_PORT ); 348 portLine->setText( IMAP_SSL_PORT );
349 } 349 }
350 else if ( index == 3 ) 350 else if ( index == 3 )
351 { 351 {
352 portLine->setText( IMAP_PORT ); 352 portLine->setText( IMAP_PORT );
353 CommandEdit->show(); 353 CommandEdit->show();
354 } 354 }
355 else 355 else
356 { 356 {
357 portLine->setText( IMAP_PORT ); 357 portLine->setText( IMAP_PORT );
358 } 358 }
359} 359}
360 360
361void IMAPconfig::fillValues() 361void IMAPconfig::fillValues()
362{ 362{
363 accountLine->setText( data->getAccountName() ); 363 accountLine->setText( data->getAccountName() );
364 serverLine->setText( data->getServer() ); 364 serverLine->setText( data->getServer() );
365 portLine->setText( data->getPort() ); 365 portLine->setText( data->getPort() );
366 ComboBox1->setCurrentItem( data->ConnectionType() ); 366 ComboBox1->setCurrentItem( data->ConnectionType() );
367 userLine->setText( data->getUser() ); 367 userLine->setText( data->getUser() );
368 passLine->setText( data->getPassword() ); 368 passLine->setText( data->getPassword() );
369 prefixLine->setText(data->getPrefix()); 369 prefixLine->setText(data->getPrefix());
370 localFolder->setText( data->getLocalFolder() ); 370 localFolder->setText( data->getLocalFolder() );
371 int max = data->getMaxMailSize() ; 371 int max = data->getMaxMailSize() ;
372 if ( max ) { 372 if ( max ) {
373 CheckBoxDown->setChecked( true ); 373 CheckBoxDown->setChecked( true );
374 SpinBoxDown->setValue ( max ); 374 SpinBoxDown->setValue ( max );
375 } else { 375 } else {
376 CheckBoxDown->setChecked( false ); 376 CheckBoxDown->setChecked( false );
377 SpinBoxDown->setValue ( 5 ); 377 SpinBoxDown->setValue ( 5 );
378 } 378 }
379 CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() ); 379 CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() );
380} 380}
381 381
382void IMAPconfig::accept() 382void IMAPconfig::accept()
383{ 383{
384 if ( localFolder->text().contains("/") ||localFolder->text().contains("\\") ) {
385 QMessageBox::information( this, i18n( "Error" ),
386 i18n( "No paths allowed in\nlocal folder settings.\nPlease specify a folder\nname or leave empty\nto create local folder\nwith account name\nautomatically." ),
387 i18n( "Ok" ) );
388 return;
389 }
384 data->setAccountName( accountLine->text() ); 390 data->setAccountName( accountLine->text() );
385 data->setServer( serverLine->text() ); 391 data->setServer( serverLine->text() );
386 data->setPort( portLine->text() ); 392 data->setPort( portLine->text() );
387 data->setConnectionType( ComboBox1->currentItem() ); 393 data->setConnectionType( ComboBox1->currentItem() );
388 data->setUser( userLine->text() ); 394 data->setUser( userLine->text() );
389 data->setPassword( passLine->text() ); 395 data->setPassword( passLine->text() );
390 data->setPrefix(prefixLine->text()); 396 data->setPrefix(prefixLine->text());
391 data->setLocalFolder( localFolder->text() ); 397 data->setLocalFolder( localFolder->text() );
392 data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; 398 data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ;
393 data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); 399 data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() );
394 400
395 QDialog::accept(); 401 QDialog::accept();
396} 402}
397 403
398/** 404/**
399 * POP3config 405 * POP3config
400 */ 406 */
401 407
402POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 408POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags )
403 : POP3configUI( parent, name, modal, flags ) 409 : POP3configUI( parent, name, modal, flags )
404{ 410{
405 data = account; 411 data = account;
406 fillValues(); 412 fillValues();
407 413
408 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); 414 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
409 ComboBox1->insertItem( "Only if available", 0 ); 415 ComboBox1->insertItem( "Only if available", 0 );
410 ComboBox1->insertItem( "Always, Negotiated", 1 ); 416 ComboBox1->insertItem( "Always, Negotiated", 1 );
411 ComboBox1->insertItem( "Connect on secure port", 2 ); 417 ComboBox1->insertItem( "Connect on secure port", 2 );
412 ComboBox1->insertItem( "Run command instead", 3 ); 418 ComboBox1->insertItem( "Run command instead", 3 );
413 CommandEdit->hide(); 419 CommandEdit->hide();
414 ComboBox1->setCurrentItem( data->ConnectionType() ); 420 ComboBox1->setCurrentItem( data->ConnectionType() );
415} 421}
416 422
417void POP3config::slotConnectionToggle( int index ) 423void POP3config::slotConnectionToggle( int index )
418{ 424{
419 // 2 is ssl connection 425 // 2 is ssl connection
420 if ( index == 2 ) 426 if ( index == 2 )
421 { 427 {
422 portLine->setText( POP3_SSL_PORT ); 428 portLine->setText( POP3_SSL_PORT );
423 } 429 }
424 else if ( index == 3 ) 430 else if ( index == 3 )
425 { 431 {
426 portLine->setText( POP3_PORT ); 432 portLine->setText( POP3_PORT );
427 CommandEdit->show(); 433 CommandEdit->show();
428 } 434 }
429 else 435 else
430 { 436 {
431 portLine->setText( POP3_PORT ); 437 portLine->setText( POP3_PORT );
432 } 438 }
433} 439}
434 440
435void POP3config::fillValues() 441void POP3config::fillValues()
436{ 442{
437 accountLine->setText( data->getAccountName() ); 443 accountLine->setText( data->getAccountName() );
438 serverLine->setText( data->getServer() ); 444 serverLine->setText( data->getServer() );
439 portLine->setText( data->getPort() ); 445 portLine->setText( data->getPort() );
440 ComboBox1->setCurrentItem( data->ConnectionType() ); 446 ComboBox1->setCurrentItem( data->ConnectionType() );
441 userLine->setText( data->getUser() ); 447 userLine->setText( data->getUser() );
442 passLine->setText( data->getPassword() ); 448 passLine->setText( data->getPassword() );
443 localFolder->setText( data->getLocalFolder() ); 449 localFolder->setText( data->getLocalFolder() );
444 int max = data->getMaxMailSize() ; 450 int max = data->getMaxMailSize() ;
445 if ( max ) { 451 if ( max ) {
446 CheckBoxDown->setChecked( true ); 452 CheckBoxDown->setChecked( true );
447 SpinBoxDown->setValue ( max ); 453 SpinBoxDown->setValue ( max );
448 } else { 454 } else {
449 CheckBoxDown->setChecked( false ); 455 CheckBoxDown->setChecked( false );
450 SpinBoxDown->setValue ( 5 ); 456 SpinBoxDown->setValue ( 5 );
451 } 457 }
452 CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() ); 458 CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() );
453} 459}
454 460
455void POP3config::accept() 461void POP3config::accept()
456{ 462{
463 if ( localFolder->text().contains("/") ||localFolder->text().contains("\\") ) {
464 QMessageBox::information( this, i18n( "Error" ),
465 i18n( "No paths allowed in\nlocal folder settings.\nPlease specify a folder\nname or leave empty\nto create local folder\nwith account name\nautomatically." ),
466 i18n( "Ok" ) );
467 return;
468 }
457 data->setAccountName( accountLine->text() ); 469 data->setAccountName( accountLine->text() );
458 data->setServer( serverLine->text() ); 470 data->setServer( serverLine->text() );
459 data->setPort( portLine->text() ); 471 data->setPort( portLine->text() );
460 data->setConnectionType( ComboBox1->currentItem() ); 472 data->setConnectionType( ComboBox1->currentItem() );
461 data->setUser( userLine->text() ); 473 data->setUser( userLine->text() );
462 data->setPassword( passLine->text() ); 474 data->setPassword( passLine->text() );
463 data->setLocalFolder( localFolder->text() ); 475 data->setLocalFolder( localFolder->text() );
464 data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; 476 data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ;
465 data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); 477 data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() );
466 478
467 QDialog::accept(); 479 QDialog::accept();
468} 480}
469 481
470/** 482/**
471 * SMTPconfig 483 * SMTPconfig
472 */ 484 */
473 485
474SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 486SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
475 : SMTPconfigUI( parent, name, modal, flags ) 487 : SMTPconfigUI( parent, name, modal, flags )
476{ 488{
477 data = account; 489 data = account;
478 490
479 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); 491 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) );
480 connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); 492 connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) );
481 493
482 fillValues(); 494 fillValues();
483 QIconSet icon; 495 QIconSet icon;
484 //icon = SmallIcon("fileexport"); 496 //icon = SmallIcon("fileexport");
485 icon = SmallIcon("fileopen"); 497 icon = SmallIcon("fileopen");
486 SignaturButton->setText(""); 498 SignaturButton->setText("");
487 SignaturButton->setIconSet (icon ) ; 499 SignaturButton->setIconSet (icon ) ;
488 SignaturButton->setMaximumSize ( SignaturButton->sizeHint().height()+4,SignaturButton->sizeHint().height()) ; 500 SignaturButton->setMaximumSize ( SignaturButton->sizeHint().height()+4,SignaturButton->sizeHint().height()) ;
489 connect( SignaturButton, SIGNAL( clicked() ), this, SLOT( chooseSig() ) ); 501 connect( SignaturButton, SIGNAL( clicked() ), this, SLOT( chooseSig() ) );
490 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); 502 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
491 ComboBox1->insertItem( "Only if available", 0 ); 503 ComboBox1->insertItem( "Only if available", 0 );
492 ComboBox1->insertItem( "Always, Negotiated", 1 ); 504 ComboBox1->insertItem( "Always, Negotiated", 1 );
493 ComboBox1->insertItem( "Connect on secure port", 2 ); 505 ComboBox1->insertItem( "Connect on secure port", 2 );
494 ComboBox1->insertItem( "Run command instead", 3 ); 506 ComboBox1->insertItem( "Run command instead", 3 );
495 CommandEdit->hide(); 507 CommandEdit->hide();
496 ComboBox1->setCurrentItem( data->ConnectionType() ); 508 ComboBox1->setCurrentItem( data->ConnectionType() );
497} 509}
498void SMTPconfig::chooseSig() 510void SMTPconfig::chooseSig()
499{ 511{
500 QString lnk = KFileDialog::getOpenFileName( "", "Choose Signatur File", this ); 512 QString lnk = KFileDialog::getOpenFileName( "", "Choose Signatur File", this );
501 if ( !lnk.isEmpty() ) { 513 if ( !lnk.isEmpty() ) {
502 SignaturEdit->setText( lnk ); 514 SignaturEdit->setText( lnk );
503 } 515 }
504} 516}
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
177void OpieMail::slotComposeMail() 177void 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
190void OpieMail::slotSendQueued() 190void 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
244void OpieMail::slotSearchMails() 242void OpieMail::slotSearchMails()
245{ 243{
246 qDebug("OpieMail::slotSearchMails():not implemented "); 244 qDebug("OpieMail::slotSearchMails():not implemented ");
247} 245}
248 246
249void OpieMail::slotEditSettings() 247void 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
262void OpieMail::slotEditAccounts() 260void 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
diff --git a/kmicromail/selectsmtp.cpp b/kmicromail/selectsmtp.cpp
index ff8b524..10b6d79 100644
--- a/kmicromail/selectsmtp.cpp
+++ b/kmicromail/selectsmtp.cpp
@@ -1,64 +1,64 @@
1#include "selectsmtp.h" 1#include "selectsmtp.h"
2#include <libmailwrapper/mailwrapper.h> 2#include <libmailwrapper/mailwrapper.h>
3 3
4#include <qcombobox.h> 4#include <qcombobox.h>
5#include <qcheckbox.h> 5#include <qcheckbox.h>
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <qpushbutton.h> 7#include <qpushbutton.h>
8#include <qlineedit.h> 8#include <qlineedit.h>
9#include <qlabel.h> 9#include <qlabel.h>
10#include <qtabwidget.h> 10#include <qtabwidget.h>
11#include <qlistview.h> 11#include <qlistview.h>
12#include <klocale.h> 12#include <klocale.h>
13selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, WFlags fl) 13selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, WFlags fl)
14 : selectstoreui(parent,name,modal,fl) 14 : selectstoreui(parent,name,modal,fl)
15{ 15{
16 //m_smtpList.setAutoDelete(false); 16 //m_smtpList.setAutoDelete(false);
17 m_smtpList = 0; 17 m_smtpList = 0;
18 //headlabel->setText(i18n("<center>Select SMTP account to use</center>")); 18 //headlabel->setText(i18n("<center>Select SMTP account to use</center>"));
19 headlabel->hide(); 19 headlabel->hide();
20 folderSelection->hide(); 20 folderSelection->hide();
21 folderLabel->hide(); 21 folderLabel->hide();
22 accountlabel->setText("<center>SMTP Accounts</center>"); 22 //accountlabel->setText(i18n("SMTP\nAccount:"));
23 Line1->hide(); 23 Line1->hide();
24 newFoldersel->hide(); 24 newFoldersel->hide();
25 newFolderedit->hide(); 25 newFolderedit->hide();
26 newFolderLabel->hide(); 26 newFolderLabel->hide();
27 Line2->hide(); 27 Line2->hide();
28 selMove->hide(); 28 selMove->hide();
29 m_current_smtp = 0; 29 m_current_smtp = 0;
30 setCaption(i18n("Select SMTP Account")); 30 setCaption(i18n("Select SMTP Account"));
31} 31}
32 32
33selectsmtp::~selectsmtp() 33selectsmtp::~selectsmtp()
34{ 34{
35} 35}
36 36
37void selectsmtp::slotAccountselected(int which) 37void selectsmtp::slotAccountselected(int which)
38{ 38{
39 if (!m_smtpList || (unsigned)which>=m_smtpList->count() || which < 0) { 39 if (!m_smtpList || (unsigned)which>=m_smtpList->count() || which < 0) {
40 m_current_smtp = 0; 40 m_current_smtp = 0;
41 return; 41 return;
42 } 42 }
43 m_current_smtp = m_smtpList->at(which); 43 m_current_smtp = m_smtpList->at(which);
44} 44}
45 45
46void selectsmtp::setSelectionlist(QList<SMTPaccount>*list) 46void selectsmtp::setSelectionlist(QList<SMTPaccount>*list)
47{ 47{
48 m_smtpList = list; 48 m_smtpList = list;
49 accountSelection->clear(); 49 accountSelection->clear();
50 if (!m_smtpList || m_smtpList->count()==0) { 50 if (!m_smtpList || m_smtpList->count()==0) {
51 accountSelection->setEnabled(false); 51 accountSelection->setEnabled(false);
52 return; 52 return;
53 } 53 }
54 accountSelection->setEnabled(true); 54 accountSelection->setEnabled(true);
55 for (unsigned i = 0; m_smtpList!=0 && i < m_smtpList->count(); ++i) { 55 for (unsigned i = 0; m_smtpList!=0 && i < m_smtpList->count(); ++i) {
56 accountSelection->insertItem( m_smtpList->at(i)->getAccountName()); 56 accountSelection->insertItem( m_smtpList->at(i)->getAccountName());
57 } 57 }
58 m_current_smtp = m_smtpList->at(0); 58 m_current_smtp = m_smtpList->at(0);
59} 59}
60 60
61SMTPaccount*selectsmtp::selected_smtp() 61SMTPaccount*selectsmtp::selected_smtp()
62{ 62{
63 return m_current_smtp; 63 return m_current_smtp;
64} 64}