summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/selectsmtp.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/net/mail/selectsmtp.cpp b/noncore/net/mail/selectsmtp.cpp
index e82c6ca..79b10ef 100644
--- a/noncore/net/mail/selectsmtp.cpp
+++ b/noncore/net/mail/selectsmtp.cpp
@@ -1,56 +1,62 @@
1#include "selectsmtp.h" 1#include "selectsmtp.h"
2#include <libmailwrapper/mailwrapper.h> 2#include <libmailwrapper/mailwrapper.h>
3#include <qlist.h> 3#include <qlist.h>
4#include <qlabel.h> 4#include <qlabel.h>
5#include <qlayout.h> 5#include <qlayout.h>
6#include <qcheckbox.h> 6#include <qcheckbox.h>
7#include <qframe.h> 7#include <qframe.h>
8#include <qlineedit.h> 8#include <qlineedit.h>
9#include <qcombobox.h> 9#include <qcombobox.h>
10 10
11selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, WFlags fl) 11selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, WFlags fl)
12 : selectstoreui(parent,name,modal,fl) 12 : selectstoreui(parent,name,modal,fl)
13{ 13{
14 //m_smtpList.setAutoDelete(false); 14 //m_smtpList.setAutoDelete(false);
15 m_smtpList = 0; 15 m_smtpList = 0;
16 //headlabel->setText(tr("<center>Select SMTP account to use</center>")); 16 //headlabel->setText(tr("<center>Select SMTP account to use</center>"));
17 headlabel->hide(); 17 headlabel->hide();
18 folderSelection->hide(); 18 folderSelection->hide();
19 folderLabel->hide(); 19 folderLabel->hide();
20 accountlabel->setText("<center>SMTP Accounts</center>"); 20 accountlabel->setText("<center>SMTP Accounts</center>");
21 Line1->hide(); 21 Line1->hide();
22 newFoldersel->hide(); 22 newFoldersel->hide();
23 newFolderedit->hide(); 23 newFolderedit->hide();
24 newFolderLabel->hide(); 24 newFolderLabel->hide();
25 Line2->hide(); 25 Line2->hide();
26 selMove->hide(); 26 selMove->hide();
27 m_current_smtp = 0; 27 m_current_smtp = 0;
28 setCaption(tr("Select SMTP Account")); 28 setCaption(tr("Select SMTP Account"));
29} 29}
30 30
31selectsmtp::~selectsmtp() 31selectsmtp::~selectsmtp()
32{ 32{
33} 33}
34 34
35void selectsmtp::slotAccountselected(int which) 35void selectsmtp::slotAccountselected(int which)
36{ 36{
37 if (!m_smtpList || (unsigned)which>=m_smtpList->count() || which < 0) { 37 if (!m_smtpList || (unsigned)which>=m_smtpList->count() || which < 0) {
38 m_current_smtp = 0; 38 m_current_smtp = 0;
39 return; 39 return;
40 } 40 }
41 m_current_smtp = m_smtpList->at(which); 41 m_current_smtp = m_smtpList->at(which);
42} 42}
43 43
44void selectsmtp::setSelectionlist(QList<SMTPaccount>*list) 44void selectsmtp::setSelectionlist(QList<SMTPaccount>*list)
45{ 45{
46 m_smtpList = list; 46 m_smtpList = list;
47 accountSelection->clear(); 47 accountSelection->clear();
48 if (!m_smtpList || m_smtpList->count()==0) {
49 accountSelection->setEnabled(false);
50 return;
51 }
52 accountSelection->setEnabled(true);
48 for (unsigned i = 0; m_smtpList!=0 && i < m_smtpList->count(); ++i) { 53 for (unsigned i = 0; m_smtpList!=0 && i < m_smtpList->count(); ++i) {
49 accountSelection->insertItem( m_smtpList->at(i)->getAccountName()); 54 accountSelection->insertItem( m_smtpList->at(i)->getAccountName());
50 } 55 }
56 m_current_smtp = m_smtpList->at(0);
51} 57}
52 58
53SMTPaccount*selectsmtp::selected_smtp() 59SMTPaccount*selectsmtp::selected_smtp()
54{ 60{
55 return m_current_smtp; 61 return m_current_smtp;
56} 62}