KIO
kmessageboxwrapper.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KMESSAGEBOXWRAPPER_H
00020 #define KMESSAGEBOXWRAPPER_H
00021 #include <kmessagebox.h>
00022 #include <QtGui/QApplication>
00023 #include <kdebug.h>
00024
00030 class KIO_EXPORT KMessageBoxWrapper : public KMessageBox
00031 {
00032 public:
00033 static void error(QWidget *parent,
00034 const QString &text,
00035 const QString &caption = QString())
00036 {
00037 if (qApp && qApp->type() == QApplication::GuiClient) {
00038 KMessageBox::error( parent, text, caption );
00039 } else
00040 kWarning() << text;
00041 }
00042
00043 static void sorry(QWidget *parent,
00044 const QString &text,
00045 const QString &caption = QString())
00046 {
00047 if (qApp && qApp->type() == QApplication::GuiClient) {
00048 KMessageBox::sorry( parent, text, caption );
00049 } else
00050 kWarning() << text;
00051 }
00052
00053 };
00054 #endif