-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 22 | ||||
-rw-r--r-- | noncore/net/mail/editaccounts.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 137 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 7 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.h | 5 | ||||
-rw-r--r-- | noncore/net/mail/pop3configui.ui | 494 |
6 files changed, 452 insertions, 215 deletions
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp index de36e0d..439b619 100644 --- a/noncore/net/mail/editaccounts.cpp +++ b/noncore/net/mail/editaccounts.cpp | |||
@@ -1,448 +1,458 @@ | |||
1 | #include <qt.h> | 1 | #include <qt.h> |
2 | 2 | ||
3 | #include "defines.h" | 3 | #include "defines.h" |
4 | #include "editaccounts.h" | 4 | #include "editaccounts.h" |
5 | 5 | ||
6 | AccountListItem::AccountListItem( QListView *parent, Account *a) | 6 | AccountListItem::AccountListItem( QListView *parent, Account *a) |
7 | : QListViewItem( parent ) | 7 | : QListViewItem( parent ) |
8 | { | 8 | { |
9 | account = a; | 9 | account = a; |
10 | setText( 0, account->getAccountName() ); | 10 | setText( 0, account->getAccountName() ); |
11 | setText( 1, account->getType() ); | 11 | setText( 1, account->getType() ); |
12 | } | 12 | } |
13 | 13 | ||
14 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) | 14 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) |
15 | : EditAccountsUI( parent, name, modal, flags ) | 15 | : EditAccountsUI( parent, name, modal, flags ) |
16 | { | 16 | { |
17 | qDebug( "New Account Configuration Widget" ); | 17 | qDebug( "New Account Configuration Widget" ); |
18 | settings = s; | 18 | settings = s; |
19 | 19 | ||
20 | mailList->addColumn( tr( "Account" ) ); | 20 | mailList->addColumn( tr( "Account" ) ); |
21 | mailList->addColumn( tr( "Type" ) ); | 21 | mailList->addColumn( tr( "Type" ) ); |
22 | 22 | ||
23 | newsList->addColumn( tr( "Account" ) ); | 23 | newsList->addColumn( tr( "Account" ) ); |
24 | 24 | ||
25 | connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); | 25 | connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); |
26 | connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); | 26 | connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); |
27 | connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); | 27 | connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); |
28 | connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) ); | 28 | connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) ); |
29 | connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) ); | 29 | connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) ); |
30 | connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) ); | 30 | connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) ); |
31 | 31 | ||
32 | slotFillLists(); | 32 | slotFillLists(); |
33 | } | 33 | } |
34 | 34 | ||
35 | void EditAccounts::slotFillLists() | 35 | void EditAccounts::slotFillLists() |
36 | { | 36 | { |
37 | mailList->clear(); | 37 | mailList->clear(); |
38 | newsList->clear(); | 38 | newsList->clear(); |
39 | 39 | ||
40 | QList<Account> accounts = settings->getAccounts(); | 40 | QList<Account> accounts = settings->getAccounts(); |
41 | Account *it; | 41 | Account *it; |
42 | for ( it = accounts.first(); it; it = accounts.next() ) { | 42 | for ( it = accounts.first(); it; it = accounts.next() ) { |
43 | if ( it->getType().compare( "NNTP" ) == 0 ) { | 43 | if ( it->getType().compare( "NNTP" ) == 0 ) { |
44 | (void) new AccountListItem( newsList, it ); | 44 | (void) new AccountListItem( newsList, it ); |
45 | } else { | 45 | } else { |
46 | (void) new AccountListItem( mailList, it ); | 46 | (void) new AccountListItem( mailList, it ); |
47 | } | 47 | } |
48 | } | 48 | } |
49 | } | 49 | } |
50 | 50 | ||
51 | void EditAccounts::slotNewMail() | 51 | void EditAccounts::slotNewMail() |
52 | { | 52 | { |
53 | qDebug( "New Mail Account" ); | 53 | qDebug( "New Mail Account" ); |
54 | QString *selection = new QString(); | 54 | QString *selection = new QString(); |
55 | SelectMailType selType( selection, this, 0, true ); | 55 | SelectMailType selType( selection, this, 0, true ); |
56 | selType.show(); | 56 | selType.show(); |
57 | if ( QDialog::Accepted == selType.exec() ) { | 57 | if ( QDialog::Accepted == selType.exec() ) { |
58 | slotNewAccount( *selection ); | 58 | slotNewAccount( *selection ); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | void EditAccounts::slotNewAccount( const QString &type ) | 62 | void EditAccounts::slotNewAccount( const QString &type ) |
63 | { | 63 | { |
64 | if ( type.compare( "IMAP" ) == 0 ) { | 64 | if ( type.compare( "IMAP" ) == 0 ) { |
65 | qDebug( "-> config IMAP" ); | 65 | qDebug( "-> config IMAP" ); |
66 | IMAPaccount *account = new IMAPaccount(); | 66 | IMAPaccount *account = new IMAPaccount(); |
67 | IMAPconfig imap( account, this, 0, true ); | 67 | IMAPconfig imap( account, this, 0, true ); |
68 | imap.showMaximized(); | 68 | imap.showMaximized(); |
69 | if ( QDialog::Accepted == imap.exec() ) { | 69 | if ( QDialog::Accepted == imap.exec() ) { |
70 | settings->addAccount( account ); | 70 | settings->addAccount( account ); |
71 | account->save(); | 71 | account->save(); |
72 | slotFillLists(); | 72 | slotFillLists(); |
73 | } else { | 73 | } else { |
74 | account->remove(); | 74 | account->remove(); |
75 | } | 75 | } |
76 | } else if ( type.compare( "POP3" ) == 0 ) { | 76 | } else if ( type.compare( "POP3" ) == 0 ) { |
77 | qDebug( "-> config POP3" ); | 77 | qDebug( "-> config POP3" ); |
78 | POP3account *account = new POP3account(); | 78 | POP3account *account = new POP3account(); |
79 | POP3config pop3( account, this, 0, true ); | 79 | POP3config pop3( account, this, 0, true ); |
80 | pop3.showMaximized(); | 80 | pop3.showMaximized(); |
81 | if ( QDialog::Accepted == pop3.exec() ) { | 81 | if ( QDialog::Accepted == pop3.exec() ) { |
82 | settings->addAccount( account ); | 82 | settings->addAccount( account ); |
83 | account->save(); | 83 | account->save(); |
84 | slotFillLists(); | 84 | slotFillLists(); |
85 | } else { | 85 | } else { |
86 | account->remove(); | 86 | account->remove(); |
87 | } | 87 | } |
88 | } else if ( type.compare( "SMTP" ) == 0 ) { | 88 | } else if ( type.compare( "SMTP" ) == 0 ) { |
89 | qDebug( "-> config SMTP" ); | 89 | qDebug( "-> config SMTP" ); |
90 | SMTPaccount *account = new SMTPaccount(); | 90 | SMTPaccount *account = new SMTPaccount(); |
91 | SMTPconfig smtp( account, this, 0, true ); | 91 | SMTPconfig smtp( account, this, 0, true ); |
92 | smtp.showMaximized(); | 92 | smtp.showMaximized(); |
93 | if ( QDialog::Accepted == smtp.exec() ) { | 93 | if ( QDialog::Accepted == smtp.exec() ) { |
94 | settings->addAccount( account ); | 94 | settings->addAccount( account ); |
95 | account->save(); | 95 | account->save(); |
96 | slotFillLists(); | 96 | slotFillLists(); |
97 | 97 | ||
98 | } else { | 98 | } else { |
99 | account->remove(); | 99 | account->remove(); |
100 | } | 100 | } |
101 | } else if ( type.compare( "NNTP" ) == 0 ) { | 101 | } else if ( type.compare( "NNTP" ) == 0 ) { |
102 | qDebug( "-> config NNTP" ); | 102 | qDebug( "-> config NNTP" ); |
103 | NNTPaccount *account = new NNTPaccount(); | 103 | NNTPaccount *account = new NNTPaccount(); |
104 | NNTPconfig nntp( account, this, 0, true ); | 104 | NNTPconfig nntp( account, this, 0, true ); |
105 | nntp.showMaximized(); | 105 | nntp.showMaximized(); |
106 | if ( QDialog::Accepted == nntp.exec() ) { | 106 | if ( QDialog::Accepted == nntp.exec() ) { |
107 | settings->addAccount( account ); | 107 | settings->addAccount( account ); |
108 | account->save(); | 108 | account->save(); |
109 | slotFillLists(); | 109 | slotFillLists(); |
110 | } else { | 110 | } else { |
111 | account->remove(); | 111 | account->remove(); |
112 | } | 112 | } |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | void EditAccounts::slotEditAccount( Account *account ) | 116 | void EditAccounts::slotEditAccount( Account *account ) |
117 | { | 117 | { |
118 | if ( account->getType().compare( "IMAP" ) == 0 ) { | 118 | if ( account->getType().compare( "IMAP" ) == 0 ) { |
119 | IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); | 119 | IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); |
120 | IMAPconfig imap( imapAcc, this, 0, true ); | 120 | IMAPconfig imap( imapAcc, this, 0, true ); |
121 | imap.showMaximized(); | 121 | imap.showMaximized(); |
122 | if ( QDialog::Accepted == imap.exec() ) { | 122 | if ( QDialog::Accepted == imap.exec() ) { |
123 | slotFillLists(); | 123 | slotFillLists(); |
124 | } | 124 | } |
125 | } else if ( account->getType().compare( "POP3" ) == 0 ) { | 125 | } else if ( account->getType().compare( "POP3" ) == 0 ) { |
126 | POP3account *pop3Acc = static_cast<POP3account *>(account); | 126 | POP3account *pop3Acc = static_cast<POP3account *>(account); |
127 | POP3config pop3( pop3Acc, this, 0, true ); | 127 | POP3config pop3( pop3Acc, this, 0, true ); |
128 | pop3.showMaximized(); | 128 | pop3.showMaximized(); |
129 | if ( QDialog::Accepted == pop3.exec() ) { | 129 | if ( QDialog::Accepted == pop3.exec() ) { |
130 | slotFillLists(); | 130 | slotFillLists(); |
131 | } | 131 | } |
132 | } else if ( account->getType().compare( "SMTP" ) == 0 ) { | 132 | } else if ( account->getType().compare( "SMTP" ) == 0 ) { |
133 | SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); | 133 | SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); |
134 | SMTPconfig smtp( smtpAcc, this, 0, true ); | 134 | SMTPconfig smtp( smtpAcc, this, 0, true ); |
135 | smtp.showMaximized(); | 135 | smtp.showMaximized(); |
136 | if ( QDialog::Accepted == smtp.exec() ) { | 136 | if ( QDialog::Accepted == smtp.exec() ) { |
137 | slotFillLists(); | 137 | slotFillLists(); |
138 | } | 138 | } |
139 | } else if ( account->getType().compare( "NNTP" ) == 0 ) { | 139 | } else if ( account->getType().compare( "NNTP" ) == 0 ) { |
140 | NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); | 140 | NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); |
141 | NNTPconfig nntp( nntpAcc, this, 0, true ); | 141 | NNTPconfig nntp( nntpAcc, this, 0, true ); |
142 | nntp.showMaximized(); | 142 | nntp.showMaximized(); |
143 | if ( QDialog::Accepted == nntp.exec() ) { | 143 | if ( QDialog::Accepted == nntp.exec() ) { |
144 | slotFillLists(); | 144 | slotFillLists(); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | } | 147 | } |
148 | 148 | ||
149 | void EditAccounts::slotDeleteAccount( Account *account ) | 149 | void EditAccounts::slotDeleteAccount( Account *account ) |
150 | { | 150 | { |
151 | if ( QMessageBox::information( this, tr( "Question" ), | 151 | if ( QMessageBox::information( this, tr( "Question" ), |
152 | tr( "<p>Do you really want to delete the selected Account?</p>" ), | 152 | tr( "<p>Do you really want to delete the selected Account?</p>" ), |
153 | tr( "Yes" ), tr( "No" ) ) == 0 ) { | 153 | tr( "Yes" ), tr( "No" ) ) == 0 ) { |
154 | settings->delAccount( account ); | 154 | settings->delAccount( account ); |
155 | slotFillLists(); | 155 | slotFillLists(); |
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
159 | void EditAccounts::slotEditMail() | 159 | void EditAccounts::slotEditMail() |
160 | { | 160 | { |
161 | qDebug( "Edit Mail Account" ); | 161 | qDebug( "Edit Mail Account" ); |
162 | if ( !mailList->currentItem() ) { | 162 | if ( !mailList->currentItem() ) { |
163 | QMessageBox::information( this, tr( "Error" ), | 163 | QMessageBox::information( this, tr( "Error" ), |
164 | tr( "<p>Please select an account.</p>" ), | 164 | tr( "<p>Please select an account.</p>" ), |
165 | tr( "Ok" ) ); | 165 | tr( "Ok" ) ); |
166 | return; | 166 | return; |
167 | } | 167 | } |
168 | 168 | ||
169 | Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); | 169 | Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); |
170 | slotEditAccount( a ); | 170 | slotEditAccount( a ); |
171 | } | 171 | } |
172 | 172 | ||
173 | void EditAccounts::slotDeleteMail() | 173 | void EditAccounts::slotDeleteMail() |
174 | { | 174 | { |
175 | if ( !mailList->currentItem() ) { | 175 | if ( !mailList->currentItem() ) { |
176 | QMessageBox::information( this, tr( "Error" ), | 176 | QMessageBox::information( this, tr( "Error" ), |
177 | tr( "<p>Please select an account.</p>" ), | 177 | tr( "<p>Please select an account.</p>" ), |
178 | tr( "Ok" ) ); | 178 | tr( "Ok" ) ); |
179 | return; | 179 | return; |
180 | } | 180 | } |
181 | 181 | ||
182 | Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); | 182 | Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); |
183 | slotDeleteAccount( a ); | 183 | slotDeleteAccount( a ); |
184 | } | 184 | } |
185 | 185 | ||
186 | void EditAccounts::slotNewNews() | 186 | void EditAccounts::slotNewNews() |
187 | { | 187 | { |
188 | qDebug( "New News Account" ); | 188 | qDebug( "New News Account" ); |
189 | slotNewAccount( "NNTP" ); | 189 | slotNewAccount( "NNTP" ); |
190 | } | 190 | } |
191 | 191 | ||
192 | void EditAccounts::slotEditNews() | 192 | void EditAccounts::slotEditNews() |
193 | { | 193 | { |
194 | qDebug( "Edit News Account" ); | 194 | qDebug( "Edit News Account" ); |
195 | if ( !newsList->currentItem() ) { | 195 | if ( !newsList->currentItem() ) { |
196 | QMessageBox::information( this, tr( "Error" ), | 196 | QMessageBox::information( this, tr( "Error" ), |
197 | tr( "<p>Please select an account.</p>" ), | 197 | tr( "<p>Please select an account.</p>" ), |
198 | tr( "Ok" ) ); | 198 | tr( "Ok" ) ); |
199 | return; | 199 | return; |
200 | } | 200 | } |
201 | 201 | ||
202 | Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); | 202 | Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); |
203 | slotEditAccount( a ); | 203 | slotEditAccount( a ); |
204 | } | 204 | } |
205 | 205 | ||
206 | void EditAccounts::slotDeleteNews() | 206 | void EditAccounts::slotDeleteNews() |
207 | { | 207 | { |
208 | qDebug( "Delete News Account" ); | 208 | qDebug( "Delete News Account" ); |
209 | if ( !newsList->currentItem() ) { | 209 | if ( !newsList->currentItem() ) { |
210 | QMessageBox::information( this, tr( "Error" ), | 210 | QMessageBox::information( this, tr( "Error" ), |
211 | tr( "<p>Please select an account.</p>" ), | 211 | tr( "<p>Please select an account.</p>" ), |
212 | tr( "Ok" ) ); | 212 | tr( "Ok" ) ); |
213 | return; | 213 | return; |
214 | } | 214 | } |
215 | 215 | ||
216 | Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); | 216 | Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); |
217 | slotDeleteAccount( a ); | 217 | slotDeleteAccount( a ); |
218 | } | 218 | } |
219 | 219 | ||
220 | void EditAccounts::slotAdjustColumns() | 220 | void EditAccounts::slotAdjustColumns() |
221 | { | 221 | { |
222 | int currPage = configTab->currentPageIndex(); | 222 | int currPage = configTab->currentPageIndex(); |
223 | 223 | ||
224 | configTab->showPage( mailTab ); | 224 | configTab->showPage( mailTab ); |
225 | mailList->setColumnWidth( 0, mailList->visibleWidth() - 50 ); | 225 | mailList->setColumnWidth( 0, mailList->visibleWidth() - 50 ); |
226 | mailList->setColumnWidth( 1, 50 ); | 226 | mailList->setColumnWidth( 1, 50 ); |
227 | 227 | ||
228 | configTab->showPage( newsTab ); | 228 | configTab->showPage( newsTab ); |
229 | newsList->setColumnWidth( 0, newsList->visibleWidth() ); | 229 | newsList->setColumnWidth( 0, newsList->visibleWidth() ); |
230 | 230 | ||
231 | configTab->setCurrentPage( currPage ); | 231 | configTab->setCurrentPage( currPage ); |
232 | } | 232 | } |
233 | 233 | ||
234 | void EditAccounts::accept() | 234 | void EditAccounts::accept() |
235 | { | 235 | { |
236 | settings->saveAccounts(); | 236 | settings->saveAccounts(); |
237 | 237 | ||
238 | QDialog::accept(); | 238 | QDialog::accept(); |
239 | } | 239 | } |
240 | 240 | ||
241 | /** | 241 | /** |
242 | * SelectMailType | 242 | * SelectMailType |
243 | */ | 243 | */ |
244 | 244 | ||
245 | SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) | 245 | SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) |
246 | : SelectMailTypeUI( parent, name, modal, flags ) | 246 | : SelectMailTypeUI( parent, name, modal, flags ) |
247 | { | 247 | { |
248 | selected = selection; | 248 | selected = selection; |
249 | selected->replace( 0, selected->length(), typeBox->currentText() ); | 249 | selected->replace( 0, selected->length(), typeBox->currentText() ); |
250 | connect( typeBox, SIGNAL( activated( const QString & ) ), SLOT( slotSelection( const QString & ) ) ); | 250 | connect( typeBox, SIGNAL( activated( const QString & ) ), SLOT( slotSelection( const QString & ) ) ); |
251 | } | 251 | } |
252 | 252 | ||
253 | void SelectMailType::slotSelection( const QString &sel ) | 253 | void SelectMailType::slotSelection( const QString &sel ) |
254 | { | 254 | { |
255 | selected->replace( 0, selected->length(), sel ); | 255 | selected->replace( 0, selected->length(), sel ); |
256 | } | 256 | } |
257 | 257 | ||
258 | /** | 258 | /** |
259 | * IMAPconfig | 259 | * IMAPconfig |
260 | */ | 260 | */ |
261 | 261 | ||
262 | IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 262 | IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
263 | : IMAPconfigUI( parent, name, modal, flags ) | 263 | : IMAPconfigUI( parent, name, modal, flags ) |
264 | { | 264 | { |
265 | data = account; | 265 | data = account; |
266 | 266 | ||
267 | fillValues(); | 267 | fillValues(); |
268 | 268 | ||
269 | connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); | 269 | connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); |
270 | } | 270 | } |
271 | 271 | ||
272 | void IMAPconfig::slotSSL( bool enabled ) | 272 | void IMAPconfig::slotSSL( bool enabled ) |
273 | { | 273 | { |
274 | if ( enabled ) { | 274 | if ( enabled ) { |
275 | portLine->setText( IMAP_SSL_PORT ); | 275 | portLine->setText( IMAP_SSL_PORT ); |
276 | } else { | 276 | } else { |
277 | portLine->setText( IMAP_PORT ); | 277 | portLine->setText( IMAP_PORT ); |
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
281 | void IMAPconfig::fillValues() | 281 | void IMAPconfig::fillValues() |
282 | { | 282 | { |
283 | accountLine->setText( data->getAccountName() ); | 283 | accountLine->setText( data->getAccountName() ); |
284 | serverLine->setText( data->getServer() ); | 284 | serverLine->setText( data->getServer() ); |
285 | portLine->setText( data->getPort() ); | 285 | portLine->setText( data->getPort() ); |
286 | sslBox->setChecked( data->getSSL() ); | 286 | sslBox->setChecked( data->getSSL() ); |
287 | userLine->setText( data->getUser() ); | 287 | userLine->setText( data->getUser() ); |
288 | passLine->setText( data->getPassword() ); | 288 | passLine->setText( data->getPassword() ); |
289 | prefixLine->setText(data->getPrefix()); | 289 | prefixLine->setText(data->getPrefix()); |
290 | } | 290 | } |
291 | 291 | ||
292 | void IMAPconfig::accept() | 292 | void IMAPconfig::accept() |
293 | { | 293 | { |
294 | data->setAccountName( accountLine->text() ); | 294 | data->setAccountName( accountLine->text() ); |
295 | data->setServer( serverLine->text() ); | 295 | data->setServer( serverLine->text() ); |
296 | data->setPort( portLine->text() ); | 296 | data->setPort( portLine->text() ); |
297 | data->setSSL( sslBox->isChecked() ); | 297 | data->setSSL( sslBox->isChecked() ); |
298 | data->setUser( userLine->text() ); | 298 | data->setUser( userLine->text() ); |
299 | data->setPassword( passLine->text() ); | 299 | data->setPassword( passLine->text() ); |
300 | data->setPrefix(prefixLine->text()); | 300 | data->setPrefix(prefixLine->text()); |
301 | 301 | ||
302 | QDialog::accept(); | 302 | QDialog::accept(); |
303 | } | 303 | } |
304 | 304 | ||
305 | /** | 305 | /** |
306 | * POP3config | 306 | * POP3config |
307 | */ | 307 | */ |
308 | 308 | ||
309 | POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 309 | POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
310 | : POP3configUI( parent, name, modal, flags ) | 310 | : POP3configUI( parent, name, modal, flags ) |
311 | { | 311 | { |
312 | data = account; | 312 | data = account; |
313 | fillValues(); | 313 | fillValues(); |
314 | 314 | ||
315 | connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); | 315 | connect( ComboBox1, SIGNAL( activated( int ) ), SLOT( slotConnectionToggle( int ) ) ); |
316 | ComboBox1->insertItem( "Only if available", 0 ); | ||
317 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | ||
318 | ComboBox1->insertItem( "Connect on secure port", 2 ); | ||
319 | ComboBox1->insertItem( "Run command instead", 3 ); | ||
320 | CommandEdit->hide(); | ||
321 | ComboBox1->setCurrentItem( data->ConnectionType() ); | ||
316 | } | 322 | } |
317 | 323 | ||
318 | void POP3config::slotSSL( bool enabled ) | 324 | void POP3config::slotConnectionToggle( int index ) |
319 | { | 325 | { |
320 | if ( enabled ) { | 326 | // 2 is ssl connection |
321 | portLine->setText( POP3_SSL_PORT ); | 327 | if ( index == 2 ) { |
328 | portLine->setText( POP3_SSL_PORT ); | ||
329 | } else if ( index == 3 ) { | ||
330 | portLine->setText( POP3_PORT ); | ||
331 | CommandEdit->show(); | ||
322 | } else { | 332 | } else { |
323 | portLine->setText( POP3_PORT ); | 333 | portLine->setText( POP3_PORT ); |
324 | } | 334 | } |
325 | } | 335 | } |
326 | 336 | ||
327 | void POP3config::fillValues() | 337 | void POP3config::fillValues() |
328 | { | 338 | { |
329 | accountLine->setText( data->getAccountName() ); | 339 | accountLine->setText( data->getAccountName() ); |
330 | serverLine->setText( data->getServer() ); | 340 | serverLine->setText( data->getServer() ); |
331 | portLine->setText( data->getPort() ); | 341 | portLine->setText( data->getPort() ); |
332 | sslBox->setChecked( data->getSSL() ); | 342 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
333 | userLine->setText( data->getUser() ); | 343 | userLine->setText( data->getUser() ); |
334 | passLine->setText( data->getPassword() ); | 344 | passLine->setText( data->getPassword() ); |
335 | } | 345 | } |
336 | 346 | ||
337 | void POP3config::accept() | 347 | void POP3config::accept() |
338 | { | 348 | { |
339 | data->setAccountName( accountLine->text() ); | 349 | data->setAccountName( accountLine->text() ); |
340 | data->setServer( serverLine->text() ); | 350 | data->setServer( serverLine->text() ); |
341 | data->setPort( portLine->text() ); | 351 | data->setPort( portLine->text() ); |
342 | data->setSSL( sslBox->isChecked() ); | 352 | data->setConnectionType( ComboBox1->currentItem() ); |
343 | data->setUser( userLine->text() ); | 353 | data->setUser( userLine->text() ); |
344 | data->setPassword( passLine->text() ); | 354 | data->setPassword( passLine->text() ); |
345 | 355 | ||
346 | QDialog::accept(); | 356 | QDialog::accept(); |
347 | } | 357 | } |
348 | 358 | ||
349 | /** | 359 | /** |
350 | * SMTPconfig | 360 | * SMTPconfig |
351 | */ | 361 | */ |
352 | 362 | ||
353 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 363 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
354 | : SMTPconfigUI( parent, name, modal, flags ) | 364 | : SMTPconfigUI( parent, name, modal, flags ) |
355 | { | 365 | { |
356 | data = account; | 366 | data = account; |
357 | 367 | ||
358 | connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); | 368 | connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); |
359 | connect( loginBox, SIGNAL( toggled( bool ) ), passLine, SLOT( setEnabled( bool ) ) ); | 369 | connect( loginBox, SIGNAL( toggled( bool ) ), passLine, SLOT( setEnabled( bool ) ) ); |
360 | 370 | ||
361 | fillValues(); | 371 | fillValues(); |
362 | 372 | ||
363 | connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); | 373 | connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); |
364 | } | 374 | } |
365 | 375 | ||
366 | void SMTPconfig::slotSSL( bool enabled ) | 376 | void SMTPconfig::slotSSL( bool enabled ) |
367 | { | 377 | { |
368 | if ( enabled ) { | 378 | if ( enabled ) { |
369 | portLine->setText( SMTP_SSL_PORT ); | 379 | portLine->setText( SMTP_SSL_PORT ); |
370 | } else { | 380 | } else { |
371 | portLine->setText( SMTP_PORT ); | 381 | portLine->setText( SMTP_PORT ); |
372 | } | 382 | } |
373 | } | 383 | } |
374 | 384 | ||
375 | void SMTPconfig::fillValues() | 385 | void SMTPconfig::fillValues() |
376 | { | 386 | { |
377 | accountLine->setText( data->getAccountName() ); | 387 | accountLine->setText( data->getAccountName() ); |
378 | serverLine->setText( data->getServer() ); | 388 | serverLine->setText( data->getServer() ); |
379 | portLine->setText( data->getPort() ); | 389 | portLine->setText( data->getPort() ); |
380 | sslBox->setChecked( data->getSSL() ); | 390 | sslBox->setChecked( data->getSSL() ); |
381 | loginBox->setChecked( data->getLogin() ); | 391 | loginBox->setChecked( data->getLogin() ); |
382 | userLine->setText( data->getUser() ); | 392 | userLine->setText( data->getUser() ); |
383 | passLine->setText( data->getPassword() ); | 393 | passLine->setText( data->getPassword() ); |
384 | } | 394 | } |
385 | 395 | ||
386 | void SMTPconfig::accept() | 396 | void SMTPconfig::accept() |
387 | { | 397 | { |
388 | data->setAccountName( accountLine->text() ); | 398 | data->setAccountName( accountLine->text() ); |
389 | data->setServer( serverLine->text() ); | 399 | data->setServer( serverLine->text() ); |
390 | data->setPort( portLine->text() ); | 400 | data->setPort( portLine->text() ); |
391 | data->setSSL( sslBox->isChecked() ); | 401 | data->setSSL( sslBox->isChecked() ); |
392 | data->setLogin( loginBox->isChecked() ); | 402 | data->setLogin( loginBox->isChecked() ); |
393 | data->setUser( userLine->text() ); | 403 | data->setUser( userLine->text() ); |
394 | data->setPassword( passLine->text() ); | 404 | data->setPassword( passLine->text() ); |
395 | 405 | ||
396 | QDialog::accept(); | 406 | QDialog::accept(); |
397 | } | 407 | } |
398 | 408 | ||
399 | /** | 409 | /** |
400 | * NNTPconfig | 410 | * NNTPconfig |
401 | */ | 411 | */ |
402 | 412 | ||
403 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 413 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
404 | : NNTPconfigUI( parent, name, modal, flags ) | 414 | : NNTPconfigUI( parent, name, modal, flags ) |
405 | { | 415 | { |
406 | data = account; | 416 | data = account; |
407 | 417 | ||
408 | connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); | 418 | connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); |
409 | connect( loginBox, SIGNAL( toggled( bool ) ), passLine, SLOT( setEnabled( bool ) ) ); | 419 | connect( loginBox, SIGNAL( toggled( bool ) ), passLine, SLOT( setEnabled( bool ) ) ); |
410 | 420 | ||
411 | fillValues(); | 421 | fillValues(); |
412 | 422 | ||
413 | connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); | 423 | connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); |
414 | } | 424 | } |
415 | 425 | ||
416 | void NNTPconfig::slotSSL( bool enabled ) | 426 | void NNTPconfig::slotSSL( bool enabled ) |
417 | { | 427 | { |
418 | if ( enabled ) { | 428 | if ( enabled ) { |
419 | portLine->setText( NNTP_SSL_PORT ); | 429 | portLine->setText( NNTP_SSL_PORT ); |
420 | } else { | 430 | } else { |
421 | portLine->setText( NNTP_PORT ); | 431 | portLine->setText( NNTP_PORT ); |
422 | } | 432 | } |
423 | } | 433 | } |
424 | 434 | ||
425 | void NNTPconfig::fillValues() | 435 | void NNTPconfig::fillValues() |
426 | { | 436 | { |
427 | accountLine->setText( data->getAccountName() ); | 437 | accountLine->setText( data->getAccountName() ); |
428 | serverLine->setText( data->getServer() ); | 438 | serverLine->setText( data->getServer() ); |
429 | portLine->setText( data->getPort() ); | 439 | portLine->setText( data->getPort() ); |
430 | sslBox->setChecked( data->getSSL() ); | 440 | sslBox->setChecked( data->getSSL() ); |
431 | loginBox->setChecked( data->getLogin() ); | 441 | loginBox->setChecked( data->getLogin() ); |
432 | userLine->setText( data->getUser() ); | 442 | userLine->setText( data->getUser() ); |
433 | passLine->setText( data->getPassword() ); | 443 | passLine->setText( data->getPassword() ); |
434 | } | 444 | } |
435 | 445 | ||
436 | void NNTPconfig::accept() | 446 | void NNTPconfig::accept() |
437 | { | 447 | { |
438 | data->setAccountName( accountLine->text() ); | 448 | data->setAccountName( accountLine->text() ); |
439 | data->setServer( serverLine->text() ); | 449 | data->setServer( serverLine->text() ); |
440 | data->setPort( portLine->text() ); | 450 | data->setPort( portLine->text() ); |
441 | data->setSSL( sslBox->isChecked() ); | 451 | data->setSSL( sslBox->isChecked() ); |
442 | data->setLogin( loginBox->isChecked() ); | 452 | data->setLogin( loginBox->isChecked() ); |
443 | data->setUser( userLine->text() ); | 453 | data->setUser( userLine->text() ); |
444 | data->setPassword( passLine->text() ); | 454 | data->setPassword( passLine->text() ); |
445 | 455 | ||
446 | QDialog::accept(); | 456 | QDialog::accept(); |
447 | } | 457 | } |
448 | 458 | ||
diff --git a/noncore/net/mail/editaccounts.h b/noncore/net/mail/editaccounts.h index 6022eef..fb4be71 100644 --- a/noncore/net/mail/editaccounts.h +++ b/noncore/net/mail/editaccounts.h | |||
@@ -1,147 +1,147 @@ | |||
1 | #ifndef EDITACCOUNTS_H | 1 | #ifndef EDITACCOUNTS_H |
2 | #define EDITACCOUNTS_H | 2 | #define EDITACCOUNTS_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | 6 | ||
7 | #include "editaccountsui.h" | 7 | #include "editaccountsui.h" |
8 | #include "selectmailtypeui.h" | 8 | #include "selectmailtypeui.h" |
9 | #include "imapconfigui.h" | 9 | #include "imapconfigui.h" |
10 | #include "pop3configui.h" | 10 | #include "pop3configui.h" |
11 | #include "smtpconfigui.h" | 11 | #include "smtpconfigui.h" |
12 | #include "nntpconfigui.h" | 12 | #include "nntpconfigui.h" |
13 | #include <libmailwrapper/settings.h> | 13 | #include <libmailwrapper/settings.h> |
14 | 14 | ||
15 | 15 | ||
16 | class AccountListItem : public QListViewItem | 16 | class AccountListItem : public QListViewItem |
17 | { | 17 | { |
18 | 18 | ||
19 | public: | 19 | public: |
20 | AccountListItem( QListView *parent, Account *a); | 20 | AccountListItem( QListView *parent, Account *a); |
21 | Account *getAccount() { return account; } | 21 | Account *getAccount() { return account; } |
22 | 22 | ||
23 | private: | 23 | private: |
24 | Account *account; | 24 | Account *account; |
25 | 25 | ||
26 | }; | 26 | }; |
27 | 27 | ||
28 | class EditAccounts : public EditAccountsUI | 28 | class EditAccounts : public EditAccountsUI |
29 | { | 29 | { |
30 | Q_OBJECT | 30 | Q_OBJECT |
31 | 31 | ||
32 | public: | 32 | public: |
33 | EditAccounts( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); | 33 | EditAccounts( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); |
34 | 34 | ||
35 | public slots: | 35 | public slots: |
36 | void slotNewAccount( const QString &type ); | 36 | void slotNewAccount( const QString &type ); |
37 | void slotEditAccount( Account *account ); | 37 | void slotEditAccount( Account *account ); |
38 | void slotDeleteAccount( Account * account ); | 38 | void slotDeleteAccount( Account * account ); |
39 | void slotAdjustColumns(); | 39 | void slotAdjustColumns(); |
40 | 40 | ||
41 | protected slots: | 41 | protected slots: |
42 | void slotFillLists(); | 42 | void slotFillLists(); |
43 | void slotNewMail(); | 43 | void slotNewMail(); |
44 | void slotEditMail(); | 44 | void slotEditMail(); |
45 | void slotDeleteMail(); | 45 | void slotDeleteMail(); |
46 | void slotNewNews(); | 46 | void slotNewNews(); |
47 | void slotEditNews(); | 47 | void slotEditNews(); |
48 | void slotDeleteNews(); | 48 | void slotDeleteNews(); |
49 | void accept(); | 49 | void accept(); |
50 | 50 | ||
51 | private: | 51 | private: |
52 | Settings *settings; | 52 | Settings *settings; |
53 | 53 | ||
54 | }; | 54 | }; |
55 | 55 | ||
56 | class SelectMailType : public SelectMailTypeUI | 56 | class SelectMailType : public SelectMailTypeUI |
57 | { | 57 | { |
58 | Q_OBJECT | 58 | Q_OBJECT |
59 | 59 | ||
60 | public: | 60 | public: |
61 | SelectMailType( QString *selection = 0, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); | 61 | SelectMailType( QString *selection = 0, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); |
62 | 62 | ||
63 | private slots: | 63 | private slots: |
64 | void slotSelection( const QString &sel ); | 64 | void slotSelection( const QString &sel ); |
65 | 65 | ||
66 | private: | 66 | private: |
67 | QString *selected; | 67 | QString *selected; |
68 | 68 | ||
69 | }; | 69 | }; |
70 | 70 | ||
71 | class IMAPconfig : public IMAPconfigUI | 71 | class IMAPconfig : public IMAPconfigUI |
72 | { | 72 | { |
73 | Q_OBJECT | 73 | Q_OBJECT |
74 | 74 | ||
75 | public: | 75 | public: |
76 | IMAPconfig( IMAPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); | 76 | IMAPconfig( IMAPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); |
77 | 77 | ||
78 | public slots: | 78 | public slots: |
79 | void fillValues(); | 79 | void fillValues(); |
80 | 80 | ||
81 | protected slots: | 81 | protected slots: |
82 | void slotSSL( bool enabled ); | 82 | void slotSSL( bool enabled ); |
83 | void accept(); | 83 | void accept(); |
84 | 84 | ||
85 | private: | 85 | private: |
86 | IMAPaccount *data; | 86 | IMAPaccount *data; |
87 | 87 | ||
88 | }; | 88 | }; |
89 | 89 | ||
90 | class POP3config : public POP3configUI | 90 | class POP3config : public POP3configUI |
91 | { | 91 | { |
92 | Q_OBJECT | 92 | Q_OBJECT |
93 | 93 | ||
94 | public: | 94 | public: |
95 | POP3config( POP3account *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); | 95 | POP3config( POP3account *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); |
96 | 96 | ||
97 | public slots: | 97 | public slots: |
98 | void fillValues(); | 98 | void fillValues(); |
99 | 99 | ||
100 | protected slots: | 100 | protected slots: |
101 | void slotSSL( bool enabled ); | 101 | void slotConnectionToggle( int index ); |
102 | void accept(); | 102 | void accept(); |
103 | 103 | ||
104 | private: | 104 | private: |
105 | POP3account *data; | 105 | POP3account *data; |
106 | 106 | ||
107 | }; | 107 | }; |
108 | 108 | ||
109 | class SMTPconfig : public SMTPconfigUI | 109 | class SMTPconfig : public SMTPconfigUI |
110 | { | 110 | { |
111 | Q_OBJECT | 111 | Q_OBJECT |
112 | 112 | ||
113 | public: | 113 | public: |
114 | SMTPconfig( SMTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); | 114 | SMTPconfig( SMTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); |
115 | 115 | ||
116 | public slots: | 116 | public slots: |
117 | void slotSSL( bool enabled ); | 117 | void slotSSL( bool enabled ); |
118 | void fillValues(); | 118 | void fillValues(); |
119 | 119 | ||
120 | protected slots: | 120 | protected slots: |
121 | void accept(); | 121 | void accept(); |
122 | 122 | ||
123 | private: | 123 | private: |
124 | SMTPaccount *data; | 124 | SMTPaccount *data; |
125 | 125 | ||
126 | }; | 126 | }; |
127 | 127 | ||
128 | class NNTPconfig : public NNTPconfigUI | 128 | class NNTPconfig : public NNTPconfigUI |
129 | { | 129 | { |
130 | Q_OBJECT | 130 | Q_OBJECT |
131 | 131 | ||
132 | public: | 132 | public: |
133 | NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); | 133 | NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); |
134 | 134 | ||
135 | public slots: | 135 | public slots: |
136 | void fillValues(); | 136 | void fillValues(); |
137 | 137 | ||
138 | protected slots: | 138 | protected slots: |
139 | void slotSSL( bool enabled ); | 139 | void slotSSL( bool enabled ); |
140 | void accept(); | 140 | void accept(); |
141 | 141 | ||
142 | private: | 142 | private: |
143 | NNTPaccount *data; | 143 | NNTPaccount *data; |
144 | 144 | ||
145 | }; | 145 | }; |
146 | 146 | ||
147 | #endif | 147 | #endif |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 67bde38..f5eca4a 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -1,257 +1,266 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include "pop3wrapper.h" | 2 | #include "pop3wrapper.h" |
3 | #include "mailtypes.h" | 3 | #include "mailtypes.h" |
4 | #include "logindialog.h" | 4 | #include "logindialog.h" |
5 | #include <libetpan/libetpan.h> | 5 | #include <libetpan/libetpan.h> |
6 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
7 | #include <qfile.h> | 7 | #include <qfile.h> |
8 | #include <qstring.h> | 8 | #include <qstring.h> |
9 | 9 | ||
10 | /* we don't fetch messages larger than 5 MB */ | 10 | /* we don't fetch messages larger than 5 MB */ |
11 | #define HARD_MSG_SIZE_LIMIT 5242880 | 11 | #define HARD_MSG_SIZE_LIMIT 5242880 |
12 | 12 | ||
13 | POP3wrapper::POP3wrapper( POP3account *a ) | 13 | POP3wrapper::POP3wrapper( POP3account *a ) |
14 | : Genericwrapper() | 14 | : Genericwrapper() { |
15 | { | ||
16 | account = a; | 15 | account = a; |
17 | m_pop3 = NULL; | 16 | m_pop3 = NULL; |
18 | m_folder = NULL; | 17 | m_folder = NULL; |
19 | msgTempName = a->getFileName()+"_msg_cache"; | 18 | msgTempName = a->getFileName()+"_msg_cache"; |
20 | last_msg_id = 0; | 19 | last_msg_id = 0; |
21 | } | 20 | } |
22 | 21 | ||
23 | POP3wrapper::~POP3wrapper() | 22 | POP3wrapper::~POP3wrapper() { |
24 | { | ||
25 | logout(); | 23 | logout(); |
26 | QFile msg_cache(msgTempName); | 24 | QFile msg_cache(msgTempName); |
27 | if (msg_cache.exists()) { | 25 | if (msg_cache.exists()) { |
28 | msg_cache.remove(); | 26 | msg_cache.remove(); |
29 | } | 27 | } |
30 | } | 28 | } |
31 | 29 | ||
32 | void POP3wrapper::pop3_progress( size_t current, size_t maximum ) | 30 | void POP3wrapper::pop3_progress( size_t current, size_t maximum ) { |
33 | { | ||
34 | qDebug( "POP3: %i of %i", current, maximum ); | 31 | qDebug( "POP3: %i of %i", current, maximum ); |
35 | } | 32 | } |
36 | 33 | ||
37 | RecBody POP3wrapper::fetchBody( const RecMail &mail ) | 34 | RecBody POP3wrapper::fetchBody( const RecMail &mail ) { |
38 | { | ||
39 | int err = MAILPOP3_NO_ERROR; | 35 | int err = MAILPOP3_NO_ERROR; |
40 | char *message = 0; | 36 | char *message = 0; |
41 | size_t length = 0; | 37 | size_t length = 0; |
42 | 38 | ||
43 | login(); | 39 | login(); |
44 | if ( !m_pop3 ) { | 40 | if ( !m_pop3 ) { |
45 | return RecBody(); | 41 | return RecBody(); |
46 | } | 42 | } |
47 | 43 | ||
48 | RecBody body; | 44 | RecBody body; |
49 | mailmessage * mailmsg; | 45 | mailmessage * mailmsg; |
50 | if (mail.Msgsize()>HARD_MSG_SIZE_LIMIT) { | 46 | if (mail.Msgsize()>HARD_MSG_SIZE_LIMIT) { |
51 | qDebug("Message to large: %i",mail.Msgsize()); | 47 | qDebug("Message to large: %i",mail.Msgsize()); |
52 | return body; | 48 | return body; |
53 | } | 49 | } |
54 | 50 | ||
55 | QFile msg_cache(msgTempName); | 51 | QFile msg_cache(msgTempName); |
56 | 52 | ||
57 | cleanMimeCache(); | 53 | cleanMimeCache(); |
58 | 54 | ||
59 | if (mail.getNumber()!=last_msg_id) { | 55 | if (mail.getNumber()!=last_msg_id) { |
60 | if (msg_cache.exists()) { | 56 | if (msg_cache.exists()) { |
61 | msg_cache.remove(); | 57 | msg_cache.remove(); |
62 | } | 58 | } |
63 | msg_cache.open(IO_ReadWrite|IO_Truncate); | 59 | msg_cache.open(IO_ReadWrite|IO_Truncate); |
64 | last_msg_id = mail.getNumber(); | 60 | last_msg_id = mail.getNumber(); |
65 | err = mailsession_get_message(m_folder->fld_session, mail.getNumber(), &mailmsg); | 61 | err = mailsession_get_message(m_folder->fld_session, mail.getNumber(), &mailmsg); |
66 | err = mailmessage_fetch(mailmsg,&message,&length); | 62 | err = mailmessage_fetch(mailmsg,&message,&length); |
67 | msg_cache.writeBlock(message,length); | 63 | msg_cache.writeBlock(message,length); |
68 | } else { | 64 | } else { |
69 | QString msg=""; | 65 | QString msg=""; |
70 | msg_cache.open(IO_ReadOnly); | 66 | msg_cache.open(IO_ReadOnly); |
71 | message = new char[4096]; | 67 | message = new char[4096]; |
72 | memset(message,0,4096); | 68 | memset(message,0,4096); |
73 | while (msg_cache.readBlock(message,4095)>0) { | 69 | while (msg_cache.readBlock(message,4095)>0) { |
74 | msg+=message; | 70 | msg+=message; |
75 | memset(message,0,4096); | 71 | memset(message,0,4096); |
76 | } | 72 | } |
77 | delete message; | 73 | delete message; |
78 | message = (char*)malloc(msg.length()+1*sizeof(char)); | 74 | message = (char*)malloc(msg.length()+1*sizeof(char)); |
79 | memset(message,0,msg.length()+1); | 75 | memset(message,0,msg.length()+1); |
80 | memcpy(message,msg.latin1(),msg.length()); | 76 | memcpy(message,msg.latin1(),msg.length()); |
81 | /* transform to libetpan stuff */ | 77 | /* transform to libetpan stuff */ |
82 | mailmsg = mailmessage_new(); | 78 | mailmsg = mailmessage_new(); |
83 | mailmessage_init(mailmsg, NULL, data_message_driver, 0, strlen(message)); | 79 | mailmessage_init(mailmsg, NULL, data_message_driver, 0, strlen(message)); |
84 | generic_message_t * msg_data; | 80 | generic_message_t * msg_data; |
85 | msg_data = (generic_message_t *)mailmsg->msg_data; | 81 | msg_data = (generic_message_t *)mailmsg->msg_data; |
86 | msg_data->msg_fetched = 1; | 82 | msg_data->msg_fetched = 1; |
87 | msg_data->msg_message = message; | 83 | msg_data->msg_message = message; |
88 | msg_data->msg_length = strlen(message); | 84 | msg_data->msg_length = strlen(message); |
89 | } | 85 | } |
90 | body = parseMail(mailmsg); | 86 | body = parseMail(mailmsg); |
91 | 87 | ||
92 | /* clean up */ | 88 | /* clean up */ |
93 | if (mailmsg) mailmessage_free(mailmsg); | 89 | if (mailmsg) |
94 | if (message) free(message); | 90 | mailmessage_free(mailmsg); |
91 | if (message) | ||
92 | free(message); | ||
95 | 93 | ||
96 | return body; | 94 | return body; |
97 | } | 95 | } |
98 | 96 | ||
99 | void POP3wrapper::listMessages(const QString &, QList<RecMail> &target ) | 97 | void POP3wrapper::listMessages(const QString &, QList<RecMail> &target ) { |
100 | { | ||
101 | login(); | 98 | login(); |
102 | if (!m_pop3) return; | 99 | if (!m_pop3) |
100 | return; | ||
103 | uint32_t res_messages,res_recent,res_unseen; | 101 | uint32_t res_messages,res_recent,res_unseen; |
104 | mailsession_status_folder(m_folder->fld_session,"INBOX",&res_messages,&res_recent,&res_unseen); | 102 | mailsession_status_folder(m_folder->fld_session,"INBOX",&res_messages,&res_recent,&res_unseen); |
105 | parseList(target,m_folder->fld_session,"INBOX"); | 103 | parseList(target,m_folder->fld_session,"INBOX"); |
106 | Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages)); | 104 | Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages)); |
107 | } | 105 | } |
108 | 106 | ||
109 | void POP3wrapper::login() | 107 | void POP3wrapper::login() { |
110 | { | 108 | if (account->getOffline()) |
111 | if (account->getOffline()) return; | 109 | return; |
112 | /* we'll hold the line */ | 110 | /* we'll hold the line */ |
113 | if ( m_pop3 != NULL ) return; | 111 | if ( m_pop3 != NULL ) |
112 | return; | ||
114 | 113 | ||
115 | const char *server, *user, *pass; | 114 | const char *server, *user, *pass; |
116 | uint16_t port; | 115 | uint16_t port; |
117 | int err = MAILPOP3_NO_ERROR; | 116 | int err = MAILPOP3_NO_ERROR; |
118 | 117 | ||
119 | server = account->getServer().latin1(); | 118 | server = account->getServer().latin1(); |
120 | port = account->getPort().toUInt(); | 119 | port = account->getPort().toUInt(); |
121 | 120 | ||
122 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { | 121 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { |
123 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); | 122 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); |
124 | login.show(); | 123 | login.show(); |
125 | if ( QDialog::Accepted == login.exec() ) { | 124 | if ( QDialog::Accepted == login.exec() ) { |
126 | // ok | 125 | // ok |
127 | user = login.getUser().latin1(); | 126 | user = login.getUser().latin1(); |
128 | pass = login.getPassword().latin1(); | 127 | pass = login.getPassword().latin1(); |
129 | } else { | 128 | } else { |
130 | // cancel | 129 | // cancel |
131 | qDebug( "POP3: Login canceled" ); | 130 | qDebug( "POP3: Login canceled" ); |
132 | return; | 131 | return; |
133 | } | 132 | } |
134 | } else { | 133 | } else { |
135 | user = account->getUser().latin1(); | 134 | user = account->getUser().latin1(); |
136 | pass = account->getPassword().latin1(); | 135 | pass = account->getPassword().latin1(); |
137 | } | 136 | } |
138 | 137 | ||
139 | bool ssl = account->getSSL(); | 138 | // bool ssl = account->getSSL(); |
140 | 139 | ||
141 | m_pop3=mailstorage_new(NULL); | 140 | m_pop3=mailstorage_new(NULL); |
142 | int conntype = (ssl?CONNECTION_TYPE_TLS:CONNECTION_TYPE_PLAIN); | 141 | |
143 | 142 | int conntypeset = account->ConnectionType(); | |
144 | pop3_mailstorage_init(m_pop3,(char*)server,port,NULL,conntype,POP3_AUTH_TYPE_PLAIN, | 143 | int conntype = 0; |
145 | (char*)user,(char*)pass,0,0,0); | 144 | if ( conntypeset == 3 ) { |
145 | conntype = CONNECTION_TYPE_COMMAND; | ||
146 | } else if ( conntypeset == 2 ) { | ||
147 | conntype = CONNECTION_TYPE_TLS; | ||
148 | } else if ( conntypeset == 1 ) { | ||
149 | conntype = CONNECTION_TYPE_STARTTLS; | ||
150 | } else if ( conntypeset == 0 ) { | ||
151 | conntype = CONNECTION_TYPE_TRY_STARTTLS; | ||
152 | } | ||
153 | |||
154 | //(ssl?CONNECTION_TYPE_TLS:CONNECTION_TYPE_PLAIN); | ||
155 | |||
156 | pop3_mailstorage_init(m_pop3,(char*)server, port, NULL, conntype, POP3_AUTH_TYPE_PLAIN, | ||
157 | (char*)user,(char*)pass,0,0,0); | ||
158 | |||
159 | |||
146 | 160 | ||
147 | m_folder = mailfolder_new(m_pop3, NULL, NULL); | 161 | m_folder = mailfolder_new(m_pop3, NULL, NULL); |
148 | 162 | ||
149 | if (m_folder==0) { | 163 | if (m_folder==0) { |
150 | Global::statusMessage(tr("Error initializing folder")); | 164 | Global::statusMessage(tr("Error initializing folder")); |
151 | mailstorage_free(m_pop3); | 165 | mailstorage_free(m_pop3); |
152 | m_pop3 = NULL; | 166 | m_pop3 = NULL; |
153 | return; | 167 | return; |
154 | } | 168 | } |
155 | err = mailfolder_connect(m_folder); | 169 | err = mailfolder_connect(m_folder); |
156 | if (err != MAIL_NO_ERROR) { | 170 | if (err != MAIL_NO_ERROR) { |
157 | qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); | 171 | qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); |
158 | Global::statusMessage(tr("Error initializing folder")); | 172 | Global::statusMessage(tr("Error initializing folder")); |
159 | mailfolder_free(m_folder); | 173 | mailfolder_free(m_folder); |
160 | m_folder = 0; | 174 | m_folder = 0; |
161 | mailstorage_free(m_pop3); | 175 | mailstorage_free(m_pop3); |
162 | m_pop3 = 0; | 176 | m_pop3 = 0; |
163 | } | 177 | } |
164 | } | 178 | } |
165 | 179 | ||
166 | void POP3wrapper::logout() | 180 | void POP3wrapper::logout() { |
167 | { | ||
168 | int err = MAILPOP3_NO_ERROR; | 181 | int err = MAILPOP3_NO_ERROR; |
169 | if ( m_pop3 == NULL ) return; | 182 | if ( m_pop3 == NULL ) |
183 | return; | ||
170 | mailfolder_free(m_folder); | 184 | mailfolder_free(m_folder); |
171 | m_folder = 0; | 185 | m_folder = 0; |
172 | mailstorage_free(m_pop3); | 186 | mailstorage_free(m_pop3); |
173 | m_pop3 = 0; | 187 | m_pop3 = 0; |
174 | } | 188 | } |
175 | 189 | ||
176 | 190 | ||
177 | QList<Folder>* POP3wrapper::listFolders() | 191 | QList<Folder>* POP3wrapper::listFolders() { |
178 | { | ||
179 | QList<Folder> * folders = new QList<Folder>(); | 192 | QList<Folder> * folders = new QList<Folder>(); |
180 | folders->setAutoDelete( false ); | 193 | folders->setAutoDelete( false ); |
181 | Folder*inb=new Folder("INBOX","/"); | 194 | Folder*inb=new Folder("INBOX","/"); |
182 | folders->append(inb); | 195 | folders->append(inb); |
183 | return folders; | 196 | return folders; |
184 | } | 197 | } |
185 | 198 | ||
186 | void POP3wrapper::deleteMail(const RecMail&mail) | 199 | void POP3wrapper::deleteMail(const RecMail&mail) { |
187 | { | ||
188 | login(); | 200 | login(); |
189 | if (!m_pop3) return; | 201 | if (!m_pop3) |
202 | return; | ||
190 | int err = mailsession_remove_message(m_folder->fld_session,mail.getNumber()); | 203 | int err = mailsession_remove_message(m_folder->fld_session,mail.getNumber()); |
191 | if (err != MAIL_NO_ERROR) { | 204 | if (err != MAIL_NO_ERROR) { |
192 | Global::statusMessage(tr("error deleting mail")); | 205 | Global::statusMessage(tr("error deleting mail")); |
193 | } | 206 | } |
194 | } | 207 | } |
195 | 208 | ||
196 | void POP3wrapper::answeredMail(const RecMail&) | 209 | void POP3wrapper::answeredMail(const RecMail&) {} |
197 | { | ||
198 | } | ||
199 | 210 | ||
200 | int POP3wrapper::deleteAllMail(const Folder*) | 211 | int POP3wrapper::deleteAllMail(const Folder*) { |
201 | { | ||
202 | login(); | 212 | login(); |
203 | if (!m_pop3) return 0; | 213 | if (!m_pop3) |
214 | return 0; | ||
204 | int res = 1; | 215 | int res = 1; |
205 | 216 | ||
206 | uint32_t result = 0; | 217 | uint32_t result = 0; |
207 | int err = mailsession_messages_number(m_folder->fld_session,NULL,&result); | 218 | int err = mailsession_messages_number(m_folder->fld_session,NULL,&result); |
208 | if (err != MAIL_NO_ERROR) { | 219 | if (err != MAIL_NO_ERROR) { |
209 | Global::statusMessage(tr("Error getting folder info")); | 220 | Global::statusMessage(tr("Error getting folder info")); |
210 | return 0; | 221 | return 0; |
211 | } | 222 | } |
212 | for (unsigned int i = 0; i < result; ++i) { | 223 | for (unsigned int i = 0; i < result; ++i) { |
213 | err = mailsession_remove_message(m_folder->fld_session,i+1); | 224 | err = mailsession_remove_message(m_folder->fld_session,i+1); |
214 | if (err != MAIL_NO_ERROR) { | 225 | if (err != MAIL_NO_ERROR) { |
215 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); | 226 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); |
216 | res=0; | 227 | res=0; |
217 | } | 228 | } |
218 | break; | 229 | break; |
219 | } | 230 | } |
220 | return res; | 231 | return res; |
221 | } | 232 | } |
222 | 233 | ||
223 | void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) | 234 | void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) { |
224 | { | ||
225 | login(); | 235 | login(); |
226 | target_stat.message_count = 0; | 236 | target_stat.message_count = 0; |
227 | target_stat.message_unseen = 0; | 237 | target_stat.message_unseen = 0; |
228 | target_stat.message_recent = 0; | 238 | target_stat.message_recent = 0; |
229 | if (!m_pop3) return; | 239 | if (!m_pop3) |
240 | return; | ||
230 | int r = mailsession_status_folder(m_folder->fld_session,0,&target_stat.message_count, | 241 | int r = mailsession_status_folder(m_folder->fld_session,0,&target_stat.message_count, |
231 | &target_stat.message_recent,&target_stat.message_unseen); | 242 | &target_stat.message_recent,&target_stat.message_unseen); |
232 | } | 243 | } |
233 | 244 | ||
234 | encodedString* POP3wrapper::fetchRawBody(const RecMail&mail) | 245 | encodedString* POP3wrapper::fetchRawBody(const RecMail&mail) { |
235 | { | ||
236 | char*target=0; | 246 | char*target=0; |
237 | size_t length=0; | 247 | size_t length=0; |
238 | encodedString*res = 0; | 248 | encodedString*res = 0; |
239 | mailmessage * mailmsg = 0; | 249 | mailmessage * mailmsg = 0; |
240 | int err = mailsession_get_message(m_folder->fld_session, mail.getNumber(), &mailmsg); | 250 | int err = mailsession_get_message(m_folder->fld_session, mail.getNumber(), &mailmsg); |
241 | err = mailmessage_fetch(mailmsg,&target,&length); | 251 | err = mailmessage_fetch(mailmsg,&target,&length); |
242 | if (mailmsg) mailmessage_free(mailmsg); | 252 | if (mailmsg) |
253 | mailmessage_free(mailmsg); | ||
243 | if (target) { | 254 | if (target) { |
244 | res = new encodedString(target,length); | 255 | res = new encodedString(target,length); |
245 | } | 256 | } |
246 | return res; | 257 | return res; |
247 | } | 258 | } |
248 | 259 | ||
249 | const QString&POP3wrapper::getType()const | 260 | const QString&POP3wrapper::getType()const { |
250 | { | ||
251 | return account->getType(); | 261 | return account->getType(); |
252 | } | 262 | } |
253 | 263 | ||
254 | const QString&POP3wrapper::getName()const | 264 | const QString&POP3wrapper::getName()const { |
255 | { | ||
256 | return account->getAccountName(); | 265 | return account->getAccountName(); |
257 | } | 266 | } |
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index 02a80a3..83e51e3 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp | |||
@@ -1,425 +1,432 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <qdir.h> | 2 | #include <qdir.h> |
3 | 3 | ||
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | 5 | ||
6 | #include "settings.h" | 6 | #include "settings.h" |
7 | //#include "defines.h" | 7 | //#include "defines.h" |
8 | 8 | ||
9 | #define IMAP_PORT "143" | 9 | #define IMAP_PORT "143" |
10 | #define IMAP_SSL_PORT "993" | 10 | #define IMAP_SSL_PORT "993" |
11 | #define SMTP_PORT "25" | 11 | #define SMTP_PORT "25" |
12 | #define SMTP_SSL_PORT "465" | 12 | #define SMTP_SSL_PORT "465" |
13 | #define POP3_PORT "110" | 13 | #define POP3_PORT "110" |
14 | #define POP3_SSL_PORT "995" | 14 | #define POP3_SSL_PORT "995" |
15 | #define NNTP_PORT "119" | 15 | #define NNTP_PORT "119" |
16 | #define NNTP_SSL_PORT "563" | 16 | #define NNTP_SSL_PORT "563" |
17 | 17 | ||
18 | 18 | ||
19 | Settings::Settings() | 19 | Settings::Settings() |
20 | : QObject() | 20 | : QObject() |
21 | { | 21 | { |
22 | updateAccounts(); | 22 | updateAccounts(); |
23 | } | 23 | } |
24 | 24 | ||
25 | void Settings::checkDirectory() | 25 | void Settings::checkDirectory() |
26 | { | 26 | { |
27 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { | 27 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { |
28 | system( "mkdir -p $HOME/Applications/opiemail" ); | 28 | system( "mkdir -p $HOME/Applications/opiemail" ); |
29 | qDebug( "$HOME/Applications/opiemail created" ); | 29 | qDebug( "$HOME/Applications/opiemail created" ); |
30 | } | 30 | } |
31 | } | 31 | } |
32 | 32 | ||
33 | QList<Account> Settings::getAccounts() | 33 | QList<Account> Settings::getAccounts() |
34 | { | 34 | { |
35 | return accounts; | 35 | return accounts; |
36 | } | 36 | } |
37 | 37 | ||
38 | void Settings::addAccount( Account *account ) | 38 | void Settings::addAccount( Account *account ) |
39 | { | 39 | { |
40 | accounts.append( account ); | 40 | accounts.append( account ); |
41 | } | 41 | } |
42 | 42 | ||
43 | void Settings::delAccount( Account *account ) | 43 | void Settings::delAccount( Account *account ) |
44 | { | 44 | { |
45 | accounts.remove( account ); | 45 | accounts.remove( account ); |
46 | account->remove(); | 46 | account->remove(); |
47 | } | 47 | } |
48 | 48 | ||
49 | void Settings::updateAccounts() | 49 | void Settings::updateAccounts() |
50 | { | 50 | { |
51 | accounts.clear(); | 51 | accounts.clear(); |
52 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); | 52 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); |
53 | QStringList::Iterator it; | 53 | QStringList::Iterator it; |
54 | 54 | ||
55 | QStringList imap = dir.entryList( "imap-*" ); | 55 | QStringList imap = dir.entryList( "imap-*" ); |
56 | for ( it = imap.begin(); it != imap.end(); it++ ) { | 56 | for ( it = imap.begin(); it != imap.end(); it++ ) { |
57 | qDebug( "Added IMAP account" ); | 57 | qDebug( "Added IMAP account" ); |
58 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); | 58 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); |
59 | accounts.append( account ); | 59 | accounts.append( account ); |
60 | } | 60 | } |
61 | 61 | ||
62 | QStringList pop3 = dir.entryList( "pop3-*" ); | 62 | QStringList pop3 = dir.entryList( "pop3-*" ); |
63 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { | 63 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { |
64 | qDebug( "Added POP account" ); | 64 | qDebug( "Added POP account" ); |
65 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); | 65 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); |
66 | accounts.append( account ); | 66 | accounts.append( account ); |
67 | } | 67 | } |
68 | 68 | ||
69 | QStringList smtp = dir.entryList( "smtp-*" ); | 69 | QStringList smtp = dir.entryList( "smtp-*" ); |
70 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { | 70 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { |
71 | qDebug( "Added SMTP account" ); | 71 | qDebug( "Added SMTP account" ); |
72 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); | 72 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); |
73 | accounts.append( account ); | 73 | accounts.append( account ); |
74 | } | 74 | } |
75 | 75 | ||
76 | QStringList nntp = dir.entryList( "nntp-*" ); | 76 | QStringList nntp = dir.entryList( "nntp-*" ); |
77 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { | 77 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { |
78 | qDebug( "Added NNTP account" ); | 78 | qDebug( "Added NNTP account" ); |
79 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); | 79 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); |
80 | accounts.append( account ); | 80 | accounts.append( account ); |
81 | } | 81 | } |
82 | 82 | ||
83 | readAccounts(); | 83 | readAccounts(); |
84 | } | 84 | } |
85 | 85 | ||
86 | void Settings::saveAccounts() | 86 | void Settings::saveAccounts() |
87 | { | 87 | { |
88 | checkDirectory(); | 88 | checkDirectory(); |
89 | Account *it; | 89 | Account *it; |
90 | 90 | ||
91 | for ( it = accounts.first(); it; it = accounts.next() ) { | 91 | for ( it = accounts.first(); it; it = accounts.next() ) { |
92 | it->save(); | 92 | it->save(); |
93 | } | 93 | } |
94 | } | 94 | } |
95 | 95 | ||
96 | void Settings::readAccounts() | 96 | void Settings::readAccounts() |
97 | { | 97 | { |
98 | checkDirectory(); | 98 | checkDirectory(); |
99 | Account *it; | 99 | Account *it; |
100 | 100 | ||
101 | for ( it = accounts.first(); it; it = accounts.next() ) { | 101 | for ( it = accounts.first(); it; it = accounts.next() ) { |
102 | it->read(); | 102 | it->read(); |
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | Account::Account() | 106 | Account::Account() |
107 | { | 107 | { |
108 | accountName = "changeMe"; | 108 | accountName = "changeMe"; |
109 | type = "changeMe"; | 109 | type = "changeMe"; |
110 | ssl = false; | 110 | ssl = false; |
111 | connectionType = 1; | ||
111 | } | 112 | } |
112 | 113 | ||
113 | void Account::remove() | 114 | void Account::remove() |
114 | { | 115 | { |
115 | QFile file( getFileName() ); | 116 | QFile file( getFileName() ); |
116 | file.remove(); | 117 | file.remove(); |
117 | } | 118 | } |
118 | 119 | ||
119 | IMAPaccount::IMAPaccount() | 120 | IMAPaccount::IMAPaccount() |
120 | : Account() | 121 | : Account() |
121 | { | 122 | { |
122 | file = IMAPaccount::getUniqueFileName(); | 123 | file = IMAPaccount::getUniqueFileName(); |
123 | accountName = "New IMAP Account"; | 124 | accountName = "New IMAP Account"; |
124 | ssl = false; | 125 | ssl = false; |
126 | connectionType = 1; | ||
125 | type = "IMAP"; | 127 | type = "IMAP"; |
126 | port = IMAP_PORT; | 128 | port = IMAP_PORT; |
127 | } | 129 | } |
128 | 130 | ||
129 | IMAPaccount::IMAPaccount( QString filename ) | 131 | IMAPaccount::IMAPaccount( QString filename ) |
130 | : Account() | 132 | : Account() |
131 | { | 133 | { |
132 | file = filename; | 134 | file = filename; |
133 | accountName = "New IMAP Account"; | 135 | accountName = "New IMAP Account"; |
134 | ssl = false; | 136 | ssl = false; |
137 | connectionType = 1; | ||
135 | type = "IMAP"; | 138 | type = "IMAP"; |
136 | port = IMAP_PORT; | 139 | port = IMAP_PORT; |
137 | } | 140 | } |
138 | 141 | ||
139 | QString IMAPaccount::getUniqueFileName() | 142 | QString IMAPaccount::getUniqueFileName() |
140 | { | 143 | { |
141 | int num = 0; | 144 | int num = 0; |
142 | QString unique; | 145 | QString unique; |
143 | 146 | ||
144 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); | 147 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); |
145 | 148 | ||
146 | QStringList imap = dir.entryList( "imap-*" ); | 149 | QStringList imap = dir.entryList( "imap-*" ); |
147 | do { | 150 | do { |
148 | unique.setNum( num++ ); | 151 | unique.setNum( num++ ); |
149 | } while ( imap.contains( "imap-" + unique ) > 0 ); | 152 | } while ( imap.contains( "imap-" + unique ) > 0 ); |
150 | 153 | ||
151 | return unique; | 154 | return unique; |
152 | } | 155 | } |
153 | 156 | ||
154 | void IMAPaccount::read() | 157 | void IMAPaccount::read() |
155 | { | 158 | { |
156 | Config *conf = new Config( getFileName(), Config::File ); | 159 | Config *conf = new Config( getFileName(), Config::File ); |
157 | conf->setGroup( "IMAP Account" ); | 160 | conf->setGroup( "IMAP Account" ); |
158 | accountName = conf->readEntry( "Account","" ); | 161 | accountName = conf->readEntry( "Account","" ); |
159 | if (accountName.isNull()) accountName = ""; | 162 | if (accountName.isNull()) accountName = ""; |
160 | server = conf->readEntry( "Server","" ); | 163 | server = conf->readEntry( "Server","" ); |
161 | if (server.isNull()) server=""; | 164 | if (server.isNull()) server=""; |
162 | port = conf->readEntry( "Port","" ); | 165 | port = conf->readEntry( "Port","" ); |
163 | if (port.isNull()) port="143"; | 166 | if (port.isNull()) port="143"; |
164 | ssl = conf->readBoolEntry( "SSL",false ); | 167 | ssl = conf->readBoolEntry( "SSL",false ); |
165 | user = conf->readEntry( "User","" ); | 168 | user = conf->readEntry( "User","" ); |
166 | if (user.isNull()) user = ""; | 169 | if (user.isNull()) user = ""; |
167 | password = conf->readEntryCrypt( "Password","" ); | 170 | password = conf->readEntryCrypt( "Password","" ); |
168 | if (password.isNull()) password = ""; | 171 | if (password.isNull()) password = ""; |
169 | prefix = conf->readEntry("MailPrefix",""); | 172 | prefix = conf->readEntry("MailPrefix",""); |
170 | if (prefix.isNull()) prefix = ""; | 173 | if (prefix.isNull()) prefix = ""; |
171 | offline = conf->readBoolEntry("Offline",false); | 174 | offline = conf->readBoolEntry("Offline",false); |
172 | delete conf; | 175 | delete conf; |
173 | } | 176 | } |
174 | 177 | ||
175 | void IMAPaccount::save() | 178 | void IMAPaccount::save() |
176 | { | 179 | { |
177 | qDebug( "saving " + getFileName() ); | 180 | qDebug( "saving " + getFileName() ); |
178 | Settings::checkDirectory(); | 181 | Settings::checkDirectory(); |
179 | 182 | ||
180 | Config *conf = new Config( getFileName(), Config::File ); | 183 | Config *conf = new Config( getFileName(), Config::File ); |
181 | conf->setGroup( "IMAP Account" ); | 184 | conf->setGroup( "IMAP Account" ); |
182 | conf->writeEntry( "Account", accountName ); | 185 | conf->writeEntry( "Account", accountName ); |
183 | conf->writeEntry( "Server", server ); | 186 | conf->writeEntry( "Server", server ); |
184 | conf->writeEntry( "Port", port ); | 187 | conf->writeEntry( "Port", port ); |
185 | conf->writeEntry( "SSL", ssl ); | 188 | conf->writeEntry( "SSL", ssl ); |
186 | conf->writeEntry( "User", user ); | 189 | conf->writeEntry( "User", user ); |
187 | conf->writeEntryCrypt( "Password", password ); | 190 | conf->writeEntryCrypt( "Password", password ); |
188 | conf->writeEntry( "MailPrefix",prefix); | 191 | conf->writeEntry( "MailPrefix",prefix); |
189 | conf->writeEntry( "Offline",offline); | 192 | conf->writeEntry( "Offline",offline); |
190 | conf->write(); | 193 | conf->write(); |
191 | delete conf; | 194 | delete conf; |
192 | } | 195 | } |
193 | 196 | ||
194 | 197 | ||
195 | QString IMAPaccount::getFileName() | 198 | QString IMAPaccount::getFileName() |
196 | { | 199 | { |
197 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/imap-" + file; | 200 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/imap-" + file; |
198 | } | 201 | } |
199 | 202 | ||
200 | POP3account::POP3account() | 203 | POP3account::POP3account() |
201 | : Account() | 204 | : Account() |
202 | { | 205 | { |
203 | file = POP3account::getUniqueFileName(); | 206 | file = POP3account::getUniqueFileName(); |
204 | accountName = "New POP3 Account"; | 207 | accountName = "New POP3 Account"; |
205 | ssl = false; | 208 | ssl = false; |
209 | connectionType = 1; | ||
206 | type = "POP3"; | 210 | type = "POP3"; |
207 | port = POP3_PORT; | 211 | port = POP3_PORT; |
208 | } | 212 | } |
209 | 213 | ||
210 | POP3account::POP3account( QString filename ) | 214 | POP3account::POP3account( QString filename ) |
211 | : Account() | 215 | : Account() |
212 | { | 216 | { |
213 | file = filename; | 217 | file = filename; |
214 | accountName = "New POP3 Account"; | 218 | accountName = "New POP3 Account"; |
215 | ssl = false; | 219 | ssl = false; |
220 | connectionType = 1; | ||
216 | type = "POP3"; | 221 | type = "POP3"; |
217 | port = POP3_PORT; | 222 | port = POP3_PORT; |
218 | } | 223 | } |
219 | 224 | ||
220 | QString POP3account::getUniqueFileName() | 225 | QString POP3account::getUniqueFileName() |
221 | { | 226 | { |
222 | int num = 0; | 227 | int num = 0; |
223 | QString unique; | 228 | QString unique; |
224 | 229 | ||
225 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); | 230 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); |
226 | 231 | ||
227 | QStringList imap = dir.entryList( "pop3-*" ); | 232 | QStringList imap = dir.entryList( "pop3-*" ); |
228 | do { | 233 | do { |
229 | unique.setNum( num++ ); | 234 | unique.setNum( num++ ); |
230 | } while ( imap.contains( "pop3-" + unique ) > 0 ); | 235 | } while ( imap.contains( "pop3-" + unique ) > 0 ); |
231 | 236 | ||
232 | return unique; | 237 | return unique; |
233 | } | 238 | } |
234 | 239 | ||
235 | void POP3account::read() | 240 | void POP3account::read() |
236 | { | 241 | { |
237 | Config *conf = new Config( getFileName(), Config::File ); | 242 | Config *conf = new Config( getFileName(), Config::File ); |
238 | conf->setGroup( "POP3 Account" ); | 243 | conf->setGroup( "POP3 Account" ); |
239 | accountName = conf->readEntry( "Account" ); | 244 | accountName = conf->readEntry( "Account" ); |
240 | server = conf->readEntry( "Server" ); | 245 | server = conf->readEntry( "Server" ); |
241 | port = conf->readEntry( "Port" ); | 246 | port = conf->readEntry( "Port" ); |
242 | ssl = conf->readBoolEntry( "SSL" ); | 247 | ssl = conf->readBoolEntry( "SSL" ); |
248 | connectionType = conf->readNumEntry( "ConnectionType" ); | ||
243 | user = conf->readEntry( "User" ); | 249 | user = conf->readEntry( "User" ); |
244 | password = conf->readEntryCrypt( "Password" ); | 250 | password = conf->readEntryCrypt( "Password" ); |
245 | offline = conf->readBoolEntry("Offline",false); | 251 | offline = conf->readBoolEntry("Offline",false); |
246 | delete conf; | 252 | delete conf; |
247 | } | 253 | } |
248 | 254 | ||
249 | void POP3account::save() | 255 | void POP3account::save() |
250 | { | 256 | { |
251 | qDebug( "saving " + getFileName() ); | 257 | qDebug( "saving " + getFileName() ); |
252 | Settings::checkDirectory(); | 258 | Settings::checkDirectory(); |
253 | 259 | ||
254 | Config *conf = new Config( getFileName(), Config::File ); | 260 | Config *conf = new Config( getFileName(), Config::File ); |
255 | conf->setGroup( "POP3 Account" ); | 261 | conf->setGroup( "POP3 Account" ); |
256 | conf->writeEntry( "Account", accountName ); | 262 | conf->writeEntry( "Account", accountName ); |
257 | conf->writeEntry( "Server", server ); | 263 | conf->writeEntry( "Server", server ); |
258 | conf->writeEntry( "Port", port ); | 264 | conf->writeEntry( "Port", port ); |
259 | conf->writeEntry( "SSL", ssl ); | 265 | conf->writeEntry( "SSL", ssl ); |
266 | conf->writeEntry( "ConnectionType", connectionType ); | ||
260 | conf->writeEntry( "User", user ); | 267 | conf->writeEntry( "User", user ); |
261 | conf->writeEntryCrypt( "Password", password ); | 268 | conf->writeEntryCrypt( "Password", password ); |
262 | conf->writeEntry( "Offline",offline); | 269 | conf->writeEntry( "Offline",offline); |
263 | conf->write(); | 270 | conf->write(); |
264 | delete conf; | 271 | delete conf; |
265 | } | 272 | } |
266 | 273 | ||
267 | 274 | ||
268 | QString POP3account::getFileName() | 275 | QString POP3account::getFileName() |
269 | { | 276 | { |
270 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/pop3-" + file; | 277 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/pop3-" + file; |
271 | } | 278 | } |
272 | 279 | ||
273 | SMTPaccount::SMTPaccount() | 280 | SMTPaccount::SMTPaccount() |
274 | : Account() | 281 | : Account() |
275 | { | 282 | { |
276 | file = SMTPaccount::getUniqueFileName(); | 283 | file = SMTPaccount::getUniqueFileName(); |
277 | accountName = "New SMTP Account"; | 284 | accountName = "New SMTP Account"; |
278 | ssl = false; | 285 | ssl = false; |
279 | login = false; | 286 | login = false; |
280 | useCC = false; | 287 | useCC = false; |
281 | useBCC = false; | 288 | useBCC = false; |
282 | useReply = false; | 289 | useReply = false; |
283 | type = "SMTP"; | 290 | type = "SMTP"; |
284 | port = SMTP_PORT; | 291 | port = SMTP_PORT; |
285 | } | 292 | } |
286 | 293 | ||
287 | SMTPaccount::SMTPaccount( QString filename ) | 294 | SMTPaccount::SMTPaccount( QString filename ) |
288 | : Account() | 295 | : Account() |
289 | { | 296 | { |
290 | file = filename; | 297 | file = filename; |
291 | accountName = "New SMTP Account"; | 298 | accountName = "New SMTP Account"; |
292 | ssl = false; | 299 | ssl = false; |
293 | login = false; | 300 | login = false; |
294 | type = "SMTP"; | 301 | type = "SMTP"; |
295 | port = SMTP_PORT; | 302 | port = SMTP_PORT; |
296 | } | 303 | } |
297 | 304 | ||
298 | QString SMTPaccount::getUniqueFileName() | 305 | QString SMTPaccount::getUniqueFileName() |
299 | { | 306 | { |
300 | int num = 0; | 307 | int num = 0; |
301 | QString unique; | 308 | QString unique; |
302 | 309 | ||
303 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); | 310 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); |
304 | 311 | ||
305 | QStringList imap = dir.entryList( "smtp-*" ); | 312 | QStringList imap = dir.entryList( "smtp-*" ); |
306 | do { | 313 | do { |
307 | unique.setNum( num++ ); | 314 | unique.setNum( num++ ); |
308 | } while ( imap.contains( "smtp-" + unique ) > 0 ); | 315 | } while ( imap.contains( "smtp-" + unique ) > 0 ); |
309 | 316 | ||
310 | return unique; | 317 | return unique; |
311 | } | 318 | } |
312 | 319 | ||
313 | void SMTPaccount::read() | 320 | void SMTPaccount::read() |
314 | { | 321 | { |
315 | Config *conf = new Config( getFileName(), Config::File ); | 322 | Config *conf = new Config( getFileName(), Config::File ); |
316 | conf->setGroup( "SMTP Account" ); | 323 | conf->setGroup( "SMTP Account" ); |
317 | accountName = conf->readEntry( "Account" ); | 324 | accountName = conf->readEntry( "Account" ); |
318 | server = conf->readEntry( "Server" ); | 325 | server = conf->readEntry( "Server" ); |
319 | port = conf->readEntry( "Port" ); | 326 | port = conf->readEntry( "Port" ); |
320 | ssl = conf->readBoolEntry( "SSL" ); | 327 | ssl = conf->readBoolEntry( "SSL" ); |
321 | login = conf->readBoolEntry( "Login" ); | 328 | login = conf->readBoolEntry( "Login" ); |
322 | user = conf->readEntry( "User" ); | 329 | user = conf->readEntry( "User" ); |
323 | password = conf->readEntryCrypt( "Password" ); | 330 | password = conf->readEntryCrypt( "Password" ); |
324 | delete conf; | 331 | delete conf; |
325 | } | 332 | } |
326 | 333 | ||
327 | void SMTPaccount::save() | 334 | void SMTPaccount::save() |
328 | { | 335 | { |
329 | qDebug( "saving " + getFileName() ); | 336 | qDebug( "saving " + getFileName() ); |
330 | Settings::checkDirectory(); | 337 | Settings::checkDirectory(); |
331 | 338 | ||
332 | Config *conf = new Config( getFileName(), Config::File ); | 339 | Config *conf = new Config( getFileName(), Config::File ); |
333 | conf->setGroup( "SMTP Account" ); | 340 | conf->setGroup( "SMTP Account" ); |
334 | conf->writeEntry( "Account", accountName ); | 341 | conf->writeEntry( "Account", accountName ); |
335 | conf->writeEntry( "Server", server ); | 342 | conf->writeEntry( "Server", server ); |
336 | conf->writeEntry( "Port", port ); | 343 | conf->writeEntry( "Port", port ); |
337 | conf->writeEntry( "SSL", ssl ); | 344 | conf->writeEntry( "SSL", ssl ); |
338 | conf->writeEntry( "Login", login ); | 345 | conf->writeEntry( "Login", login ); |
339 | conf->writeEntry( "User", user ); | 346 | conf->writeEntry( "User", user ); |
340 | conf->writeEntryCrypt( "Password", password ); | 347 | conf->writeEntryCrypt( "Password", password ); |
341 | conf->write(); | 348 | conf->write(); |
342 | delete conf; | 349 | delete conf; |
343 | } | 350 | } |
344 | 351 | ||
345 | 352 | ||
346 | QString SMTPaccount::getFileName() | 353 | QString SMTPaccount::getFileName() |
347 | { | 354 | { |
348 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/smtp-" + file; | 355 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/smtp-" + file; |
349 | } | 356 | } |
350 | 357 | ||
351 | NNTPaccount::NNTPaccount() | 358 | NNTPaccount::NNTPaccount() |
352 | : Account() | 359 | : Account() |
353 | { | 360 | { |
354 | file = NNTPaccount::getUniqueFileName(); | 361 | file = NNTPaccount::getUniqueFileName(); |
355 | accountName = "New NNTP Account"; | 362 | accountName = "New NNTP Account"; |
356 | ssl = false; | 363 | ssl = false; |
357 | login = false; | 364 | login = false; |
358 | type = "NNTP"; | 365 | type = "NNTP"; |
359 | port = NNTP_PORT; | 366 | port = NNTP_PORT; |
360 | } | 367 | } |
361 | 368 | ||
362 | NNTPaccount::NNTPaccount( QString filename ) | 369 | NNTPaccount::NNTPaccount( QString filename ) |
363 | : Account() | 370 | : Account() |
364 | { | 371 | { |
365 | file = filename; | 372 | file = filename; |
366 | accountName = "New NNTP Account"; | 373 | accountName = "New NNTP Account"; |
367 | ssl = false; | 374 | ssl = false; |
368 | login = false; | 375 | login = false; |
369 | type = "NNTP"; | 376 | type = "NNTP"; |
370 | port = NNTP_PORT; | 377 | port = NNTP_PORT; |
371 | } | 378 | } |
372 | 379 | ||
373 | QString NNTPaccount::getUniqueFileName() | 380 | QString NNTPaccount::getUniqueFileName() |
374 | { | 381 | { |
375 | int num = 0; | 382 | int num = 0; |
376 | QString unique; | 383 | QString unique; |
377 | 384 | ||
378 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); | 385 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); |
379 | 386 | ||
380 | QStringList imap = dir.entryList( "nntp-*" ); | 387 | QStringList imap = dir.entryList( "nntp-*" ); |
381 | do { | 388 | do { |
382 | unique.setNum( num++ ); | 389 | unique.setNum( num++ ); |
383 | } while ( imap.contains( "nntp-" + unique ) > 0 ); | 390 | } while ( imap.contains( "nntp-" + unique ) > 0 ); |
384 | 391 | ||
385 | return unique; | 392 | return unique; |
386 | } | 393 | } |
387 | 394 | ||
388 | void NNTPaccount::read() | 395 | void NNTPaccount::read() |
389 | { | 396 | { |
390 | Config *conf = new Config( getFileName(), Config::File ); | 397 | Config *conf = new Config( getFileName(), Config::File ); |
391 | conf->setGroup( "NNTP Account" ); | 398 | conf->setGroup( "NNTP Account" ); |
392 | accountName = conf->readEntry( "Account" ); | 399 | accountName = conf->readEntry( "Account" ); |
393 | server = conf->readEntry( "Server" ); | 400 | server = conf->readEntry( "Server" ); |
394 | port = conf->readEntry( "Port" ); | 401 | port = conf->readEntry( "Port" ); |
395 | ssl = conf->readBoolEntry( "SSL" ); | 402 | ssl = conf->readBoolEntry( "SSL" ); |
396 | login = conf->readBoolEntry( "Login" ); | 403 | login = conf->readBoolEntry( "Login" ); |
397 | user = conf->readEntry( "User" ); | 404 | user = conf->readEntry( "User" ); |
398 | password = conf->readEntryCrypt( "Password" ); | 405 | password = conf->readEntryCrypt( "Password" ); |
399 | delete conf; | 406 | delete conf; |
400 | } | 407 | } |
401 | 408 | ||
402 | void NNTPaccount::save() | 409 | void NNTPaccount::save() |
403 | { | 410 | { |
404 | qDebug( "saving " + getFileName() ); | 411 | qDebug( "saving " + getFileName() ); |
405 | Settings::checkDirectory(); | 412 | Settings::checkDirectory(); |
406 | 413 | ||
407 | Config *conf = new Config( getFileName(), Config::File ); | 414 | Config *conf = new Config( getFileName(), Config::File ); |
408 | conf->setGroup( "NNTP Account" ); | 415 | conf->setGroup( "NNTP Account" ); |
409 | conf->writeEntry( "Account", accountName ); | 416 | conf->writeEntry( "Account", accountName ); |
410 | conf->writeEntry( "Server", server ); | 417 | conf->writeEntry( "Server", server ); |
411 | conf->writeEntry( "Port", port ); | 418 | conf->writeEntry( "Port", port ); |
412 | conf->writeEntry( "SSL", ssl ); | 419 | conf->writeEntry( "SSL", ssl ); |
413 | conf->writeEntry( "Login", login ); | 420 | conf->writeEntry( "Login", login ); |
414 | conf->writeEntry( "User", user ); | 421 | conf->writeEntry( "User", user ); |
415 | conf->writeEntryCrypt( "Password", password ); | 422 | conf->writeEntryCrypt( "Password", password ); |
416 | conf->write(); | 423 | conf->write(); |
417 | delete conf; | 424 | delete conf; |
418 | } | 425 | } |
419 | 426 | ||
420 | 427 | ||
421 | QString NNTPaccount::getFileName() | 428 | QString NNTPaccount::getFileName() |
422 | { | 429 | { |
423 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/nntp-" + file; | 430 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/nntp-" + file; |
424 | } | 431 | } |
425 | 432 | ||
diff --git a/noncore/net/mail/libmailwrapper/settings.h b/noncore/net/mail/libmailwrapper/settings.h index 2104997..8d7df92 100644 --- a/noncore/net/mail/libmailwrapper/settings.h +++ b/noncore/net/mail/libmailwrapper/settings.h | |||
@@ -1,149 +1,154 @@ | |||
1 | #ifndef SETTINGS_H | 1 | #ifndef SETTINGS_H |
2 | #define SETTINGS_H | 2 | #define SETTINGS_H |
3 | 3 | ||
4 | #include <qobject.h> | 4 | #include <qobject.h> |
5 | #include <qlist.h> | 5 | #include <qlist.h> |
6 | 6 | ||
7 | class Account | 7 | class Account |
8 | { | 8 | { |
9 | 9 | ||
10 | public: | 10 | public: |
11 | Account(); | 11 | Account(); |
12 | virtual ~Account() {} | 12 | virtual ~Account() {} |
13 | 13 | ||
14 | void remove(); | 14 | void remove(); |
15 | void setAccountName( QString name ) { accountName = name; } | 15 | void setAccountName( QString name ) { accountName = name; } |
16 | const QString&getAccountName()const{ return accountName; } | 16 | const QString&getAccountName()const{ return accountName; } |
17 | const QString&getType()const{ return type; } | 17 | const QString&getType()const{ return type; } |
18 | 18 | ||
19 | void setServer(const QString&str){ server = str; } | 19 | void setServer(const QString&str){ server = str; } |
20 | const QString&getServer()const{ return server; } | 20 | const QString&getServer()const{ return server; } |
21 | 21 | ||
22 | void setPort(const QString&str) { port = str; } | 22 | void setPort(const QString&str) { port = str; } |
23 | const QString&getPort()const{ return port; } | 23 | const QString&getPort()const{ return port; } |
24 | 24 | ||
25 | void setUser(const QString&str){ user = str; } | 25 | void setUser(const QString&str){ user = str; } |
26 | const QString&getUser()const{ return user; } | 26 | const QString&getUser()const{ return user; } |
27 | 27 | ||
28 | void setPassword(const QString&str) { password = str; } | 28 | void setPassword(const QString&str) { password = str; } |
29 | const QString&getPassword()const { return password; } | 29 | const QString&getPassword()const { return password; } |
30 | 30 | ||
31 | void setSSL( bool b ) { ssl = b; } | 31 | void setSSL( bool b ) { ssl = b; } |
32 | bool getSSL() { return ssl; } | 32 | bool getSSL() { return ssl; } |
33 | 33 | ||
34 | void setConnectionType( int x ) { connectionType = x; } | ||
35 | int ConnectionType() { return connectionType; } | ||
36 | |||
37 | |||
34 | void setOffline(bool b) {offline = b;} | 38 | void setOffline(bool b) {offline = b;} |
35 | bool getOffline()const{return offline;} | 39 | bool getOffline()const{return offline;} |
36 | 40 | ||
37 | virtual QString getFileName() { return accountName; } | 41 | virtual QString getFileName() { return accountName; } |
38 | virtual void read() { qDebug( "base reading..." ); } | 42 | virtual void read() { qDebug( "base reading..." ); } |
39 | virtual void save() { qDebug( "base saving..." ); } | 43 | virtual void save() { qDebug( "base saving..." ); } |
40 | 44 | ||
41 | protected: | 45 | protected: |
42 | QString accountName, type, server, port, user, password; | 46 | QString accountName, type, server, port, user, password; |
43 | bool ssl; | 47 | bool ssl; |
48 | int connectionType; | ||
44 | bool offline; | 49 | bool offline; |
45 | }; | 50 | }; |
46 | 51 | ||
47 | class IMAPaccount : public Account | 52 | class IMAPaccount : public Account |
48 | { | 53 | { |
49 | 54 | ||
50 | public: | 55 | public: |
51 | IMAPaccount(); | 56 | IMAPaccount(); |
52 | IMAPaccount( QString filename ); | 57 | IMAPaccount( QString filename ); |
53 | 58 | ||
54 | static QString getUniqueFileName(); | 59 | static QString getUniqueFileName(); |
55 | 60 | ||
56 | virtual void read(); | 61 | virtual void read(); |
57 | virtual void save(); | 62 | virtual void save(); |
58 | virtual QString getFileName(); | 63 | virtual QString getFileName(); |
59 | 64 | ||
60 | void setPrefix(const QString&str) {prefix=str;} | 65 | void setPrefix(const QString&str) {prefix=str;} |
61 | const QString&getPrefix()const{return prefix;} | 66 | const QString&getPrefix()const{return prefix;} |
62 | 67 | ||
63 | private: | 68 | private: |
64 | QString file,prefix; | 69 | QString file,prefix; |
65 | 70 | ||
66 | }; | 71 | }; |
67 | 72 | ||
68 | class POP3account : public Account | 73 | class POP3account : public Account |
69 | { | 74 | { |
70 | 75 | ||
71 | public: | 76 | public: |
72 | POP3account(); | 77 | POP3account(); |
73 | POP3account( QString filename ); | 78 | POP3account( QString filename ); |
74 | 79 | ||
75 | static QString getUniqueFileName(); | 80 | static QString getUniqueFileName(); |
76 | 81 | ||
77 | virtual void read(); | 82 | virtual void read(); |
78 | virtual void save(); | 83 | virtual void save(); |
79 | virtual QString getFileName(); | 84 | virtual QString getFileName(); |
80 | 85 | ||
81 | private: | 86 | private: |
82 | QString file; | 87 | QString file; |
83 | 88 | ||
84 | }; | 89 | }; |
85 | 90 | ||
86 | class SMTPaccount : public Account | 91 | class SMTPaccount : public Account |
87 | { | 92 | { |
88 | 93 | ||
89 | public: | 94 | public: |
90 | SMTPaccount(); | 95 | SMTPaccount(); |
91 | SMTPaccount( QString filename ); | 96 | SMTPaccount( QString filename ); |
92 | 97 | ||
93 | static QString getUniqueFileName(); | 98 | static QString getUniqueFileName(); |
94 | 99 | ||
95 | virtual void read(); | 100 | virtual void read(); |
96 | virtual void save(); | 101 | virtual void save(); |
97 | virtual QString getFileName(); | 102 | virtual QString getFileName(); |
98 | 103 | ||
99 | void setLogin( bool b ) { login = b; } | 104 | void setLogin( bool b ) { login = b; } |
100 | bool getLogin() { return login; } | 105 | bool getLogin() { return login; } |
101 | 106 | ||
102 | private: | 107 | private: |
103 | QString file, name, mail, org, cc, bcc, reply, signature; | 108 | QString file, name, mail, org, cc, bcc, reply, signature; |
104 | bool useCC, useBCC, useReply, login; | 109 | bool useCC, useBCC, useReply, login; |
105 | 110 | ||
106 | }; | 111 | }; |
107 | 112 | ||
108 | class NNTPaccount : public Account | 113 | class NNTPaccount : public Account |
109 | { | 114 | { |
110 | 115 | ||
111 | public: | 116 | public: |
112 | NNTPaccount(); | 117 | NNTPaccount(); |
113 | NNTPaccount( QString filename ); | 118 | NNTPaccount( QString filename ); |
114 | 119 | ||
115 | static QString getUniqueFileName(); | 120 | static QString getUniqueFileName(); |
116 | 121 | ||
117 | virtual void read(); | 122 | virtual void read(); |
118 | virtual void save(); | 123 | virtual void save(); |
119 | virtual QString getFileName(); | 124 | virtual QString getFileName(); |
120 | 125 | ||
121 | void setLogin( bool b ) { login = b; } | 126 | void setLogin( bool b ) { login = b; } |
122 | bool getLogin() { return login; } | 127 | bool getLogin() { return login; } |
123 | 128 | ||
124 | private: | 129 | private: |
125 | QString file; | 130 | QString file; |
126 | bool login; | 131 | bool login; |
127 | 132 | ||
128 | }; | 133 | }; |
129 | 134 | ||
130 | class Settings : public QObject | 135 | class Settings : public QObject |
131 | { | 136 | { |
132 | Q_OBJECT | 137 | Q_OBJECT |
133 | 138 | ||
134 | public: | 139 | public: |
135 | Settings(); | 140 | Settings(); |
136 | QList<Account> getAccounts(); | 141 | QList<Account> getAccounts(); |
137 | void addAccount(Account *account); | 142 | void addAccount(Account *account); |
138 | void delAccount(Account *account); | 143 | void delAccount(Account *account); |
139 | void saveAccounts(); | 144 | void saveAccounts(); |
140 | void readAccounts(); | 145 | void readAccounts(); |
141 | static void checkDirectory(); | 146 | static void checkDirectory(); |
142 | 147 | ||
143 | private: | 148 | private: |
144 | void updateAccounts(); | 149 | void updateAccounts(); |
145 | QList<Account> accounts; | 150 | QList<Account> accounts; |
146 | 151 | ||
147 | }; | 152 | }; |
148 | 153 | ||
149 | #endif | 154 | #endif |
diff --git a/noncore/net/mail/pop3configui.ui b/noncore/net/mail/pop3configui.ui index 8fdb4ba..95cbdc2 100644 --- a/noncore/net/mail/pop3configui.ui +++ b/noncore/net/mail/pop3configui.ui | |||
@@ -1,199 +1,405 @@ | |||
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>236</width> | 14 | <width>232</width> |
15 | <height>320</height> | 15 | <height>320</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 | <grid> | 28 | <widget> |
29 | <class>QLayoutWidget</class> | ||
29 | <property stdset="1"> | 30 | <property stdset="1"> |
30 | <name>margin</name> | 31 | <name>name</name> |
31 | <number>4</number> | 32 | <cstring>Layout12</cstring> |
32 | </property> | 33 | </property> |
33 | <property stdset="1"> | 34 | <property stdset="1"> |
34 | <name>spacing</name> | 35 | <name>geometry</name> |
35 | <number>3</number> | 36 | <rect> |
37 | <x>3</x> | ||
38 | <y>3</y> | ||
39 | <width>226</width> | ||
40 | <height>32</height> | ||
41 | </rect> | ||
36 | </property> | 42 | </property> |
37 | <widget row="6" column="1" > | 43 | <hbox> |
38 | <class>QLineEdit</class> | ||
39 | <property stdset="1"> | 44 | <property stdset="1"> |
40 | <name>name</name> | 45 | <name>margin</name> |
41 | <cstring>userLine</cstring> | 46 | <number>0</number> |
42 | </property> | 47 | </property> |
43 | </widget> | ||
44 | <widget row="7" column="0" > | ||
45 | <class>QLabel</class> | ||
46 | <property stdset="1"> | 48 | <property stdset="1"> |
47 | <name>name</name> | 49 | <name>spacing</name> |
48 | <cstring>passLabel</cstring> | 50 | <number>6</number> |
49 | </property> | ||
50 | <property stdset="1"> | ||
51 | <name>text</name> | ||
52 | <string>Password</string> | ||
53 | </property> | ||
54 | </widget> | ||
55 | <widget row="7" column="1" > | ||
56 | <class>QLineEdit</class> | ||
57 | <property stdset="1"> | ||
58 | <name>name</name> | ||
59 | <cstring>passLine</cstring> | ||
60 | </property> | ||
61 | <property stdset="1"> | ||
62 | <name>echoMode</name> | ||
63 | <enum>Password</enum> | ||
64 | </property> | ||
65 | </widget> | ||
66 | <widget row="3" column="1" > | ||
67 | <class>QLineEdit</class> | ||
68 | <property stdset="1"> | ||
69 | <name>name</name> | ||
70 | <cstring>portLine</cstring> | ||
71 | </property> | ||
72 | </widget> | ||
73 | <widget row="2" column="1" > | ||
74 | <class>QLineEdit</class> | ||
75 | <property stdset="1"> | ||
76 | <name>name</name> | ||
77 | <cstring>serverLine</cstring> | ||
78 | </property> | ||
79 | </widget> | ||
80 | <widget row="2" column="0" > | ||
81 | <class>QLabel</class> | ||
82 | <property stdset="1"> | ||
83 | <name>name</name> | ||
84 | <cstring>serverLabel</cstring> | ||
85 | </property> | ||
86 | <property stdset="1"> | ||
87 | <name>text</name> | ||
88 | <string>Server</string> | ||
89 | </property> | ||
90 | </widget> | ||
91 | <widget row="4" column="1" > | ||
92 | <class>QCheckBox</class> | ||
93 | <property stdset="1"> | ||
94 | <name>name</name> | ||
95 | <cstring>sslBox</cstring> | ||
96 | </property> | ||
97 | <property stdset="1"> | ||
98 | <name>text</name> | ||
99 | <string>Use SSL</string> | ||
100 | </property> | ||
101 | </widget> | ||
102 | <widget row="3" column="0" > | ||
103 | <class>QLabel</class> | ||
104 | <property stdset="1"> | ||
105 | <name>name</name> | ||
106 | <cstring>portLabel</cstring> | ||
107 | </property> | ||
108 | <property stdset="1"> | ||
109 | <name>text</name> | ||
110 | <string>Port</string> | ||
111 | </property> | ||
112 | </widget> | ||
113 | <widget row="6" column="0" > | ||
114 | <class>QLabel</class> | ||
115 | <property stdset="1"> | ||
116 | <name>name</name> | ||
117 | <cstring>userLabel</cstring> | ||
118 | </property> | ||
119 | <property stdset="1"> | ||
120 | <name>text</name> | ||
121 | <string>User</string> | ||
122 | </property> | ||
123 | </widget> | ||
124 | <spacer row="8" column="1" > | ||
125 | <property> | ||
126 | <name>name</name> | ||
127 | <cstring>spacer</cstring> | ||
128 | </property> | ||
129 | <property stdset="1"> | ||
130 | <name>orientation</name> | ||
131 | <enum>Vertical</enum> | ||
132 | </property> | ||
133 | <property stdset="1"> | ||
134 | <name>sizeType</name> | ||
135 | <enum>Expanding</enum> | ||
136 | </property> | ||
137 | <property> | ||
138 | <name>sizeHint</name> | ||
139 | <size> | ||
140 | <width>20</width> | ||
141 | <height>20</height> | ||
142 | </size> | ||
143 | </property> | ||
144 | </spacer> | ||
145 | <widget row="5" column="0" rowspan="1" colspan="2" > | ||
146 | <class>Line</class> | ||
147 | <property stdset="1"> | ||
148 | <name>name</name> | ||
149 | <cstring>line2</cstring> | ||
150 | </property> | 51 | </property> |
52 | <widget> | ||
53 | <class>QLabel</class> | ||
54 | <property stdset="1"> | ||
55 | <name>name</name> | ||
56 | <cstring>accountLabel</cstring> | ||
57 | </property> | ||
58 | <property stdset="1"> | ||
59 | <name>text</name> | ||
60 | <string>Account</string> | ||
61 | </property> | ||
62 | </widget> | ||
63 | <widget> | ||
64 | <class>QLineEdit</class> | ||
65 | <property stdset="1"> | ||
66 | <name>name</name> | ||
67 | <cstring>accountLine</cstring> | ||
68 | </property> | ||
69 | <property> | ||
70 | <name>toolTip</name> | ||
71 | <string>Name of the Account</string> | ||
72 | </property> | ||
73 | </widget> | ||
74 | </hbox> | ||
75 | </widget> | ||
76 | <widget> | ||
77 | <class>Line</class> | ||
78 | <property stdset="1"> | ||
79 | <name>name</name> | ||
80 | <cstring>line1</cstring> | ||
81 | </property> | ||
82 | <property stdset="1"> | ||
83 | <name>geometry</name> | ||
84 | <rect> | ||
85 | <x>3</x> | ||
86 | <y>38</y> | ||
87 | <width>226</width> | ||
88 | <height>16</height> | ||
89 | </rect> | ||
90 | </property> | ||
91 | <property stdset="1"> | ||
92 | <name>orientation</name> | ||
93 | <enum>Horizontal</enum> | ||
94 | </property> | ||
95 | </widget> | ||
96 | <widget> | ||
97 | <class>QLayoutWidget</class> | ||
98 | <property stdset="1"> | ||
99 | <name>name</name> | ||
100 | <cstring>Layout11</cstring> | ||
101 | </property> | ||
102 | <property stdset="1"> | ||
103 | <name>geometry</name> | ||
104 | <rect> | ||
105 | <x>3</x> | ||
106 | <y>44</y> | ||
107 | <width>226</width> | ||
108 | <height>70</height> | ||
109 | </rect> | ||
110 | </property> | ||
111 | <hbox> | ||
151 | <property stdset="1"> | 112 | <property stdset="1"> |
152 | <name>orientation</name> | 113 | <name>margin</name> |
153 | <enum>Horizontal</enum> | 114 | <number>0</number> |
154 | </property> | 115 | </property> |
155 | </widget> | ||
156 | <widget row="0" column="0" > | ||
157 | <class>QLabel</class> | ||
158 | <property stdset="1"> | 116 | <property stdset="1"> |
159 | <name>name</name> | 117 | <name>spacing</name> |
160 | <cstring>accountLabel</cstring> | 118 | <number>6</number> |
161 | </property> | 119 | </property> |
120 | <widget> | ||
121 | <class>QLayoutWidget</class> | ||
122 | <property stdset="1"> | ||
123 | <name>name</name> | ||
124 | <cstring>Layout9</cstring> | ||
125 | </property> | ||
126 | <vbox> | ||
127 | <property stdset="1"> | ||
128 | <name>margin</name> | ||
129 | <number>0</number> | ||
130 | </property> | ||
131 | <property stdset="1"> | ||
132 | <name>spacing</name> | ||
133 | <number>6</number> | ||
134 | </property> | ||
135 | <widget> | ||
136 | <class>QLabel</class> | ||
137 | <property stdset="1"> | ||
138 | <name>name</name> | ||
139 | <cstring>serverLabel</cstring> | ||
140 | </property> | ||
141 | <property stdset="1"> | ||
142 | <name>text</name> | ||
143 | <string>Server</string> | ||
144 | </property> | ||
145 | </widget> | ||
146 | <widget> | ||
147 | <class>QLabel</class> | ||
148 | <property stdset="1"> | ||
149 | <name>name</name> | ||
150 | <cstring>portLabel</cstring> | ||
151 | </property> | ||
152 | <property stdset="1"> | ||
153 | <name>text</name> | ||
154 | <string>Port</string> | ||
155 | </property> | ||
156 | </widget> | ||
157 | </vbox> | ||
158 | </widget> | ||
159 | <widget> | ||
160 | <class>QLayoutWidget</class> | ||
161 | <property stdset="1"> | ||
162 | <name>name</name> | ||
163 | <cstring>Layout10</cstring> | ||
164 | </property> | ||
165 | <vbox> | ||
166 | <property stdset="1"> | ||
167 | <name>margin</name> | ||
168 | <number>0</number> | ||
169 | </property> | ||
170 | <property stdset="1"> | ||
171 | <name>spacing</name> | ||
172 | <number>6</number> | ||
173 | </property> | ||
174 | <widget> | ||
175 | <class>QLineEdit</class> | ||
176 | <property stdset="1"> | ||
177 | <name>name</name> | ||
178 | <cstring>serverLine</cstring> | ||
179 | </property> | ||
180 | </widget> | ||
181 | <widget> | ||
182 | <class>QLineEdit</class> | ||
183 | <property stdset="1"> | ||
184 | <name>name</name> | ||
185 | <cstring>portLine</cstring> | ||
186 | </property> | ||
187 | </widget> | ||
188 | </vbox> | ||
189 | </widget> | ||
190 | </hbox> | ||
191 | </widget> | ||
192 | <widget> | ||
193 | <class>QLayoutWidget</class> | ||
194 | <property stdset="1"> | ||
195 | <name>name</name> | ||
196 | <cstring>Layout13</cstring> | ||
197 | </property> | ||
198 | <property stdset="1"> | ||
199 | <name>geometry</name> | ||
200 | <rect> | ||
201 | <x>3</x> | ||
202 | <y>117</y> | ||
203 | <width>226</width> | ||
204 | <height>64</height> | ||
205 | </rect> | ||
206 | </property> | ||
207 | <vbox> | ||
162 | <property stdset="1"> | 208 | <property stdset="1"> |
163 | <name>text</name> | 209 | <name>margin</name> |
164 | <string>Account</string> | 210 | <number>0</number> |
165 | </property> | 211 | </property> |
166 | </widget> | ||
167 | <widget row="0" column="1" > | ||
168 | <class>QLineEdit</class> | ||
169 | <property stdset="1"> | 212 | <property stdset="1"> |
170 | <name>name</name> | 213 | <name>spacing</name> |
171 | <cstring>accountLine</cstring> | 214 | <number>6</number> |
172 | </property> | 215 | </property> |
173 | <property> | 216 | <widget> |
174 | <name>toolTip</name> | 217 | <class>QLabel</class> |
175 | <string>Name of the Account</string> | 218 | <property stdset="1"> |
176 | </property> | 219 | <name>name</name> |
177 | </widget> | 220 | <cstring>TextLabel1</cstring> |
178 | <widget row="1" column="0" rowspan="1" colspan="2" > | 221 | </property> |
179 | <class>Line</class> | 222 | <property stdset="1"> |
223 | <name>text</name> | ||
224 | <string>Use secure sockets:</string> | ||
225 | </property> | ||
226 | </widget> | ||
227 | <widget> | ||
228 | <class>QComboBox</class> | ||
229 | <property stdset="1"> | ||
230 | <name>name</name> | ||
231 | <cstring>ComboBox1</cstring> | ||
232 | </property> | ||
233 | </widget> | ||
234 | </vbox> | ||
235 | </widget> | ||
236 | <widget> | ||
237 | <class>QLayoutWidget</class> | ||
238 | <property stdset="1"> | ||
239 | <name>name</name> | ||
240 | <cstring>Layout6</cstring> | ||
241 | </property> | ||
242 | <property stdset="1"> | ||
243 | <name>geometry</name> | ||
244 | <rect> | ||
245 | <x>3</x> | ||
246 | <y>223</y> | ||
247 | <width>226</width> | ||
248 | <height>70</height> | ||
249 | </rect> | ||
250 | </property> | ||
251 | <hbox> | ||
180 | <property stdset="1"> | 252 | <property stdset="1"> |
181 | <name>name</name> | 253 | <name>margin</name> |
182 | <cstring>line1</cstring> | 254 | <number>0</number> |
183 | </property> | 255 | </property> |
184 | <property stdset="1"> | 256 | <property stdset="1"> |
185 | <name>orientation</name> | 257 | <name>spacing</name> |
186 | <enum>Horizontal</enum> | 258 | <number>6</number> |
187 | </property> | 259 | </property> |
188 | </widget> | 260 | <widget> |
189 | </grid> | 261 | <class>QLayoutWidget</class> |
262 | <property stdset="1"> | ||
263 | <name>name</name> | ||
264 | <cstring>Layout4</cstring> | ||
265 | </property> | ||
266 | <vbox> | ||
267 | <property stdset="1"> | ||
268 | <name>margin</name> | ||
269 | <number>0</number> | ||
270 | </property> | ||
271 | <property stdset="1"> | ||
272 | <name>spacing</name> | ||
273 | <number>6</number> | ||
274 | </property> | ||
275 | <widget> | ||
276 | <class>QLabel</class> | ||
277 | <property stdset="1"> | ||
278 | <name>name</name> | ||
279 | <cstring>userLabel</cstring> | ||
280 | </property> | ||
281 | <property stdset="1"> | ||
282 | <name>text</name> | ||
283 | <string>User</string> | ||
284 | </property> | ||
285 | </widget> | ||
286 | <widget> | ||
287 | <class>QLabel</class> | ||
288 | <property stdset="1"> | ||
289 | <name>name</name> | ||
290 | <cstring>passLabel</cstring> | ||
291 | </property> | ||
292 | <property stdset="1"> | ||
293 | <name>text</name> | ||
294 | <string>Password</string> | ||
295 | </property> | ||
296 | </widget> | ||
297 | </vbox> | ||
298 | </widget> | ||
299 | <widget> | ||
300 | <class>QLayoutWidget</class> | ||
301 | <property stdset="1"> | ||
302 | <name>name</name> | ||
303 | <cstring>Layout5</cstring> | ||
304 | </property> | ||
305 | <vbox> | ||
306 | <property stdset="1"> | ||
307 | <name>margin</name> | ||
308 | <number>0</number> | ||
309 | </property> | ||
310 | <property stdset="1"> | ||
311 | <name>spacing</name> | ||
312 | <number>6</number> | ||
313 | </property> | ||
314 | <widget> | ||
315 | <class>QLineEdit</class> | ||
316 | <property stdset="1"> | ||
317 | <name>name</name> | ||
318 | <cstring>userLine</cstring> | ||
319 | </property> | ||
320 | </widget> | ||
321 | <widget> | ||
322 | <class>QLineEdit</class> | ||
323 | <property stdset="1"> | ||
324 | <name>name</name> | ||
325 | <cstring>passLine</cstring> | ||
326 | </property> | ||
327 | <property stdset="1"> | ||
328 | <name>echoMode</name> | ||
329 | <enum>Password</enum> | ||
330 | </property> | ||
331 | </widget> | ||
332 | </vbox> | ||
333 | </widget> | ||
334 | </hbox> | ||
335 | </widget> | ||
336 | <spacer> | ||
337 | <property> | ||
338 | <name>name</name> | ||
339 | <cstring>spacer</cstring> | ||
340 | </property> | ||
341 | <property stdset="1"> | ||
342 | <name>orientation</name> | ||
343 | <enum>Vertical</enum> | ||
344 | </property> | ||
345 | <property stdset="1"> | ||
346 | <name>sizeType</name> | ||
347 | <enum>Expanding</enum> | ||
348 | </property> | ||
349 | <property> | ||
350 | <name>sizeHint</name> | ||
351 | <size> | ||
352 | <width>20</width> | ||
353 | <height>20</height> | ||
354 | </size> | ||
355 | </property> | ||
356 | </spacer> | ||
357 | <widget> | ||
358 | <class>QLineEdit</class> | ||
359 | <property stdset="1"> | ||
360 | <name>name</name> | ||
361 | <cstring>CommandEdit</cstring> | ||
362 | </property> | ||
363 | <property stdset="1"> | ||
364 | <name>geometry</name> | ||
365 | <rect> | ||
366 | <x>0</x> | ||
367 | <y>180</y> | ||
368 | <width>226</width> | ||
369 | <height>30</height> | ||
370 | </rect> | ||
371 | </property> | ||
372 | <property stdset="1"> | ||
373 | <name>text</name> | ||
374 | <string>ssh $SERVER exec imapd</string> | ||
375 | </property> | ||
376 | </widget> | ||
377 | <widget> | ||
378 | <class>Line</class> | ||
379 | <property stdset="1"> | ||
380 | <name>name</name> | ||
381 | <cstring>line2</cstring> | ||
382 | </property> | ||
383 | <property stdset="1"> | ||
384 | <name>geometry</name> | ||
385 | <rect> | ||
386 | <x>3</x> | ||
387 | <y>204</y> | ||
388 | <width>226</width> | ||
389 | <height>16</height> | ||
390 | </rect> | ||
391 | </property> | ||
392 | <property stdset="1"> | ||
393 | <name>orientation</name> | ||
394 | <enum>Horizontal</enum> | ||
395 | </property> | ||
396 | </widget> | ||
190 | </widget> | 397 | </widget> |
191 | <tabstops> | 398 | <tabstops> |
192 | <tabstop>accountLine</tabstop> | 399 | <tabstop>accountLine</tabstop> |
193 | <tabstop>serverLine</tabstop> | 400 | <tabstop>serverLine</tabstop> |
194 | <tabstop>portLine</tabstop> | 401 | <tabstop>portLine</tabstop> |
195 | <tabstop>sslBox</tabstop> | ||
196 | <tabstop>userLine</tabstop> | 402 | <tabstop>userLine</tabstop> |
197 | <tabstop>passLine</tabstop> | 403 | <tabstop>passLine</tabstop> |
198 | </tabstops> | 404 | </tabstops> |
199 | </UI> | 405 | </UI> |