author | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
commit | b9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff) | |
tree | 2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /microkde/kmessagebox.cpp | |
download | kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2 |
Initial revision
-rw-r--r-- | microkde/kmessagebox.cpp | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/microkde/kmessagebox.cpp b/microkde/kmessagebox.cpp new file mode 100644 index 0000000..f06708a --- a/dev/null +++ b/microkde/kmessagebox.cpp | |||
@@ -0,0 +1,90 @@ | |||
1 | #include "kmessagebox.h" | ||
2 | #include "klocale.h" | ||
3 | |||
4 | #include <qmessagebox.h> | ||
5 | |||
6 | void KMessageBox::sorry( QWidget *parent, | ||
7 | const QString &text, | ||
8 | const QString &caption, bool ) | ||
9 | { | ||
10 | QString cap = caption; | ||
11 | |||
12 | if (cap.isEmpty()) { | ||
13 | cap = i18n("Sorry"); | ||
14 | } | ||
15 | |||
16 | QMessageBox::warning( parent, cap, text ); | ||
17 | } | ||
18 | |||
19 | int KMessageBox::warningContinueCancel( QWidget *parent, | ||
20 | const QString &text, | ||
21 | const QString &caption, | ||
22 | const QString &buttonContinue, | ||
23 | const QString &dontAskAgainName, | ||
24 | bool notify ) | ||
25 | { | ||
26 | QString cap = caption; | ||
27 | |||
28 | int result = QMessageBox::warning( parent, cap, text, buttonContinue, | ||
29 | dontAskAgainName); | ||
30 | |||
31 | if ( result == 0 ) return KMessageBox::Continue; | ||
32 | return KMessageBox::Cancel; | ||
33 | } | ||
34 | |||
35 | int KMessageBox::warningYesNoCancel( QWidget *parent, | ||
36 | const QString &text, | ||
37 | const QString &caption, | ||
38 | const QString &buttonYes, | ||
39 | const QString &buttonNo ) | ||
40 | { | ||
41 | QString cap = caption; | ||
42 | |||
43 | int result = QMessageBox::warning( parent, cap, text,buttonYes ,buttonNo, | ||
44 | i18n("Cancel") ); | ||
45 | |||
46 | if ( result == 0 ) return KMessageBox::Yes; | ||
47 | else if ( result == 1 ) return KMessageBox::No; | ||
48 | return KMessageBox::Cancel; | ||
49 | } | ||
50 | |||
51 | int KMessageBox::questionYesNo(QWidget *parent, | ||
52 | const QString &text, | ||
53 | const QString &caption) | ||
54 | { | ||
55 | QString cap = caption; | ||
56 | |||
57 | int result = QMessageBox::warning( parent, cap, text, i18n("Yes"), | ||
58 | i18n("No") ); | ||
59 | |||
60 | if ( result == 0 ) return KMessageBox::Yes; | ||
61 | else return KMessageBox::No; | ||
62 | } | ||
63 | |||
64 | void KMessageBox::error( QWidget *parent, | ||
65 | const QString &text, | ||
66 | const QString &caption, bool notify ) | ||
67 | { | ||
68 | QString cap = caption; | ||
69 | |||
70 | if (cap.isEmpty()) { | ||
71 | cap = i18n("Error"); | ||
72 | } | ||
73 | |||
74 | QMessageBox::critical( parent, cap, text ); | ||
75 | } | ||
76 | |||
77 | void KMessageBox::information( QWidget *parent, | ||
78 | const QString &text, | ||
79 | const QString &caption, | ||
80 | const QString &, | ||
81 | bool ) | ||
82 | { | ||
83 | QString cap = caption; | ||
84 | |||
85 | if (cap.isEmpty()) { | ||
86 | cap = i18n("Information"); | ||
87 | } | ||
88 | |||
89 | QMessageBox::information( parent, cap, text ); | ||
90 | } | ||