author | jgf <jgf> | 2003-12-18 16:02:47 (UTC) |
---|---|---|
committer | jgf <jgf> | 2003-12-18 16:02:47 (UTC) |
commit | 5b88f5d05b2f3f5d106b58b07bc7018f757cfc03 (patch) (unidiff) | |
tree | 27f8a7ccb9dd659ea8484cb12c0e3dc3c3c99252 | |
parent | 5cb08b0c69ffc7216405b552e17ff0541578bda0 (diff) | |
download | opie-5b88f5d05b2f3f5d106b58b07bc7018f757cfc03.zip opie-5b88f5d05b2f3f5d106b58b07bc7018f757cfc03.tar.gz opie-5b88f5d05b2f3f5d106b58b07bc7018f757cfc03.tar.bz2 |
ask for user/password if field is empty
-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 19 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 19 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 20 | ||||
-rw-r--r-- | noncore/net/mail/pop3wrapper.cpp | 20 |
4 files changed, 70 insertions, 8 deletions
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp index 838300a..cce3d34 100644 --- a/noncore/net/mail/imapwrapper.cpp +++ b/noncore/net/mail/imapwrapper.cpp | |||
@@ -2,8 +2,9 @@ | |||
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | 3 | ||
4 | #include "imapwrapper.h" | 4 | #include "imapwrapper.h" |
5 | #include "mailtypes.h" | 5 | #include "mailtypes.h" |
6 | #include "logindialog.h" | ||
6 | #include <libetpan/mailimap.h> | 7 | #include <libetpan/mailimap.h> |
7 | 8 | ||
8 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) | 9 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) |
9 | : AbstractMail() | 10 | : AbstractMail() |
@@ -35,10 +36,24 @@ void IMAPwrapper::login() | |||
35 | return; | 36 | return; |
36 | } | 37 | } |
37 | server = account->getServer().latin1(); | 38 | server = account->getServer().latin1(); |
38 | port = account->getPort().toUInt(); | 39 | port = account->getPort().toUInt(); |
39 | user = account->getUser().latin1(); | 40 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { |
40 | pass = account->getPassword().latin1(); | 41 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); |
42 | login.show(); | ||
43 | if ( QDialog::Accepted == login.exec() ) { | ||
44 | // ok | ||
45 | user = strdup( login.getUser().latin1() ); | ||
46 | pass = strdup( login.getPassword().latin1() ); | ||
47 | } else { | ||
48 | // cancel | ||
49 | qDebug( "IMAP: Login canceled" ); | ||
50 | return; | ||
51 | } | ||
52 | } else { | ||
53 | user = account->getUser().latin1(); | ||
54 | pass = account->getPassword().latin1(); | ||
55 | } | ||
41 | 56 | ||
42 | m_imap = mailimap_new( 20, &imap_progress ); | 57 | m_imap = mailimap_new( 20, &imap_progress ); |
43 | /* connect */ | 58 | /* connect */ |
44 | if (account->getSSL()) { | 59 | if (account->getSSL()) { |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 838300a..cce3d34 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -2,8 +2,9 @@ | |||
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | 3 | ||
4 | #include "imapwrapper.h" | 4 | #include "imapwrapper.h" |
5 | #include "mailtypes.h" | 5 | #include "mailtypes.h" |
6 | #include "logindialog.h" | ||
6 | #include <libetpan/mailimap.h> | 7 | #include <libetpan/mailimap.h> |
7 | 8 | ||
8 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) | 9 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) |
9 | : AbstractMail() | 10 | : AbstractMail() |
@@ -35,10 +36,24 @@ void IMAPwrapper::login() | |||
35 | return; | 36 | return; |
36 | } | 37 | } |
37 | server = account->getServer().latin1(); | 38 | server = account->getServer().latin1(); |
38 | port = account->getPort().toUInt(); | 39 | port = account->getPort().toUInt(); |
39 | user = account->getUser().latin1(); | 40 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { |
40 | pass = account->getPassword().latin1(); | 41 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); |
42 | login.show(); | ||
43 | if ( QDialog::Accepted == login.exec() ) { | ||
44 | // ok | ||
45 | user = strdup( login.getUser().latin1() ); | ||
46 | pass = strdup( login.getPassword().latin1() ); | ||
47 | } else { | ||
48 | // cancel | ||
49 | qDebug( "IMAP: Login canceled" ); | ||
50 | return; | ||
51 | } | ||
52 | } else { | ||
53 | user = account->getUser().latin1(); | ||
54 | pass = account->getPassword().latin1(); | ||
55 | } | ||
41 | 56 | ||
42 | m_imap = mailimap_new( 20, &imap_progress ); | 57 | m_imap = mailimap_new( 20, &imap_progress ); |
43 | /* connect */ | 58 | /* connect */ |
44 | if (account->getSSL()) { | 59 | if (account->getSSL()) { |
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 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include "pop3wrapper.h" | 2 | #include "pop3wrapper.h" |
3 | #include "mailtypes.h" | 3 | #include "mailtypes.h" |
4 | #include "logindialog.h" | ||
4 | #include <libetpan/mailpop3.h> | 5 | #include <libetpan/mailpop3.h> |
5 | #include <libetpan/mailmime.h> | 6 | #include <libetpan/mailmime.h> |
6 | #include <libetpan/data_message_driver.h> | 7 | #include <libetpan/data_message_driver.h> |
7 | #include <qfile.h> | 8 | #include <qfile.h> |
@@ -356,10 +357,25 @@ void POP3wrapper::login() | |||
356 | int err = MAILPOP3_NO_ERROR; | 357 | int err = MAILPOP3_NO_ERROR; |
357 | 358 | ||
358 | server = account->getServer().latin1(); | 359 | server = account->getServer().latin1(); |
359 | port = account->getPort().toUInt(); | 360 | port = account->getPort().toUInt(); |
360 | user = account->getUser().latin1(); | 361 | |
361 | pass = account->getPassword().latin1(); | 362 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { |
363 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); | ||
364 | login.show(); | ||
365 | if ( QDialog::Accepted == login.exec() ) { | ||
366 | // ok | ||
367 | user = strdup( login.getUser().latin1() ); | ||
368 | pass = strdup( login.getPassword().latin1() ); | ||
369 | } else { | ||
370 | // cancel | ||
371 | qDebug( "POP3: Login canceled" ); | ||
372 | return; | ||
373 | } | ||
374 | } else { | ||
375 | user = account->getUser().latin1(); | ||
376 | pass = account->getPassword().latin1(); | ||
377 | } | ||
362 | 378 | ||
363 | m_pop3 = mailpop3_new( 200, &pop3_progress ); | 379 | m_pop3 = mailpop3_new( 200, &pop3_progress ); |
364 | 380 | ||
365 | // connect | 381 | // connect |
diff --git a/noncore/net/mail/pop3wrapper.cpp b/noncore/net/mail/pop3wrapper.cpp index 22a4c70..b0b985c 100644 --- a/noncore/net/mail/pop3wrapper.cpp +++ b/noncore/net/mail/pop3wrapper.cpp | |||
@@ -1,7 +1,8 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include "pop3wrapper.h" | 2 | #include "pop3wrapper.h" |
3 | #include "mailtypes.h" | 3 | #include "mailtypes.h" |
4 | #include "logindialog.h" | ||
4 | #include <libetpan/mailpop3.h> | 5 | #include <libetpan/mailpop3.h> |
5 | #include <libetpan/mailmime.h> | 6 | #include <libetpan/mailmime.h> |
6 | #include <libetpan/data_message_driver.h> | 7 | #include <libetpan/data_message_driver.h> |
7 | #include <qfile.h> | 8 | #include <qfile.h> |
@@ -356,10 +357,25 @@ void POP3wrapper::login() | |||
356 | int err = MAILPOP3_NO_ERROR; | 357 | int err = MAILPOP3_NO_ERROR; |
357 | 358 | ||
358 | server = account->getServer().latin1(); | 359 | server = account->getServer().latin1(); |
359 | port = account->getPort().toUInt(); | 360 | port = account->getPort().toUInt(); |
360 | user = account->getUser().latin1(); | 361 | |
361 | pass = account->getPassword().latin1(); | 362 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { |
363 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); | ||
364 | login.show(); | ||
365 | if ( QDialog::Accepted == login.exec() ) { | ||
366 | // ok | ||
367 | user = strdup( login.getUser().latin1() ); | ||
368 | pass = strdup( login.getPassword().latin1() ); | ||
369 | } else { | ||
370 | // cancel | ||
371 | qDebug( "POP3: Login canceled" ); | ||
372 | return; | ||
373 | } | ||
374 | } else { | ||
375 | user = account->getUser().latin1(); | ||
376 | pass = account->getPassword().latin1(); | ||
377 | } | ||
362 | 378 | ||
363 | m_pop3 = mailpop3_new( 200, &pop3_progress ); | 379 | m_pop3 = mailpop3_new( 200, &pop3_progress ); |
364 | 380 | ||
365 | // connect | 381 | // connect |