From 0f0e65ed8f88768d27b8103f2e3c82ea9d18dab4 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 4 Jul 2022 02:15:00 +0300 Subject: [PATCH 68/68] Qt: Make font/color chooser headings translatable See osdn #44957 Signed-off-by: Marko Lindqvist --- client/gui-qt/optiondlg.cpp | 12 +++++++----- client/gui-qt/optiondlg.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/gui-qt/optiondlg.cpp b/client/gui-qt/optiondlg.cpp index 04e92dc328..a9f575f682 100644 --- a/client/gui-qt/optiondlg.cpp +++ b/client/gui-qt/optiondlg.cpp @@ -708,7 +708,7 @@ void option_dialog::add_option(struct option *poption) qlist = qstr.split(","); button->setFont(qf); button->setText(qlist[0] + " " + qlist[1]); - connect(button, SIGNAL(clicked()), this, SLOT(set_font())); + connect(button, SIGNAL(clicked()), this, SLOT(select_font())); widget = button; break; @@ -790,9 +790,9 @@ void option_dialog_popup(QString name, const struct option_set *poptset, } /************************************************************************//** - Sets font and text in pushbutton (user just chosen font) + Ask user for the font option value ****************************************************************************/ -void option_dialog::set_font() +void option_dialog::select_font() { QStringList ql; bool ok; @@ -801,7 +801,8 @@ void option_dialog::set_font() pb = (QPushButton *) QObject::sender(); qf = pb->font(); - qf = QFontDialog::getFont(&ok, qf, this); + qf = QFontDialog::getFont(&ok, qf, this, + _("Select Font")); pb->setFont(qf); ql = qf.toString().split(","); pb->setText(ql[0] + " " + ql[1]); @@ -845,7 +846,8 @@ void option_dialog::select_color() but = qobject_cast(QObject::sender()); pal = but->palette(); - color = QColorDialog::getColor(pal.color(QPalette::Button), this); + color = QColorDialog::getColor(pal.color(QPalette::Button), this, + _("Select Color")); if (color.isValid()) { pal.setColor(QPalette::Button, color); but->setPalette(pal); diff --git a/client/gui-qt/optiondlg.h b/client/gui-qt/optiondlg.h index a2ba4f39bf..4201c34dee 100644 --- a/client/gui-qt/optiondlg.h +++ b/client/gui-qt/optiondlg.h @@ -90,7 +90,7 @@ protected: private slots: void apply_option(int response); void select_color(); - void set_font(); + void select_font(); }; #endif // FC__OPTIONDLG_H -- 2.35.1