Freeciv21
Develop your civilization from humble roots to a global empire
tab_enablers.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_ENABLERS_H
15 #define FC__TAB_ENABLERS_H
16 
17 #include <fc_config.h>
18 
19 // Qt
20 #include <QWidget>
21 
22 // ruledit
23 #include "req_vec_fix.h"
24 
25 class QPushButton;
26 class QLabel;
27 class QLineEdit;
28 class QListWidget;
29 class QMenu;
30 class QRadioButton;
31 class QToolButton;
32 
33 class ruledit_gui;
34 
35 class tab_enabler : public QWidget {
36  Q_OBJECT
37 
38 public:
39  explicit tab_enabler(ruledit_gui *ui_in);
40  void refresh();
41 
42 private:
44  void update_enabler_info(struct action_enabler *enabler);
45  bool initialize_new_enabler(struct action_enabler *enabler);
46 
47  QToolButton *type_button;
48  QMenu *type_menu;
49  QPushButton *act_reqs_button;
50  QPushButton *tgt_reqs_button;
51  QPushButton *delete_button;
52  QPushButton *repair_button;
53  QListWidget *enabler_list;
54 
56 
57 private slots:
58  void select_enabler();
59  void add_now();
60  void repair_now();
61  void incoming_rec_vec_change(const requirement_vector *vec);
62  void delete_now();
63  void edit_type(QAction *action);
64  void edit_target_reqs();
65  void edit_actor_reqs();
66 };
67 
68 #endif // FC__TAB_ENABLERS_H
ruledit_gui * ui
Definition: tab_enablers.h:43
void delete_now()
User requested enabler deletion.
void refresh()
Refresh the information.
void edit_type(QAction *action)
User selected action to enable.
struct action_enabler * selected
Definition: tab_enablers.h:55
QPushButton * act_reqs_button
Definition: tab_enablers.h:49
QToolButton * type_button
Definition: tab_enablers.h:47
void edit_actor_reqs()
User wants to edit actor reqs.
tab_enabler(ruledit_gui *ui_in)
Setup tab_enabler object.
QPushButton * tgt_reqs_button
Definition: tab_enablers.h:50
QMenu * type_menu
Definition: tab_enablers.h:48
void repair_now()
User requested enabler repair.
void edit_target_reqs()
User wants to edit target reqs.
void select_enabler()
User selected enabler from the list.
QListWidget * enabler_list
Definition: tab_enablers.h:53
QPushButton * delete_button
Definition: tab_enablers.h:51
bool initialize_new_enabler(struct action_enabler *enabler)
Initialize new enabler for use.
QPushButton * repair_button
Definition: tab_enablers.h:52
void update_enabler_info(struct action_enabler *enabler)
Update info of the enabler.
void add_now()
User requested new enabler.
void incoming_rec_vec_change(const requirement_vector *vec)
A requirement vector may have been changed.