diff options
author | Liang Qi <liang.qi@qt.io> | 2016-11-08 09:58:52 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-11-08 10:01:50 +0100 |
commit | 9d50df5511e7919d9e03e5f70c693d36af8204f2 (patch) | |
tree | e1e62848dac6297784646666afaee65cb0867545 /src/plugins/platformthemes/gtk3 | |
parent | 969bb10eed646313209fcdd9b84605aa98fc88de (diff) | |
parent | e918605f4238841596a1723a0a8592ec152dc723 (diff) |
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
src/corelib/tools/qalgorithms.h
Change-Id: Ib8ce4d5d9ecd5b9c166d5b8b44e58f3e4e7283ff
Diffstat (limited to 'src/plugins/platformthemes/gtk3')
-rw-r--r-- | src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp index 2030732e4b..ba5089a8bc 100644 --- a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp +++ b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp @@ -38,6 +38,7 @@ ****************************************************************************/ #include "qgtk3dialoghelpers.h" +#include "qgtk3theme.h" #include <qeventloop.h> #include <qwindow.h> @@ -56,6 +57,11 @@ QT_BEGIN_NAMESPACE +static const char *standardButtonText(int button) +{ + return QGtk3Theme::defaultStandardButtonText(button).toUtf8(); +} + class QGtk3Dialog : public QWindow { Q_OBJECT @@ -237,8 +243,10 @@ QGtk3FileDialogHelper::QGtk3FileDialogHelper() { d.reset(new QGtk3Dialog(gtk_file_chooser_dialog_new("", 0, GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, NULL))); + standardButtonText(QPlatformDialogHelper::Cancel), GTK_RESPONSE_CANCEL, + standardButtonText(QPlatformDialogHelper::Ok), GTK_RESPONSE_OK, + NULL))); + connect(d.data(), SIGNAL(accept()), this, SLOT(onAccepted())); connect(d.data(), SIGNAL(reject()), this, SIGNAL(reject())); @@ -438,9 +446,9 @@ void QGtk3FileDialogHelper::applyOptions() if (opts->isLabelExplicitlySet(QFileDialogOptions::Accept)) gtk_button_set_label(GTK_BUTTON(acceptButton), opts->labelText(QFileDialogOptions::Accept).toUtf8()); else if (opts->acceptMode() == QFileDialogOptions::AcceptOpen) - gtk_button_set_label(GTK_BUTTON(acceptButton), GTK_STOCK_OPEN); + gtk_button_set_label(GTK_BUTTON(acceptButton), standardButtonText(QPlatformDialogHelper::Open)); else - gtk_button_set_label(GTK_BUTTON(acceptButton), GTK_STOCK_SAVE); + gtk_button_set_label(GTK_BUTTON(acceptButton), standardButtonText(QPlatformDialogHelper::Save)); } GtkWidget *rejectButton = gtk_dialog_get_widget_for_response(gtkDialog, GTK_RESPONSE_CANCEL); @@ -448,7 +456,7 @@ void QGtk3FileDialogHelper::applyOptions() if (opts->isLabelExplicitlySet(QFileDialogOptions::Reject)) gtk_button_set_label(GTK_BUTTON(rejectButton), opts->labelText(QFileDialogOptions::Reject).toUtf8()); else - gtk_button_set_label(GTK_BUTTON(rejectButton), GTK_STOCK_CANCEL); + gtk_button_set_label(GTK_BUTTON(rejectButton), standardButtonText(QPlatformDialogHelper::Cancel)); } } |