diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-01-08 15:12:43 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-18 09:23:38 +0100 |
commit | ab2c90cc525f499f0061a5042e7370bb8db2af94 (patch) | |
tree | 7f18fc9f88364b56ddc8de6bee055cd124ebcadf /src/platformsupport/themes/genericunix/qgenericunixthemes.cpp | |
parent | d5912b2a475f6d947fc11c754504afcf3aaddf31 (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/themes/genericunix/qgenericunixthemes.cpp')
-rw-r--r-- | src/platformsupport/themes/genericunix/qgenericunixthemes.cpp | 20 |
1 files changed, 20 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. */ |