Diffstat (limited to 'noncore/net/mail/libmailwrapper/pop3wrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 22a4c70..b0b985c 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp @@ -1,7 +1,8 @@ #include <stdlib.h> #include "pop3wrapper.h" #include "mailtypes.h" +#include "logindialog.h" #include <libetpan/mailpop3.h> #include <libetpan/mailmime.h> #include <libetpan/data_message_driver.h> #include <qfile.h> @@ -356,10 +357,25 @@ void POP3wrapper::login() int err = MAILPOP3_NO_ERROR; server = account->getServer().latin1(); port = account->getPort().toUInt(); - user = account->getUser().latin1(); - pass = account->getPassword().latin1(); + + if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { + LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); + login.show(); + if ( QDialog::Accepted == login.exec() ) { + // ok + user = strdup( login.getUser().latin1() ); + pass = strdup( login.getPassword().latin1() ); + } else { + // cancel + qDebug( "POP3: Login canceled" ); + return; + } + } else { + user = account->getUser().latin1(); + pass = account->getPassword().latin1(); + } m_pop3 = mailpop3_new( 200, &pop3_progress ); // connect |