Freeciv-3.3
|
#include <dialogs.h>
Public Slots | |
void | execute_action (const int action) |
Public Member Functions | |
choice_dialog (const QString title, const QString text, QWidget *parent=nullptr, void(*run_on_close_in)(int)=nullptr) | |
~choice_dialog () | |
void | set_layout () |
void | add_item (QString title, pfcn_void func, QVariant data1, QVariant data2, QString tool_tip, const int button_id) |
void | show_me () |
void | stack_button (Choice_dialog_button *button) |
void | unstack_all_buttons () |
QVBoxLayout * | get_layout () |
Choice_dialog_button * | get_identified_button (const int id) |
void | update_dialog (const struct act_prob *act_probs) |
Data Fields | |
int | unit_id |
int | target_id [ATK_COUNT] |
int | sub_target_id [ASTK_COUNT] |
struct unit * | targeted_unit |
Private Slots | |
void | prev_unit () |
void | next_unit () |
Private Member Functions | |
void | switch_target () |
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 1395 of file dialogs.cpp.
choice_dialog::~choice_dialog | ( | ) |
Destructor for choice dialog
Definition at line 1433 of file dialogs.cpp.
void choice_dialog::add_item | ( | QString | title, |
pfcn_void | func, | ||
QVariant | data1, | ||
QVariant | data2, | ||
QString | tool_tip = "" , |
||
const int | button_id = -1 |
||
) |
Adds new action for choice dialog
Definition at line 1490 of file dialogs.cpp.
Run chosen action and close dialog
Definition at line 1696 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 1542 of file dialogs.cpp.
QVBoxLayout * choice_dialog::get_layout | ( | ) |
Returns layout in choice dialog
Definition at line 1534 of file dialogs.cpp.
|
privateslot |
|
privateslot |
void choice_dialog::set_layout | ( | ) |
Sets layout for choice dialog
Definition at line 1448 of file dialogs.cpp.
void choice_dialog::show_me | ( | ) |
Shows choice dialog
Definition at line 1520 of file dialogs.cpp.
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 1713 of file dialogs.cpp.
|
private |
Switches target unit
Definition at line 1677 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 1730 of file dialogs.cpp.
Update dialog for new target (targeted_unit)
Definition at line 1659 of file dialogs.cpp.
|
private |
Definition at line 267 of file dialogs.h.
Referenced by add_item(), choice_dialog(), get_identified_button(), and ~choice_dialog().
|
private |
Definition at line 265 of file dialogs.h.
Referenced by add_item(), execute_action(), stack_button(), unstack_all_buttons(), and ~choice_dialog().
|
private |
Definition at line 266 of file dialogs.h.
Referenced by stack_button(), and unstack_all_buttons().
|
private |
Definition at line 263 of file dialogs.h.
Referenced by add_item(), choice_dialog(), get_layout(), set_layout(), stack_button(), switch_target(), unstack_all_buttons(), and update_dialog().
Definition at line 268 of file dialogs.h.
Referenced by choice_dialog(), and ~choice_dialog().
int choice_dialog::sub_target_id[ASTK_COUNT] |
Definition at line 285 of file dialogs.h.
Referenced by choice_dialog(), and update_dialog().
Definition at line 284 of file dialogs.h.
Referenced by choice_dialog(), and set_layout().
|
private |
Definition at line 262 of file dialogs.h.
Referenced by next_unit(), prev_unit(), and set_layout().
Definition at line 286 of file dialogs.h.
Referenced by choice_dialog(), next_unit(), prev_unit(), set_layout(), switch_target(), and update_dialog().
int choice_dialog::unit_id |
Definition at line 283 of file dialogs.h.
Referenced by choice_dialog(), set_layout(), switch_target(), update_dialog(), and ~choice_dialog().
|
private |
Definition at line 264 of file dialogs.h.
Referenced by set_layout(), switch_target(), and update_dialog().