summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/editaccounts.cpp29
-rw-r--r--noncore/net/mail/opiemail.cpp9
-rw-r--r--noncore/net/mail/opiemail.h5
3 files changed, 25 insertions, 18 deletions
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
@@ -15,14 +15,14 @@ EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool
: EditAccountsUI( parent, name, modal, flags )
{
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() ) );
connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) );
@@ -69,9 +69,9 @@ void EditAccounts::slotNewAccount( const QString &type )
if ( QDialog::Accepted == imap.exec() ) {
settings->addAccount( account );
account->save();
slotFillLists();
- } else {
+ } else {
account->remove();
}
} else if ( type.compare( "POP3" ) == 0 ) {
qDebug( "-> config POP3" );
@@ -93,8 +93,9 @@ void EditAccounts::slotNewAccount( const QString &type )
if ( QDialog::Accepted == smtp.exec() ) {
settings->addAccount( account );
account->save();
slotFillLists();
+
} else {
account->remove();
}
} else if ( type.compare( "NNTP" ) == 0 ) {
@@ -146,9 +147,9 @@ void EditAccounts::slotEditAccount( Account *account )
}
void EditAccounts::slotDeleteAccount( Account *account )
{
- if ( QMessageBox::information( this, tr( "Question" ),
+ if ( QMessageBox::information( this, tr( "Question" ),
tr( "<p>Do you really want to delete the selected Account?</p>" ),
tr( "Yes" ), tr( "No" ) ) == 0 ) {
settings->delAccount( account );
slotFillLists();
@@ -158,9 +159,9 @@ void EditAccounts::slotDeleteAccount( Account *account )
void EditAccounts::slotEditMail()
{
qDebug( "Edit Mail Account" );
if ( !mailList->currentItem() ) {
- QMessageBox::information( this, tr( "Error" ),
+ QMessageBox::information( this, tr( "Error" ),
tr( "<p>Please select an account.</p>" ),
tr( "Ok" ) );
return;
}
@@ -171,14 +172,14 @@ void EditAccounts::slotEditMail()
void EditAccounts::slotDeleteMail()
{
if ( !mailList->currentItem() ) {
- QMessageBox::information( this, tr( "Error" ),
+ QMessageBox::information( this, tr( "Error" ),
tr( "<p>Please select an account.</p>" ),
tr( "Ok" ) );
return;
}
-
+
Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
slotDeleteAccount( a );
}
@@ -191,9 +192,9 @@ void EditAccounts::slotNewNews()
void EditAccounts::slotEditNews()
{
qDebug( "Edit News Account" );
if ( !newsList->currentItem() ) {
- QMessageBox::information( this, tr( "Error" ),
+ QMessageBox::information( this, tr( "Error" ),
tr( "<p>Please select an account.</p>" ),
tr( "Ok" ) );
return;
}
@@ -205,22 +206,22 @@ void EditAccounts::slotEditNews()
void EditAccounts::slotDeleteNews()
{
qDebug( "Delete News Account" );
if ( !newsList->currentItem() ) {
- QMessageBox::information( this, tr( "Error" ),
+ QMessageBox::information( this, tr( "Error" ),
tr( "<p>Please select an account.</p>" ),
tr( "Ok" ) );
return;
}
-
+
Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
slotDeleteAccount( a );
}
void EditAccounts::slotAdjustColumns()
{
int currPage = configTab->currentPageIndex();
-
+
configTab->showPage( mailTab );
mailList->setColumnWidth( 0, mailList->visibleWidth() - 50 );
mailList->setColumnWidth( 1, 50 );
@@ -232,9 +233,9 @@ void EditAccounts::slotAdjustColumns()
void EditAccounts::accept()
{
settings->saveAccounts();
-
+
QDialog::accept();
}
/**
@@ -261,9 +262,9 @@ void SelectMailType::slotSelection( const QString &sel )
IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
: IMAPconfigUI( parent, name, modal, flags )
{
data = account;
-
+
fillValues();
connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) );
}
@@ -428,9 +429,9 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name,
data = account;
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
@@ -5,11 +5,11 @@
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() ) );
connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) );
@@ -46,5 +46,10 @@ void OpieMail::slotEditAccounts()
EditAccounts eaDialog( settings, this, 0, true );
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
@@ -10,15 +10,16 @@ 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;
};