Freeciv21
Develop your civilization from humble roots to a global empire
tab_unit.h
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3 \_ \ / __/ contributors. This file is part of Freeciv21.
4  _\ \ / /__ Freeciv21 is free software: you can redistribute it
5  \___ \____/ __/ and/or modify it under the terms of the GNU General
6  \_ _/ Public License as published by the Free Software
7  | @ @ \_ Foundation, either version 3 of the License,
8  | or (at your option) any later version.
9  _/ /\ You should have received a copy of the GNU
10  /o) (o/\ \_ General Public License along with Freeciv21.
11  \_____/ / If not, see https://www.gnu.org/licenses/.
12  \____/ ********************************************************/
13 
14 #ifndef FC__TAB_UNIT_H
15 #define FC__TAB_UNIT_H
16 
17 #include <fc_config.h>
18 
19 // Qt
20 #include <QWidget>
21 
22 class QLineEdit;
23 class QListWidget;
24 class QRadioButton;
25 
26 class ruledit_gui;
27 
28 class tab_unit : public QWidget {
29  Q_OBJECT
30 
31 public:
32  explicit tab_unit(ruledit_gui *ui_in);
33  void refresh();
34 
35 private:
37  void update_utype_info(struct unit_type *ptype);
38  bool initialize_new_utype(struct unit_type *ptype);
39 
40  QLineEdit *name;
41  QLineEdit *rname;
42  QListWidget *unit_list;
43  QRadioButton *same_name;
44 
46 
47 private slots:
48  void name_given();
49  void select_unit();
50  void add_now();
51  void delete_now();
52  void edit_now();
53  void same_name_toggle(bool checked);
54  void edit_effects();
55 };
56 
57 #endif // FC__TAB_UNIT_H
QListWidget * unit_list
Definition: tab_unit.h:42
ruledit_gui * ui
Definition: tab_unit.h:36
void refresh()
Refresh the information.
Definition: tab_unit.cpp:112
struct unit_type * selected
Definition: tab_unit.h:45
QLineEdit * rname
Definition: tab_unit.h:41
QRadioButton * same_name
Definition: tab_unit.h:43
void add_now()
User requested new unit.
Definition: tab_unit.cpp:252
void edit_effects()
User wants to edit effects.
Definition: tab_unit.cpp:302
bool initialize_new_utype(struct unit_type *ptype)
Initialize new tech for use.
Definition: tab_unit.cpp:239
void edit_now()
User requested unit edit dialog.
Definition: tab_unit.cpp:227
void select_unit()
User selected unit from the list.
Definition: tab_unit.cpp:158
QLineEdit * name
Definition: tab_unit.h:40
void same_name_toggle(bool checked)
Toggled whether rule_name and name should be kept identical.
Definition: tab_unit.cpp:291
tab_unit(ruledit_gui *ui_in)
Setup tab_unit object.
Definition: tab_unit.cpp:40
void name_given()
User entered name for the unit.
Definition: tab_unit.cpp:173
void update_utype_info(struct unit_type *ptype)
Update info of the unit.
Definition: tab_unit.cpp:130
void delete_now()
User requested unit deletion.
Definition: tab_unit.cpp:206