Diffstat (limited to 'noncore/apps/tinykate/libkate/microkde/kmessagebox.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tinykate/libkate/microkde/kmessagebox.cpp | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/noncore/apps/tinykate/libkate/microkde/kmessagebox.cpp b/noncore/apps/tinykate/libkate/microkde/kmessagebox.cpp new file mode 100644 index 0000000..fd305cd --- a/dev/null +++ b/noncore/apps/tinykate/libkate/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::warningYesNoCancel(QWidget *parent, const QString &text) | ||
20 | { | ||
21 | int result = QMessageBox::warning(parent,i18n("Warning"),text,QMessageBox::Yes, | ||
22 | QMessageBox::No, QMessageBox::Cancel); | ||
23 | switch (result) { | ||
24 | case QMessageBox::Yes: return Yes; | ||
25 | case QMessageBox::No: return No; | ||
26 | case QMessageBox::Cancel: return Cancel; | ||
27 | } | ||
28 | } | ||
29 | |||
30 | int KMessageBox::questionYesNo(QWidget *parent, | ||
31 | const QString &text, | ||
32 | const QString &textYes, | ||
33 | const QString &textNo, | ||
34 | bool notify=true ) | ||
35 | { | ||
36 | int result =QMessageBox::warning(parent,i18n("Question"),text,textYes,textNo); | ||
37 | if ( result == 0 ) return KMessageBox::Yes; | ||
38 | return KMessageBox::No; | ||
39 | } | ||
40 | |||
41 | |||
42 | |||
43 | |||
44 | int KMessageBox::warningContinueCancel( QWidget *parent, | ||
45 | const QString &text, | ||
46 | const QString &caption, | ||
47 | const QString &buttonContinue, | ||
48 | const QString &dontAskAgainName, | ||
49 | bool notify ) | ||
50 | { | ||
51 | QString cap = caption; | ||
52 | |||
53 | if (cap.isEmpty()) { | ||
54 | cap = i18n("Warning"); | ||
55 | } | ||
56 | |||
57 | int result = QMessageBox::warning( parent, cap, text, i18n("Ok"), | ||
58 | i18n("Cancel") ); | ||
59 | |||
60 | if ( result == 0 ) return KMessageBox::Continue; | ||
61 | return KMessageBox::Cancel; | ||
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 | } | ||