From fb054f9c69224e14f446f405098bd5166377f58d Mon Sep 17 00:00:00 2001 From: harlekin Date: Wed, 17 Dec 2003 00:18:06 +0000 Subject: new account, changed account etc are there now without a restart ,) --- (limited to 'noncore') diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp index 1c80adb..1246037 100644 --- a/noncore/net/mail/editaccounts.cpp +++ b/noncore/net/mail/editaccounts.cpp @@ -16,12 +16,12 @@ EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool { qDebug( "New Account Configuration Widget" ); settings = s; - + mailList->addColumn( tr( "Account" ) ); mailList->addColumn( tr( "Type" ) ); newsList->addColumn( tr( "Account" ) ); - + connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); @@ -70,7 +70,7 @@ void EditAccounts::slotNewAccount( const QString &type ) settings->addAccount( account ); account->save(); slotFillLists(); - } else { + } else { account->remove(); } } else if ( type.compare( "POP3" ) == 0 ) { @@ -94,6 +94,7 @@ void EditAccounts::slotNewAccount( const QString &type ) settings->addAccount( account ); account->save(); slotFillLists(); + } else { account->remove(); } @@ -147,7 +148,7 @@ void EditAccounts::slotEditAccount( Account *account ) void EditAccounts::slotDeleteAccount( Account *account ) { - if ( QMessageBox::information( this, tr( "Question" ), + if ( QMessageBox::information( this, tr( "Question" ), tr( "

Do you really want to delete the selected Account?

" ), tr( "Yes" ), tr( "No" ) ) == 0 ) { settings->delAccount( account ); @@ -159,7 +160,7 @@ void EditAccounts::slotEditMail() { qDebug( "Edit Mail Account" ); if ( !mailList->currentItem() ) { - QMessageBox::information( this, tr( "Error" ), + QMessageBox::information( this, tr( "Error" ), tr( "

Please select an account.

" ), tr( "Ok" ) ); return; @@ -172,12 +173,12 @@ void EditAccounts::slotEditMail() void EditAccounts::slotDeleteMail() { if ( !mailList->currentItem() ) { - QMessageBox::information( this, tr( "Error" ), + QMessageBox::information( this, tr( "Error" ), tr( "

Please select an account.

" ), tr( "Ok" ) ); return; } - + Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); slotDeleteAccount( a ); } @@ -192,7 +193,7 @@ void EditAccounts::slotEditNews() { qDebug( "Edit News Account" ); if ( !newsList->currentItem() ) { - QMessageBox::information( this, tr( "Error" ), + QMessageBox::information( this, tr( "Error" ), tr( "

Please select an account.

" ), tr( "Ok" ) ); return; @@ -206,12 +207,12 @@ void EditAccounts::slotDeleteNews() { qDebug( "Delete News Account" ); if ( !newsList->currentItem() ) { - QMessageBox::information( this, tr( "Error" ), + QMessageBox::information( this, tr( "Error" ), tr( "

Please select an account.

" ), tr( "Ok" ) ); return; } - + Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); slotDeleteAccount( a ); } @@ -219,7 +220,7 @@ void EditAccounts::slotDeleteNews() void EditAccounts::slotAdjustColumns() { int currPage = configTab->currentPageIndex(); - + configTab->showPage( mailTab ); mailList->setColumnWidth( 0, mailList->visibleWidth() - 50 ); mailList->setColumnWidth( 1, 50 ); @@ -233,7 +234,7 @@ void EditAccounts::slotAdjustColumns() void EditAccounts::accept() { settings->saveAccounts(); - + QDialog::accept(); } @@ -262,7 +263,7 @@ IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, : IMAPconfigUI( parent, name, modal, flags ) { data = account; - + fillValues(); connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); @@ -429,7 +430,7 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); connect( loginBox, SIGNAL( toggled( bool ) ), passLine, SLOT( setEnabled( bool ) ) ); - + fillValues(); connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 93f3bb7..740e4cf 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp @@ -6,9 +6,9 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) : MainWindow( parent, name, flags ) { settings = new Settings(); - + folderView->populate( settings->getAccounts() ); - + connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); @@ -47,4 +47,9 @@ void OpieMail::slotEditAccounts() eaDialog.showMaximized(); eaDialog.slotAdjustColumns(); eaDialog.exec(); + if ( settings ) delete settings; + settings = new Settings(); + + folderView->populate( settings->getAccounts() ); } + diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h index 7bcd818..ba60297 100644 --- a/noncore/net/mail/opiemail.h +++ b/noncore/net/mail/opiemail.h @@ -11,13 +11,14 @@ class OpieMail : public MainWindow public: OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); static QString appName() { return QString::fromLatin1("opiemail"); } -protected slots: + +public slots: void slotComposeMail(); +protected slots: void slotSendQueued(); void slotSearchMails(); void slotEditSettings(); void slotEditAccounts(); - private: Settings *settings; -- cgit v0.9.0.2