From b41ab337bf652b0c08d3a10b890e221a68efca45 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 8 Apr 2021 18:05:50 +0300 Subject: [PATCH 18/18] 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_nation.cpp | 3 ++- tools/ruledit/tab_nation.h | 7 ++++--- tools/ruledit/tab_tech.cpp | 4 ++-- tools/ruledit/tab_tech.h | 4 ++-- tools/ruledit/tab_unit.cpp | 4 ++-- tools/ruledit/tab_unit.h | 4 ++-- 8 files changed, 18 insertions(+), 16 deletions(-) diff --git a/tools/ruledit/tab_building.cpp b/tools/ruledit/tab_building.cpp index d9d5e2d59e..d4daf3c215 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 @@ -68,7 +68,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 37b7637e8c..8c32f1bdd6 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_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 993be9b73b..6b1abe3695 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 @@ -68,7 +68,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 ef32a55c7e..181acbf822 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_unit.cpp b/tools/ruledit/tab_unit.cpp index 998fa400a5..b8d3c03f63 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 @@ -68,7 +68,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 cae546e55a..96a2037a39 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