author | alwin <alwin> | 2004-10-24 00:55:14 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-10-24 00:55:14 (UTC) |
commit | 9755bc969d17fc683791abc5c6fbd50fa3112486 (patch) (unidiff) | |
tree | 0fdcf7b52b2f4627dd3efcd7330b116c4d9c4d98 /noncore/net/mail/editaccounts.cpp | |
parent | 12eed25c7f18285f0e342d49fd3c41eb4b14e151 (diff) | |
download | opie-9755bc969d17fc683791abc5c6fbd50fa3112486.zip opie-9755bc969d17fc683791abc5c6fbd50fa3112486.tar.gz opie-9755bc969d17fc683791abc5c6fbd50fa3112486.tar.bz2 |
new options for pop3 accounts
KATE eated a lot of last spaces in files
some tryouts
Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp index b0ce57d..b7c137d 100644 --- a/noncore/net/mail/editaccounts.cpp +++ b/noncore/net/mail/editaccounts.cpp | |||
@@ -38,17 +38,17 @@ AccountListItem::AccountListItem( QListView *parent, Account *a) | |||
38 | break; | 38 | break; |
39 | } | 39 | } |
40 | setText( 1, ttext); | 40 | setText( 1, ttext); |
41 | } | 41 | } |
42 | 42 | ||
43 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) | 43 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) |
44 | : EditAccountsUI( parent, name, modal, flags ) | 44 | : EditAccountsUI( parent, name, modal, flags ) |
45 | { | 45 | { |
46 | odebug << "New Account Configuration Widget" << oendl; | 46 | odebug << "New Account Configuration Widget" << oendl; |
47 | settings = s; | 47 | settings = s; |
48 | 48 | ||
49 | mailList->addColumn( tr( "Account" ) ); | 49 | mailList->addColumn( tr( "Account" ) ); |
50 | mailList->addColumn( tr( "Type" ) ); | 50 | mailList->addColumn( tr( "Type" ) ); |
51 | 51 | ||
52 | newsList->addColumn( tr( "Account" ) ); | 52 | newsList->addColumn( tr( "Account" ) ); |
53 | 53 | ||
54 | connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); | 54 | connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); |
@@ -78,80 +78,80 @@ void EditAccounts::slotFillLists() | |||
78 | { | 78 | { |
79 | (void) new AccountListItem( mailList, it ); | 79 | (void) new AccountListItem( mailList, it ); |
80 | } | 80 | } |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | void EditAccounts::slotNewMail() | 84 | void EditAccounts::slotNewMail() |
85 | { | 85 | { |
86 | odebug << "New Mail Account" << oendl; | 86 | odebug << "New Mail Account" << oendl; |
87 | QString *selection = new QString(); | 87 | QString *selection = new QString(); |
88 | SelectMailType selType( selection, this, 0, true ); | 88 | SelectMailType selType( selection, this, 0, true ); |
89 | selType.show(); | 89 | selType.show(); |
90 | if ( QDialog::Accepted == selType.exec() ) | 90 | if ( QDialog::Accepted == selType.exec() ) |
91 | { | 91 | { |
92 | slotNewAccount( *selection ); | 92 | slotNewAccount( *selection ); |
93 | } | 93 | } |
94 | } | 94 | } |
95 | 95 | ||
96 | void EditAccounts::slotNewAccount( const QString &type ) | 96 | void EditAccounts::slotNewAccount( const QString &type ) |
97 | { | 97 | { |
98 | if ( type.compare( "IMAP" ) == 0 ) | 98 | if ( type.compare( "IMAP" ) == 0 ) |
99 | { | 99 | { |
100 | odebug << "-> config IMAP" << oendl; | 100 | odebug << "-> config IMAP" << oendl; |
101 | IMAPaccount *account = new IMAPaccount(); | 101 | IMAPaccount *account = new IMAPaccount(); |
102 | IMAPconfig imap( account, this, 0, true ); | 102 | IMAPconfig imap( account, this, 0, true ); |
103 | if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) | 103 | if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) |
104 | { | 104 | { |
105 | settings->addAccount( account ); | 105 | settings->addAccount( account ); |
106 | account->save(); | 106 | account->save(); |
107 | slotFillLists(); | 107 | slotFillLists(); |
108 | } | 108 | } |
109 | else | 109 | else |
110 | { | 110 | { |
111 | account->remove(); | 111 | account->remove(); |
112 | } | 112 | } |
113 | } | 113 | } |
114 | else if ( type.compare( "POP3" ) == 0 ) | 114 | else if ( type.compare( "POP3" ) == 0 ) |
115 | { | 115 | { |
116 | odebug << "-> config POP3" << oendl; | 116 | odebug << "-> config POP3" << oendl; |
117 | POP3account *account = new POP3account(); | 117 | POP3account *account = new POP3account(); |
118 | POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); | 118 | POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); |
119 | if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) | 119 | if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) |
120 | { | 120 | { |
121 | settings->addAccount( account ); | 121 | settings->addAccount( account ); |
122 | account->save(); | 122 | account->save(); |
123 | slotFillLists(); | 123 | slotFillLists(); |
124 | } | 124 | } |
125 | else | 125 | else |
126 | { | 126 | { |
127 | account->remove(); | 127 | account->remove(); |
128 | } | 128 | } |
129 | } | 129 | } |
130 | else if ( type.compare( "SMTP" ) == 0 ) | 130 | else if ( type.compare( "SMTP" ) == 0 ) |
131 | { | 131 | { |
132 | odebug << "-> config SMTP" << oendl; | 132 | odebug << "-> config SMTP" << oendl; |
133 | SMTPaccount *account = new SMTPaccount(); | 133 | SMTPaccount *account = new SMTPaccount(); |
134 | SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp ); | 134 | SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp ); |
135 | if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) | 135 | if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) |
136 | { | 136 | { |
137 | settings->addAccount( account ); | 137 | settings->addAccount( account ); |
138 | account->save(); | 138 | account->save(); |
139 | slotFillLists(); | 139 | slotFillLists(); |
140 | 140 | ||
141 | } | 141 | } |
142 | else | 142 | else |
143 | { | 143 | { |
144 | account->remove(); | 144 | account->remove(); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | else if ( type.compare( "NNTP" ) == 0 ) | 147 | else if ( type.compare( "NNTP" ) == 0 ) |
148 | { | 148 | { |
149 | odebug << "-> config NNTP" << oendl; | 149 | odebug << "-> config NNTP" << oendl; |
150 | NNTPaccount *account = new NNTPaccount(); | 150 | NNTPaccount *account = new NNTPaccount(); |
151 | NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp ); | 151 | NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp ); |
152 | if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) | 152 | if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) |
153 | { | 153 | { |
154 | settings->addAccount( account ); | 154 | settings->addAccount( account ); |
155 | account->save(); | 155 | account->save(); |
156 | slotFillLists(); | 156 | slotFillLists(); |
157 | } | 157 | } |
@@ -210,17 +210,17 @@ void EditAccounts::slotDeleteAccount( Account *account ) | |||
210 | { | 210 | { |
211 | settings->delAccount( account ); | 211 | settings->delAccount( account ); |
212 | slotFillLists(); | 212 | slotFillLists(); |
213 | } | 213 | } |
214 | } | 214 | } |
215 | 215 | ||
216 | void EditAccounts::slotEditMail() | 216 | void EditAccounts::slotEditMail() |
217 | { | 217 | { |
218 | odebug << "Edit Mail Account" << oendl; | 218 | odebug << "Edit Mail Account" << oendl; |
219 | if ( !mailList->currentItem() ) | 219 | if ( !mailList->currentItem() ) |
220 | { | 220 | { |
221 | QMessageBox::information( this, tr( "Error" ), | 221 | QMessageBox::information( this, tr( "Error" ), |
222 | tr( "<p>Please select an account.</p>" ), | 222 | tr( "<p>Please select an account.</p>" ), |
223 | tr( "Ok" ) ); | 223 | tr( "Ok" ) ); |
224 | return; | 224 | return; |
225 | } | 225 | } |
226 | 226 | ||
@@ -239,38 +239,38 @@ void EditAccounts::slotDeleteMail() | |||
239 | } | 239 | } |
240 | 240 | ||
241 | Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); | 241 | Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); |
242 | slotDeleteAccount( a ); | 242 | slotDeleteAccount( a ); |
243 | } | 243 | } |
244 | 244 | ||
245 | void EditAccounts::slotNewNews() | 245 | void EditAccounts::slotNewNews() |
246 | { | 246 | { |
247 | odebug << "New News Account" << oendl; | 247 | odebug << "New News Account" << oendl; |
248 | slotNewAccount( "NNTP" ); | 248 | slotNewAccount( "NNTP" ); |
249 | } | 249 | } |
250 | 250 | ||
251 | void EditAccounts::slotEditNews() | 251 | void EditAccounts::slotEditNews() |
252 | { | 252 | { |
253 | odebug << "Edit News Account" << oendl; | 253 | odebug << "Edit News Account" << oendl; |
254 | if ( !newsList->currentItem() ) | 254 | if ( !newsList->currentItem() ) |
255 | { | 255 | { |
256 | QMessageBox::information( this, tr( "Error" ), | 256 | QMessageBox::information( this, tr( "Error" ), |
257 | tr( "<p>Please select an account.</p>" ), | 257 | tr( "<p>Please select an account.</p>" ), |
258 | tr( "Ok" ) ); | 258 | tr( "Ok" ) ); |
259 | return; | 259 | return; |
260 | } | 260 | } |
261 | 261 | ||
262 | Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); | 262 | Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); |
263 | slotEditAccount( a ); | 263 | slotEditAccount( a ); |
264 | } | 264 | } |
265 | 265 | ||
266 | void EditAccounts::slotDeleteNews() | 266 | void EditAccounts::slotDeleteNews() |
267 | { | 267 | { |
268 | odebug << "Delete News Account" << oendl; | 268 | odebug << "Delete News Account" << oendl; |
269 | if ( !newsList->currentItem() ) | 269 | if ( !newsList->currentItem() ) |
270 | { | 270 | { |
271 | QMessageBox::information( this, tr( "Error" ), | 271 | QMessageBox::information( this, tr( "Error" ), |
272 | tr( "<p>Please select an account.</p>" ), | 272 | tr( "<p>Please select an account.</p>" ), |
273 | tr( "Ok" ) ); | 273 | tr( "Ok" ) ); |
274 | return; | 274 | return; |
275 | } | 275 | } |
276 | 276 | ||
@@ -417,26 +417,30 @@ void POP3config::slotConnectionToggle( int index ) | |||
417 | void POP3config::fillValues() | 417 | void POP3config::fillValues() |
418 | { | 418 | { |
419 | accountLine->setText( data->getAccountName() ); | 419 | accountLine->setText( data->getAccountName() ); |
420 | serverLine->setText( data->getServer() ); | 420 | serverLine->setText( data->getServer() ); |
421 | portLine->setText( data->getPort() ); | 421 | portLine->setText( data->getPort() ); |
422 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 422 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
423 | userLine->setText( data->getUser() ); | 423 | userLine->setText( data->getUser() ); |
424 | passLine->setText( data->getPassword() ); | 424 | passLine->setText( data->getPassword() ); |
425 | m_CheckSize->setChecked(data->getCheckMaxSize()); | ||
426 | m_MailLimitBox->setValue(data->getMaxSize()); | ||
425 | } | 427 | } |
426 | 428 | ||
427 | void POP3config::accept() | 429 | void POP3config::accept() |
428 | { | 430 | { |
429 | data->setAccountName( accountLine->text() ); | 431 | data->setAccountName( accountLine->text() ); |
430 | data->setServer( serverLine->text() ); | 432 | data->setServer( serverLine->text() ); |
431 | data->setPort( portLine->text() ); | 433 | data->setPort( portLine->text() ); |
432 | data->setConnectionType( ComboBox1->currentItem() ); | 434 | data->setConnectionType( ComboBox1->currentItem() ); |
433 | data->setUser( userLine->text() ); | 435 | data->setUser( userLine->text() ); |
434 | data->setPassword( passLine->text() ); | 436 | data->setPassword( passLine->text() ); |
437 | data->setMaxSize(m_MailLimitBox->value()); | ||
438 | data->setCheckMaxSize(m_CheckSize->isChecked()); | ||
435 | 439 | ||
436 | QDialog::accept(); | 440 | QDialog::accept(); |
437 | } | 441 | } |
438 | 442 | ||
439 | /** | 443 | /** |
440 | * SMTPconfig | 444 | * SMTPconfig |
441 | */ | 445 | */ |
442 | 446 | ||
@@ -518,17 +522,17 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, | |||
518 | connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); | 522 | connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); |
519 | } | 523 | } |
520 | 524 | ||
521 | void NNTPconfig::slotGetNG() { | 525 | void NNTPconfig::slotGetNG() { |
522 | save(); | 526 | save(); |
523 | data->save(); | 527 | data->save(); |
524 | NNTPwrapper* tmp = new NNTPwrapper( data ); | 528 | NNTPwrapper* tmp = new NNTPwrapper( data ); |
525 | QStringList list = tmp->listAllNewsgroups(); | 529 | QStringList list = tmp->listAllNewsgroups(); |
526 | 530 | ||
527 | ListViewGroups->clear(); | 531 | ListViewGroups->clear(); |
528 | 532 | ||
529 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 533 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
530 | QCheckListItem *item; | 534 | QCheckListItem *item; |
531 | item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); | 535 | item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); |
532 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { | 536 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { |
533 | item->setOn( true ); | 537 | item->setOn( true ); |
534 | } | 538 | } |
@@ -576,17 +580,17 @@ void NNTPconfig::save() | |||
576 | data->setPassword( passLine->text() ); | 580 | data->setPassword( passLine->text() ); |
577 | 581 | ||
578 | QListViewItemIterator list_it( ListViewGroups ); | 582 | QListViewItemIterator list_it( ListViewGroups ); |
579 | 583 | ||
580 | QStringList groupList; | 584 | QStringList groupList; |
581 | for ( ; list_it.current(); ++list_it ) { | 585 | for ( ; list_it.current(); ++list_it ) { |
582 | 586 | ||
583 | if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { | 587 | if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { |
584 | odebug << list_it.current()->text(0) << oendl; | 588 | odebug << list_it.current()->text(0) << oendl; |
585 | groupList.append( list_it.current()->text(0) ); | 589 | groupList.append( list_it.current()->text(0) ); |
586 | } | 590 | } |
587 | 591 | ||
588 | } | 592 | } |
589 | data->setGroups( groupList ); | 593 | data->setGroups( groupList ); |
590 | } | 594 | } |
591 | 595 | ||
592 | void NNTPconfig::accept() | 596 | void NNTPconfig::accept() |