author | zautrix <zautrix> | 2004-09-10 22:52:50 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-10 22:52:50 (UTC) |
commit | 1b41a0e3bf63364940daf132446939e3570c57ad (patch) (unidiff) | |
tree | 81db8e427beadcf3bbd5356962b5d08b970a87e4 | |
parent | c280882f788b31f874f928e23fc29c2aaca991eb (diff) | |
download | kdepimpi-1b41a0e3bf63364940daf132446939e3570c57ad.zip kdepimpi-1b41a0e3bf63364940daf132446939e3570c57ad.tar.gz kdepimpi-1b41a0e3bf63364940daf132446939e3570c57ad.tar.bz2 |
Added pop3 settings
-rw-r--r-- | kmicromail/editaccounts.cpp | 12 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/pop3wrapper.cpp | 2 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.cpp | 10 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.h | 9 | ||||
-rw-r--r-- | kmicromail/pop3configui.ui | 94 |
5 files changed, 122 insertions, 5 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index d272c3b..e7d2750 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp | |||
@@ -1,594 +1,606 @@ | |||
1 | 1 | ||
2 | #include "defines.h" | 2 | #include "defines.h" |
3 | #include "editaccounts.h" | 3 | #include "editaccounts.h" |
4 | #include "kapplication.h" | 4 | #include "kapplication.h" |
5 | /* OPIE */ | 5 | /* OPIE */ |
6 | #include <qpe/qpeapplication.h> | 6 | #include <qpe/qpeapplication.h> |
7 | 7 | ||
8 | /* QT */ | 8 | /* QT */ |
9 | #include <qstringlist.h> | 9 | #include <qstringlist.h> |
10 | 10 | ||
11 | #include <qcombobox.h> | 11 | #include <qcombobox.h> |
12 | #include <qcheckbox.h> | 12 | #include <qcheckbox.h> |
13 | #include <qmessagebox.h> | 13 | #include <qmessagebox.h> |
14 | #include <qpushbutton.h> | 14 | #include <qpushbutton.h> |
15 | #include <qlineedit.h> | 15 | #include <qlineedit.h> |
16 | #include <qlabel.h> | 16 | #include <qlabel.h> |
17 | #include <qtabwidget.h> | 17 | #include <qtabwidget.h> |
18 | #include <qlistview.h> | 18 | #include <qlistview.h> |
19 | #include <qspinbox.h> | ||
19 | 20 | ||
20 | #include <libmailwrapper/nntpwrapper.h> | 21 | #include <libmailwrapper/nntpwrapper.h> |
21 | 22 | ||
22 | using namespace Opie::Core; | 23 | using namespace Opie::Core; |
23 | 24 | ||
24 | AccountListItem::AccountListItem( QListView *parent, Account *a) | 25 | AccountListItem::AccountListItem( QListView *parent, Account *a) |
25 | : QListViewItem( parent ) | 26 | : QListViewItem( parent ) |
26 | { | 27 | { |
27 | account = a; | 28 | account = a; |
28 | setText( 0, account->getAccountName() ); | 29 | setText( 0, account->getAccountName() ); |
29 | QString ttext = ""; | 30 | QString ttext = ""; |
30 | switch (account->getType()) { | 31 | switch (account->getType()) { |
31 | case MAILLIB::A_NNTP: | 32 | case MAILLIB::A_NNTP: |
32 | ttext="NNTP"; | 33 | ttext="NNTP"; |
33 | break; | 34 | break; |
34 | case MAILLIB::A_POP3: | 35 | case MAILLIB::A_POP3: |
35 | ttext = "POP3"; | 36 | ttext = "POP3"; |
36 | break; | 37 | break; |
37 | case MAILLIB::A_IMAP: | 38 | case MAILLIB::A_IMAP: |
38 | ttext = "IMAP"; | 39 | ttext = "IMAP"; |
39 | break; | 40 | break; |
40 | case MAILLIB::A_SMTP: | 41 | case MAILLIB::A_SMTP: |
41 | ttext = "SMTP"; | 42 | ttext = "SMTP"; |
42 | break; | 43 | break; |
43 | default: | 44 | default: |
44 | ttext = "UNKNOWN"; | 45 | ttext = "UNKNOWN"; |
45 | break; | 46 | break; |
46 | } | 47 | } |
47 | setText( 1, ttext); | 48 | setText( 1, ttext); |
48 | } | 49 | } |
49 | 50 | ||
50 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) | 51 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) |
51 | : EditAccountsUI( parent, name, modal, flags ) | 52 | : EditAccountsUI( parent, name, modal, flags ) |
52 | { | 53 | { |
53 | settings = s; | 54 | settings = s; |
54 | 55 | ||
55 | mailList->addColumn( tr( "Account" ) ); | 56 | mailList->addColumn( tr( "Account" ) ); |
56 | mailList->addColumn( tr( "Type" ) ); | 57 | mailList->addColumn( tr( "Type" ) ); |
57 | 58 | ||
58 | newsList->addColumn( tr( "Account" ) ); | 59 | newsList->addColumn( tr( "Account" ) ); |
59 | 60 | ||
60 | connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); | 61 | connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); |
61 | connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); | 62 | connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); |
62 | connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); | 63 | connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); |
63 | connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) ); | 64 | connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) ); |
64 | connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) ); | 65 | connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) ); |
65 | connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) ); | 66 | connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) ); |
66 | 67 | ||
67 | slotFillLists(); | 68 | slotFillLists(); |
68 | } | 69 | } |
69 | 70 | ||
70 | void EditAccounts::slotFillLists() | 71 | void EditAccounts::slotFillLists() |
71 | { | 72 | { |
72 | mailList->clear(); | 73 | mailList->clear(); |
73 | newsList->clear(); | 74 | newsList->clear(); |
74 | 75 | ||
75 | QList<Account> accounts = settings->getAccounts(); | 76 | QList<Account> accounts = settings->getAccounts(); |
76 | Account *it; | 77 | Account *it; |
77 | for ( it = accounts.first(); it; it = accounts.next() ) | 78 | for ( it = accounts.first(); it; it = accounts.next() ) |
78 | { | 79 | { |
79 | if ( it->getType()==MAILLIB::A_NNTP ) | 80 | if ( it->getType()==MAILLIB::A_NNTP ) |
80 | { | 81 | { |
81 | (void) new AccountListItem( newsList, it ); | 82 | (void) new AccountListItem( newsList, it ); |
82 | } | 83 | } |
83 | else | 84 | else |
84 | { | 85 | { |
85 | (void) new AccountListItem( mailList, it ); | 86 | (void) new AccountListItem( mailList, it ); |
86 | } | 87 | } |
87 | } | 88 | } |
88 | } | 89 | } |
89 | 90 | ||
90 | void EditAccounts::slotNewMail() | 91 | void EditAccounts::slotNewMail() |
91 | { | 92 | { |
92 | QString *selection = new QString(); | 93 | QString *selection = new QString(); |
93 | SelectMailType selType( selection, this, 0, true ); | 94 | SelectMailType selType( selection, this, 0, true ); |
94 | selType.show(); | 95 | selType.show(); |
95 | if ( QDialog::Accepted == selType.exec() ) | 96 | if ( QDialog::Accepted == selType.exec() ) |
96 | { | 97 | { |
97 | slotNewAccount( *selection ); | 98 | slotNewAccount( *selection ); |
98 | } | 99 | } |
99 | } | 100 | } |
100 | 101 | ||
101 | void EditAccounts::slotNewAccount( const QString &type ) | 102 | void EditAccounts::slotNewAccount( const QString &type ) |
102 | { | 103 | { |
103 | if ( type.compare( "IMAP" ) == 0 ) | 104 | if ( type.compare( "IMAP" ) == 0 ) |
104 | { | 105 | { |
105 | IMAPaccount *account = new IMAPaccount(); | 106 | IMAPaccount *account = new IMAPaccount(); |
106 | IMAPconfig imap( account, this, 0, true ); | 107 | IMAPconfig imap( account, this, 0, true ); |
107 | imap.showMaximized(); | 108 | imap.showMaximized(); |
108 | if ( QDialog::Accepted == imap.exec() ) | 109 | if ( QDialog::Accepted == imap.exec() ) |
109 | { | 110 | { |
110 | settings->addAccount( account ); | 111 | settings->addAccount( account ); |
111 | account->save(); | 112 | account->save(); |
112 | slotFillLists(); | 113 | slotFillLists(); |
113 | } | 114 | } |
114 | else | 115 | else |
115 | { | 116 | { |
116 | account->remove(); | 117 | account->remove(); |
117 | } | 118 | } |
118 | } | 119 | } |
119 | else if ( type.compare( "POP3" ) == 0 ) | 120 | else if ( type.compare( "POP3" ) == 0 ) |
120 | { | 121 | { |
121 | POP3account *account = new POP3account(); | 122 | POP3account *account = new POP3account(); |
122 | POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); | 123 | POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); |
123 | if ( QDialog::Accepted == KApplication::execDialog( &pop3 ) ) | 124 | if ( QDialog::Accepted == KApplication::execDialog( &pop3 ) ) |
124 | { | 125 | { |
125 | settings->addAccount( account ); | 126 | settings->addAccount( account ); |
126 | account->save(); | 127 | account->save(); |
127 | slotFillLists(); | 128 | slotFillLists(); |
128 | } | 129 | } |
129 | else | 130 | else |
130 | { | 131 | { |
131 | account->remove(); | 132 | account->remove(); |
132 | } | 133 | } |
133 | } | 134 | } |
134 | else if ( type.compare( "SMTP" ) == 0 ) | 135 | else if ( type.compare( "SMTP" ) == 0 ) |
135 | { | 136 | { |
136 | SMTPaccount *account = new SMTPaccount(); | 137 | SMTPaccount *account = new SMTPaccount(); |
137 | SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp ); | 138 | SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp ); |
138 | if ( QDialog::Accepted == KApplication::execDialog( &smtp ) ) | 139 | if ( QDialog::Accepted == KApplication::execDialog( &smtp ) ) |
139 | { | 140 | { |
140 | settings->addAccount( account ); | 141 | settings->addAccount( account ); |
141 | account->save(); | 142 | account->save(); |
142 | slotFillLists(); | 143 | slotFillLists(); |
143 | 144 | ||
144 | } | 145 | } |
145 | else | 146 | else |
146 | { | 147 | { |
147 | account->remove(); | 148 | account->remove(); |
148 | } | 149 | } |
149 | } | 150 | } |
150 | else if ( type.compare( "NNTP" ) == 0 ) | 151 | else if ( type.compare( "NNTP" ) == 0 ) |
151 | { | 152 | { |
152 | NNTPaccount *account = new NNTPaccount(); | 153 | NNTPaccount *account = new NNTPaccount(); |
153 | NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp ); | 154 | NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp ); |
154 | if ( QDialog::Accepted == KApplication::execDialog( &nntp ) ) | 155 | if ( QDialog::Accepted == KApplication::execDialog( &nntp ) ) |
155 | { | 156 | { |
156 | settings->addAccount( account ); | 157 | settings->addAccount( account ); |
157 | account->save(); | 158 | account->save(); |
158 | slotFillLists(); | 159 | slotFillLists(); |
159 | } | 160 | } |
160 | else | 161 | else |
161 | { | 162 | { |
162 | account->remove(); | 163 | account->remove(); |
163 | } | 164 | } |
164 | } | 165 | } |
165 | } | 166 | } |
166 | 167 | ||
167 | void EditAccounts::slotEditAccount( Account *account ) | 168 | void EditAccounts::slotEditAccount( Account *account ) |
168 | { | 169 | { |
169 | if ( account->getType() == MAILLIB::A_IMAP ) | 170 | if ( account->getType() == MAILLIB::A_IMAP ) |
170 | { | 171 | { |
171 | IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); | 172 | IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); |
172 | IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp ); | 173 | IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp ); |
173 | if ( QDialog::Accepted == KApplication::execDialog( &imap ) ) | 174 | if ( QDialog::Accepted == KApplication::execDialog( &imap ) ) |
174 | { | 175 | { |
175 | slotFillLists(); | 176 | slotFillLists(); |
176 | } | 177 | } |
177 | } | 178 | } |
178 | else if ( account->getType()==MAILLIB::A_POP3 ) | 179 | else if ( account->getType()==MAILLIB::A_POP3 ) |
179 | { | 180 | { |
180 | POP3account *pop3Acc = static_cast<POP3account *>(account); | 181 | POP3account *pop3Acc = static_cast<POP3account *>(account); |
181 | POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp ); | 182 | POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp ); |
182 | if ( QDialog::Accepted == KApplication::execDialog( &pop3 ) ) | 183 | if ( QDialog::Accepted == KApplication::execDialog( &pop3 ) ) |
183 | { | 184 | { |
184 | slotFillLists(); | 185 | slotFillLists(); |
185 | } | 186 | } |
186 | } | 187 | } |
187 | else if ( account->getType()==MAILLIB::A_SMTP ) | 188 | else if ( account->getType()==MAILLIB::A_SMTP ) |
188 | { | 189 | { |
189 | SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); | 190 | SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); |
190 | SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp ); | 191 | SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp ); |
191 | if ( QDialog::Accepted == KApplication::execDialog( &smtp ) ) | 192 | if ( QDialog::Accepted == KApplication::execDialog( &smtp ) ) |
192 | { | 193 | { |
193 | slotFillLists(); | 194 | slotFillLists(); |
194 | } | 195 | } |
195 | } | 196 | } |
196 | else if ( account->getType()==MAILLIB::A_NNTP) | 197 | else if ( account->getType()==MAILLIB::A_NNTP) |
197 | { | 198 | { |
198 | NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); | 199 | NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); |
199 | NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); | 200 | NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); |
200 | if ( QDialog::Accepted == KApplication::execDialog( &nntp ) ) | 201 | if ( QDialog::Accepted == KApplication::execDialog( &nntp ) ) |
201 | { | 202 | { |
202 | slotFillLists(); | 203 | slotFillLists(); |
203 | } | 204 | } |
204 | } | 205 | } |
205 | } | 206 | } |
206 | 207 | ||
207 | void EditAccounts::slotDeleteAccount( Account *account ) | 208 | void EditAccounts::slotDeleteAccount( Account *account ) |
208 | { | 209 | { |
209 | if ( QMessageBox::information( this, tr( "Question" ), | 210 | if ( QMessageBox::information( this, tr( "Question" ), |
210 | tr( "<p>Do you really want to delete the selected Account?</p>" ), | 211 | tr( "<p>Do you really want to delete the selected Account?</p>" ), |
211 | tr( "Yes" ), tr( "No" ) ) == 0 ) | 212 | tr( "Yes" ), tr( "No" ) ) == 0 ) |
212 | { | 213 | { |
213 | settings->delAccount( account ); | 214 | settings->delAccount( account ); |
214 | slotFillLists(); | 215 | slotFillLists(); |
215 | } | 216 | } |
216 | } | 217 | } |
217 | 218 | ||
218 | void EditAccounts::slotEditMail() | 219 | void EditAccounts::slotEditMail() |
219 | { | 220 | { |
220 | if ( !mailList->currentItem() ) | 221 | if ( !mailList->currentItem() ) |
221 | { | 222 | { |
222 | QMessageBox::information( this, tr( "Error" ), | 223 | QMessageBox::information( this, tr( "Error" ), |
223 | tr( "<p>Please select an account.</p>" ), | 224 | tr( "<p>Please select an account.</p>" ), |
224 | tr( "Ok" ) ); | 225 | tr( "Ok" ) ); |
225 | return; | 226 | return; |
226 | } | 227 | } |
227 | 228 | ||
228 | Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); | 229 | Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); |
229 | slotEditAccount( a ); | 230 | slotEditAccount( a ); |
230 | } | 231 | } |
231 | 232 | ||
232 | void EditAccounts::slotDeleteMail() | 233 | void EditAccounts::slotDeleteMail() |
233 | { | 234 | { |
234 | if ( !mailList->currentItem() ) | 235 | if ( !mailList->currentItem() ) |
235 | { | 236 | { |
236 | QMessageBox::information( this, tr( "Error" ), | 237 | QMessageBox::information( this, tr( "Error" ), |
237 | tr( "<p>Please select an account.</p>" ), | 238 | tr( "<p>Please select an account.</p>" ), |
238 | tr( "Ok" ) ); | 239 | tr( "Ok" ) ); |
239 | return; | 240 | return; |
240 | } | 241 | } |
241 | 242 | ||
242 | Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); | 243 | Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); |
243 | slotDeleteAccount( a ); | 244 | slotDeleteAccount( a ); |
244 | } | 245 | } |
245 | 246 | ||
246 | void EditAccounts::slotNewNews() | 247 | void EditAccounts::slotNewNews() |
247 | { | 248 | { |
248 | slotNewAccount( "NNTP" ); | 249 | slotNewAccount( "NNTP" ); |
249 | } | 250 | } |
250 | 251 | ||
251 | void EditAccounts::slotEditNews() | 252 | void EditAccounts::slotEditNews() |
252 | { | 253 | { |
253 | if ( !newsList->currentItem() ) | 254 | if ( !newsList->currentItem() ) |
254 | { | 255 | { |
255 | QMessageBox::information( this, tr( "Error" ), | 256 | QMessageBox::information( this, tr( "Error" ), |
256 | tr( "<p>Please select an account.</p>" ), | 257 | tr( "<p>Please select an account.</p>" ), |
257 | tr( "Ok" ) ); | 258 | tr( "Ok" ) ); |
258 | return; | 259 | return; |
259 | } | 260 | } |
260 | 261 | ||
261 | Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); | 262 | Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); |
262 | slotEditAccount( a ); | 263 | slotEditAccount( a ); |
263 | } | 264 | } |
264 | 265 | ||
265 | void EditAccounts::slotDeleteNews() | 266 | void EditAccounts::slotDeleteNews() |
266 | { | 267 | { |
267 | if ( !newsList->currentItem() ) | 268 | if ( !newsList->currentItem() ) |
268 | { | 269 | { |
269 | QMessageBox::information( this, tr( "Error" ), | 270 | QMessageBox::information( this, tr( "Error" ), |
270 | tr( "<p>Please select an account.</p>" ), | 271 | tr( "<p>Please select an account.</p>" ), |
271 | tr( "Ok" ) ); | 272 | tr( "Ok" ) ); |
272 | return; | 273 | return; |
273 | } | 274 | } |
274 | 275 | ||
275 | Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); | 276 | Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); |
276 | slotDeleteAccount( a ); | 277 | slotDeleteAccount( a ); |
277 | } | 278 | } |
278 | 279 | ||
279 | void EditAccounts::slotAdjustColumns() | 280 | void EditAccounts::slotAdjustColumns() |
280 | { | 281 | { |
281 | int currPage = configTab->currentPageIndex(); | 282 | int currPage = configTab->currentPageIndex(); |
282 | 283 | ||
283 | configTab->showPage( mailTab ); | 284 | configTab->showPage( mailTab ); |
284 | mailList->setColumnWidth( 0, mailList->visibleWidth() - 50 ); | 285 | mailList->setColumnWidth( 0, mailList->visibleWidth() - 50 ); |
285 | mailList->setColumnWidth( 1, 50 ); | 286 | mailList->setColumnWidth( 1, 50 ); |
286 | 287 | ||
287 | configTab->showPage( newsTab ); | 288 | configTab->showPage( newsTab ); |
288 | newsList->setColumnWidth( 0, newsList->visibleWidth() ); | 289 | newsList->setColumnWidth( 0, newsList->visibleWidth() ); |
289 | 290 | ||
290 | configTab->setCurrentPage( currPage ); | 291 | configTab->setCurrentPage( currPage ); |
291 | } | 292 | } |
292 | 293 | ||
293 | void EditAccounts::accept() | 294 | void EditAccounts::accept() |
294 | { | 295 | { |
295 | settings->saveAccounts(); | 296 | settings->saveAccounts(); |
296 | 297 | ||
297 | QDialog::accept(); | 298 | QDialog::accept(); |
298 | } | 299 | } |
299 | 300 | ||
300 | /** | 301 | /** |
301 | * SelectMailType | 302 | * SelectMailType |
302 | */ | 303 | */ |
303 | 304 | ||
304 | SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) | 305 | SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) |
305 | : SelectMailTypeUI( parent, name, modal, flags ) | 306 | : SelectMailTypeUI( parent, name, modal, flags ) |
306 | { | 307 | { |
307 | selected = selection; | 308 | selected = selection; |
308 | selected->replace( 0, selected->length(), typeBox->currentText() ); | 309 | selected->replace( 0, selected->length(), typeBox->currentText() ); |
309 | connect( typeBox, SIGNAL( activated(const QString&) ), SLOT( slotSelection(const QString&) ) ); | 310 | connect( typeBox, SIGNAL( activated(const QString&) ), SLOT( slotSelection(const QString&) ) ); |
310 | } | 311 | } |
311 | 312 | ||
312 | void SelectMailType::slotSelection( const QString &sel ) | 313 | void SelectMailType::slotSelection( const QString &sel ) |
313 | { | 314 | { |
314 | selected->replace( 0, selected->length(), sel ); | 315 | selected->replace( 0, selected->length(), sel ); |
315 | } | 316 | } |
316 | 317 | ||
317 | /** | 318 | /** |
318 | * IMAPconfig | 319 | * IMAPconfig |
319 | */ | 320 | */ |
320 | 321 | ||
321 | IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 322 | IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
322 | : IMAPconfigUI( parent, name, modal, flags ) | 323 | : IMAPconfigUI( parent, name, modal, flags ) |
323 | { | 324 | { |
324 | data = account; | 325 | data = account; |
325 | 326 | ||
326 | fillValues(); | 327 | fillValues(); |
327 | 328 | ||
328 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); | 329 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); |
329 | ComboBox1->insertItem( "Only if available", 0 ); | 330 | ComboBox1->insertItem( "Only if available", 0 ); |
330 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | 331 | ComboBox1->insertItem( "Always, Negotiated", 1 ); |
331 | ComboBox1->insertItem( "Connect on secure port", 2 ); | 332 | ComboBox1->insertItem( "Connect on secure port", 2 ); |
332 | ComboBox1->insertItem( "Run command instead", 3 ); | 333 | ComboBox1->insertItem( "Run command instead", 3 ); |
333 | CommandEdit->hide(); | 334 | CommandEdit->hide(); |
334 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 335 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
335 | } | 336 | } |
336 | 337 | ||
337 | void IMAPconfig::slotConnectionToggle( int index ) | 338 | void IMAPconfig::slotConnectionToggle( int index ) |
338 | { | 339 | { |
339 | if ( index == 2 ) | 340 | if ( index == 2 ) |
340 | { | 341 | { |
341 | portLine->setText( IMAP_SSL_PORT ); | 342 | portLine->setText( IMAP_SSL_PORT ); |
342 | } | 343 | } |
343 | else if ( index == 3 ) | 344 | else if ( index == 3 ) |
344 | { | 345 | { |
345 | portLine->setText( IMAP_PORT ); | 346 | portLine->setText( IMAP_PORT ); |
346 | CommandEdit->show(); | 347 | CommandEdit->show(); |
347 | } | 348 | } |
348 | else | 349 | else |
349 | { | 350 | { |
350 | portLine->setText( IMAP_PORT ); | 351 | portLine->setText( IMAP_PORT ); |
351 | } | 352 | } |
352 | } | 353 | } |
353 | 354 | ||
354 | void IMAPconfig::fillValues() | 355 | void IMAPconfig::fillValues() |
355 | { | 356 | { |
356 | accountLine->setText( data->getAccountName() ); | 357 | accountLine->setText( data->getAccountName() ); |
357 | serverLine->setText( data->getServer() ); | 358 | serverLine->setText( data->getServer() ); |
358 | portLine->setText( data->getPort() ); | 359 | portLine->setText( data->getPort() ); |
359 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 360 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
360 | userLine->setText( data->getUser() ); | 361 | userLine->setText( data->getUser() ); |
361 | passLine->setText( data->getPassword() ); | 362 | passLine->setText( data->getPassword() ); |
362 | prefixLine->setText(data->getPrefix()); | 363 | prefixLine->setText(data->getPrefix()); |
363 | } | 364 | } |
364 | 365 | ||
365 | void IMAPconfig::accept() | 366 | void IMAPconfig::accept() |
366 | { | 367 | { |
367 | data->setAccountName( accountLine->text() ); | 368 | data->setAccountName( accountLine->text() ); |
368 | data->setServer( serverLine->text() ); | 369 | data->setServer( serverLine->text() ); |
369 | data->setPort( portLine->text() ); | 370 | data->setPort( portLine->text() ); |
370 | data->setConnectionType( ComboBox1->currentItem() ); | 371 | data->setConnectionType( ComboBox1->currentItem() ); |
371 | data->setUser( userLine->text() ); | 372 | data->setUser( userLine->text() ); |
372 | data->setPassword( passLine->text() ); | 373 | data->setPassword( passLine->text() ); |
373 | data->setPrefix(prefixLine->text()); | 374 | data->setPrefix(prefixLine->text()); |
374 | 375 | ||
375 | QDialog::accept(); | 376 | QDialog::accept(); |
376 | } | 377 | } |
377 | 378 | ||
378 | /** | 379 | /** |
379 | * POP3config | 380 | * POP3config |
380 | */ | 381 | */ |
381 | 382 | ||
382 | POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 383 | POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
383 | : POP3configUI( parent, name, modal, flags ) | 384 | : POP3configUI( parent, name, modal, flags ) |
384 | { | 385 | { |
385 | data = account; | 386 | data = account; |
386 | fillValues(); | 387 | fillValues(); |
387 | 388 | ||
388 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); | 389 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); |
389 | ComboBox1->insertItem( "Only if available", 0 ); | 390 | ComboBox1->insertItem( "Only if available", 0 ); |
390 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | 391 | ComboBox1->insertItem( "Always, Negotiated", 1 ); |
391 | ComboBox1->insertItem( "Connect on secure port", 2 ); | 392 | ComboBox1->insertItem( "Connect on secure port", 2 ); |
392 | ComboBox1->insertItem( "Run command instead", 3 ); | 393 | ComboBox1->insertItem( "Run command instead", 3 ); |
393 | CommandEdit->hide(); | 394 | CommandEdit->hide(); |
394 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 395 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
395 | } | 396 | } |
396 | 397 | ||
397 | void POP3config::slotConnectionToggle( int index ) | 398 | void POP3config::slotConnectionToggle( int index ) |
398 | { | 399 | { |
399 | // 2 is ssl connection | 400 | // 2 is ssl connection |
400 | if ( index == 2 ) | 401 | if ( index == 2 ) |
401 | { | 402 | { |
402 | portLine->setText( POP3_SSL_PORT ); | 403 | portLine->setText( POP3_SSL_PORT ); |
403 | } | 404 | } |
404 | else if ( index == 3 ) | 405 | else if ( index == 3 ) |
405 | { | 406 | { |
406 | portLine->setText( POP3_PORT ); | 407 | portLine->setText( POP3_PORT ); |
407 | CommandEdit->show(); | 408 | CommandEdit->show(); |
408 | } | 409 | } |
409 | else | 410 | else |
410 | { | 411 | { |
411 | portLine->setText( POP3_PORT ); | 412 | portLine->setText( POP3_PORT ); |
412 | } | 413 | } |
413 | } | 414 | } |
414 | 415 | ||
415 | void POP3config::fillValues() | 416 | void POP3config::fillValues() |
416 | { | 417 | { |
417 | accountLine->setText( data->getAccountName() ); | 418 | accountLine->setText( data->getAccountName() ); |
418 | serverLine->setText( data->getServer() ); | 419 | serverLine->setText( data->getServer() ); |
419 | portLine->setText( data->getPort() ); | 420 | portLine->setText( data->getPort() ); |
420 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 421 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
421 | userLine->setText( data->getUser() ); | 422 | userLine->setText( data->getUser() ); |
422 | passLine->setText( data->getPassword() ); | 423 | passLine->setText( data->getPassword() ); |
424 | localFolder->setText( data->getLocalFolder() ); | ||
425 | int max = data->getMaxMailSize() ; | ||
426 | if ( max ) { | ||
427 | CheckBoxDown->setChecked( true ); | ||
428 | SpinBoxDown->setValue ( max ); | ||
429 | } else { | ||
430 | CheckBoxDown->setChecked( false ); | ||
431 | SpinBoxDown->setValue ( 5 ); | ||
432 | } | ||
423 | } | 433 | } |
424 | 434 | ||
425 | void POP3config::accept() | 435 | void POP3config::accept() |
426 | { | 436 | { |
427 | data->setAccountName( accountLine->text() ); | 437 | data->setAccountName( accountLine->text() ); |
428 | data->setServer( serverLine->text() ); | 438 | data->setServer( serverLine->text() ); |
429 | data->setPort( portLine->text() ); | 439 | data->setPort( portLine->text() ); |
430 | data->setConnectionType( ComboBox1->currentItem() ); | 440 | data->setConnectionType( ComboBox1->currentItem() ); |
431 | data->setUser( userLine->text() ); | 441 | data->setUser( userLine->text() ); |
432 | data->setPassword( passLine->text() ); | 442 | data->setPassword( passLine->text() ); |
443 | data->setLocalFolder( localFolder->text() ); | ||
444 | data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; | ||
433 | 445 | ||
434 | QDialog::accept(); | 446 | QDialog::accept(); |
435 | } | 447 | } |
436 | 448 | ||
437 | /** | 449 | /** |
438 | * SMTPconfig | 450 | * SMTPconfig |
439 | */ | 451 | */ |
440 | 452 | ||
441 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 453 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
442 | : SMTPconfigUI( parent, name, modal, flags ) | 454 | : SMTPconfigUI( parent, name, modal, flags ) |
443 | { | 455 | { |
444 | data = account; | 456 | data = account; |
445 | 457 | ||
446 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); | 458 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); |
447 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); | 459 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); |
448 | 460 | ||
449 | fillValues(); | 461 | fillValues(); |
450 | 462 | ||
451 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); | 463 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); |
452 | ComboBox1->insertItem( "Only if available", 0 ); | 464 | ComboBox1->insertItem( "Only if available", 0 ); |
453 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | 465 | ComboBox1->insertItem( "Always, Negotiated", 1 ); |
454 | ComboBox1->insertItem( "Connect on secure port", 2 ); | 466 | ComboBox1->insertItem( "Connect on secure port", 2 ); |
455 | ComboBox1->insertItem( "Run command instead", 3 ); | 467 | ComboBox1->insertItem( "Run command instead", 3 ); |
456 | CommandEdit->hide(); | 468 | CommandEdit->hide(); |
457 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 469 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
458 | } | 470 | } |
459 | 471 | ||
460 | void SMTPconfig::slotConnectionToggle( int index ) | 472 | void SMTPconfig::slotConnectionToggle( int index ) |
461 | { | 473 | { |
462 | // 2 is ssl connection | 474 | // 2 is ssl connection |
463 | if ( index == 2 ) | 475 | if ( index == 2 ) |
464 | { | 476 | { |
465 | portLine->setText( SMTP_SSL_PORT ); | 477 | portLine->setText( SMTP_SSL_PORT ); |
466 | } | 478 | } |
467 | else if ( index == 3 ) | 479 | else if ( index == 3 ) |
468 | { | 480 | { |
469 | portLine->setText( SMTP_PORT ); | 481 | portLine->setText( SMTP_PORT ); |
470 | CommandEdit->show(); | 482 | CommandEdit->show(); |
471 | } | 483 | } |
472 | else | 484 | else |
473 | { | 485 | { |
474 | portLine->setText( SMTP_PORT ); | 486 | portLine->setText( SMTP_PORT ); |
475 | } | 487 | } |
476 | } | 488 | } |
477 | 489 | ||
478 | void SMTPconfig::fillValues() | 490 | void SMTPconfig::fillValues() |
479 | { | 491 | { |
480 | accountLine->setText( data->getAccountName() ); | 492 | accountLine->setText( data->getAccountName() ); |
481 | serverLine->setText( data->getServer() ); | 493 | serverLine->setText( data->getServer() ); |
482 | portLine->setText( data->getPort() ); | 494 | portLine->setText( data->getPort() ); |
483 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 495 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
484 | loginBox->setChecked( data->getLogin() ); | 496 | loginBox->setChecked( data->getLogin() ); |
485 | userLine->setText( data->getUser() ); | 497 | userLine->setText( data->getUser() ); |
486 | passLine->setText( data->getPassword() ); | 498 | passLine->setText( data->getPassword() ); |
487 | } | 499 | } |
488 | 500 | ||
489 | void SMTPconfig::accept() | 501 | void SMTPconfig::accept() |
490 | { | 502 | { |
491 | data->setAccountName( accountLine->text() ); | 503 | data->setAccountName( accountLine->text() ); |
492 | data->setServer( serverLine->text() ); | 504 | data->setServer( serverLine->text() ); |
493 | data->setPort( portLine->text() ); | 505 | data->setPort( portLine->text() ); |
494 | data->setConnectionType( ComboBox1->currentItem() ); | 506 | data->setConnectionType( ComboBox1->currentItem() ); |
495 | data->setLogin( loginBox->isChecked() ); | 507 | data->setLogin( loginBox->isChecked() ); |
496 | data->setUser( userLine->text() ); | 508 | data->setUser( userLine->text() ); |
497 | data->setPassword( passLine->text() ); | 509 | data->setPassword( passLine->text() ); |
498 | 510 | ||
499 | QDialog::accept(); | 511 | QDialog::accept(); |
500 | } | 512 | } |
501 | 513 | ||
502 | /** | 514 | /** |
503 | * NNTPconfig | 515 | * NNTPconfig |
504 | */ | 516 | */ |
505 | 517 | ||
506 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 518 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
507 | : NNTPconfigUI( parent, name, modal, flags ) | 519 | : NNTPconfigUI( parent, name, modal, flags ) |
508 | { | 520 | { |
509 | data = account; | 521 | data = account; |
510 | 522 | ||
511 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); | 523 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); |
512 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); | 524 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); |
513 | connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) ); | 525 | connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) ); |
514 | fillValues(); | 526 | fillValues(); |
515 | 527 | ||
516 | connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); | 528 | connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); |
517 | } | 529 | } |
518 | 530 | ||
519 | void NNTPconfig::slotGetNG() { | 531 | void NNTPconfig::slotGetNG() { |
520 | save(); | 532 | save(); |
521 | data->save(); | 533 | data->save(); |
522 | NNTPwrapper* tmp = new NNTPwrapper( data ); | 534 | NNTPwrapper* tmp = new NNTPwrapper( data ); |
523 | QStringList list = tmp->listAllNewsgroups(); | 535 | QStringList list = tmp->listAllNewsgroups(); |
524 | 536 | ||
525 | ListViewGroups->clear(); | 537 | ListViewGroups->clear(); |
526 | 538 | ||
527 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 539 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
528 | QCheckListItem *item; | 540 | QCheckListItem *item; |
529 | item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); | 541 | item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); |
530 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { | 542 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { |
531 | item->setOn( true ); | 543 | item->setOn( true ); |
532 | } | 544 | } |
533 | } | 545 | } |
534 | } | 546 | } |
535 | 547 | ||
536 | void NNTPconfig::slotSSL( bool enabled ) | 548 | void NNTPconfig::slotSSL( bool enabled ) |
537 | { | 549 | { |
538 | if ( enabled ) | 550 | if ( enabled ) |
539 | { | 551 | { |
540 | portLine->setText( NNTP_SSL_PORT ); | 552 | portLine->setText( NNTP_SSL_PORT ); |
541 | } | 553 | } |
542 | else | 554 | else |
543 | { | 555 | { |
544 | portLine->setText( NNTP_PORT ); | 556 | portLine->setText( NNTP_PORT ); |
545 | } | 557 | } |
546 | } | 558 | } |
547 | 559 | ||
548 | void NNTPconfig::fillValues() | 560 | void NNTPconfig::fillValues() |
549 | { | 561 | { |
550 | accountLine->setText( data->getAccountName() ); | 562 | accountLine->setText( data->getAccountName() ); |
551 | serverLine->setText( data->getServer() ); | 563 | serverLine->setText( data->getServer() ); |
552 | portLine->setText( data->getPort() ); | 564 | portLine->setText( data->getPort() ); |
553 | sslBox->setChecked( data->getSSL() ); | 565 | sslBox->setChecked( data->getSSL() ); |
554 | loginBox->setChecked( data->getLogin() ); | 566 | loginBox->setChecked( data->getLogin() ); |
555 | userLine->setText( data->getUser() ); | 567 | userLine->setText( data->getUser() ); |
556 | passLine->setText( data->getPassword() ); | 568 | passLine->setText( data->getPassword() ); |
557 | subscribedGroups = data->getGroups(); | 569 | subscribedGroups = data->getGroups(); |
558 | /* don't forget that - you will overwrite values if user clicks cancel! */ | 570 | /* don't forget that - you will overwrite values if user clicks cancel! */ |
559 | for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { | 571 | for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { |
560 | QCheckListItem *item; | 572 | QCheckListItem *item; |
561 | item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); | 573 | item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); |
562 | item->setOn( true ); | 574 | item->setOn( true ); |
563 | } | 575 | } |
564 | } | 576 | } |
565 | 577 | ||
566 | void NNTPconfig::save() | 578 | void NNTPconfig::save() |
567 | { | 579 | { |
568 | data->setAccountName( accountLine->text() ); | 580 | data->setAccountName( accountLine->text() ); |
569 | data->setServer( serverLine->text() ); | 581 | data->setServer( serverLine->text() ); |
570 | data->setPort( portLine->text() ); | 582 | data->setPort( portLine->text() ); |
571 | data->setSSL( sslBox->isChecked() ); | 583 | data->setSSL( sslBox->isChecked() ); |
572 | data->setLogin( loginBox->isChecked() ); | 584 | data->setLogin( loginBox->isChecked() ); |
573 | data->setUser( userLine->text() ); | 585 | data->setUser( userLine->text() ); |
574 | data->setPassword( passLine->text() ); | 586 | data->setPassword( passLine->text() ); |
575 | 587 | ||
576 | QListViewItemIterator list_it( ListViewGroups ); | 588 | QListViewItemIterator list_it( ListViewGroups ); |
577 | 589 | ||
578 | QStringList groupList; | 590 | QStringList groupList; |
579 | for ( ; list_it.current(); ++list_it ) { | 591 | for ( ; list_it.current(); ++list_it ) { |
580 | 592 | ||
581 | if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { | 593 | if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { |
582 | groupList.append( list_it.current()->text(0) ); | 594 | groupList.append( list_it.current()->text(0) ); |
583 | } | 595 | } |
584 | 596 | ||
585 | } | 597 | } |
586 | data->setGroups( groupList ); | 598 | data->setGroups( groupList ); |
587 | } | 599 | } |
588 | 600 | ||
589 | void NNTPconfig::accept() | 601 | void NNTPconfig::accept() |
590 | { | 602 | { |
591 | save(); | 603 | save(); |
592 | QDialog::accept(); | 604 | QDialog::accept(); |
593 | } | 605 | } |
594 | 606 | ||
diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp index 8d2f778..1edec9e 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.cpp +++ b/kmicromail/libmailwrapper/pop3wrapper.cpp | |||
@@ -1,294 +1,294 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include "pop3wrapper.h" | 3 | #include "pop3wrapper.h" |
4 | #include "mailtypes.h" | 4 | #include "mailtypes.h" |
5 | #include "logindialog.h" | 5 | #include "logindialog.h" |
6 | #include <libetpan/libetpan.h> | 6 | #include <libetpan/libetpan.h> |
7 | 7 | ||
8 | 8 | ||
9 | #include <qpe/global.h> | 9 | #include <qpe/global.h> |
10 | #include <qfile.h> | 10 | #include <qfile.h> |
11 | #include <qprogressbar.h> | 11 | #include <qprogressbar.h> |
12 | #include <qapplication.h> | 12 | #include <qapplication.h> |
13 | 13 | ||
14 | /* we don't fetch messages larger than 5 MB */ | 14 | /* we don't fetch messages larger than 5 MB */ |
15 | #define HARD_MSG_SIZE_LIMIT 5242880 | 15 | #define HARD_MSG_SIZE_LIMIT 5242880 |
16 | 16 | ||
17 | using namespace Opie::Core; | 17 | using namespace Opie::Core; |
18 | POP3wrapper::POP3wrapper( POP3account *a ) | 18 | POP3wrapper::POP3wrapper( POP3account *a ) |
19 | : Genericwrapper() { | 19 | : Genericwrapper() { |
20 | account = a; | 20 | account = a; |
21 | m_pop3 = NULL; | 21 | m_pop3 = NULL; |
22 | msgTempName = a->getFileName()+"_msg_cache"; | 22 | msgTempName = a->getFileName()+"_msg_cache"; |
23 | last_msg_id = 0; | 23 | last_msg_id = 0; |
24 | } | 24 | } |
25 | 25 | ||
26 | POP3wrapper::~POP3wrapper() { | 26 | POP3wrapper::~POP3wrapper() { |
27 | logout(); | 27 | logout(); |
28 | QFile msg_cache(msgTempName); | 28 | QFile msg_cache(msgTempName); |
29 | if (msg_cache.exists()) { | 29 | if (msg_cache.exists()) { |
30 | msg_cache.remove(); | 30 | msg_cache.remove(); |
31 | } | 31 | } |
32 | } | 32 | } |
33 | 33 | ||
34 | void POP3wrapper::pop3_progress( size_t current, size_t maximum ) { | 34 | void POP3wrapper::pop3_progress( size_t current, size_t maximum ) { |
35 | ; // odebug << "POP3: " << current << " of " << maximum << "" << oendl; | 35 | ; // odebug << "POP3: " << current << " of " << maximum << "" << oendl; |
36 | } | 36 | } |
37 | 37 | ||
38 | RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { | 38 | RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { |
39 | int err = MAILPOP3_NO_ERROR; | 39 | int err = MAILPOP3_NO_ERROR; |
40 | char *message = 0; | 40 | char *message = 0; |
41 | size_t length = 0; | 41 | size_t length = 0; |
42 | 42 | ||
43 | RecBodyP body = new RecBody(); | 43 | RecBodyP body = new RecBody(); |
44 | 44 | ||
45 | login(); | 45 | login(); |
46 | if ( !m_pop3 ) { | 46 | if ( !m_pop3 ) { |
47 | return body; | 47 | return body; |
48 | } | 48 | } |
49 | 49 | ||
50 | mailmessage * mailmsg; | 50 | mailmessage * mailmsg; |
51 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { | 51 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { |
52 | ; // odebug << "Message to large: " << mail->Msgsize() << "" << oendl; | 52 | ; // odebug << "Message to large: " << mail->Msgsize() << "" << oendl; |
53 | return body; | 53 | return body; |
54 | } | 54 | } |
55 | 55 | ||
56 | QFile msg_cache(msgTempName); | 56 | QFile msg_cache(msgTempName); |
57 | 57 | ||
58 | cleanMimeCache(); | 58 | cleanMimeCache(); |
59 | 59 | ||
60 | if (mail->getNumber()!=last_msg_id) { | 60 | if (mail->getNumber()!=last_msg_id) { |
61 | if (msg_cache.exists()) { | 61 | if (msg_cache.exists()) { |
62 | msg_cache.remove(); | 62 | msg_cache.remove(); |
63 | } | 63 | } |
64 | msg_cache.open(IO_ReadWrite|IO_Truncate); | 64 | msg_cache.open(IO_ReadWrite|IO_Truncate); |
65 | last_msg_id = mail->getNumber(); | 65 | last_msg_id = mail->getNumber(); |
66 | err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); | 66 | err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); |
67 | err = mailmessage_fetch(mailmsg,&message,&length); | 67 | err = mailmessage_fetch(mailmsg,&message,&length); |
68 | msg_cache.writeBlock(message,length); | 68 | msg_cache.writeBlock(message,length); |
69 | } else { | 69 | } else { |
70 | QString msg=""; | 70 | QString msg=""; |
71 | msg_cache.open(IO_ReadOnly); | 71 | msg_cache.open(IO_ReadOnly); |
72 | message = new char[4096]; | 72 | message = new char[4096]; |
73 | memset(message,0,4096); | 73 | memset(message,0,4096); |
74 | while (msg_cache.readBlock(message,4095)>0) { | 74 | while (msg_cache.readBlock(message,4095)>0) { |
75 | msg+=message; | 75 | msg+=message; |
76 | memset(message,0,4096); | 76 | memset(message,0,4096); |
77 | } | 77 | } |
78 | delete message; | 78 | delete message; |
79 | message = (char*)malloc(msg.length()+1*sizeof(char)); | 79 | message = (char*)malloc(msg.length()+1*sizeof(char)); |
80 | memset(message,0,msg.length()+1); | 80 | memset(message,0,msg.length()+1); |
81 | memcpy(message,msg.latin1(),msg.length()); | 81 | memcpy(message,msg.latin1(),msg.length()); |
82 | /* transform to libetpan stuff */ | 82 | /* transform to libetpan stuff */ |
83 | mailmsg = mailmessage_new(); | 83 | mailmsg = mailmessage_new(); |
84 | mailmessage_init(mailmsg, NULL, data_message_driver, 0, strlen(message)); | 84 | mailmessage_init(mailmsg, NULL, data_message_driver, 0, strlen(message)); |
85 | generic_message_t * msg_data; | 85 | generic_message_t * msg_data; |
86 | msg_data = (generic_message_t *)mailmsg->msg_data; | 86 | msg_data = (generic_message_t *)mailmsg->msg_data; |
87 | msg_data->msg_fetched = 1; | 87 | msg_data->msg_fetched = 1; |
88 | msg_data->msg_message = message; | 88 | msg_data->msg_message = message; |
89 | msg_data->msg_length = strlen(message); | 89 | msg_data->msg_length = strlen(message); |
90 | } | 90 | } |
91 | body = parseMail(mailmsg); | 91 | body = parseMail(mailmsg); |
92 | 92 | ||
93 | /* clean up */ | 93 | /* clean up */ |
94 | if (mailmsg) | 94 | if (mailmsg) |
95 | mailmessage_free(mailmsg); | 95 | mailmessage_free(mailmsg); |
96 | if (message) | 96 | if (message) |
97 | free(message); | 97 | free(message); |
98 | 98 | ||
99 | return body; | 99 | return body; |
100 | } | 100 | } |
101 | 101 | ||
102 | void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) | 102 | void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) |
103 | { | 103 | { |
104 | login(); | 104 | login(); |
105 | if (!m_pop3) | 105 | if (!m_pop3) |
106 | return; | 106 | return; |
107 | uint32_t res_messages,res_recent,res_unseen; | 107 | uint32_t res_messages,res_recent,res_unseen; |
108 | mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); | 108 | mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); |
109 | parseList(target,m_pop3->sto_session,"INBOX", false, maxSizeInKb); | 109 | parseList(target,m_pop3->sto_session,"INBOX", false, maxSizeInKb); |
110 | Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages)); | 110 | Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages)); |
111 | } | 111 | } |
112 | 112 | ||
113 | void POP3wrapper::login() | 113 | void POP3wrapper::login() |
114 | { | 114 | { |
115 | if (account->getOffline()) | 115 | if (account->getOffline()) |
116 | return; | 116 | return; |
117 | /* we'll hold the line */ | 117 | /* we'll hold the line */ |
118 | if ( m_pop3 != NULL ) | 118 | if ( m_pop3 != NULL ) |
119 | return; | 119 | return; |
120 | 120 | ||
121 | QString server,user, pass; | 121 | QString server,user, pass; |
122 | uint16_t port; | 122 | uint16_t port; |
123 | int err = MAILPOP3_NO_ERROR; | 123 | int err = MAILPOP3_NO_ERROR; |
124 | 124 | ||
125 | server = account->getServer().latin1(); | 125 | server = account->getServer(); |
126 | port = account->getPort().toUInt(); | 126 | port = account->getPort().toUInt(); |
127 | 127 | ||
128 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { | 128 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { |
129 | qApp->processEvents(); | 129 | qApp->processEvents(); |
130 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); | 130 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); |
131 | login.show(); | 131 | login.show(); |
132 | if ( QDialog::Accepted == login.exec() ) { | 132 | if ( QDialog::Accepted == login.exec() ) { |
133 | // ok | 133 | // ok |
134 | user = login.getUser(); | 134 | user = login.getUser(); |
135 | pass = login.getPassword(); | 135 | pass = login.getPassword(); |
136 | } else { | 136 | } else { |
137 | // cancel | 137 | // cancel |
138 | ; // odebug << "POP3: Login canceled" << oendl; | 138 | ; // odebug << "POP3: Login canceled" << oendl; |
139 | return; | 139 | return; |
140 | } | 140 | } |
141 | } else { | 141 | } else { |
142 | user = account->getUser(); | 142 | user = account->getUser(); |
143 | pass = account->getPassword(); | 143 | pass = account->getPassword(); |
144 | } | 144 | } |
145 | // bool ssl = account->getSSL(); | 145 | // bool ssl = account->getSSL(); |
146 | 146 | ||
147 | m_pop3=mailstorage_new(NULL); | 147 | m_pop3=mailstorage_new(NULL); |
148 | int conntypeset = account->ConnectionType(); | 148 | int conntypeset = account->ConnectionType(); |
149 | int conntype = 0; | 149 | int conntype = 0; |
150 | if ( conntypeset == 3 ) { | 150 | if ( conntypeset == 3 ) { |
151 | conntype = CONNECTION_TYPE_COMMAND; | 151 | conntype = CONNECTION_TYPE_COMMAND; |
152 | } else if ( conntypeset == 2 ) { | 152 | } else if ( conntypeset == 2 ) { |
153 | conntype = CONNECTION_TYPE_TLS; | 153 | conntype = CONNECTION_TYPE_TLS; |
154 | } else if ( conntypeset == 1 ) { | 154 | } else if ( conntypeset == 1 ) { |
155 | conntype = CONNECTION_TYPE_STARTTLS; | 155 | conntype = CONNECTION_TYPE_STARTTLS; |
156 | } else if ( conntypeset == 0 ) { | 156 | } else if ( conntypeset == 0 ) { |
157 | conntype = CONNECTION_TYPE_TRY_STARTTLS; | 157 | conntype = CONNECTION_TYPE_TRY_STARTTLS; |
158 | } | 158 | } |
159 | 159 | ||
160 | //(ssl?CONNECTION_TYPE_TLS:CONNECTION_TYPE_PLAIN); | 160 | //(ssl?CONNECTION_TYPE_TLS:CONNECTION_TYPE_PLAIN); |
161 | 161 | ||
162 | pop3_mailstorage_init(m_pop3,(char*)server.latin1(), port, NULL, conntype, POP3_AUTH_TYPE_PLAIN, | 162 | pop3_mailstorage_init(m_pop3,(char*)server.latin1(), port, NULL, conntype, POP3_AUTH_TYPE_PLAIN, |
163 | (char*)user.latin1(),(char*)pass.latin1(),0,0,0); | 163 | (char*)user.latin1(),(char*)pass.latin1(),0,0,0); |
164 | 164 | ||
165 | err = mailstorage_connect(m_pop3); | 165 | err = mailstorage_connect(m_pop3); |
166 | if (err != MAIL_NO_ERROR) { | 166 | if (err != MAIL_NO_ERROR) { |
167 | ; // odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl; | 167 | ; // odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl; |
168 | Global::statusMessage(tr("Error %1 initializing folder").arg( err )); | 168 | Global::statusMessage(tr("Error %1 initializing folder").arg( err )); |
169 | mailstorage_free(m_pop3); | 169 | mailstorage_free(m_pop3); |
170 | m_pop3 = 0; | 170 | m_pop3 = 0; |
171 | } else { | 171 | } else { |
172 | mailsession * session = m_pop3->sto_session; | 172 | mailsession * session = m_pop3->sto_session; |
173 | mailpop3 * mail = ( ( pop3_session_state_data * )session->sess_data )->pop3_session; | 173 | mailpop3 * mail = ( ( pop3_session_state_data * )session->sess_data )->pop3_session; |
174 | if (mail) { | 174 | if (mail) { |
175 | mail->pop3_progr_fun = &pop3_progress; | 175 | mail->pop3_progr_fun = &pop3_progress; |
176 | } | 176 | } |
177 | } | 177 | } |
178 | } | 178 | } |
179 | 179 | ||
180 | void POP3wrapper::logout() | 180 | void POP3wrapper::logout() |
181 | { | 181 | { |
182 | if ( m_pop3 == NULL ) | 182 | if ( m_pop3 == NULL ) |
183 | return; | 183 | return; |
184 | mailstorage_free(m_pop3); | 184 | mailstorage_free(m_pop3); |
185 | m_pop3 = 0; | 185 | m_pop3 = 0; |
186 | } | 186 | } |
187 | 187 | ||
188 | 188 | ||
189 | QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { | 189 | QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { |
190 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<FolderP>(); | 190 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<FolderP>(); |
191 | FolderP inb=new Folder("INBOX","/"); | 191 | FolderP inb=new Folder("INBOX","/"); |
192 | folders->append(inb); | 192 | folders->append(inb); |
193 | return folders; | 193 | return folders; |
194 | } | 194 | } |
195 | 195 | ||
196 | void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) | 196 | void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) |
197 | { | 197 | { |
198 | login(); | 198 | login(); |
199 | if (!m_pop3) | 199 | if (!m_pop3) |
200 | return; | 200 | return; |
201 | int iii = 0; | 201 | int iii = 0; |
202 | int count = target.count(); | 202 | int count = target.count(); |
203 | QWidget wid; | 203 | QWidget wid; |
204 | wid.show(); | 204 | wid.show(); |
205 | while (iii < count ) { | 205 | while (iii < count ) { |
206 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); | 206 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); |
207 | wid.raise(); | 207 | wid.raise(); |
208 | qApp->processEvents(); | 208 | qApp->processEvents(); |
209 | //qDebug("delete "); | 209 | //qDebug("delete "); |
210 | RecMailP mail = (*target.at( iii )); | 210 | RecMailP mail = (*target.at( iii )); |
211 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); | 211 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); |
212 | if (err != MAIL_NO_ERROR) { | 212 | if (err != MAIL_NO_ERROR) { |
213 | Global::statusMessage(tr("Error deleting mail")); | 213 | Global::statusMessage(tr("Error deleting mail")); |
214 | } | 214 | } |
215 | ++iii; | 215 | ++iii; |
216 | } | 216 | } |
217 | } | 217 | } |
218 | void POP3wrapper::deleteMail(const RecMailP&mail) { | 218 | void POP3wrapper::deleteMail(const RecMailP&mail) { |
219 | login(); | 219 | login(); |
220 | if (!m_pop3) | 220 | if (!m_pop3) |
221 | return; | 221 | return; |
222 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); | 222 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); |
223 | if (err != MAIL_NO_ERROR) { | 223 | if (err != MAIL_NO_ERROR) { |
224 | Global::statusMessage(tr("error deleting mail")); | 224 | Global::statusMessage(tr("error deleting mail")); |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
228 | void POP3wrapper::answeredMail(const RecMailP&) {} | 228 | void POP3wrapper::answeredMail(const RecMailP&) {} |
229 | 229 | ||
230 | int POP3wrapper::deleteAllMail(const FolderP&) { | 230 | int POP3wrapper::deleteAllMail(const FolderP&) { |
231 | login(); | 231 | login(); |
232 | if (!m_pop3) | 232 | if (!m_pop3) |
233 | return 0; | 233 | return 0; |
234 | int res = 1; | 234 | int res = 1; |
235 | 235 | ||
236 | uint32_t result = 0; | 236 | uint32_t result = 0; |
237 | int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result); | 237 | int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result); |
238 | if (err != MAIL_NO_ERROR) { | 238 | if (err != MAIL_NO_ERROR) { |
239 | Global::statusMessage(tr("Error getting folder info")); | 239 | Global::statusMessage(tr("Error getting folder info")); |
240 | return 0; | 240 | return 0; |
241 | } | 241 | } |
242 | QWidget wid; | 242 | QWidget wid; |
243 | wid.show(); | 243 | wid.show(); |
244 | for (unsigned int i = 0; i < result; ++i) { | 244 | for (unsigned int i = 0; i < result; ++i) { |
245 | Global::statusMessage(tr("Delete message %1 of %2").arg(i).arg(result)); | 245 | Global::statusMessage(tr("Delete message %1 of %2").arg(i).arg(result)); |
246 | wid.raise(); | 246 | wid.raise(); |
247 | qApp->processEvents(); | 247 | qApp->processEvents(); |
248 | 248 | ||
249 | err = mailsession_remove_message(m_pop3->sto_session,i+1); | 249 | err = mailsession_remove_message(m_pop3->sto_session,i+1); |
250 | if (err != MAIL_NO_ERROR) { | 250 | if (err != MAIL_NO_ERROR) { |
251 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); | 251 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); |
252 | res=0; | 252 | res=0; |
253 | } | 253 | } |
254 | break; | 254 | break; |
255 | } | 255 | } |
256 | return res; | 256 | return res; |
257 | } | 257 | } |
258 | 258 | ||
259 | void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) { | 259 | void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) { |
260 | login(); | 260 | login(); |
261 | target_stat.message_count = 0; | 261 | target_stat.message_count = 0; |
262 | target_stat.message_unseen = 0; | 262 | target_stat.message_unseen = 0; |
263 | target_stat.message_recent = 0; | 263 | target_stat.message_recent = 0; |
264 | if (!m_pop3) | 264 | if (!m_pop3) |
265 | return; | 265 | return; |
266 | int r = mailsession_status_folder(m_pop3->sto_session,0,&target_stat.message_count, | 266 | int r = mailsession_status_folder(m_pop3->sto_session,0,&target_stat.message_count, |
267 | &target_stat.message_recent,&target_stat.message_unseen); | 267 | &target_stat.message_recent,&target_stat.message_unseen); |
268 | if (r != MAIL_NO_ERROR) { | 268 | if (r != MAIL_NO_ERROR) { |
269 | ; // odebug << "error getting folter status." << oendl; | 269 | ; // odebug << "error getting folter status." << oendl; |
270 | } | 270 | } |
271 | } | 271 | } |
272 | 272 | ||
273 | encodedString* POP3wrapper::fetchRawBody(const RecMailP&mail) { | 273 | encodedString* POP3wrapper::fetchRawBody(const RecMailP&mail) { |
274 | char*target=0; | 274 | char*target=0; |
275 | size_t length=0; | 275 | size_t length=0; |
276 | encodedString*res = 0; | 276 | encodedString*res = 0; |
277 | mailmessage * mailmsg = 0; | 277 | mailmessage * mailmsg = 0; |
278 | int err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); | 278 | int err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); |
279 | err = mailmessage_fetch(mailmsg,&target,&length); | 279 | err = mailmessage_fetch(mailmsg,&target,&length); |
280 | if (mailmsg) | 280 | if (mailmsg) |
281 | mailmessage_free(mailmsg); | 281 | mailmessage_free(mailmsg); |
282 | if (target) { | 282 | if (target) { |
283 | res = new encodedString(target,length); | 283 | res = new encodedString(target,length); |
284 | } | 284 | } |
285 | return res; | 285 | return res; |
286 | } | 286 | } |
287 | 287 | ||
288 | MAILLIB::ATYPE POP3wrapper::getType()const { | 288 | MAILLIB::ATYPE POP3wrapper::getType()const { |
289 | return account->getType(); | 289 | return account->getType(); |
290 | } | 290 | } |
291 | 291 | ||
292 | const QString&POP3wrapper::getName()const{ | 292 | const QString&POP3wrapper::getName()const{ |
293 | return account->getAccountName(); | 293 | return account->getAccountName(); |
294 | } | 294 | } |
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index b0a539e..90e32fa 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp | |||
@@ -1,440 +1,450 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <qdir.h> | 2 | #include <qdir.h> |
3 | 3 | ||
4 | //#include <opie2/odebug.h> | 4 | //#include <opie2/odebug.h> |
5 | #include <qpe/config.h> | 5 | #include <qpe/config.h> |
6 | 6 | ||
7 | #include <kstandarddirs.h> | 7 | #include <kstandarddirs.h> |
8 | #include "settings.h" | 8 | #include "settings.h" |
9 | //#include "defines.h" | 9 | //#include "defines.h" |
10 | 10 | ||
11 | #define IMAP_PORT "143" | 11 | #define IMAP_PORT "143" |
12 | #define IMAP_SSL_PORT "993" | 12 | #define IMAP_SSL_PORT "993" |
13 | #define SMTP_PORT "25" | 13 | #define SMTP_PORT "25" |
14 | #define SMTP_SSL_PORT "465" | 14 | #define SMTP_SSL_PORT "465" |
15 | #define POP3_PORT "110" | 15 | #define POP3_PORT "110" |
16 | #define POP3_SSL_PORT "995" | 16 | #define POP3_SSL_PORT "995" |
17 | #define NNTP_PORT "119" | 17 | #define NNTP_PORT "119" |
18 | #define NNTP_SSL_PORT "563" | 18 | #define NNTP_SSL_PORT "563" |
19 | 19 | ||
20 | 20 | ||
21 | Settings::Settings() | 21 | Settings::Settings() |
22 | : QObject() | 22 | : QObject() |
23 | { | 23 | { |
24 | updateAccounts(); | 24 | updateAccounts(); |
25 | } | 25 | } |
26 | 26 | ||
27 | void Settings::checkDirectory() | 27 | void Settings::checkDirectory() |
28 | { | 28 | { |
29 | qDebug("Settings::checkDirectory() "); | 29 | qDebug("Settings::checkDirectory() "); |
30 | return; | 30 | return; |
31 | locateLocal("data", "kopiemail" ); | 31 | locateLocal("data", "kopiemail" ); |
32 | /* | 32 | /* |
33 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { | 33 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { |
34 | system( "mkdir -p $HOME/Applications/opiemail" ); | 34 | system( "mkdir -p $HOME/Applications/opiemail" ); |
35 | qDebug("$HOME/Applications/opiemail created "); | 35 | qDebug("$HOME/Applications/opiemail created "); |
36 | } | 36 | } |
37 | */ | 37 | */ |
38 | } | 38 | } |
39 | 39 | ||
40 | QList<Account> Settings::getAccounts() | 40 | QList<Account> Settings::getAccounts() |
41 | { | 41 | { |
42 | return accounts; | 42 | return accounts; |
43 | } | 43 | } |
44 | 44 | ||
45 | void Settings::addAccount( Account *account ) | 45 | void Settings::addAccount( Account *account ) |
46 | { | 46 | { |
47 | accounts.append( account ); | 47 | accounts.append( account ); |
48 | } | 48 | } |
49 | 49 | ||
50 | void Settings::delAccount( Account *account ) | 50 | void Settings::delAccount( Account *account ) |
51 | { | 51 | { |
52 | accounts.remove( account ); | 52 | accounts.remove( account ); |
53 | account->remove(); | 53 | account->remove(); |
54 | } | 54 | } |
55 | 55 | ||
56 | void Settings::updateAccounts() | 56 | void Settings::updateAccounts() |
57 | { | 57 | { |
58 | accounts.clear(); | 58 | accounts.clear(); |
59 | QDir dir( locateLocal("data", "kopiemail" ) ); | 59 | QDir dir( locateLocal("data", "kopiemail" ) ); |
60 | QStringList::Iterator it; | 60 | QStringList::Iterator it; |
61 | 61 | ||
62 | QStringList imap = dir.entryList( "imap-*" ); | 62 | QStringList imap = dir.entryList( "imap-*" ); |
63 | for ( it = imap.begin(); it != imap.end(); it++ ) { | 63 | for ( it = imap.begin(); it != imap.end(); it++ ) { |
64 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); | 64 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); |
65 | accounts.append( account ); | 65 | accounts.append( account ); |
66 | } | 66 | } |
67 | 67 | ||
68 | QStringList pop3 = dir.entryList( "pop3-*" ); | 68 | QStringList pop3 = dir.entryList( "pop3-*" ); |
69 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { | 69 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { |
70 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); | 70 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); |
71 | accounts.append( account ); | 71 | accounts.append( account ); |
72 | } | 72 | } |
73 | 73 | ||
74 | QStringList smtp = dir.entryList( "smtp-*" ); | 74 | QStringList smtp = dir.entryList( "smtp-*" ); |
75 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { | 75 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { |
76 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); | 76 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); |
77 | accounts.append( account ); | 77 | accounts.append( account ); |
78 | } | 78 | } |
79 | 79 | ||
80 | QStringList nntp = dir.entryList( "nntp-*" ); | 80 | QStringList nntp = dir.entryList( "nntp-*" ); |
81 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { | 81 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { |
82 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); | 82 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); |
83 | accounts.append( account ); | 83 | accounts.append( account ); |
84 | } | 84 | } |
85 | 85 | ||
86 | readAccounts(); | 86 | readAccounts(); |
87 | } | 87 | } |
88 | 88 | ||
89 | void Settings::saveAccounts() | 89 | void Settings::saveAccounts() |
90 | { | 90 | { |
91 | checkDirectory(); | 91 | checkDirectory(); |
92 | Account *it; | 92 | Account *it; |
93 | 93 | ||
94 | for ( it = accounts.first(); it; it = accounts.next() ) { | 94 | for ( it = accounts.first(); it; it = accounts.next() ) { |
95 | it->save(); | 95 | it->save(); |
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | void Settings::readAccounts() | 99 | void Settings::readAccounts() |
100 | { | 100 | { |
101 | checkDirectory(); | 101 | checkDirectory(); |
102 | Account *it; | 102 | Account *it; |
103 | 103 | ||
104 | for ( it = accounts.first(); it; it = accounts.next() ) { | 104 | for ( it = accounts.first(); it; it = accounts.next() ) { |
105 | it->read(); | 105 | it->read(); |
106 | } | 106 | } |
107 | } | 107 | } |
108 | 108 | ||
109 | Account::Account() | 109 | Account::Account() |
110 | { | 110 | { |
111 | accountName = "changeMe"; | 111 | accountName = "changeMe"; |
112 | type = MAILLIB::A_UNDEFINED; | 112 | type = MAILLIB::A_UNDEFINED; |
113 | ssl = false; | 113 | ssl = false; |
114 | connectionType = 1; | 114 | connectionType = 1; |
115 | offline = false; | 115 | offline = false; |
116 | } | 116 | } |
117 | 117 | ||
118 | void Account::remove() | 118 | void Account::remove() |
119 | { | 119 | { |
120 | QFile file( getFileName() ); | 120 | QFile file( getFileName() ); |
121 | file.remove(); | 121 | file.remove(); |
122 | } | 122 | } |
123 | 123 | ||
124 | IMAPaccount::IMAPaccount() | 124 | IMAPaccount::IMAPaccount() |
125 | : Account() | 125 | : Account() |
126 | { | 126 | { |
127 | file = IMAPaccount::getUniqueFileName(); | 127 | file = IMAPaccount::getUniqueFileName(); |
128 | accountName = "New IMAP Account"; | 128 | accountName = "New IMAP Account"; |
129 | ssl = false; | 129 | ssl = false; |
130 | connectionType = 1; | 130 | connectionType = 1; |
131 | type = MAILLIB::A_IMAP; | 131 | type = MAILLIB::A_IMAP; |
132 | port = IMAP_PORT; | 132 | port = IMAP_PORT; |
133 | } | 133 | } |
134 | 134 | ||
135 | IMAPaccount::IMAPaccount( QString filename ) | 135 | IMAPaccount::IMAPaccount( QString filename ) |
136 | : Account() | 136 | : Account() |
137 | { | 137 | { |
138 | file = filename; | 138 | file = filename; |
139 | accountName = "New IMAP Account"; | 139 | accountName = "New IMAP Account"; |
140 | ssl = false; | 140 | ssl = false; |
141 | connectionType = 1; | 141 | connectionType = 1; |
142 | type = MAILLIB::A_IMAP; | 142 | type = MAILLIB::A_IMAP; |
143 | port = IMAP_PORT; | 143 | port = IMAP_PORT; |
144 | } | 144 | } |
145 | 145 | ||
146 | QString IMAPaccount::getUniqueFileName() | 146 | QString IMAPaccount::getUniqueFileName() |
147 | { | 147 | { |
148 | int num = 0; | 148 | int num = 0; |
149 | QString unique; | 149 | QString unique; |
150 | 150 | ||
151 | QDir dir( locateLocal("data", "kopiemail" ) ); | 151 | QDir dir( locateLocal("data", "kopiemail" ) ); |
152 | 152 | ||
153 | QStringList imap = dir.entryList( "imap-*" ); | 153 | QStringList imap = dir.entryList( "imap-*" ); |
154 | do { | 154 | do { |
155 | unique.setNum( num++ ); | 155 | unique.setNum( num++ ); |
156 | } while ( imap.contains( "imap-" + unique ) > 0 ); | 156 | } while ( imap.contains( "imap-" + unique ) > 0 ); |
157 | 157 | ||
158 | return unique; | 158 | return unique; |
159 | } | 159 | } |
160 | 160 | ||
161 | void IMAPaccount::read() | 161 | void IMAPaccount::read() |
162 | { | 162 | { |
163 | Config *conf = new Config( getFileName(), Config::File ); | 163 | Config *conf = new Config( getFileName(), Config::File ); |
164 | conf->setGroup( "IMAP Account" ); | 164 | conf->setGroup( "IMAP Account" ); |
165 | accountName = conf->readEntry( "Account","" ); | 165 | accountName = conf->readEntry( "Account","" ); |
166 | if (accountName.isNull()) accountName = ""; | 166 | if (accountName.isNull()) accountName = ""; |
167 | server = conf->readEntry( "Server","" ); | 167 | server = conf->readEntry( "Server","" ); |
168 | if (server.isNull()) server=""; | 168 | if (server.isNull()) server=""; |
169 | port = conf->readEntry( "Port","" ); | 169 | port = conf->readEntry( "Port","" ); |
170 | if (port.isNull()) port="143"; | 170 | if (port.isNull()) port="143"; |
171 | connectionType = conf->readNumEntry( "ConnectionType" ); | 171 | connectionType = conf->readNumEntry( "ConnectionType" ); |
172 | ssl = conf->readBoolEntry( "SSL",false ); | 172 | ssl = conf->readBoolEntry( "SSL",false ); |
173 | user = conf->readEntry( "User","" ); | 173 | user = conf->readEntry( "User","" ); |
174 | if (user.isNull()) user = ""; | 174 | if (user.isNull()) user = ""; |
175 | password = conf->readEntryCrypt( "Password","" ); | 175 | password = conf->readEntryCrypt( "Password","" ); |
176 | if (password.isNull()) password = ""; | 176 | if (password.isNull()) password = ""; |
177 | prefix = conf->readEntry("MailPrefix",""); | 177 | prefix = conf->readEntry("MailPrefix",""); |
178 | if (prefix.isNull()) prefix = ""; | 178 | if (prefix.isNull()) prefix = ""; |
179 | offline = conf->readBoolEntry("Offline",false); | 179 | offline = conf->readBoolEntry("Offline",false); |
180 | delete conf; | 180 | delete conf; |
181 | } | 181 | } |
182 | 182 | ||
183 | void IMAPaccount::save() | 183 | void IMAPaccount::save() |
184 | { | 184 | { |
185 | qDebug("saving %s ",getFileName().latin1() ); | 185 | qDebug("saving %s ",getFileName().latin1() ); |
186 | Settings::checkDirectory(); | 186 | Settings::checkDirectory(); |
187 | 187 | ||
188 | Config *conf = new Config( getFileName(), Config::File ); | 188 | Config *conf = new Config( getFileName(), Config::File ); |
189 | conf->setGroup( "IMAP Account" ); | 189 | conf->setGroup( "IMAP Account" ); |
190 | conf->writeEntry( "Account", accountName ); | 190 | conf->writeEntry( "Account", accountName ); |
191 | conf->writeEntry( "Server", server ); | 191 | conf->writeEntry( "Server", server ); |
192 | conf->writeEntry( "Port", port ); | 192 | conf->writeEntry( "Port", port ); |
193 | conf->writeEntry( "SSL", ssl ); | 193 | conf->writeEntry( "SSL", ssl ); |
194 | conf->writeEntry( "ConnectionType", connectionType ); | 194 | conf->writeEntry( "ConnectionType", connectionType ); |
195 | conf->writeEntry( "User", user ); | 195 | conf->writeEntry( "User", user ); |
196 | conf->writeEntryCrypt( "Password", password ); | 196 | conf->writeEntryCrypt( "Password", password ); |
197 | conf->writeEntry( "MailPrefix",prefix); | 197 | conf->writeEntry( "MailPrefix",prefix); |
198 | conf->writeEntry( "Offline",offline); | 198 | conf->writeEntry( "Offline",offline); |
199 | conf->write(); | 199 | conf->write(); |
200 | delete conf; | 200 | delete conf; |
201 | } | 201 | } |
202 | 202 | ||
203 | 203 | ||
204 | QString IMAPaccount::getFileName() | 204 | QString IMAPaccount::getFileName() |
205 | { | 205 | { |
206 | return locateLocal("data", "kopiemail" ) +"/imap-" + file; | 206 | return locateLocal("data", "kopiemail" ) +"/imap-" + file; |
207 | } | 207 | } |
208 | 208 | ||
209 | POP3account::POP3account() | 209 | POP3account::POP3account() |
210 | : Account() | 210 | : Account() |
211 | { | 211 | { |
212 | file = POP3account::getUniqueFileName(); | 212 | file = POP3account::getUniqueFileName(); |
213 | accountName = "New POP3 Account"; | 213 | accountName = "New POP3 Account"; |
214 | ssl = false; | 214 | ssl = false; |
215 | connectionType = 1; | 215 | connectionType = 1; |
216 | type = MAILLIB::A_POP3; | 216 | type = MAILLIB::A_POP3; |
217 | port = POP3_PORT; | 217 | port = POP3_PORT; |
218 | } | 218 | } |
219 | 219 | ||
220 | POP3account::POP3account( QString filename ) | 220 | POP3account::POP3account( QString filename ) |
221 | : Account() | 221 | : Account() |
222 | { | 222 | { |
223 | file = filename; | 223 | file = filename; |
224 | accountName = "New POP3 Account"; | 224 | accountName = "New POP3 Account"; |
225 | ssl = false; | 225 | ssl = false; |
226 | connectionType = 1; | 226 | connectionType = 1; |
227 | type = MAILLIB::A_POP3; | 227 | type = MAILLIB::A_POP3; |
228 | port = POP3_PORT; | 228 | port = POP3_PORT; |
229 | } | 229 | } |
230 | 230 | ||
231 | QString POP3account::getUniqueFileName() | 231 | QString POP3account::getUniqueFileName() |
232 | { | 232 | { |
233 | int num = 0; | 233 | int num = 0; |
234 | QString unique; | 234 | QString unique; |
235 | 235 | ||
236 | QDir dir( locateLocal("data", "kopiemail" ) ); | 236 | QDir dir( locateLocal("data", "kopiemail" ) ); |
237 | 237 | ||
238 | QStringList imap = dir.entryList( "pop3-*" ); | 238 | QStringList imap = dir.entryList( "pop3-*" ); |
239 | do { | 239 | do { |
240 | unique.setNum( num++ ); | 240 | unique.setNum( num++ ); |
241 | } while ( imap.contains( "pop3-" + unique ) > 0 ); | 241 | } while ( imap.contains( "pop3-" + unique ) > 0 ); |
242 | 242 | ||
243 | return unique; | 243 | return unique; |
244 | } | 244 | } |
245 | 245 | ||
246 | void POP3account::read() | 246 | void POP3account::read() |
247 | { | 247 | { |
248 | Config *conf = new Config( getFileName(), Config::File ); | 248 | Config *conf = new Config( getFileName(), Config::File ); |
249 | conf->setGroup( "POP3 Account" ); | 249 | conf->setGroup( "POP3 Account" ); |
250 | accountName = conf->readEntry( "Account" ); | 250 | accountName = conf->readEntry( "Account" ); |
251 | server = conf->readEntry( "Server" ); | 251 | server = conf->readEntry( "Server" ); |
252 | port = conf->readEntry( "Port" ); | 252 | port = conf->readEntry( "Port" ); |
253 | ssl = conf->readBoolEntry( "SSL" ); | 253 | ssl = conf->readBoolEntry( "SSL" ); |
254 | connectionType = conf->readNumEntry( "ConnectionType" ); | 254 | connectionType = conf->readNumEntry( "ConnectionType" ); |
255 | user = conf->readEntry( "User" ); | 255 | user = conf->readEntry( "User" ); |
256 | password = conf->readEntryCrypt( "Password" ); | 256 | password = conf->readEntryCrypt( "Password" ); |
257 | offline = conf->readBoolEntry("Offline",false); | 257 | offline = conf->readBoolEntry("Offline",false); |
258 | localFolder = conf->readEntry( "LocalFolder" ); | ||
259 | maxMailSize = conf->readNumEntry( "MaxSize",0 ); | ||
260 | int lf = conf->readNumEntry( "LastFetch",0 ); | ||
261 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); | ||
262 | lastFetch = dt.addSecs( lf ); | ||
258 | delete conf; | 263 | delete conf; |
259 | } | 264 | } |
260 | 265 | ||
261 | void POP3account::save() | 266 | void POP3account::save() |
262 | { | 267 | { |
263 | Settings::checkDirectory(); | 268 | Settings::checkDirectory(); |
264 | 269 | ||
265 | Config *conf = new Config( getFileName(), Config::File ); | 270 | Config *conf = new Config( getFileName(), Config::File ); |
266 | conf->setGroup( "POP3 Account" ); | 271 | conf->setGroup( "POP3 Account" ); |
267 | conf->writeEntry( "Account", accountName ); | 272 | conf->writeEntry( "Account", accountName ); |
268 | conf->writeEntry( "Server", server ); | 273 | conf->writeEntry( "Server", server ); |
269 | conf->writeEntry( "Port", port ); | 274 | conf->writeEntry( "Port", port ); |
270 | conf->writeEntry( "SSL", ssl ); | 275 | conf->writeEntry( "SSL", ssl ); |
271 | conf->writeEntry( "ConnectionType", connectionType ); | 276 | conf->writeEntry( "ConnectionType", connectionType ); |
272 | conf->writeEntry( "User", user ); | 277 | conf->writeEntry( "User", user ); |
273 | conf->writeEntryCrypt( "Password", password ); | 278 | conf->writeEntryCrypt( "Password", password ); |
274 | conf->writeEntry( "Offline",offline); | 279 | conf->writeEntry( "Offline",offline); |
280 | conf->writeEntry( "LocalFolder", localFolder ); | ||
281 | conf->writeEntry( "MaxSize", maxMailSize ); | ||
282 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); | ||
283 | int lf = dt.secsTo ( lastFetch ); | ||
284 | conf->writeEntry( "LastFetch", lf ); | ||
275 | conf->write(); | 285 | conf->write(); |
276 | delete conf; | 286 | delete conf; |
277 | } | 287 | } |
278 | 288 | ||
279 | 289 | ||
280 | QString POP3account::getFileName() | 290 | QString POP3account::getFileName() |
281 | { | 291 | { |
282 | return locateLocal("data", "kopiemail" ) +"/pop3-" + file; | 292 | return locateLocal("data", "kopiemail" ) +"/pop3-" + file; |
283 | } | 293 | } |
284 | 294 | ||
285 | SMTPaccount::SMTPaccount() | 295 | SMTPaccount::SMTPaccount() |
286 | : Account() | 296 | : Account() |
287 | { | 297 | { |
288 | file = SMTPaccount::getUniqueFileName(); | 298 | file = SMTPaccount::getUniqueFileName(); |
289 | accountName = "New SMTP Account"; | 299 | accountName = "New SMTP Account"; |
290 | ssl = false; | 300 | ssl = false; |
291 | connectionType = 1; | 301 | connectionType = 1; |
292 | login = false; | 302 | login = false; |
293 | useCC = false; | 303 | useCC = false; |
294 | useBCC = false; | 304 | useBCC = false; |
295 | useReply = false; | 305 | useReply = false; |
296 | type = MAILLIB::A_SMTP; | 306 | type = MAILLIB::A_SMTP; |
297 | port = SMTP_PORT; | 307 | port = SMTP_PORT; |
298 | } | 308 | } |
299 | 309 | ||
300 | SMTPaccount::SMTPaccount( QString filename ) | 310 | SMTPaccount::SMTPaccount( QString filename ) |
301 | : Account() | 311 | : Account() |
302 | { | 312 | { |
303 | file = filename; | 313 | file = filename; |
304 | accountName = "New SMTP Account"; | 314 | accountName = "New SMTP Account"; |
305 | ssl = false; | 315 | ssl = false; |
306 | connectionType = 1; | 316 | connectionType = 1; |
307 | login = false; | 317 | login = false; |
308 | type = MAILLIB::A_SMTP; | 318 | type = MAILLIB::A_SMTP; |
309 | port = SMTP_PORT; | 319 | port = SMTP_PORT; |
310 | } | 320 | } |
311 | 321 | ||
312 | QString SMTPaccount::getUniqueFileName() | 322 | QString SMTPaccount::getUniqueFileName() |
313 | { | 323 | { |
314 | int num = 0; | 324 | int num = 0; |
315 | QString unique; | 325 | QString unique; |
316 | 326 | ||
317 | QDir dir( locateLocal("data", "kopiemail" ) ); | 327 | QDir dir( locateLocal("data", "kopiemail" ) ); |
318 | 328 | ||
319 | QStringList imap = dir.entryList( "smtp-*" ); | 329 | QStringList imap = dir.entryList( "smtp-*" ); |
320 | do { | 330 | do { |
321 | unique.setNum( num++ ); | 331 | unique.setNum( num++ ); |
322 | } while ( imap.contains( "smtp-" + unique ) > 0 ); | 332 | } while ( imap.contains( "smtp-" + unique ) > 0 ); |
323 | 333 | ||
324 | return unique; | 334 | return unique; |
325 | } | 335 | } |
326 | 336 | ||
327 | void SMTPaccount::read() | 337 | void SMTPaccount::read() |
328 | { | 338 | { |
329 | Config *conf = new Config( getFileName(), Config::File ); | 339 | Config *conf = new Config( getFileName(), Config::File ); |
330 | conf->setGroup( "SMTP Account" ); | 340 | conf->setGroup( "SMTP Account" ); |
331 | accountName = conf->readEntry( "Account" ); | 341 | accountName = conf->readEntry( "Account" ); |
332 | server = conf->readEntry( "Server" ); | 342 | server = conf->readEntry( "Server" ); |
333 | port = conf->readEntry( "Port" ); | 343 | port = conf->readEntry( "Port" ); |
334 | ssl = conf->readBoolEntry( "SSL" ); | 344 | ssl = conf->readBoolEntry( "SSL" ); |
335 | connectionType = conf->readNumEntry( "ConnectionType" ); | 345 | connectionType = conf->readNumEntry( "ConnectionType" ); |
336 | login = conf->readBoolEntry( "Login" ); | 346 | login = conf->readBoolEntry( "Login" ); |
337 | user = conf->readEntry( "User" ); | 347 | user = conf->readEntry( "User" ); |
338 | password = conf->readEntryCrypt( "Password" ); | 348 | password = conf->readEntryCrypt( "Password" ); |
339 | delete conf; | 349 | delete conf; |
340 | } | 350 | } |
341 | 351 | ||
342 | void SMTPaccount::save() | 352 | void SMTPaccount::save() |
343 | { | 353 | { |
344 | Settings::checkDirectory(); | 354 | Settings::checkDirectory(); |
345 | 355 | ||
346 | Config *conf = new Config( getFileName(), Config::File ); | 356 | Config *conf = new Config( getFileName(), Config::File ); |
347 | conf->setGroup( "SMTP Account" ); | 357 | conf->setGroup( "SMTP Account" ); |
348 | conf->writeEntry( "Account", accountName ); | 358 | conf->writeEntry( "Account", accountName ); |
349 | conf->writeEntry( "Server", server ); | 359 | conf->writeEntry( "Server", server ); |
350 | conf->writeEntry( "Port", port ); | 360 | conf->writeEntry( "Port", port ); |
351 | conf->writeEntry( "SSL", ssl ); | 361 | conf->writeEntry( "SSL", ssl ); |
352 | conf->writeEntry( "ConnectionType", connectionType ); | 362 | conf->writeEntry( "ConnectionType", connectionType ); |
353 | conf->writeEntry( "Login", login ); | 363 | conf->writeEntry( "Login", login ); |
354 | conf->writeEntry( "User", user ); | 364 | conf->writeEntry( "User", user ); |
355 | conf->writeEntryCrypt( "Password", password ); | 365 | conf->writeEntryCrypt( "Password", password ); |
356 | conf->write(); | 366 | conf->write(); |
357 | delete conf; | 367 | delete conf; |
358 | } | 368 | } |
359 | 369 | ||
360 | 370 | ||
361 | QString SMTPaccount::getFileName() | 371 | QString SMTPaccount::getFileName() |
362 | { | 372 | { |
363 | return locateLocal("data", "kopiemail" ) +"/smtp-" + file; | 373 | return locateLocal("data", "kopiemail" ) +"/smtp-" + file; |
364 | } | 374 | } |
365 | 375 | ||
366 | NNTPaccount::NNTPaccount() | 376 | NNTPaccount::NNTPaccount() |
367 | : Account() | 377 | : Account() |
368 | { | 378 | { |
369 | file = NNTPaccount::getUniqueFileName(); | 379 | file = NNTPaccount::getUniqueFileName(); |
370 | accountName = "New NNTP Account"; | 380 | accountName = "New NNTP Account"; |
371 | ssl = false; | 381 | ssl = false; |
372 | login = false; | 382 | login = false; |
373 | type = MAILLIB::A_NNTP; | 383 | type = MAILLIB::A_NNTP; |
374 | port = NNTP_PORT; | 384 | port = NNTP_PORT; |
375 | } | 385 | } |
376 | 386 | ||
377 | NNTPaccount::NNTPaccount( QString filename ) | 387 | NNTPaccount::NNTPaccount( QString filename ) |
378 | : Account() | 388 | : Account() |
379 | { | 389 | { |
380 | file = filename; | 390 | file = filename; |
381 | accountName = "New NNTP Account"; | 391 | accountName = "New NNTP Account"; |
382 | ssl = false; | 392 | ssl = false; |
383 | login = false; | 393 | login = false; |
384 | type = MAILLIB::A_NNTP; | 394 | type = MAILLIB::A_NNTP; |
385 | port = NNTP_PORT; | 395 | port = NNTP_PORT; |
386 | } | 396 | } |
387 | 397 | ||
388 | QString NNTPaccount::getUniqueFileName() | 398 | QString NNTPaccount::getUniqueFileName() |
389 | { | 399 | { |
390 | int num = 0; | 400 | int num = 0; |
391 | QString unique; | 401 | QString unique; |
392 | 402 | ||
393 | QDir dir( locateLocal("data", "kopiemail" ) ); | 403 | QDir dir( locateLocal("data", "kopiemail" ) ); |
394 | 404 | ||
395 | QStringList imap = dir.entryList( "nntp-*" ); | 405 | QStringList imap = dir.entryList( "nntp-*" ); |
396 | do { | 406 | do { |
397 | unique.setNum( num++ ); | 407 | unique.setNum( num++ ); |
398 | } while ( imap.contains( "nntp-" + unique ) > 0 ); | 408 | } while ( imap.contains( "nntp-" + unique ) > 0 ); |
399 | 409 | ||
400 | return unique; | 410 | return unique; |
401 | } | 411 | } |
402 | 412 | ||
403 | void NNTPaccount::read() | 413 | void NNTPaccount::read() |
404 | { | 414 | { |
405 | Config *conf = new Config( getFileName(), Config::File ); | 415 | Config *conf = new Config( getFileName(), Config::File ); |
406 | conf->setGroup( "NNTP Account" ); | 416 | conf->setGroup( "NNTP Account" ); |
407 | accountName = conf->readEntry( "Account" ); | 417 | accountName = conf->readEntry( "Account" ); |
408 | server = conf->readEntry( "Server" ); | 418 | server = conf->readEntry( "Server" ); |
409 | port = conf->readEntry( "Port" ); | 419 | port = conf->readEntry( "Port" ); |
410 | ssl = conf->readBoolEntry( "SSL" ); | 420 | ssl = conf->readBoolEntry( "SSL" ); |
411 | login = conf->readBoolEntry( "Login" ); | 421 | login = conf->readBoolEntry( "Login" ); |
412 | user = conf->readEntry( "User" ); | 422 | user = conf->readEntry( "User" ); |
413 | password = conf->readEntryCrypt( "Password" ); | 423 | password = conf->readEntryCrypt( "Password" ); |
414 | subscribedGroups = conf->readListEntry( "Subscribed", ',' ); | 424 | subscribedGroups = conf->readListEntry( "Subscribed", ',' ); |
415 | delete conf; | 425 | delete conf; |
416 | } | 426 | } |
417 | 427 | ||
418 | void NNTPaccount::save() | 428 | void NNTPaccount::save() |
419 | { | 429 | { |
420 | Settings::checkDirectory(); | 430 | Settings::checkDirectory(); |
421 | 431 | ||
422 | Config *conf = new Config( getFileName(), Config::File ); | 432 | Config *conf = new Config( getFileName(), Config::File ); |
423 | conf->setGroup( "NNTP Account" ); | 433 | conf->setGroup( "NNTP Account" ); |
424 | conf->writeEntry( "Account", accountName ); | 434 | conf->writeEntry( "Account", accountName ); |
425 | conf->writeEntry( "Server", server ); | 435 | conf->writeEntry( "Server", server ); |
426 | conf->writeEntry( "Port", port ); | 436 | conf->writeEntry( "Port", port ); |
427 | conf->writeEntry( "SSL", ssl ); | 437 | conf->writeEntry( "SSL", ssl ); |
428 | conf->writeEntry( "Login", login ); | 438 | conf->writeEntry( "Login", login ); |
429 | conf->writeEntry( "User", user ); | 439 | conf->writeEntry( "User", user ); |
430 | conf->writeEntryCrypt( "Password", password ); | 440 | conf->writeEntryCrypt( "Password", password ); |
431 | conf->writeEntry( "Subscribed" , subscribedGroups, ',' ); | 441 | conf->writeEntry( "Subscribed" , subscribedGroups, ',' ); |
432 | conf->write(); | 442 | conf->write(); |
433 | delete conf; | 443 | delete conf; |
434 | } | 444 | } |
435 | 445 | ||
436 | 446 | ||
437 | QString NNTPaccount::getFileName() | 447 | QString NNTPaccount::getFileName() |
438 | { | 448 | { |
439 | return locateLocal("data", "kopiemail" ) +"/nntp-" + file; | 449 | return locateLocal("data", "kopiemail" ) +"/nntp-" + file; |
440 | } | 450 | } |
diff --git a/kmicromail/libmailwrapper/settings.h b/kmicromail/libmailwrapper/settings.h index ba3ec89..c33c403 100644 --- a/kmicromail/libmailwrapper/settings.h +++ b/kmicromail/libmailwrapper/settings.h | |||
@@ -1,164 +1,173 @@ | |||
1 | #ifndef SETTINGS_H | 1 | #ifndef SETTINGS_H |
2 | #define SETTINGS_H | 2 | #define SETTINGS_H |
3 | 3 | ||
4 | #include "maildefines.h" | 4 | #include "maildefines.h" |
5 | 5 | ||
6 | /* OPIE */ | 6 | /* OPIE */ |
7 | 7 | ||
8 | /* QT */ | 8 | /* QT */ |
9 | #include <qobject.h> | 9 | #include <qobject.h> |
10 | #include <qlist.h> | 10 | #include <qlist.h> |
11 | #include <qdatetime.h> | ||
11 | 12 | ||
12 | class Account | 13 | class Account |
13 | { | 14 | { |
14 | 15 | ||
15 | public: | 16 | public: |
16 | Account(); | 17 | Account(); |
17 | virtual ~Account() {} | 18 | virtual ~Account() {} |
18 | 19 | ||
19 | void remove(); | 20 | void remove(); |
20 | void setAccountName( QString name ) { accountName = name; } | 21 | void setAccountName( QString name ) { accountName = name; } |
21 | const QString&getAccountName()const{ return accountName; } | 22 | const QString&getAccountName()const{ return accountName; } |
22 | MAILLIB::ATYPE getType()const{ return type; } | 23 | MAILLIB::ATYPE getType()const{ return type; } |
23 | 24 | ||
24 | void setServer(const QString&str){ server = str; } | 25 | void setServer(const QString&str){ server = str; } |
25 | const QString&getServer()const{ return server; } | 26 | const QString&getServer()const{ return server; } |
26 | 27 | ||
28 | void setLocalFolder( QString name ) { localFolder = name; } | ||
29 | const QString& getLocalFolder()const{ return localFolder; } | ||
30 | |||
27 | void setPort(const QString&str) { port = str; } | 31 | void setPort(const QString&str) { port = str; } |
28 | const QString&getPort()const{ return port; } | 32 | const QString&getPort()const{ return port; } |
29 | 33 | ||
30 | void setUser(const QString&str){ user = str; } | 34 | void setUser(const QString&str){ user = str; } |
31 | const QString&getUser()const{ return user; } | 35 | const QString&getUser()const{ return user; } |
32 | 36 | ||
33 | void setPassword(const QString&str) { password = str; } | 37 | void setPassword(const QString&str) { password = str; } |
34 | const QString&getPassword()const { return password; } | 38 | const QString&getPassword()const { return password; } |
35 | 39 | ||
36 | void setSSL( bool b ) { ssl = b; } | 40 | void setSSL( bool b ) { ssl = b; } |
37 | bool getSSL() { return ssl; } | 41 | bool getSSL() { return ssl; } |
38 | 42 | ||
39 | void setConnectionType( int x ) { connectionType = x; } | 43 | void setConnectionType( int x ) { connectionType = x; } |
40 | int ConnectionType() { return connectionType; } | 44 | int ConnectionType() { return connectionType; } |
41 | 45 | ||
46 | void setMaxMailSize( int x ) { maxMailSize = x; } | ||
47 | int getMaxMailSize() { return maxMailSize; } | ||
42 | 48 | ||
43 | void setOffline(bool b) {offline = b;} | 49 | void setOffline(bool b) {offline = b;} |
44 | bool getOffline()const{return offline;} | 50 | bool getOffline()const{return offline;} |
45 | 51 | ||
46 | virtual QString getFileName() { return accountName; } | 52 | virtual QString getFileName() { return accountName; } |
47 | virtual void read() { ; } | 53 | virtual void read() { ; } |
48 | virtual void save() { ; } | 54 | virtual void save() { ; } |
49 | 55 | ||
50 | protected: | 56 | protected: |
51 | QString accountName, server, port, user, password; | 57 | QString accountName, server, port, user, password; |
52 | bool ssl; | 58 | bool ssl; |
53 | int connectionType; | 59 | int connectionType; |
54 | bool offline; | 60 | bool offline; |
55 | MAILLIB::ATYPE type; | 61 | MAILLIB::ATYPE type; |
62 | QString localFolder; | ||
63 | int maxMailSize; | ||
64 | QDateTime lastFetch; | ||
56 | }; | 65 | }; |
57 | 66 | ||
58 | class IMAPaccount : public Account | 67 | class IMAPaccount : public Account |
59 | { | 68 | { |
60 | 69 | ||
61 | public: | 70 | public: |
62 | IMAPaccount(); | 71 | IMAPaccount(); |
63 | IMAPaccount( QString filename ); | 72 | IMAPaccount( QString filename ); |
64 | 73 | ||
65 | static QString getUniqueFileName(); | 74 | static QString getUniqueFileName(); |
66 | 75 | ||
67 | virtual void read(); | 76 | virtual void read(); |
68 | virtual void save(); | 77 | virtual void save(); |
69 | virtual QString getFileName(); | 78 | virtual QString getFileName(); |
70 | 79 | ||
71 | void setPrefix(const QString&str) {prefix=str;} | 80 | void setPrefix(const QString&str) {prefix=str;} |
72 | const QString&getPrefix()const{return prefix;} | 81 | const QString&getPrefix()const{return prefix;} |
73 | 82 | ||
74 | private: | 83 | private: |
75 | QString file,prefix; | 84 | QString file,prefix; |
76 | 85 | ||
77 | }; | 86 | }; |
78 | 87 | ||
79 | class POP3account : public Account | 88 | class POP3account : public Account |
80 | { | 89 | { |
81 | 90 | ||
82 | public: | 91 | public: |
83 | POP3account(); | 92 | POP3account(); |
84 | POP3account( QString filename ); | 93 | POP3account( QString filename ); |
85 | 94 | ||
86 | static QString getUniqueFileName(); | 95 | static QString getUniqueFileName(); |
87 | 96 | ||
88 | virtual void read(); | 97 | virtual void read(); |
89 | virtual void save(); | 98 | virtual void save(); |
90 | virtual QString getFileName(); | 99 | virtual QString getFileName(); |
91 | 100 | ||
92 | private: | 101 | private: |
93 | QString file; | 102 | QString file; |
94 | 103 | ||
95 | }; | 104 | }; |
96 | 105 | ||
97 | class SMTPaccount : public Account | 106 | class SMTPaccount : public Account |
98 | { | 107 | { |
99 | 108 | ||
100 | public: | 109 | public: |
101 | SMTPaccount(); | 110 | SMTPaccount(); |
102 | SMTPaccount( QString filename ); | 111 | SMTPaccount( QString filename ); |
103 | 112 | ||
104 | static QString getUniqueFileName(); | 113 | static QString getUniqueFileName(); |
105 | 114 | ||
106 | virtual void read(); | 115 | virtual void read(); |
107 | virtual void save(); | 116 | virtual void save(); |
108 | virtual QString getFileName(); | 117 | virtual QString getFileName(); |
109 | 118 | ||
110 | void setLogin( bool b ) { login = b; } | 119 | void setLogin( bool b ) { login = b; } |
111 | bool getLogin() { return login; } | 120 | bool getLogin() { return login; } |
112 | 121 | ||
113 | private: | 122 | private: |
114 | QString file, name, mail, org, cc, bcc, reply, signature; | 123 | QString file, name, mail, org, cc, bcc, reply, signature; |
115 | bool useCC, useBCC, useReply, login; | 124 | bool useCC, useBCC, useReply, login; |
116 | 125 | ||
117 | }; | 126 | }; |
118 | 127 | ||
119 | class NNTPaccount : public Account | 128 | class NNTPaccount : public Account |
120 | { | 129 | { |
121 | 130 | ||
122 | public: | 131 | public: |
123 | NNTPaccount(); | 132 | NNTPaccount(); |
124 | NNTPaccount( QString filename ); | 133 | NNTPaccount( QString filename ); |
125 | 134 | ||
126 | static QString getUniqueFileName(); | 135 | static QString getUniqueFileName(); |
127 | 136 | ||
128 | virtual void read(); | 137 | virtual void read(); |
129 | virtual void save(); | 138 | virtual void save(); |
130 | virtual QString getFileName(); | 139 | virtual QString getFileName(); |
131 | 140 | ||
132 | void setLogin( bool b ) { login = b; } | 141 | void setLogin( bool b ) { login = b; } |
133 | bool getLogin() { return login; } | 142 | bool getLogin() { return login; } |
134 | 143 | ||
135 | void setGroups( QStringList list ) { subscribedGroups = list; } | 144 | void setGroups( QStringList list ) { subscribedGroups = list; } |
136 | QStringList getGroups() { return subscribedGroups; } | 145 | QStringList getGroups() { return subscribedGroups; } |
137 | 146 | ||
138 | private: | 147 | private: |
139 | QString file; | 148 | QString file; |
140 | bool login; | 149 | bool login; |
141 | QStringList subscribedGroups; | 150 | QStringList subscribedGroups; |
142 | 151 | ||
143 | }; | 152 | }; |
144 | 153 | ||
145 | class Settings : public QObject | 154 | class Settings : public QObject |
146 | { | 155 | { |
147 | Q_OBJECT | 156 | Q_OBJECT |
148 | 157 | ||
149 | public: | 158 | public: |
150 | Settings(); | 159 | Settings(); |
151 | QList<Account> getAccounts(); | 160 | QList<Account> getAccounts(); |
152 | void addAccount(Account *account); | 161 | void addAccount(Account *account); |
153 | void delAccount(Account *account); | 162 | void delAccount(Account *account); |
154 | void saveAccounts(); | 163 | void saveAccounts(); |
155 | void readAccounts(); | 164 | void readAccounts(); |
156 | static void checkDirectory(); | 165 | static void checkDirectory(); |
157 | 166 | ||
158 | private: | 167 | private: |
159 | void updateAccounts(); | 168 | void updateAccounts(); |
160 | QList<Account> accounts; | 169 | QList<Account> accounts; |
161 | 170 | ||
162 | }; | 171 | }; |
163 | 172 | ||
164 | #endif | 173 | #endif |
diff --git a/kmicromail/pop3configui.ui b/kmicromail/pop3configui.ui index 1014ef4..a2d43bd 100644 --- a/kmicromail/pop3configui.ui +++ b/kmicromail/pop3configui.ui | |||
@@ -1,352 +1,438 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>POP3configUI</class> | 2 | <class>POP3configUI</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>POP3configUI</cstring> | 7 | <cstring>POP3configUI</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>314</width> | 14 | <width>322</width> |
15 | <height>410</height> | 15 | <height>404</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Configure POP3</string> | 20 | <string>Configure POP3</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <vbox> | 28 | <vbox> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>3</number> | 31 | <number>11</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>3</number> | 35 | <number>6</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QLayoutWidget</class> | 38 | <class>QLayoutWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>Layout12</cstring> | 41 | <cstring>Layout12</cstring> |
42 | </property> | 42 | </property> |
43 | <hbox> | 43 | <hbox> |
44 | <property stdset="1"> | 44 | <property stdset="1"> |
45 | <name>margin</name> | 45 | <name>margin</name> |
46 | <number>0</number> | 46 | <number>0</number> |
47 | </property> | 47 | </property> |
48 | <property stdset="1"> | 48 | <property stdset="1"> |
49 | <name>spacing</name> | 49 | <name>spacing</name> |
50 | <number>6</number> | 50 | <number>6</number> |
51 | </property> | 51 | </property> |
52 | <widget> | 52 | <widget> |
53 | <class>QLabel</class> | 53 | <class>QLabel</class> |
54 | <property stdset="1"> | 54 | <property stdset="1"> |
55 | <name>name</name> | 55 | <name>name</name> |
56 | <cstring>accountLabel</cstring> | 56 | <cstring>accountLabel</cstring> |
57 | </property> | 57 | </property> |
58 | <property stdset="1"> | 58 | <property stdset="1"> |
59 | <name>text</name> | 59 | <name>text</name> |
60 | <string>Account</string> | 60 | <string>Account</string> |
61 | </property> | 61 | </property> |
62 | </widget> | 62 | </widget> |
63 | <widget> | 63 | <widget> |
64 | <class>QLineEdit</class> | 64 | <class>QLineEdit</class> |
65 | <property stdset="1"> | 65 | <property stdset="1"> |
66 | <name>name</name> | 66 | <name>name</name> |
67 | <cstring>accountLine</cstring> | 67 | <cstring>accountLine</cstring> |
68 | </property> | 68 | </property> |
69 | <property> | 69 | <property> |
70 | <name>toolTip</name> | 70 | <name>toolTip</name> |
71 | <string>Name of the Account</string> | 71 | <string>Name of the Account</string> |
72 | </property> | 72 | </property> |
73 | </widget> | 73 | </widget> |
74 | </hbox> | 74 | </hbox> |
75 | </widget> | 75 | </widget> |
76 | <widget> | 76 | <widget> |
77 | <class>Line</class> | 77 | <class>Line</class> |
78 | <property stdset="1"> | 78 | <property stdset="1"> |
79 | <name>name</name> | 79 | <name>name</name> |
80 | <cstring>line1</cstring> | 80 | <cstring>line1</cstring> |
81 | </property> | 81 | </property> |
82 | <property stdset="1"> | 82 | <property stdset="1"> |
83 | <name>orientation</name> | 83 | <name>orientation</name> |
84 | <enum>Horizontal</enum> | 84 | <enum>Horizontal</enum> |
85 | </property> | 85 | </property> |
86 | </widget> | 86 | </widget> |
87 | <widget> | 87 | <widget> |
88 | <class>QLayoutWidget</class> | 88 | <class>QLayoutWidget</class> |
89 | <property stdset="1"> | 89 | <property stdset="1"> |
90 | <name>name</name> | 90 | <name>name</name> |
91 | <cstring>Layout11</cstring> | 91 | <cstring>Layout11</cstring> |
92 | </property> | 92 | </property> |
93 | <hbox> | 93 | <hbox> |
94 | <property stdset="1"> | 94 | <property stdset="1"> |
95 | <name>margin</name> | 95 | <name>margin</name> |
96 | <number>0</number> | 96 | <number>0</number> |
97 | </property> | 97 | </property> |
98 | <property stdset="1"> | 98 | <property stdset="1"> |
99 | <name>spacing</name> | 99 | <name>spacing</name> |
100 | <number>6</number> | 100 | <number>6</number> |
101 | </property> | 101 | </property> |
102 | <widget> | 102 | <widget> |
103 | <class>QLayoutWidget</class> | 103 | <class>QLayoutWidget</class> |
104 | <property stdset="1"> | 104 | <property stdset="1"> |
105 | <name>name</name> | 105 | <name>name</name> |
106 | <cstring>Layout9</cstring> | 106 | <cstring>Layout9</cstring> |
107 | </property> | 107 | </property> |
108 | <vbox> | 108 | <vbox> |
109 | <property stdset="1"> | 109 | <property stdset="1"> |
110 | <name>margin</name> | 110 | <name>margin</name> |
111 | <number>0</number> | 111 | <number>0</number> |
112 | </property> | 112 | </property> |
113 | <property stdset="1"> | 113 | <property stdset="1"> |
114 | <name>spacing</name> | 114 | <name>spacing</name> |
115 | <number>6</number> | 115 | <number>6</number> |
116 | </property> | 116 | </property> |
117 | <widget> | 117 | <widget> |
118 | <class>QLabel</class> | 118 | <class>QLabel</class> |
119 | <property stdset="1"> | 119 | <property stdset="1"> |
120 | <name>name</name> | 120 | <name>name</name> |
121 | <cstring>serverLabel</cstring> | 121 | <cstring>serverLabel</cstring> |
122 | </property> | 122 | </property> |
123 | <property stdset="1"> | 123 | <property stdset="1"> |
124 | <name>text</name> | 124 | <name>text</name> |
125 | <string>Server</string> | 125 | <string>Server</string> |
126 | </property> | 126 | </property> |
127 | </widget> | 127 | </widget> |
128 | <widget> | 128 | <widget> |
129 | <class>QLabel</class> | 129 | <class>QLabel</class> |
130 | <property stdset="1"> | 130 | <property stdset="1"> |
131 | <name>name</name> | 131 | <name>name</name> |
132 | <cstring>portLabel</cstring> | 132 | <cstring>portLabel</cstring> |
133 | </property> | 133 | </property> |
134 | <property stdset="1"> | 134 | <property stdset="1"> |
135 | <name>text</name> | 135 | <name>text</name> |
136 | <string>Port</string> | 136 | <string>Port</string> |
137 | </property> | 137 | </property> |
138 | </widget> | 138 | </widget> |
139 | </vbox> | 139 | </vbox> |
140 | </widget> | 140 | </widget> |
141 | <widget> | 141 | <widget> |
142 | <class>QLayoutWidget</class> | 142 | <class>QLayoutWidget</class> |
143 | <property stdset="1"> | 143 | <property stdset="1"> |
144 | <name>name</name> | 144 | <name>name</name> |
145 | <cstring>Layout10</cstring> | 145 | <cstring>Layout10</cstring> |
146 | </property> | 146 | </property> |
147 | <vbox> | 147 | <vbox> |
148 | <property stdset="1"> | 148 | <property stdset="1"> |
149 | <name>margin</name> | 149 | <name>margin</name> |
150 | <number>0</number> | 150 | <number>0</number> |
151 | </property> | 151 | </property> |
152 | <property stdset="1"> | 152 | <property stdset="1"> |
153 | <name>spacing</name> | 153 | <name>spacing</name> |
154 | <number>6</number> | 154 | <number>6</number> |
155 | </property> | 155 | </property> |
156 | <widget> | 156 | <widget> |
157 | <class>QLineEdit</class> | 157 | <class>QLineEdit</class> |
158 | <property stdset="1"> | 158 | <property stdset="1"> |
159 | <name>name</name> | 159 | <name>name</name> |
160 | <cstring>serverLine</cstring> | 160 | <cstring>serverLine</cstring> |
161 | </property> | 161 | </property> |
162 | </widget> | 162 | </widget> |
163 | <widget> | 163 | <widget> |
164 | <class>QLineEdit</class> | 164 | <class>QLineEdit</class> |
165 | <property stdset="1"> | 165 | <property stdset="1"> |
166 | <name>name</name> | 166 | <name>name</name> |
167 | <cstring>portLine</cstring> | 167 | <cstring>portLine</cstring> |
168 | </property> | 168 | </property> |
169 | </widget> | 169 | </widget> |
170 | </vbox> | 170 | </vbox> |
171 | </widget> | 171 | </widget> |
172 | </hbox> | 172 | </hbox> |
173 | </widget> | 173 | </widget> |
174 | <widget> | 174 | <widget> |
175 | <class>QLayoutWidget</class> | 175 | <class>QLayoutWidget</class> |
176 | <property stdset="1"> | 176 | <property stdset="1"> |
177 | <name>name</name> | 177 | <name>name</name> |
178 | <cstring>Layout13</cstring> | 178 | <cstring>Layout13</cstring> |
179 | </property> | 179 | </property> |
180 | <vbox> | 180 | <vbox> |
181 | <property stdset="1"> | 181 | <property stdset="1"> |
182 | <name>margin</name> | 182 | <name>margin</name> |
183 | <number>0</number> | 183 | <number>0</number> |
184 | </property> | 184 | </property> |
185 | <property stdset="1"> | 185 | <property stdset="1"> |
186 | <name>spacing</name> | 186 | <name>spacing</name> |
187 | <number>6</number> | 187 | <number>6</number> |
188 | </property> | 188 | </property> |
189 | <widget> | 189 | <widget> |
190 | <class>QLabel</class> | 190 | <class>QLabel</class> |
191 | <property stdset="1"> | 191 | <property stdset="1"> |
192 | <name>name</name> | 192 | <name>name</name> |
193 | <cstring>TextLabel1</cstring> | 193 | <cstring>TextLabel1</cstring> |
194 | </property> | 194 | </property> |
195 | <property stdset="1"> | 195 | <property stdset="1"> |
196 | <name>text</name> | 196 | <name>text</name> |
197 | <string>Use secure sockets:</string> | 197 | <string>Use secure sockets:</string> |
198 | </property> | 198 | </property> |
199 | </widget> | 199 | </widget> |
200 | <widget> | 200 | <widget> |
201 | <class>QComboBox</class> | 201 | <class>QComboBox</class> |
202 | <property stdset="1"> | 202 | <property stdset="1"> |
203 | <name>name</name> | 203 | <name>name</name> |
204 | <cstring>ComboBox1</cstring> | 204 | <cstring>ComboBox1</cstring> |
205 | </property> | 205 | </property> |
206 | </widget> | 206 | </widget> |
207 | </vbox> | 207 | </vbox> |
208 | </widget> | 208 | </widget> |
209 | <widget> | 209 | <widget> |
210 | <class>QLineEdit</class> | 210 | <class>QLineEdit</class> |
211 | <property stdset="1"> | 211 | <property stdset="1"> |
212 | <name>name</name> | 212 | <name>name</name> |
213 | <cstring>CommandEdit</cstring> | 213 | <cstring>CommandEdit</cstring> |
214 | </property> | 214 | </property> |
215 | <property stdset="1"> | 215 | <property stdset="1"> |
216 | <name>text</name> | 216 | <name>text</name> |
217 | <string>ssh $SERVER exec imapd</string> | 217 | <string>ssh $SERVER exec imapd</string> |
218 | </property> | 218 | </property> |
219 | </widget> | 219 | </widget> |
220 | <widget> | 220 | <widget> |
221 | <class>Line</class> | 221 | <class>Line</class> |
222 | <property stdset="1"> | 222 | <property stdset="1"> |
223 | <name>name</name> | 223 | <name>name</name> |
224 | <cstring>line2</cstring> | 224 | <cstring>line2</cstring> |
225 | </property> | 225 | </property> |
226 | <property stdset="1"> | 226 | <property stdset="1"> |
227 | <name>orientation</name> | 227 | <name>orientation</name> |
228 | <enum>Horizontal</enum> | 228 | <enum>Horizontal</enum> |
229 | </property> | 229 | </property> |
230 | </widget> | 230 | </widget> |
231 | <widget> | 231 | <widget> |
232 | <class>QLayoutWidget</class> | 232 | <class>QLayoutWidget</class> |
233 | <property stdset="1"> | 233 | <property stdset="1"> |
234 | <name>name</name> | 234 | <name>name</name> |
235 | <cstring>Layout6</cstring> | 235 | <cstring>Layout6</cstring> |
236 | </property> | 236 | </property> |
237 | <hbox> | 237 | <hbox> |
238 | <property stdset="1"> | 238 | <property stdset="1"> |
239 | <name>margin</name> | 239 | <name>margin</name> |
240 | <number>0</number> | 240 | <number>0</number> |
241 | </property> | 241 | </property> |
242 | <property stdset="1"> | 242 | <property stdset="1"> |
243 | <name>spacing</name> | 243 | <name>spacing</name> |
244 | <number>6</number> | 244 | <number>6</number> |
245 | </property> | 245 | </property> |
246 | <widget> | 246 | <widget> |
247 | <class>QLayoutWidget</class> | 247 | <class>QLayoutWidget</class> |
248 | <property stdset="1"> | 248 | <property stdset="1"> |
249 | <name>name</name> | 249 | <name>name</name> |
250 | <cstring>Layout4</cstring> | 250 | <cstring>Layout4</cstring> |
251 | </property> | 251 | </property> |
252 | <vbox> | 252 | <vbox> |
253 | <property stdset="1"> | 253 | <property stdset="1"> |
254 | <name>margin</name> | 254 | <name>margin</name> |
255 | <number>0</number> | 255 | <number>0</number> |
256 | </property> | 256 | </property> |
257 | <property stdset="1"> | 257 | <property stdset="1"> |
258 | <name>spacing</name> | 258 | <name>spacing</name> |
259 | <number>6</number> | 259 | <number>6</number> |
260 | </property> | 260 | </property> |
261 | <widget> | 261 | <widget> |
262 | <class>QLabel</class> | 262 | <class>QLabel</class> |
263 | <property stdset="1"> | 263 | <property stdset="1"> |
264 | <name>name</name> | 264 | <name>name</name> |
265 | <cstring>userLabel</cstring> | 265 | <cstring>userLabel</cstring> |
266 | </property> | 266 | </property> |
267 | <property stdset="1"> | 267 | <property stdset="1"> |
268 | <name>text</name> | 268 | <name>text</name> |
269 | <string>User</string> | 269 | <string>User</string> |
270 | </property> | 270 | </property> |
271 | </widget> | 271 | </widget> |
272 | <widget> | 272 | <widget> |
273 | <class>QLabel</class> | 273 | <class>QLabel</class> |
274 | <property stdset="1"> | 274 | <property stdset="1"> |
275 | <name>name</name> | 275 | <name>name</name> |
276 | <cstring>passLabel</cstring> | 276 | <cstring>passLabel</cstring> |
277 | </property> | 277 | </property> |
278 | <property stdset="1"> | 278 | <property stdset="1"> |
279 | <name>text</name> | 279 | <name>text</name> |
280 | <string>Password</string> | 280 | <string>Password</string> |
281 | </property> | 281 | </property> |
282 | </widget> | 282 | </widget> |
283 | </vbox> | 283 | </vbox> |
284 | </widget> | 284 | </widget> |
285 | <widget> | 285 | <widget> |
286 | <class>QLayoutWidget</class> | 286 | <class>QLayoutWidget</class> |
287 | <property stdset="1"> | 287 | <property stdset="1"> |
288 | <name>name</name> | 288 | <name>name</name> |
289 | <cstring>Layout5</cstring> | 289 | <cstring>Layout5</cstring> |
290 | </property> | 290 | </property> |
291 | <vbox> | 291 | <vbox> |
292 | <property stdset="1"> | 292 | <property stdset="1"> |
293 | <name>margin</name> | 293 | <name>margin</name> |
294 | <number>0</number> | 294 | <number>0</number> |
295 | </property> | 295 | </property> |
296 | <property stdset="1"> | 296 | <property stdset="1"> |
297 | <name>spacing</name> | 297 | <name>spacing</name> |
298 | <number>6</number> | 298 | <number>6</number> |
299 | </property> | 299 | </property> |
300 | <widget> | 300 | <widget> |
301 | <class>QLineEdit</class> | 301 | <class>QLineEdit</class> |
302 | <property stdset="1"> | 302 | <property stdset="1"> |
303 | <name>name</name> | 303 | <name>name</name> |
304 | <cstring>userLine</cstring> | 304 | <cstring>userLine</cstring> |
305 | </property> | 305 | </property> |
306 | </widget> | 306 | </widget> |
307 | <widget> | 307 | <widget> |
308 | <class>QLineEdit</class> | 308 | <class>QLineEdit</class> |
309 | <property stdset="1"> | 309 | <property stdset="1"> |
310 | <name>name</name> | 310 | <name>name</name> |
311 | <cstring>passLine</cstring> | 311 | <cstring>passLine</cstring> |
312 | </property> | 312 | </property> |
313 | <property stdset="1"> | 313 | <property stdset="1"> |
314 | <name>echoMode</name> | 314 | <name>echoMode</name> |
315 | <enum>Password</enum> | 315 | <enum>Password</enum> |
316 | </property> | 316 | </property> |
317 | </widget> | 317 | </widget> |
318 | </vbox> | 318 | </vbox> |
319 | </widget> | 319 | </widget> |
320 | </hbox> | 320 | </hbox> |
321 | </widget> | 321 | </widget> |
322 | <widget> | ||
323 | <class>QLayoutWidget</class> | ||
324 | <property stdset="1"> | ||
325 | <name>name</name> | ||
326 | <cstring>Layout9</cstring> | ||
327 | </property> | ||
328 | <hbox> | ||
329 | <property stdset="1"> | ||
330 | <name>margin</name> | ||
331 | <number>0</number> | ||
332 | </property> | ||
333 | <property stdset="1"> | ||
334 | <name>spacing</name> | ||
335 | <number>6</number> | ||
336 | </property> | ||
337 | <widget> | ||
338 | <class>QLabel</class> | ||
339 | <property stdset="1"> | ||
340 | <name>name</name> | ||
341 | <cstring>TextLabel1_2</cstring> | ||
342 | </property> | ||
343 | <property stdset="1"> | ||
344 | <name>text</name> | ||
345 | <string>Local storage folder:</string> | ||
346 | </property> | ||
347 | </widget> | ||
348 | <widget> | ||
349 | <class>QLineEdit</class> | ||
350 | <property stdset="1"> | ||
351 | <name>name</name> | ||
352 | <cstring>localFolder</cstring> | ||
353 | </property> | ||
354 | <property stdset="1"> | ||
355 | <name>text</name> | ||
356 | <string></string> | ||
357 | </property> | ||
358 | </widget> | ||
359 | </hbox> | ||
360 | </widget> | ||
361 | <widget> | ||
362 | <class>QLayoutWidget</class> | ||
363 | <property stdset="1"> | ||
364 | <name>name</name> | ||
365 | <cstring>Layout10</cstring> | ||
366 | </property> | ||
367 | <hbox> | ||
368 | <property stdset="1"> | ||
369 | <name>margin</name> | ||
370 | <number>0</number> | ||
371 | </property> | ||
372 | <property stdset="1"> | ||
373 | <name>spacing</name> | ||
374 | <number>6</number> | ||
375 | </property> | ||
376 | <widget> | ||
377 | <class>QCheckBox</class> | ||
378 | <property stdset="1"> | ||
379 | <name>name</name> | ||
380 | <cstring>CheckBoxDown</cstring> | ||
381 | </property> | ||
382 | <property stdset="1"> | ||
383 | <name>text</name> | ||
384 | <string>Download only messages smaller</string> | ||
385 | </property> | ||
386 | </widget> | ||
387 | <widget> | ||
388 | <class>QSpinBox</class> | ||
389 | <property stdset="1"> | ||
390 | <name>name</name> | ||
391 | <cstring>SpinBoxDown</cstring> | ||
392 | </property> | ||
393 | <property stdset="1"> | ||
394 | <name>suffix</name> | ||
395 | <string>kB</string> | ||
396 | </property> | ||
397 | <property stdset="1"> | ||
398 | <name>maxValue</name> | ||
399 | <number>99999</number> | ||
400 | </property> | ||
401 | <property stdset="1"> | ||
402 | <name>minValue</name> | ||
403 | <number>1</number> | ||
404 | </property> | ||
405 | </widget> | ||
406 | </hbox> | ||
407 | </widget> | ||
322 | <spacer> | 408 | <spacer> |
323 | <property> | 409 | <property> |
324 | <name>name</name> | 410 | <name>name</name> |
325 | <cstring>spacer</cstring> | 411 | <cstring>spacer</cstring> |
326 | </property> | 412 | </property> |
327 | <property stdset="1"> | 413 | <property stdset="1"> |
328 | <name>orientation</name> | 414 | <name>orientation</name> |
329 | <enum>Vertical</enum> | 415 | <enum>Vertical</enum> |
330 | </property> | 416 | </property> |
331 | <property stdset="1"> | 417 | <property stdset="1"> |
332 | <name>sizeType</name> | 418 | <name>sizeType</name> |
333 | <enum>Expanding</enum> | 419 | <enum>Expanding</enum> |
334 | </property> | 420 | </property> |
335 | <property> | 421 | <property> |
336 | <name>sizeHint</name> | 422 | <name>sizeHint</name> |
337 | <size> | 423 | <size> |
338 | <width>20</width> | 424 | <width>20</width> |
339 | <height>20</height> | 425 | <height>20</height> |
340 | </size> | 426 | </size> |
341 | </property> | 427 | </property> |
342 | </spacer> | 428 | </spacer> |
343 | </vbox> | 429 | </vbox> |
344 | </widget> | 430 | </widget> |
345 | <tabstops> | 431 | <tabstops> |
346 | <tabstop>accountLine</tabstop> | 432 | <tabstop>accountLine</tabstop> |
347 | <tabstop>serverLine</tabstop> | 433 | <tabstop>serverLine</tabstop> |
348 | <tabstop>portLine</tabstop> | 434 | <tabstop>portLine</tabstop> |
349 | <tabstop>userLine</tabstop> | 435 | <tabstop>userLine</tabstop> |
350 | <tabstop>passLine</tabstop> | 436 | <tabstop>passLine</tabstop> |
351 | </tabstops> | 437 | </tabstops> |
352 | </UI> | 438 | </UI> |