author | conber <conber> | 2002-06-15 09:46:14 (UTC) |
---|---|---|
committer | conber <conber> | 2002-06-15 09:46:14 (UTC) |
commit | 7f2eef29708380844922f34f59ba4e9beefbf7c3 (patch) (unidiff) | |
tree | f57125fbaabddecc35d6677f1b9e48a4594165d5 /noncore/unsupported/mail2/rename.cpp | |
parent | 0acbdd392814589df303b6e50c79d9822e3db27a (diff) | |
download | opie-7f2eef29708380844922f34f59ba4e9beefbf7c3.zip opie-7f2eef29708380844922f34f59ba4e9beefbf7c3.tar.gz opie-7f2eef29708380844922f34f59ba4e9beefbf7c3.tar.bz2 |
initial checkin
Diffstat (limited to 'noncore/unsupported/mail2/rename.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/rename.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/noncore/unsupported/mail2/rename.cpp b/noncore/unsupported/mail2/rename.cpp new file mode 100644 index 0000000..8c2fde1 --- a/dev/null +++ b/noncore/unsupported/mail2/rename.cpp | |||
@@ -0,0 +1,39 @@ | |||
1 | #include <qlineedit.h> | ||
2 | #include <qlabel.h> | ||
3 | |||
4 | #include "rename.h" | ||
5 | |||
6 | Rename::Rename(QWidget *parent, const char *name, bool modal, WFlags fl) | ||
7 | : RenameBase(parent, name, modal, fl) | ||
8 | { | ||
9 | } | ||
10 | |||
11 | QString Rename::rename(const QString &on, QWidget *parent) | ||
12 | { | ||
13 | Rename *rename = new Rename(parent, 0, true); | ||
14 | rename->oldName->setText(on); | ||
15 | rename->newName->setText(on); | ||
16 | rename->newName->setFocus(); | ||
17 | |||
18 | if (rename->exec() == QDialog::Accepted) { | ||
19 | return rename->newName->text(); | ||
20 | } | ||
21 | |||
22 | return QString(0); | ||
23 | } | ||
24 | |||
25 | QString Rename::getText(const QString &caption, const QString &secondLabel, QWidget *parent) | ||
26 | { | ||
27 | Rename *rename = new Rename(parent, 0, true); | ||
28 | rename->firstLabel->hide(); | ||
29 | rename->oldName->hide(); | ||
30 | rename->setCaption(caption); | ||
31 | rename->secondLabel->setText(secondLabel); | ||
32 | |||
33 | if (rename->exec() == QDialog::Accepted) { | ||
34 | return rename->newName->text(); | ||
35 | } | ||
36 | |||
37 | return QString(0); | ||
38 | } | ||
39 | |||