From af26a0287ef90dba52134a35c77c988346ea9c1b Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 4 Jul 2022 02:18:01 +0300 Subject: [PATCH 32/32] Qt: Make font/color chooser headings translatable See osdn #44957 Signed-off-by: Marko Lindqvist --- client/gui-qt/optiondlg.cpp | 13 +++++++------ client/gui-qt/optiondlg.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/client/gui-qt/optiondlg.cpp b/client/gui-qt/optiondlg.cpp index b7abe9db40..5eb0c5a99a 100644 --- a/client/gui-qt/optiondlg.cpp +++ b/client/gui-qt/optiondlg.cpp @@ -709,7 +709,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; @@ -789,9 +789,9 @@ void option_dialog_popup(const char *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; @@ -800,13 +800,13 @@ 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]); } - /**************************************************************************** Get font from option. ****************************************************************************/ @@ -845,7 +845,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 4de1eb6bd4..4556db14f6 100644 --- a/client/gui-qt/optiondlg.h +++ b/client/gui-qt/optiondlg.h @@ -80,7 +80,7 @@ private: private slots: void apply_option(int response); void select_color(); - void set_font(); + void select_font(); }; #endif /* FC__OPTIONDLG_H */ -- 2.35.1