summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-01-08 15:12:43 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-18 09:23:38 +0100
commitab2c90cc525f499f0061a5042e7370bb8db2af94 (patch)
tree7f18fc9f88364b56ddc8de6bee055cd124ebcadf /src/platformsupport
parentd5912b2a475f6d947fc11c754504afcf3aaddf31 (diff)
Introduce function for standard button texts to QPlatformTheme.
Change-Id: I91eec04a95b5047d893490a70152237b2991f662 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp20
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes_p.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index ee295afe6c..42b3d64a47 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -57,6 +57,7 @@
#include <private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformservices.h>
+#include <qpa/qplatformdialoghelper.h>
#include <algorithm>
@@ -533,6 +534,25 @@ const QFont *QGnomeTheme::font(Font type) const
}
}
+QString QGnomeTheme::standardButtonText(int button) const
+{
+ switch (button) {
+ case QMessageDialogOptions::Ok:
+ return QCoreApplication::translate("QGnomeTheme", "&OK");
+ case QMessageDialogOptions::Save:
+ return QCoreApplication::translate("QGnomeTheme", "&Save");
+ case QMessageDialogOptions::Cancel:
+ return QCoreApplication::translate("QGnomeTheme", "&Cancel");
+ case QMessageDialogOptions::QMessageDialogOptions::Close:
+ return QCoreApplication::translate("QGnomeTheme", "&Close");
+ case QMessageDialogOptions::Discard:
+ return QCoreApplication::translate("QGnomeTheme", "Close without Saving");
+ default:
+ break;
+ }
+ return QPlatformTheme::standardButtonText(button);
+}
+
/*!
\brief Creates a UNIX theme according to the detected desktop environment.
*/
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
index de53874941..36fcdd8dce 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
@@ -109,6 +109,7 @@ public:
QGnomeTheme();
virtual QVariant themeHint(ThemeHint hint) const;
virtual const QFont *font(Font type) const;
+ QString standardButtonText(int button) const Q_DECL_OVERRIDE;
static const char *name;
};