From 23541aa6ff03dd96dd34d492db77c201ec0c64f3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 8 Apr 2021 16:24:10 +0300 Subject: [PATCH 44/44] Ruledit: Use QCheckBox instead of QRadioButton where sensible See osdn #41945 Signed-off-by: Marko Lindqvist --- tools/ruledit/tab_building.cpp | 4 ++-- tools/ruledit/tab_building.h | 4 ++-- tools/ruledit/tab_enablers.cpp | 1 - tools/ruledit/tab_enablers.h | 1 - tools/ruledit/tab_extras.cpp | 4 ++-- tools/ruledit/tab_extras.h | 4 ++-- tools/ruledit/tab_good.cpp | 4 ++-- tools/ruledit/tab_good.h | 4 ++-- tools/ruledit/tab_gov.cpp | 4 ++-- tools/ruledit/tab_gov.h | 4 ++-- tools/ruledit/tab_misc.cpp | 3 +-- tools/ruledit/tab_misc.h | 3 +-- tools/ruledit/tab_multiplier.cpp | 4 ++-- tools/ruledit/tab_multiplier.h | 4 ++-- tools/ruledit/tab_nation.cpp | 3 ++- tools/ruledit/tab_nation.h | 7 ++++--- tools/ruledit/tab_tech.cpp | 4 ++-- tools/ruledit/tab_tech.h | 4 ++-- tools/ruledit/tab_terrains.cpp | 4 ++-- tools/ruledit/tab_terrains.h | 4 ++-- tools/ruledit/tab_unit.cpp | 4 ++-- tools/ruledit/tab_unit.h | 4 ++-- 22 files changed, 40 insertions(+), 42 deletions(-) diff --git a/tools/ruledit/tab_building.cpp b/tools/ruledit/tab_building.cpp index 2343051030..18c27163fa 100644 --- a/tools/ruledit/tab_building.cpp +++ b/tools/ruledit/tab_building.cpp @@ -16,12 +16,12 @@ #endif // Qt +#include #include #include #include #include #include -#include #include // utility @@ -74,7 +74,7 @@ tab_building::tab_building(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Name"))); label->setParent(this); - same_name = new QRadioButton(); + same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); name->setText("None"); diff --git a/tools/ruledit/tab_building.h b/tools/ruledit/tab_building.h index 6d944e4bda..65ad000dea 100644 --- a/tools/ruledit/tab_building.h +++ b/tools/ruledit/tab_building.h @@ -21,9 +21,9 @@ // Qt #include +class QCheckBox; class QLineEdit; class QListWidget; -class QRadioButton; class ruledit_gui; @@ -43,7 +43,7 @@ class tab_building : public QWidget QLineEdit *name; QLineEdit *rname; QListWidget *bldg_list; - QRadioButton *same_name; + QCheckBox *same_name; struct impr_type *selected; diff --git a/tools/ruledit/tab_enablers.cpp b/tools/ruledit/tab_enablers.cpp index b13eddb40f..e8d60a814f 100644 --- a/tools/ruledit/tab_enablers.cpp +++ b/tools/ruledit/tab_enablers.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include // utility diff --git a/tools/ruledit/tab_enablers.h b/tools/ruledit/tab_enablers.h index a94c6a055e..c6346d8e19 100644 --- a/tools/ruledit/tab_enablers.h +++ b/tools/ruledit/tab_enablers.h @@ -29,7 +29,6 @@ class QLabel; class QLineEdit; class QListWidget; class QMenu; -class QRadioButton; class QToolButton; class ruledit_gui; diff --git a/tools/ruledit/tab_extras.cpp b/tools/ruledit/tab_extras.cpp index 92d156228e..761c624d65 100644 --- a/tools/ruledit/tab_extras.cpp +++ b/tools/ruledit/tab_extras.cpp @@ -16,12 +16,12 @@ #endif // Qt +#include #include #include #include #include #include -#include #include // utility @@ -72,7 +72,7 @@ tab_extras::tab_extras(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Name"))); label->setParent(this); - same_name = new QRadioButton(); + same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); name->setText("None"); diff --git a/tools/ruledit/tab_extras.h b/tools/ruledit/tab_extras.h index 855a6fe6d6..50c888036c 100644 --- a/tools/ruledit/tab_extras.h +++ b/tools/ruledit/tab_extras.h @@ -21,9 +21,9 @@ // Qt #include +class QCheckBox; class QLineEdit; class QListWidget; -class QRadioButton; class ruledit_gui; @@ -43,7 +43,7 @@ class tab_extras : public QWidget QLineEdit *name; QLineEdit *rname; QListWidget *extra_list; - QRadioButton *same_name; + QCheckBox *same_name; struct extra_type *selected; diff --git a/tools/ruledit/tab_good.cpp b/tools/ruledit/tab_good.cpp index 558ee08dbc..d3a9684d0f 100644 --- a/tools/ruledit/tab_good.cpp +++ b/tools/ruledit/tab_good.cpp @@ -16,12 +16,12 @@ #endif // Qt +#include #include #include #include #include #include -#include #include // utility @@ -73,7 +73,7 @@ tab_good::tab_good(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Name"))); label->setParent(this); - same_name = new QRadioButton(); + same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); name->setText("None"); diff --git a/tools/ruledit/tab_good.h b/tools/ruledit/tab_good.h index 17ea811ebe..8d0b4449d3 100644 --- a/tools/ruledit/tab_good.h +++ b/tools/ruledit/tab_good.h @@ -21,9 +21,9 @@ // Qt #include +class QCheckBox; class QLineEdit; class QListWidget; -class QRadioButton; class ruledit_gui; @@ -43,7 +43,7 @@ class tab_good : public QWidget QLineEdit *name; QLineEdit *rname; QListWidget *good_list; - QRadioButton *same_name; + QCheckBox *same_name; struct goods_type *selected; diff --git a/tools/ruledit/tab_gov.cpp b/tools/ruledit/tab_gov.cpp index cf24b0dea1..f327ff4981 100644 --- a/tools/ruledit/tab_gov.cpp +++ b/tools/ruledit/tab_gov.cpp @@ -16,12 +16,12 @@ #endif // Qt +#include #include #include #include #include #include -#include #include // utility @@ -72,7 +72,7 @@ tab_gov::tab_gov(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Name"))); label->setParent(this); - same_name = new QRadioButton(); + same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); name->setText("None"); diff --git a/tools/ruledit/tab_gov.h b/tools/ruledit/tab_gov.h index 0b376a1c8c..9875a230f5 100644 --- a/tools/ruledit/tab_gov.h +++ b/tools/ruledit/tab_gov.h @@ -21,9 +21,9 @@ // Qt #include +class QCheckBox; class QLineEdit; class QListWidget; -class QRadioButton; class ruledit_gui; @@ -43,7 +43,7 @@ class tab_gov : public QWidget QLineEdit *name; QLineEdit *rname; QListWidget *gov_list; - QRadioButton *same_name; + QCheckBox *same_name; struct government *selected; diff --git a/tools/ruledit/tab_misc.cpp b/tools/ruledit/tab_misc.cpp index a8c7a73fca..d3f7d19d19 100644 --- a/tools/ruledit/tab_misc.cpp +++ b/tools/ruledit/tab_misc.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include // utility @@ -88,7 +87,7 @@ tab_misc::tab_misc(ruledit_gui *ui_in) : QWidget() save_ver_label = new QLabel(QString::fromUtf8(R__("Version suffix to directory name"))); save_ver_label->setParent(this); main_layout->addWidget(save_ver_label, row, 0); - savedir_version = new QRadioButton(this); + savedir_version = new QCheckBox(this); main_layout->addWidget(savedir_version, row++, 1); save_button = new QPushButton(QString::fromUtf8(R__("Save now")), this); connect(save_button, SIGNAL(pressed()), this, SLOT(save_now())); diff --git a/tools/ruledit/tab_misc.h b/tools/ruledit/tab_misc.h index b6b0f1a5b4..f6dcb3d5c2 100644 --- a/tools/ruledit/tab_misc.h +++ b/tools/ruledit/tab_misc.h @@ -19,7 +19,6 @@ class QCheckBox; class QLineEdit; -class QRadioButton; class QTableWidget; class ruledit_gui; @@ -46,7 +45,7 @@ class tab_misc : public QWidget QLineEdit *name; QLineEdit *version; QLineEdit *savedir; - QRadioButton *savedir_version; + QCheckBox *savedir_version; QTableWidget *stats; QCheckBox *desc_via_file; QLineEdit *desc_file; diff --git a/tools/ruledit/tab_multiplier.cpp b/tools/ruledit/tab_multiplier.cpp index be4383f3db..883092a3e3 100644 --- a/tools/ruledit/tab_multiplier.cpp +++ b/tools/ruledit/tab_multiplier.cpp @@ -16,12 +16,12 @@ #endif // Qt +#include #include #include #include #include #include -#include #include // utility @@ -72,7 +72,7 @@ tab_multiplier::tab_multiplier(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Name"))); label->setParent(this); - same_name = new QRadioButton(); + same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); name->setText("None"); diff --git a/tools/ruledit/tab_multiplier.h b/tools/ruledit/tab_multiplier.h index 6dc20f7219..9cfc5f3900 100644 --- a/tools/ruledit/tab_multiplier.h +++ b/tools/ruledit/tab_multiplier.h @@ -21,9 +21,9 @@ // Qt #include +class QCheckBox; class QLineEdit; class QListWidget; -class QRadioButton; class ruledit_gui; @@ -43,7 +43,7 @@ class tab_multiplier : public QWidget QLineEdit *name; QLineEdit *rname; QListWidget *mpr_list; - QRadioButton *same_name; + QCheckBox *same_name; struct multiplier *selected; diff --git a/tools/ruledit/tab_nation.cpp b/tools/ruledit/tab_nation.cpp index bbdb3568d2..139dc2c9be 100644 --- a/tools/ruledit/tab_nation.cpp +++ b/tools/ruledit/tab_nation.cpp @@ -16,6 +16,7 @@ #endif // Qt +#include #include #include #include @@ -46,7 +47,7 @@ tab_nation::tab_nation(ruledit_gui *ui_in) : QWidget() main_layout->setSizeConstraint(QLayout::SetMaximumSize); - via_include = new QRadioButton(QString::fromUtf8(R__("Use nationlist"))); + via_include = new QCheckBox(QString::fromUtf8(R__("Use nationlist"))); main_layout->addWidget(via_include, row++, 0); connect(via_include, SIGNAL(toggled(bool)), this, SLOT(nationlist_toggle(bool))); diff --git a/tools/ruledit/tab_nation.h b/tools/ruledit/tab_nation.h index 11f1593595..2899e2982c 100644 --- a/tools/ruledit/tab_nation.h +++ b/tools/ruledit/tab_nation.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ // Qt #include -#include #include +class QCheckBox; + class ruledit_gui; class tab_nation : public QWidget @@ -36,7 +37,7 @@ class tab_nation : public QWidget private: ruledit_gui *ui; - QRadioButton *via_include; + QCheckBox *via_include; QLineEdit *nationlist; }; diff --git a/tools/ruledit/tab_tech.cpp b/tools/ruledit/tab_tech.cpp index 583086cbf1..07c71153f6 100644 --- a/tools/ruledit/tab_tech.cpp +++ b/tools/ruledit/tab_tech.cpp @@ -16,12 +16,12 @@ #endif // Qt +#include #include #include #include #include #include -#include #include // utility @@ -71,7 +71,7 @@ tab_tech::tab_tech(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Name"))); label->setParent(this); - same_name = new QRadioButton(); + same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); name->setText("None"); diff --git a/tools/ruledit/tab_tech.h b/tools/ruledit/tab_tech.h index d9f3649e7e..664e6596d2 100644 --- a/tools/ruledit/tab_tech.h +++ b/tools/ruledit/tab_tech.h @@ -24,12 +24,12 @@ // common #include "tech.h" +class QCheckBox; class QGridLayout; class QLabel; class QLineEdit; class QListWidget; class QMenu; -class QRadioButton; class QToolButton; class ruledit_gui; @@ -59,7 +59,7 @@ class tab_tech : public QWidget QMenu *req2; QMenu *root_req; QListWidget *tech_list; - QRadioButton *same_name; + QCheckBox *same_name; struct advance *selected; diff --git a/tools/ruledit/tab_terrains.cpp b/tools/ruledit/tab_terrains.cpp index 09fec48908..e0173f22af 100644 --- a/tools/ruledit/tab_terrains.cpp +++ b/tools/ruledit/tab_terrains.cpp @@ -16,12 +16,12 @@ #endif // Qt +#include #include #include #include #include #include -#include #include // utility @@ -72,7 +72,7 @@ tab_terrains::tab_terrains(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Name"))); label->setParent(this); - same_name = new QRadioButton(); + same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); name->setText("None"); diff --git a/tools/ruledit/tab_terrains.h b/tools/ruledit/tab_terrains.h index c92e00a501..aa4c67f89d 100644 --- a/tools/ruledit/tab_terrains.h +++ b/tools/ruledit/tab_terrains.h @@ -21,9 +21,9 @@ // Qt #include +class QCheckBox; class QLineEdit; class QListWidget; -class QRadioButton; class ruledit_gui; @@ -43,7 +43,7 @@ class tab_terrains : public QWidget QLineEdit *name; QLineEdit *rname; QListWidget *terrain_list; - QRadioButton *same_name; + QCheckBox *same_name; struct terrain *selected; diff --git a/tools/ruledit/tab_unit.cpp b/tools/ruledit/tab_unit.cpp index b4da5d3e41..bab52747f1 100644 --- a/tools/ruledit/tab_unit.cpp +++ b/tools/ruledit/tab_unit.cpp @@ -16,12 +16,12 @@ #endif // Qt +#include #include #include #include #include #include -#include #include // utility @@ -73,7 +73,7 @@ tab_unit::tab_unit(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Name"))); label->setParent(this); - same_name = new QRadioButton(); + same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); name->setText("None"); diff --git a/tools/ruledit/tab_unit.h b/tools/ruledit/tab_unit.h index 4a58d831c7..9dfc81aa28 100644 --- a/tools/ruledit/tab_unit.h +++ b/tools/ruledit/tab_unit.h @@ -21,9 +21,9 @@ // Qt #include +class QCheckBox; class QLineEdit; class QListWidget; -class QRadioButton; class ruledit_gui; @@ -43,7 +43,7 @@ class tab_unit : public QWidget QLineEdit *name; QLineEdit *rname; QListWidget *unit_list; - QRadioButton *same_name; + QCheckBox *same_name; struct unit_type *selected; -- 2.30.2