summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2/passdiag.cpp
authorconber <conber>2002-06-15 09:46:14 (UTC)
committer conber <conber>2002-06-15 09:46:14 (UTC)
commit7f2eef29708380844922f34f59ba4e9beefbf7c3 (patch) (unidiff)
treef57125fbaabddecc35d6677f1b9e48a4594165d5 /noncore/unsupported/mail2/passdiag.cpp
parent0acbdd392814589df303b6e50c79d9822e3db27a (diff)
downloadopie-7f2eef29708380844922f34f59ba4e9beefbf7c3.zip
opie-7f2eef29708380844922f34f59ba4e9beefbf7c3.tar.gz
opie-7f2eef29708380844922f34f59ba4e9beefbf7c3.tar.bz2
initial checkin
Diffstat (limited to 'noncore/unsupported/mail2/passdiag.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/mail2/passdiag.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/noncore/unsupported/mail2/passdiag.cpp b/noncore/unsupported/mail2/passdiag.cpp
new file mode 100644
index 0000000..d3daa2c
--- a/dev/null
+++ b/noncore/unsupported/mail2/passdiag.cpp
@@ -0,0 +1,38 @@
1#include <qmessagebox.h>
2#include <qpushbutton.h>
3#include <qlineedit.h>
4#include <qlabel.h>
5
6#include "passdiag.h"
7
8PassDiag::PassDiag(QString text, QWidget *parent, const char *name, bool modal, WFlags fl)
9 : PassDiagBase(parent, name, modal, fl)
10{
11 infoLabel->setText(text);
12
13 connect(ok, SIGNAL(clicked()), SLOT(accept()));
14 connect(cancel, SIGNAL(clicked()), SLOT(close()));
15}
16
17void PassDiag::accept()
18{
19 if (password->text().isEmpty()) {
20 QMessageBox::information(this, tr("Error"), tr("<p>You have to enter a password or click on cancel.</p>"), tr("Ok"));
21 return;
22 }
23
24 QDialog::accept();
25}
26
27QString PassDiag::getPassword(QWidget *parent, QString text)
28{
29 PassDiag *diag = new PassDiag(text, parent, 0, true);
30 diag->show();
31
32 if (QDialog::Accepted == diag->exec()) {
33 return diag->password->text();
34 }
35
36 return 0;
37}
38