![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <dialogs.h>
Inheritance diagram for choice_dialog:
Collaboration diagram for choice_dialog:Public Slots | |
| void | execute_action (const int action) |
| Run chosen action and close dialog. More... | |
Public Member Functions | |
| choice_dialog (const QString title, const QString text, QWidget *parent=nullptr, void(*run_on_close_in)(int)=nullptr) | |
| Constructor for choice_dialog. More... | |
| ~choice_dialog () override | |
| Destructor for choice dialog. More... | |
| void | set_layout () |
| Sets layout for choice dialog. More... | |
| void | add_item (QString title, pfcn_void func, QVariant data1, QVariant data2, QString tool_tip, const int button_id) |
| Adds new action for choice dialog. More... | |
| void | show_me () |
| Shows choice dialog. More... | |
| void | stack_button (Choice_dialog_button *button) |
| Put the button in the stack and temporarily remove it. More... | |
| void | unstack_all_buttons () |
| Put all the buttons in the stack back to the dialog. More... | |
| QVBoxLayout * | get_layout () |
| Returns layout in choice dialog. More... | |
| Choice_dialog_button * | get_identified_button (const int id) |
| Get the button with the given identity. More... | |
| void | update_dialog (const struct act_prob *act_probs) |
| Update dialog for new target (targeted_unit) More... | |
Public Attributes | |
| int | unit_id |
| int | target_id [ATK_COUNT] |
| int | sub_target_id [ASTK_COUNT] |
| struct unit * | targeted_unit |
Private Slots | |
| void | prev_unit () |
| Focus previous target. More... | |
| void | next_unit () |
| Focus next target. More... | |
Private Member Functions | |
| void | switch_target () |
| Switches target unit. More... | |
Private Attributes | |
| QPushButton * | target_unit_button |
| QVBoxLayout * | layout |
| QHBoxLayout * | unit_skip |
| QList< Choice_dialog_button * > | buttons_list |
| QList< Choice_dialog_button * > | last_buttons_stack |
| QList< Choice_dialog_button * > | action_button_map |
| void(* | run_on_close )(int) |
| choice_dialog::choice_dialog | ( | const QString | title, |
| const QString | text, | ||
| QWidget * | parent = nullptr, |
||
| void(*)(int) | run_on_close_in = nullptr |
||
| ) |
Constructor for choice_dialog.
Definition at line 1139 of file dialogs.cpp.
|
override |
Destructor for choice dialog.
Definition at line 1176 of file dialogs.cpp.
| void choice_dialog::add_item | ( | QString | title, |
| pfcn_void | func, | ||
| QVariant | data1, | ||
| QVariant | data2, | ||
| QString | tool_tip = QLatin1String(""), |
||
| const int | button_id = -1 |
||
| ) |
Adds new action for choice dialog.
Definition at line 1236 of file dialogs.cpp.
Referenced by action_entry(), popup_action_selection(), popup_pillage_dialog(), popup_sabotage_dialog(), and spy_steal_shared().
|
slot |
Run chosen action and close dialog.
Definition at line 1441 of file dialogs.cpp.
Referenced by add_item().
| Choice_dialog_button * choice_dialog::get_identified_button | ( | const int | id | ) |
Get the button with the given identity.
Definition at line 1284 of file dialogs.cpp.
Referenced by action_selection_refresh().
| QVBoxLayout * choice_dialog::get_layout | ( | ) |
Returns layout in choice dialog.
Definition at line 1279 of file dialogs.cpp.
|
privateslot |
|
privateslot |
| void choice_dialog::set_layout | ( | ) |
Sets layout for choice dialog.
Definition at line 1191 of file dialogs.cpp.
Referenced by popup_action_selection(), popup_pillage_dialog(), popup_sabotage_dialog(), and spy_steal_shared().
| void choice_dialog::show_me | ( | ) |
Shows choice dialog.
Definition at line 1265 of file dialogs.cpp.
Referenced by popup_action_selection(), popup_pillage_dialog(), popup_sabotage_dialog(), and spy_steal_shared().
| void choice_dialog::stack_button | ( | Choice_dialog_button * | button | ) |
Put the button in the stack and temporarily remove it.
When unstack_all_buttons() is called all buttons in the stack will be added to the end of the dialog.
Can be used to place a button below existing buttons or below buttons added while it was in the stack.
Definition at line 1458 of file dialogs.cpp.
Referenced by action_selection_refresh().
|
private |
Switches target unit.
Definition at line 1425 of file dialogs.cpp.
Referenced by next_unit(), and prev_unit().
| void choice_dialog::unstack_all_buttons | ( | ) |
Put all the buttons in the stack back to the dialog.
They will appear after any other buttons. See stack_button()
Definition at line 1475 of file dialogs.cpp.
Referenced by action_selection_refresh().
| void choice_dialog::update_dialog | ( | const struct act_prob * | act_probs | ) |
Update dialog for new target (targeted_unit)
Definition at line 1405 of file dialogs.cpp.
Referenced by popup_action_selection().
|
private |
Definition at line 190 of file dialogs.h.
Referenced by add_item(), choice_dialog(), get_identified_button(), and ~choice_dialog().
|
private |
Definition at line 188 of file dialogs.h.
Referenced by add_item(), execute_action(), stack_button(), unstack_all_buttons(), and ~choice_dialog().
|
private |
Definition at line 189 of file dialogs.h.
Referenced by stack_button(), and unstack_all_buttons().
|
private |
Definition at line 186 of file dialogs.h.
Referenced by add_item(), choice_dialog(), get_layout(), set_layout(), stack_button(), switch_target(), unstack_all_buttons(), and update_dialog().
|
private |
Definition at line 191 of file dialogs.h.
Referenced by choice_dialog(), and ~choice_dialog().
| int choice_dialog::sub_target_id[ASTK_COUNT] |
Definition at line 209 of file dialogs.h.
Referenced by action_selection_target_extra(), choice_dialog(), popup_action_selection(), and update_dialog().
| int choice_dialog::target_id[ATK_COUNT] |
Definition at line 208 of file dialogs.h.
Referenced by action_selection_target_city(), action_selection_target_tile(), action_selection_target_unit(), choice_dialog(), popup_action_selection(), and set_layout().
|
private |
Definition at line 185 of file dialogs.h.
Referenced by next_unit(), prev_unit(), and set_layout().
| struct unit* choice_dialog::targeted_unit |
Definition at line 210 of file dialogs.h.
Referenced by choice_dialog(), next_unit(), popup_action_selection(), prev_unit(), set_layout(), switch_target(), and update_dialog().
| int choice_dialog::unit_id |
Definition at line 207 of file dialogs.h.
Referenced by action_selection_actor_unit(), choice_dialog(), popup_action_selection(), set_layout(), switch_target(), update_dialog(), and ~choice_dialog().
|
private |
Definition at line 187 of file dialogs.h.
Referenced by set_layout(), switch_target(), and update_dialog().