From a9fc0c9f2c33c4728ff3460d44d2bd08b9293565 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 8 Apr 2021 17:58:41 +0300 Subject: [PATCH 23/23] 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_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 ++-- 20 files changed, 36 insertions(+), 38 deletions(-) diff --git a/tools/ruledit/tab_building.cpp b/tools/ruledit/tab_building.cpp index 5489a88540..e2fda74a4f 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 @@ -73,7 +73,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 873a8f69d1..3529e20a66 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 6fc5acd156..7bc3311f72 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 afbd3d3fd4..16855cad22 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 @@ -71,7 +71,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 75187886cd..eed144b190 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 4f9c495a8b..9b7f4d7bcb 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 @@ -72,7 +72,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 48139ac3a2..6ad5423691 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 9043358f84..cf6166fb98 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 @@ -71,7 +71,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 17dffb5a95..8affe3fc40 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 dc99073b40..87d6743629 100644 --- a/tools/ruledit/tab_misc.cpp +++ b/tools/ruledit/tab_misc.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include // utility @@ -86,7 +85,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 57534724d4..57591e5479 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; @@ -44,7 +43,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_nation.cpp b/tools/ruledit/tab_nation.cpp index 68c3d19744..aa37e4d66a 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 b89ca3005f..69089345b3 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 @@ -70,7 +70,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 3e035aabf0..aaa8e54ccd 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 b784c413b0..2357a5757f 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 @@ -71,7 +71,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 f04ae422dd..d47fb9e7f2 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 e348efd241..263d0e16f4 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 @@ -72,7 +72,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 fceab5e0ee..e1d761c2fd 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