-rw-r--r-- | kmicromail/editaccounts.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index 48c3963..8253c91 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp @@ -10,24 +10,25 @@ #include <qstringlist.h> #include <qcombobox.h> #include <qcheckbox.h> #include <qmessagebox.h> #include <qpushbutton.h> #include <qlineedit.h> #include <qlabel.h> #include <qtabwidget.h> #include <qlistview.h> #include <qspinbox.h> #include <klocale.h> +#include <kfiledialog.h> #include <libmailwrapper/nntpwrapper.h> using namespace Opie::Core; AccountListItem::AccountListItem( QListView *parent, Account *a) : QListViewItem( parent ) { account = a; setText( 0, account->getAccountName() ); QString ttext = ""; switch (account->getType()) { @@ -470,34 +471,46 @@ void POP3config::accept() * SMTPconfig */ SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) : SMTPconfigUI( parent, name, modal, flags ) { data = account; connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); fillValues(); - + QIconSet icon; + //icon = SmallIcon("fileexport"); + icon = SmallIcon("fileopen"); + SignaturButton->setText(""); + SignaturButton->setIconSet (icon ) ; + SignaturButton->setMaximumSize ( SignaturButton->sizeHint().height()+4,SignaturButton->sizeHint().height()) ; + connect( SignaturButton, SIGNAL( clicked() ), this, SLOT( chooseSig() ) ); connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); ComboBox1->insertItem( "Only if available", 0 ); ComboBox1->insertItem( "Always, Negotiated", 1 ); ComboBox1->insertItem( "Connect on secure port", 2 ); ComboBox1->insertItem( "Run command instead", 3 ); CommandEdit->hide(); ComboBox1->setCurrentItem( data->ConnectionType() ); } - +void SMTPconfig::chooseSig() +{ + QString lnk = KFileDialog::getOpenFileName( "", "Choose Signatur File", this ); + if ( !lnk.isEmpty() ) { + SignaturEdit->setText( lnk ); + } +} void SMTPconfig::slotConnectionToggle( int index ) { // 2 is ssl connection if ( index == 2 ) { portLine->setText( SMTP_SSL_PORT ); } else if ( index == 3 ) { portLine->setText( SMTP_PORT ); CommandEdit->show(); } @@ -507,35 +520,37 @@ void SMTPconfig::slotConnectionToggle( int index ) } } void SMTPconfig::fillValues() { accountLine->setText( data->getAccountName() ); serverLine->setText( data->getServer() ); portLine->setText( data->getPort() ); ComboBox1->setCurrentItem( data->ConnectionType() ); loginBox->setChecked( data->getLogin() ); userLine->setText( data->getUser() ); passLine->setText( data->getPassword() ); + SignaturEdit->setText( data->getSigFile() ); } void SMTPconfig::accept() { data->setAccountName( accountLine->text() ); data->setServer( serverLine->text() ); data->setPort( portLine->text() ); data->setConnectionType( ComboBox1->currentItem() ); data->setLogin( loginBox->isChecked() ); data->setUser( userLine->text() ); data->setPassword( passLine->text() ); + data->setSigFile( SignaturEdit->text() ); QDialog::accept(); } /** * NNTPconfig */ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) : NNTPconfigUI( parent, name, modal, flags ) { data = account; |