![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <fc_client.h>
Inheritance diagram for fc_client:
Collaboration diagram for fc_client:Public Slots | |
| void | slot_disconnect () |
| Disconnect from server and return to MAIN PAGE. More... | |
| void | start_tutorial () |
| start tutorial More... | |
| void | start_from_file (const QString &file) |
| start from save file More... | |
| void | start_new_game () |
| spawn a server, if there isn't one, using the default settings. More... | |
| void | switch_page (int i) |
| Switch from one client page to another. More... | |
| void | load_modpack () |
| Load the modpack-installer from the start menu. More... | |
Signals | |
| void | keyCaught (QKeyEvent *e) |
Public Member Functions | |
| fc_client () | |
| Constructor. More... | |
| ~fc_client () override | |
| Destructor. More... | |
| void | fc_main (QApplication *) |
| This is not called simply 'fc_client::main()', since SDL includes ould sometimes cause 'main' to be considered an macro that expands to 'SDL_main'. More... | |
| void | add_server_source (QIODevice *socket) |
| Add notifier for server input. More... | |
| enum client_pages | current_page () |
| Returns currently open page. More... | |
| void | set_status_bar (const QString &str, int timeout=20000) |
| Sets application status bar for given time in miliseconds. More... | |
| void | set_diplo_dialog (choice_dialog *widget) |
| Set current diplo dialog. More... | |
| choice_dialog * | get_diplo_dialog () |
| Get current diplo dialog. More... | |
| void | write_settings () |
| Save qt-specific options. More... | |
| bool | is_closing () |
| Returns status if fc_client is being closed. More... | |
Public Attributes | |
| QWidget * | pages [static_cast< int >(PAGE_GAME)+2] |
| QCursor * | fc_cursors [CURSOR_LAST][NUM_CURSOR_FRAMES] |
| QWidget * | central_wdg {nullptr} |
| bool | interface_locked {false} |
| fc_corner * | corner_wid |
| fc_settings | qt_settings |
| mr_menu * | menu_bar {nullptr} |
| qfc_rally_list | rallies |
| trade_generator | trade_gen |
Protected Member Functions | |
| bool | eventFilter (QObject *obj, QEvent *event) override |
| Used to keep track of the size and location of the chat widget. More... | |
| void | timerEvent (QTimerEvent *) override |
| Timer event handling. More... | |
| void | closeEvent (QCloseEvent *event) override |
| Closes main window. More... | |
Private Slots | |
| void | server_input () |
| There is input from server. More... | |
| void | closing () |
| Called when fc_client is going to quit. More... | |
| void | clear_status_bar () |
| Clears status bar or shows next message in queue if exists. More... | |
Private Member Functions | |
| void | create_loading_page () |
| Creates page LOADING, showing label with Loading text. More... | |
| void | create_cursors () |
| Setup cursors. More... | |
| void | delete_cursors () |
| Deletes cursors. More... | |
| void | read_settings () |
| Loads qt-specific options. More... | |
Private Attributes | |
| enum client_pages | page |
| QGridLayout * | pages_layout [PAGE_COUNT] |
| QLabel * | status_bar_label {nullptr} |
| QSocketNotifier * | server_notifier {nullptr} |
| QStackedLayout * | central_layout {nullptr} |
| QStatusBar * | status_bar {nullptr} |
| QString | current_file |
| QStringList | status_bar_queue |
| bool | quitting {false} |
| bool | send_new_aifill_to_server |
| choice_dialog * | opened_dialog {nullptr} |
Definition at line 93 of file fc_client.h.
| fc_client::fc_client | ( | ) |
|
override |
Destructor.
Definition at line 130 of file fc_client.cpp.
| void fc_client::add_server_source | ( | QIODevice * | socket | ) |
Add notifier for server input.
Definition at line 279 of file fc_client.cpp.
Referenced by add_net_input().
|
privateslot |
Clears status bar or shows next message in queue if exists.
Definition at line 622 of file fc_client.cpp.
Referenced by set_status_bar().
|
overrideprotected |
Closes main window.
Definition at line 291 of file fc_client.cpp.
|
privateslot |
Called when fc_client is going to quit.
Definition at line 172 of file fc_client.cpp.
Referenced by fc_main().
|
private |
|
private |
Creates page LOADING, showing label with Loading text.
Definition at line 638 of file fc_client.cpp.
Referenced by fc_client().
| enum client_pages fc_client::current_page | ( | ) |
Returns currently open page.
Definition at line 180 of file fc_client.cpp.
|
private |
|
overrideprotected |
Used to keep track of the size and location of the chat widget.
Definition at line 349 of file fc_client.cpp.
| void fc_client::fc_main | ( | QApplication * | qapp | ) |
This is not called simply 'fc_client::main()', since SDL includes ould sometimes cause 'main' to be considered an macro that expands to 'SDL_main'.
Definition at line 144 of file fc_client.cpp.
Referenced by ui_main().
| choice_dialog * fc_client::get_diplo_dialog | ( | ) |
Get current diplo dialog.
Definition at line 3812 of file dialogs.cpp.
Referenced by action_selection_actor_unit(), action_selection_close(), action_selection_refresh(), action_selection_target_city(), action_selection_target_extra(), action_selection_target_tile(), action_selection_target_unit(), popup_action_selection(), and spy_steal_shared().
| bool fc_client::is_closing | ( | ) |
Returns status if fc_client is being closed.
Definition at line 167 of file fc_client.cpp.
|
signal |
|
slot |
Load the modpack-installer from the start menu.
Definition at line 695 of file fc_client.cpp.
Referenced by mr_menu::add_modpacks(), and page_main::page_main().
|
private |
|
privateslot |
There is input from server.
Definition at line 300 of file fc_client.cpp.
Referenced by add_server_source().
| void fc_client::set_diplo_dialog | ( | choice_dialog * | widget | ) |
Set current diplo dialog.
Definition at line 3804 of file dialogs.cpp.
Referenced by choice_dialog::choice_dialog(), and choice_dialog::~choice_dialog().
| void fc_client::set_status_bar | ( | const QString & | str, |
| int | timeout = 20000 |
||
| ) |
Sets application status bar for given time in miliseconds.
Definition at line 606 of file fc_client.cpp.
Referenced by fc_client(), page_network::handle_authentication_req(), real_output_window_append(), page_network::set_connection_state(), page_network::slot_connect(), and version_message().
|
slot |
Disconnect from server and return to MAIN PAGE.
Definition at line 323 of file fc_client.cpp.
Referenced by page_load::page_load(), page_pregame::page_pregame(), and page_scenario::page_scenario().
|
slot |
start from save file
Definition at line 669 of file fc_client.cpp.
Referenced by page_load::start_from_save(), and page_scenario::start_scenario().
|
slot |
spawn a server, if there isn't one, using the default settings.
Definition at line 685 of file fc_client.cpp.
Referenced by page_main::page_main().
|
slot |
|
slot |
Switch from one client page to another.
Argument is int cause QSignalMapper doesn't want to work with enum Because chat widget is in 2 layouts we need to switch between them here (addWidget removes it from prevoius layout automatically)
Definition at line 180 of file fc_client.cpp.
Referenced by handle_diplomacy_init_meeting(), real_set_client_page(), slot_disconnect(), and start_from_file().
|
overrideprotected |
Timer event handling.
Definition at line 310 of file fc_client.cpp.
| void fc_client::write_settings | ( | ) |
Save qt-specific options.
Definition at line 514 of file fc_client.cpp.
Referenced by popup_quit_dialog().
|
private |
Definition at line 100 of file fc_client.h.
Referenced by current_page(), and fc_client().
| QWidget* fc_client::central_wdg {nullptr} |
Definition at line 123 of file fc_client.h.
Referenced by current_page(), and fc_client().
| fc_corner* fc_client::corner_wid |
Definition at line 125 of file fc_client.h.
Referenced by apply_titlebar(), and fc_client().
|
private |
Definition at line 102 of file fc_client.h.
Referenced by current_page(), and start_tutorial().
| QCursor* fc_client::fc_cursors[CURSOR_LAST][NUM_CURSOR_FRAMES] |
Definition at line 122 of file fc_client.h.
Referenced by create_cursors(), and delete_cursors().
| bool fc_client::interface_locked {false} |
Definition at line 124 of file fc_client.h.
Referenced by mr_menu::slot_lock().
| mr_menu* fc_client::menu_bar {nullptr} |
Definition at line 127 of file fc_client.h.
Referenced by apply_titlebar(), fc_client(), city_dialog::hideEvent(), real_menus_init(), real_menus_update(), fc_shortcuts::set_shortcut(), fc_shortcuts_dialog::shortcut_exists(), map_view::shortcut_pressed(), city_dialog::showEvent(), and minimap_view::update_menu().
|
private |
Definition at line 106 of file fc_client.h.
Referenced by get_diplo_dialog(), and set_diplo_dialog().
|
private |
Definition at line 90 of file fc_client.h.
Referenced by current_page(), and fc_client().
| QWidget* fc_client::pages[static_cast< int >(PAGE_GAME)+2] |
Definition at line 111 of file fc_client.h.
Referenced by current_page(), eventFilter(), and fc_client().
|
private |
Definition at line 97 of file fc_client.h.
Referenced by create_loading_page(), and fc_client().
| fc_settings fc_client::qt_settings |
Definition at line 126 of file fc_client.h.
Referenced by help_dialog::closeEvent(), current_page(), eventFilter(), help_dialog::hideEvent(), hud_units::moveEvent(), hud_battle_log::moveEvent(), read_settings(), minimap_view::resizeEvent(), mr_menu::slot_battlelog(), mr_menu::slot_show_new_turn_text(), hud_battle_log::update_size(), write_settings(), city_widget::~city_widget(), and plr_widget::~plr_widget().
|
private |
Definition at line 104 of file fc_client.h.
Referenced by closing(), and is_closing().
| qfc_rally_list fc_client::rallies |
Definition at line 128 of file fc_client.h.
Referenced by map_view::shortcut_pressed(), map_view::shortcut_released(), and mr_menu::slot_rally().
|
private |
Definition at line 105 of file fc_client.h.
|
private |
Definition at line 99 of file fc_client.h.
|
private |
Definition at line 101 of file fc_client.h.
Referenced by current_page(), and fc_client().
|
private |
Definition at line 98 of file fc_client.h.
Referenced by clear_status_bar(), fc_client(), and set_status_bar().
|
private |
Definition at line 103 of file fc_client.h.
Referenced by clear_status_bar(), fc_client(), set_status_bar(), and ~fc_client().
| trade_generator fc_client::trade_gen |
Definition at line 129 of file fc_client.h.
Referenced by popup_action_selection(), map_view::shortcut_pressed(), map_view::shortcut_released(), mr_menu::slot_autocaravan(), mr_menu::slot_calculate(), mr_menu::slot_clear_trade(), mr_menu::slot_trade_add_all(), and mr_menu::slot_trade_city().