Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 153 |
1 files changed, 104 insertions, 49 deletions
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp index 1cb202e..60bffa5 100644 --- a/noncore/net/mail/editaccounts.cpp +++ b/noncore/net/mail/editaccounts.cpp @@ -1,2 +1 @@ -#include <qt.h> @@ -5,2 +4,8 @@ +/* OPIE */ +#include <qpe/qpeapplication.h> + +/* QT */ +#include <qt.h> + AccountListItem::AccountListItem( QListView *parent, Account *a) @@ -41,6 +46,10 @@ void EditAccounts::slotFillLists() Account *it; - for ( it = accounts.first(); it; it = accounts.next() ) { - if ( it->getType().compare( "NNTP" ) == 0 ) { + for ( it = accounts.first(); it; it = accounts.next() ) + { + if ( it->getType().compare( "NNTP" ) == 0 ) + { (void) new AccountListItem( newsList, it ); - } else { + } + else + { (void) new AccountListItem( mailList, it ); @@ -56,3 +65,4 @@ void EditAccounts::slotNewMail() selType.show(); - if ( QDialog::Accepted == selType.exec() ) { + if ( QDialog::Accepted == selType.exec() ) + { slotNewAccount( *selection ); @@ -63,3 +73,4 @@ void EditAccounts::slotNewAccount( const QString &type ) { - if ( type.compare( "IMAP" ) == 0 ) { + if ( type.compare( "IMAP" ) == 0 ) + { qDebug( "-> config IMAP" ); @@ -67,4 +78,4 @@ void EditAccounts::slotNewAccount( const QString &type ) IMAPconfig imap( account, this, 0, true ); - imap.showMaximized(); - if ( QDialog::Accepted == imap.exec() ) { + if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) + { settings->addAccount( account ); @@ -72,6 +83,10 @@ void EditAccounts::slotNewAccount( const QString &type ) slotFillLists(); - } else { + } + else + { account->remove(); } - } else if ( type.compare( "POP3" ) == 0 ) { + } + else if ( type.compare( "POP3" ) == 0 ) + { qDebug( "-> config POP3" ); @@ -79,4 +94,4 @@ void EditAccounts::slotNewAccount( const QString &type ) POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); - pop3.showMaximized(); - if ( QDialog::Accepted == pop3.exec() ) { + if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) + { settings->addAccount( account ); @@ -84,6 +99,10 @@ void EditAccounts::slotNewAccount( const QString &type ) slotFillLists(); - } else { + } + else + { account->remove(); } - } else if ( type.compare( "SMTP" ) == 0 ) { + } + else if ( type.compare( "SMTP" ) == 0 ) + { qDebug( "-> config SMTP" ); @@ -91,4 +110,4 @@ void EditAccounts::slotNewAccount( const QString &type ) SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp ); - smtp.showMaximized(); - if ( QDialog::Accepted == smtp.exec() ) { + if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) + { settings->addAccount( account ); @@ -97,6 +116,10 @@ void EditAccounts::slotNewAccount( const QString &type ) - } else { + } + else + { account->remove(); } - } else if ( type.compare( "NNTP" ) == 0 ) { + } + else if ( type.compare( "NNTP" ) == 0 ) + { qDebug( "-> config NNTP" ); @@ -104,4 +127,4 @@ void EditAccounts::slotNewAccount( const QString &type ) NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp ); - nntp.showMaximized(); - if ( QDialog::Accepted == nntp.exec() ) { + if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) + { settings->addAccount( account ); @@ -109,3 +132,5 @@ void EditAccounts::slotNewAccount( const QString &type ) slotFillLists(); - } else { + } + else + { account->remove(); @@ -117,28 +142,35 @@ void EditAccounts::slotEditAccount( Account *account ) { - if ( account->getType().compare( "IMAP" ) == 0 ) { + if ( account->getType().compare( "IMAP" ) == 0 ) + { IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp ); - imap.showMaximized(); - if ( QDialog::Accepted == imap.exec() ) { + if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) + { slotFillLists(); } - } else if ( account->getType().compare( "POP3" ) == 0 ) { + } + else if ( account->getType().compare( "POP3" ) == 0 ) + { POP3account *pop3Acc = static_cast<POP3account *>(account); POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp ); - pop3.showMaximized(); - if ( QDialog::Accepted == pop3.exec() ) { + if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) + { slotFillLists(); } - } else if ( account->getType().compare( "SMTP" ) == 0 ) { + } + else if ( account->getType().compare( "SMTP" ) == 0 ) + { SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp ); - smtp.showMaximized(); - if ( QDialog::Accepted == smtp.exec() ) { + if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) + { slotFillLists(); } - } else if ( account->getType().compare( "NNTP" ) == 0 ) { + } + else if ( account->getType().compare( "NNTP" ) == 0 ) + { NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); - nntp.showMaximized(); - if ( QDialog::Accepted == nntp.exec() ) { + if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) + { slotFillLists(); @@ -152,3 +184,4 @@ void EditAccounts::slotDeleteAccount( Account *account ) tr( "<p>Do you really want to delete the selected Account?</p>" ), - tr( "Yes" ), tr( "No" ) ) == 0 ) { + tr( "Yes" ), tr( "No" ) ) == 0 ) + { settings->delAccount( account ); @@ -161,3 +194,4 @@ void EditAccounts::slotEditMail() qDebug( "Edit Mail Account" ); - if ( !mailList->currentItem() ) { + if ( !mailList->currentItem() ) + { QMessageBox::information( this, tr( "Error" ), @@ -174,3 +208,4 @@ void EditAccounts::slotDeleteMail() { - if ( !mailList->currentItem() ) { + if ( !mailList->currentItem() ) + { QMessageBox::information( this, tr( "Error" ), @@ -194,3 +229,4 @@ void EditAccounts::slotEditNews() qDebug( "Edit News Account" ); - if ( !newsList->currentItem() ) { + if ( !newsList->currentItem() ) + { QMessageBox::information( this, tr( "Error" ), @@ -208,3 +244,4 @@ void EditAccounts::slotDeleteNews() qDebug( "Delete News Account" ); - if ( !newsList->currentItem() ) { + if ( !newsList->currentItem() ) + { QMessageBox::information( this, tr( "Error" ), @@ -279,8 +316,13 @@ void IMAPconfig::slotConnectionToggle( int index ) { - if ( index == 2 ) { + if ( index == 2 ) + { portLine->setText( IMAP_SSL_PORT ); - } else if ( index == 3 ) { + } + else if ( index == 3 ) + { portLine->setText( IMAP_PORT ); CommandEdit->show(); - } else { + } + else + { portLine->setText( IMAP_PORT ); @@ -335,8 +377,13 @@ void POP3config::slotConnectionToggle( int index ) // 2 is ssl connection - if ( index == 2 ) { + if ( index == 2 ) + { portLine->setText( POP3_SSL_PORT ); - } else if ( index == 3 ) { + } + else if ( index == 3 ) + { portLine->setText( POP3_PORT ); CommandEdit->show(); - } else { + } + else + { portLine->setText( POP3_PORT ); @@ -393,8 +440,13 @@ void SMTPconfig::slotConnectionToggle( int index ) // 2 is ssl connection - if ( index == 2 ) { + if ( index == 2 ) + { portLine->setText( SMTP_SSL_PORT ); - } else if ( index == 3 ) { + } + else if ( index == 3 ) + { portLine->setText( SMTP_PORT ); CommandEdit->show(); - } else { + } + else + { portLine->setText( SMTP_PORT ); @@ -446,5 +498,8 @@ void NNTPconfig::slotSSL( bool enabled ) { - if ( enabled ) { + if ( enabled ) + { portLine->setText( NNTP_SSL_PORT ); - } else { + } + else + { portLine->setText( NNTP_PORT ); |