summaryrefslogtreecommitdiffstats
path: root/src/dialogs/qmessagebox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogs/qmessagebox.cpp')
-rw-r--r--src/dialogs/qmessagebox.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/dialogs/qmessagebox.cpp b/src/dialogs/qmessagebox.cpp
index 848c008..37407b0 100644
--- a/src/dialogs/qmessagebox.cpp
+++ b/src/dialogs/qmessagebox.cpp
@@ -57,6 +57,12 @@
#endif
+#ifdef Q_WS_X11
+#include "private/qtkdeintegration_x11_p.h"
+#endif
+
+extern bool qt_use_native_dialogs;
+
// Internal class - don't touch
class QMessageBoxLabel : public QLabel
@@ -1114,6 +1120,10 @@ int QMessageBox::information( QWidget *parent,
const QString& caption, const QString& text,
int button0, int button1, int button2 )
{
+#if defined(Q_WS_X11)
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::information( parent, caption, text, button0, button1, button2 );
+#endif
QMessageBox *mb = new QMessageBox( caption, text, Information,
button0, button1, button2,
parent, "qt_msgbox_information", TRUE,
@@ -1161,6 +1171,10 @@ int QMessageBox::question( QWidget *parent,
const QString& caption, const QString& text,
int button0, int button1, int button2 )
{
+#if defined(Q_WS_X11)
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::question( parent, caption, text, button0, button1, button2 );
+#endif
QMessageBox *mb = new QMessageBox( caption, text, Question,
button0, button1, button2,
parent, "qt_msgbox_information", TRUE,
@@ -1209,6 +1223,10 @@ int QMessageBox::warning( QWidget *parent,
const QString& caption, const QString& text,
int button0, int button1, int button2 )
{
+#if defined(Q_WS_X11)
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::warning( parent, caption, text, button0, button1, button2 );
+#endif
QMessageBox *mb = new QMessageBox( caption, text, Warning,
button0, button1, button2,
parent, "qt_msgbox_warning", TRUE,
@@ -1257,6 +1275,10 @@ int QMessageBox::critical( QWidget *parent,
const QString& caption, const QString& text,
int button0, int button1, int button2 )
{
+#if defined(Q_WS_X11)
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::critical( parent, caption, text, button0, button1, button2 );
+#endif
QMessageBox *mb = new QMessageBox( caption, text, Critical,
button0, button1, button2,
parent, "qt_msgbox_critical", TRUE,
@@ -1404,6 +1426,11 @@ int QMessageBox::information( QWidget *parent, const QString &caption,
int defaultButtonNumber,
int escapeButtonNumber )
{
+#if defined(Q_WS_X11)
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::information( parent, caption, text,
+ button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber );
+#endif
return textBox( parent, Information, caption, text,
button0Text, button1Text, button2Text,
defaultButtonNumber, escapeButtonNumber );
@@ -1446,6 +1473,11 @@ int QMessageBox::question( QWidget *parent, const QString &caption,
int defaultButtonNumber,
int escapeButtonNumber )
{
+#if defined(Q_WS_X11)
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::question( parent, caption, text,
+ button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber );
+#endif
return textBox( parent, Question, caption, text,
button0Text, button1Text, button2Text,
defaultButtonNumber, escapeButtonNumber );
@@ -1490,6 +1522,11 @@ int QMessageBox::warning( QWidget *parent, const QString &caption,
int defaultButtonNumber,
int escapeButtonNumber )
{
+#if defined(Q_WS_X11)
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::warning( parent, caption, text,
+ button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber );
+#endif
return textBox( parent, Warning, caption, text,
button0Text, button1Text, button2Text,
defaultButtonNumber, escapeButtonNumber );
@@ -1530,6 +1567,11 @@ int QMessageBox::critical( QWidget *parent, const QString &caption,
int defaultButtonNumber,
int escapeButtonNumber )
{
+#if defined(Q_WS_X11)
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::critical( parent, caption, text,
+ button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber );
+#endif
return textBox( parent, Critical, caption, text,
button0Text, button1Text, button2Text,
defaultButtonNumber, escapeButtonNumber );