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