author | zautrix <zautrix> | 2004-10-31 16:54:47 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-31 16:54:47 (UTC) |
commit | 3964a158be731f1bb244ca861262df5fa8d04cf3 (patch) (unidiff) | |
tree | fa4a8e9af345c144562be480f21df6e3d8d609c7 /kmicromail/editaccounts.cpp | |
parent | bed831cc1a38d38a4c5b9329bf37b1c663142c23 (diff) | |
download | kdepimpi-3964a158be731f1bb244ca861262df5fa8d04cf3.zip kdepimpi-3964a158be731f1bb244ca861262df5fa8d04cf3.tar.gz kdepimpi-3964a158be731f1bb244ca861262df5fa8d04cf3.tar.bz2 |
changed showmaximized for desktop
-rw-r--r-- | kmicromail/editaccounts.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index 0d30097..48c3963 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp | |||
@@ -14,193 +14,196 @@ | |||
14 | #include <qmessagebox.h> | 14 | #include <qmessagebox.h> |
15 | #include <qpushbutton.h> | 15 | #include <qpushbutton.h> |
16 | #include <qlineedit.h> | 16 | #include <qlineedit.h> |
17 | #include <qlabel.h> | 17 | #include <qlabel.h> |
18 | #include <qtabwidget.h> | 18 | #include <qtabwidget.h> |
19 | #include <qlistview.h> | 19 | #include <qlistview.h> |
20 | #include <qspinbox.h> | 20 | #include <qspinbox.h> |
21 | #include <klocale.h> | 21 | #include <klocale.h> |
22 | 22 | ||
23 | #include <libmailwrapper/nntpwrapper.h> | 23 | #include <libmailwrapper/nntpwrapper.h> |
24 | 24 | ||
25 | using namespace Opie::Core; | 25 | using namespace Opie::Core; |
26 | 26 | ||
27 | AccountListItem::AccountListItem( QListView *parent, Account *a) | 27 | AccountListItem::AccountListItem( QListView *parent, Account *a) |
28 | : QListViewItem( parent ) | 28 | : QListViewItem( parent ) |
29 | { | 29 | { |
30 | account = a; | 30 | account = a; |
31 | setText( 0, account->getAccountName() ); | 31 | setText( 0, account->getAccountName() ); |
32 | QString ttext = ""; | 32 | QString ttext = ""; |
33 | switch (account->getType()) { | 33 | switch (account->getType()) { |
34 | case MAILLIB::A_NNTP: | 34 | case MAILLIB::A_NNTP: |
35 | ttext="NNTP"; | 35 | ttext="NNTP"; |
36 | break; | 36 | break; |
37 | case MAILLIB::A_POP3: | 37 | case MAILLIB::A_POP3: |
38 | ttext = "POP3"; | 38 | ttext = "POP3"; |
39 | break; | 39 | break; |
40 | case MAILLIB::A_IMAP: | 40 | case MAILLIB::A_IMAP: |
41 | ttext = "IMAP"; | 41 | ttext = "IMAP"; |
42 | break; | 42 | break; |
43 | case MAILLIB::A_SMTP: | 43 | case MAILLIB::A_SMTP: |
44 | ttext = "SMTP"; | 44 | ttext = "SMTP"; |
45 | break; | 45 | break; |
46 | default: | 46 | default: |
47 | ttext = "UNKNOWN"; | 47 | ttext = "UNKNOWN"; |
48 | break; | 48 | break; |
49 | } | 49 | } |
50 | setText( 1, ttext); | 50 | setText( 1, ttext); |
51 | } | 51 | } |
52 | 52 | ||
53 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) | 53 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) |
54 | : EditAccountsUI( parent, name, modal, flags ) | 54 | : EditAccountsUI( parent, name, modal, flags ) |
55 | { | 55 | { |
56 | settings = s; | 56 | settings = s; |
57 | 57 | ||
58 | mailList->addColumn( i18n( "Account" ) ); | 58 | mailList->addColumn( i18n( "Account" ) ); |
59 | mailList->addColumn( i18n( "Type" ) ); | 59 | mailList->addColumn( i18n( "Type" ) ); |
60 | 60 | ||
61 | newsList->addColumn( i18n( "Account" ) ); | 61 | newsList->addColumn( i18n( "Account" ) ); |
62 | 62 | ||
63 | connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); | 63 | connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); |
64 | connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); | 64 | connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); |
65 | connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); | 65 | connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); |
66 | connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) ); | 66 | connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) ); |
67 | connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) ); | 67 | connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) ); |
68 | connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) ); | 68 | connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) ); |
69 | 69 | ||
70 | slotFillLists(); | 70 | slotFillLists(); |
71 | } | 71 | } |
72 | 72 | ||
73 | void EditAccounts::slotFillLists() | 73 | void EditAccounts::slotFillLists() |
74 | { | 74 | { |
75 | mailList->clear(); | 75 | mailList->clear(); |
76 | newsList->clear(); | 76 | newsList->clear(); |
77 | 77 | ||
78 | QList<Account> accounts = settings->getAccounts(); | 78 | QList<Account> accounts = settings->getAccounts(); |
79 | Account *it; | 79 | Account *it; |
80 | for ( it = accounts.first(); it; it = accounts.next() ) | 80 | for ( it = accounts.first(); it; it = accounts.next() ) |
81 | { | 81 | { |
82 | if ( it->getType()==MAILLIB::A_NNTP ) | 82 | if ( it->getType()==MAILLIB::A_NNTP ) |
83 | { | 83 | { |
84 | (void) new AccountListItem( newsList, it ); | 84 | (void) new AccountListItem( newsList, it ); |
85 | } | 85 | } |
86 | else | 86 | else |
87 | { | 87 | { |
88 | (void) new AccountListItem( mailList, it ); | 88 | (void) new AccountListItem( mailList, it ); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | } | 91 | } |
92 | 92 | ||
93 | void EditAccounts::slotNewMail() | 93 | void EditAccounts::slotNewMail() |
94 | { | 94 | { |
95 | QString *selection = new QString(); | 95 | QString *selection = new QString(); |
96 | SelectMailType selType( selection, this, 0, true ); | 96 | SelectMailType selType( selection, this, 0, true ); |
97 | selType.show(); | 97 | selType.show(); |
98 | if ( QDialog::Accepted == selType.exec() ) | 98 | if ( QDialog::Accepted == selType.exec() ) |
99 | { | 99 | { |
100 | slotNewAccount( *selection ); | 100 | slotNewAccount( *selection ); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | void EditAccounts::slotNewAccount( const QString &type ) | 104 | void EditAccounts::slotNewAccount( const QString &type ) |
105 | { | 105 | { |
106 | if ( type.compare( i18n("IMAP") ) == 0 ) | 106 | if ( type.compare( i18n("IMAP") ) == 0 ) |
107 | { | 107 | { |
108 | IMAPaccount *account = new IMAPaccount(); | 108 | IMAPaccount *account = new IMAPaccount(); |
109 | IMAPconfig imap( account, this, 0, true ); | 109 | IMAPconfig imap( account, this, 0, true ); |
110 | |||
111 | #ifndef DESKTOP_VERSION | ||
110 | imap.showMaximized(); | 112 | imap.showMaximized(); |
113 | #endif | ||
111 | if ( QDialog::Accepted == imap.exec() ) | 114 | if ( QDialog::Accepted == imap.exec() ) |
112 | { | 115 | { |
113 | settings->addAccount( account ); | 116 | settings->addAccount( account ); |
114 | account->save(); | 117 | account->save(); |
115 | slotFillLists(); | 118 | slotFillLists(); |
116 | } | 119 | } |
117 | else | 120 | else |
118 | { | 121 | { |
119 | account->remove(); | 122 | account->remove(); |
120 | } | 123 | } |
121 | } | 124 | } |
122 | else if ( type.compare( i18n("POP3") ) == 0 ) | 125 | else if ( type.compare( i18n("POP3") ) == 0 ) |
123 | { | 126 | { |
124 | POP3account *account = new POP3account(); | 127 | POP3account *account = new POP3account(); |
125 | POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); | 128 | POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); |
126 | if ( QDialog::Accepted == KApplication::execDialog( &pop3 ) ) | 129 | if ( QDialog::Accepted == KApplication::execDialog( &pop3 ) ) |
127 | { | 130 | { |
128 | settings->addAccount( account ); | 131 | settings->addAccount( account ); |
129 | account->save(); | 132 | account->save(); |
130 | slotFillLists(); | 133 | slotFillLists(); |
131 | } | 134 | } |
132 | else | 135 | else |
133 | { | 136 | { |
134 | account->remove(); | 137 | account->remove(); |
135 | } | 138 | } |
136 | } | 139 | } |
137 | else if ( type.compare( i18n("SMTP") ) == 0 ) | 140 | else if ( type.compare( i18n("SMTP") ) == 0 ) |
138 | { | 141 | { |
139 | SMTPaccount *account = new SMTPaccount(); | 142 | SMTPaccount *account = new SMTPaccount(); |
140 | SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp ); | 143 | SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp ); |
141 | if ( QDialog::Accepted == KApplication::execDialog( &smtp ) ) | 144 | if ( QDialog::Accepted == KApplication::execDialog( &smtp ) ) |
142 | { | 145 | { |
143 | settings->addAccount( account ); | 146 | settings->addAccount( account ); |
144 | account->save(); | 147 | account->save(); |
145 | slotFillLists(); | 148 | slotFillLists(); |
146 | 149 | ||
147 | } | 150 | } |
148 | else | 151 | else |
149 | { | 152 | { |
150 | account->remove(); | 153 | account->remove(); |
151 | } | 154 | } |
152 | } | 155 | } |
153 | else if ( type.compare( i18n("NNTP") ) == 0 ) | 156 | else if ( type.compare( i18n("NNTP") ) == 0 ) |
154 | { | 157 | { |
155 | NNTPaccount *account = new NNTPaccount(); | 158 | NNTPaccount *account = new NNTPaccount(); |
156 | NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp ); | 159 | NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp ); |
157 | if ( QDialog::Accepted == KApplication::execDialog( &nntp ) ) | 160 | if ( QDialog::Accepted == KApplication::execDialog( &nntp ) ) |
158 | { | 161 | { |
159 | settings->addAccount( account ); | 162 | settings->addAccount( account ); |
160 | account->save(); | 163 | account->save(); |
161 | slotFillLists(); | 164 | slotFillLists(); |
162 | } | 165 | } |
163 | else | 166 | else |
164 | { | 167 | { |
165 | account->remove(); | 168 | account->remove(); |
166 | } | 169 | } |
167 | } | 170 | } |
168 | } | 171 | } |
169 | 172 | ||
170 | void EditAccounts::slotEditAccount( Account *account ) | 173 | void EditAccounts::slotEditAccount( Account *account ) |
171 | { | 174 | { |
172 | if ( account->getType() == MAILLIB::A_IMAP ) | 175 | if ( account->getType() == MAILLIB::A_IMAP ) |
173 | { | 176 | { |
174 | IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); | 177 | IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); |
175 | IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp ); | 178 | IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp ); |
176 | if ( QDialog::Accepted == KApplication::execDialog( &imap ) ) | 179 | if ( QDialog::Accepted == KApplication::execDialog( &imap ) ) |
177 | { | 180 | { |
178 | slotFillLists(); | 181 | slotFillLists(); |
179 | } | 182 | } |
180 | } | 183 | } |
181 | else if ( account->getType()==MAILLIB::A_POP3 ) | 184 | else if ( account->getType()==MAILLIB::A_POP3 ) |
182 | { | 185 | { |
183 | POP3account *pop3Acc = static_cast<POP3account *>(account); | 186 | POP3account *pop3Acc = static_cast<POP3account *>(account); |
184 | POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp ); | 187 | POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp ); |
185 | if ( QDialog::Accepted == KApplication::execDialog( &pop3 ) ) | 188 | if ( QDialog::Accepted == KApplication::execDialog( &pop3 ) ) |
186 | { | 189 | { |
187 | slotFillLists(); | 190 | slotFillLists(); |
188 | } | 191 | } |
189 | } | 192 | } |
190 | else if ( account->getType()==MAILLIB::A_SMTP ) | 193 | else if ( account->getType()==MAILLIB::A_SMTP ) |
191 | { | 194 | { |
192 | SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); | 195 | SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); |
193 | SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp ); | 196 | SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp ); |
194 | if ( QDialog::Accepted == KApplication::execDialog( &smtp ) ) | 197 | if ( QDialog::Accepted == KApplication::execDialog( &smtp ) ) |
195 | { | 198 | { |
196 | slotFillLists(); | 199 | slotFillLists(); |
197 | } | 200 | } |
198 | } | 201 | } |
199 | else if ( account->getType()==MAILLIB::A_NNTP) | 202 | else if ( account->getType()==MAILLIB::A_NNTP) |
200 | { | 203 | { |
201 | NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); | 204 | NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); |
202 | NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); | 205 | NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); |
203 | if ( QDialog::Accepted == KApplication::execDialog( &nntp ) ) | 206 | if ( QDialog::Accepted == KApplication::execDialog( &nntp ) ) |
204 | { | 207 | { |
205 | slotFillLists(); | 208 | slotFillLists(); |
206 | } | 209 | } |