summaryrefslogtreecommitdiffabout
path: root/kmicromail/editaccounts.cpp
authorzautrix <zautrix>2004-10-30 15:56:24 (UTC)
committer zautrix <zautrix>2004-10-30 15:56:24 (UTC)
commitc8662dc632987a317386b923e24acb9507859528 (patch) (unidiff)
tree97ca9b266d075c3c0f2689769829c453f8118cd8 /kmicromail/editaccounts.cpp
parent632b43950f1ac2980c281eb8901d797deb0ba971 (diff)
downloadkdepimpi-c8662dc632987a317386b923e24acb9507859528.zip
kdepimpi-c8662dc632987a317386b923e24acb9507859528.tar.gz
kdepimpi-c8662dc632987a317386b923e24acb9507859528.tar.bz2
ompi desktop compile hack
Diffstat (limited to 'kmicromail/editaccounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/editaccounts.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp
index c931e45..0d30097 100644
--- a/kmicromail/editaccounts.cpp
+++ b/kmicromail/editaccounts.cpp
@@ -1,132 +1,133 @@
1 1
2#include <qdialog.h>
3#include "kapplication.h"
2#include "defines.h" 4#include "defines.h"
3#include "editaccounts.h" 5#include "editaccounts.h"
4#include "kapplication.h"
5/* OPIE */ 6/* OPIE */
6#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
7 8
8/* QT */ 9/* QT */
9#include <qstringlist.h> 10#include <qstringlist.h>
10 11
11#include <qcombobox.h> 12#include <qcombobox.h>
12#include <qcheckbox.h> 13#include <qcheckbox.h>
13#include <qmessagebox.h> 14#include <qmessagebox.h>
14#include <qpushbutton.h> 15#include <qpushbutton.h>
15#include <qlineedit.h> 16#include <qlineedit.h>
16#include <qlabel.h> 17#include <qlabel.h>
17#include <qtabwidget.h> 18#include <qtabwidget.h>
18#include <qlistview.h> 19#include <qlistview.h>
19#include <qspinbox.h> 20#include <qspinbox.h>
20#include <klocale.h> 21#include <klocale.h>
21 22
22#include <libmailwrapper/nntpwrapper.h> 23#include <libmailwrapper/nntpwrapper.h>
23 24
24using namespace Opie::Core; 25using namespace Opie::Core;
25 26
26AccountListItem::AccountListItem( QListView *parent, Account *a) 27AccountListItem::AccountListItem( QListView *parent, Account *a)
27 : QListViewItem( parent ) 28 : QListViewItem( parent )
28{ 29{
29 account = a; 30 account = a;
30 setText( 0, account->getAccountName() ); 31 setText( 0, account->getAccountName() );
31 QString ttext = ""; 32 QString ttext = "";
32 switch (account->getType()) { 33 switch (account->getType()) {
33 case MAILLIB::A_NNTP: 34 case MAILLIB::A_NNTP:
34 ttext="NNTP"; 35 ttext="NNTP";
35 break; 36 break;
36 case MAILLIB::A_POP3: 37 case MAILLIB::A_POP3:
37 ttext = "POP3"; 38 ttext = "POP3";
38 break; 39 break;
39 case MAILLIB::A_IMAP: 40 case MAILLIB::A_IMAP:
40 ttext = "IMAP"; 41 ttext = "IMAP";
41 break; 42 break;
42 case MAILLIB::A_SMTP: 43 case MAILLIB::A_SMTP:
43 ttext = "SMTP"; 44 ttext = "SMTP";
44 break; 45 break;
45 default: 46 default:
46 ttext = "UNKNOWN"; 47 ttext = "UNKNOWN";
47 break; 48 break;
48 } 49 }
49 setText( 1, ttext); 50 setText( 1, ttext);
50} 51}
51 52
52EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 53EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
53 : EditAccountsUI( parent, name, modal, flags ) 54 : EditAccountsUI( parent, name, modal, flags )
54{ 55{
55 settings = s; 56 settings = s;
56 57
57 mailList->addColumn( i18n( "Account" ) ); 58 mailList->addColumn( i18n( "Account" ) );
58 mailList->addColumn( i18n( "Type" ) ); 59 mailList->addColumn( i18n( "Type" ) );
59 60
60 newsList->addColumn( i18n( "Account" ) ); 61 newsList->addColumn( i18n( "Account" ) );
61 62
62 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); 63 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) );
63 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); 64 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) );
64 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); 65 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) );
65 connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) ); 66 connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) );
66 connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) ); 67 connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) );
67 connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) ); 68 connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) );
68 69
69 slotFillLists(); 70 slotFillLists();
70} 71}
71 72
72void EditAccounts::slotFillLists() 73void EditAccounts::slotFillLists()
73{ 74{
74 mailList->clear(); 75 mailList->clear();
75 newsList->clear(); 76 newsList->clear();
76 77
77 QList<Account> accounts = settings->getAccounts(); 78 QList<Account> accounts = settings->getAccounts();
78 Account *it; 79 Account *it;
79 for ( it = accounts.first(); it; it = accounts.next() ) 80 for ( it = accounts.first(); it; it = accounts.next() )
80 { 81 {
81 if ( it->getType()==MAILLIB::A_NNTP ) 82 if ( it->getType()==MAILLIB::A_NNTP )
82 { 83 {
83 (void) new AccountListItem( newsList, it ); 84 (void) new AccountListItem( newsList, it );
84 } 85 }
85 else 86 else
86 { 87 {
87 (void) new AccountListItem( mailList, it ); 88 (void) new AccountListItem( mailList, it );
88 } 89 }
89 } 90 }
90} 91}
91 92
92void EditAccounts::slotNewMail() 93void EditAccounts::slotNewMail()
93{ 94{
94 QString *selection = new QString(); 95 QString *selection = new QString();
95 SelectMailType selType( selection, this, 0, true ); 96 SelectMailType selType( selection, this, 0, true );
96 selType.show(); 97 selType.show();
97 if ( QDialog::Accepted == selType.exec() ) 98 if ( QDialog::Accepted == selType.exec() )
98 { 99 {
99 slotNewAccount( *selection ); 100 slotNewAccount( *selection );
100 } 101 }
101} 102}
102 103
103void EditAccounts::slotNewAccount( const QString &type ) 104void EditAccounts::slotNewAccount( const QString &type )
104{ 105{
105 if ( type.compare( i18n("IMAP") ) == 0 ) 106 if ( type.compare( i18n("IMAP") ) == 0 )
106 { 107 {
107 IMAPaccount *account = new IMAPaccount(); 108 IMAPaccount *account = new IMAPaccount();
108 IMAPconfig imap( account, this, 0, true ); 109 IMAPconfig imap( account, this, 0, true );
109 imap.showMaximized(); 110 imap.showMaximized();
110 if ( QDialog::Accepted == imap.exec() ) 111 if ( QDialog::Accepted == imap.exec() )
111 { 112 {
112 settings->addAccount( account ); 113 settings->addAccount( account );
113 account->save(); 114 account->save();
114 slotFillLists(); 115 slotFillLists();
115 } 116 }
116 else 117 else
117 { 118 {
118 account->remove(); 119 account->remove();
119 } 120 }
120 } 121 }
121 else if ( type.compare( i18n("POP3") ) == 0 ) 122 else if ( type.compare( i18n("POP3") ) == 0 )
122 { 123 {
123 POP3account *account = new POP3account(); 124 POP3account *account = new POP3account();
124 POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); 125 POP3config pop3( account, this, 0, true, WStyle_ContextHelp );
125 if ( QDialog::Accepted == KApplication::execDialog( &pop3 ) ) 126 if ( QDialog::Accepted == KApplication::execDialog( &pop3 ) )
126 { 127 {
127 settings->addAccount( account ); 128 settings->addAccount( account );
128 account->save(); 129 account->save();
129 slotFillLists(); 130 slotFillLists();
130 } 131 }
131 else 132 else
132 { 133 {