18 #include <QApplication>
72 QIcon::setThemeSearchPaths(
get_data_dirs() + QIcon::themeSearchPaths());
73 QIcon::setFallbackThemeName(QIcon::themeName());
74 QIcon::setThemeName(QStringLiteral(
"icons"));
76 qApp->setWindowIcon(QIcon::fromTheme(QStringLiteral(
"freeciv21-client")));
96 #define option_var_set_callback(var, callback) \
97 if ((poption = optset_option_by_name(client_optset, #var))) { \
98 option_set_changed_callback(poption, callback); \
100 qCritical("Didn't find option %s!", #var); \
110 #undef option_var_set_callback
126 qobject_cast<page_pregame *>(
king()->pages[PAGE_START])
127 ->update_start_page();
136 QApplication::beep();
137 QApplication::alert(
king()->central_wdg);
158 if (unit_sel !=
nullptr && unit_sel->isVisible()) {
170 Qt::WindowFlags flags = Qt::Window;
173 if (
king()->current_page() < PAGE_GAME) {
179 king()->setWindowFlags(flags);
184 flags |= Qt::CustomizeWindowHint;
185 king()->setWindowFlags(flags);
226 if (
auto page_game =
queen(); page_game) {
232 for (
auto report : list) {
233 QApplication::postEvent(report,
new QEvent(QEvent::FontChange));
279 auto fname = QStringLiteral(
"gui_qt_font_") + QString(font_name);
298 ask->setStandardButtons(QMessageBox::No | QMessageBox::Yes);
299 ask->setDefaultButton(QMessageBox::No);
300 ask->button(QMessageBox::Yes)->setText(
_(
"Yes Quit"));
301 ask->button(QMessageBox::No)->setText(
_(
"Keep Playing"));
302 ask->setAttribute(Qt::WA_DeleteOnClose);
303 QObject::connect(ask, &hud_message_box::accepted, [=]() {
void setSizeAll(int)
Increases/decreases all fonts sizes.
QFont getFont(const QString &name, double zoom=1.0) const
Returns desired font.
static fcFont * instance()
Returns instance of fc_font.
void setFont(const QString &name, const QFont &qf)
Adds new font or overwrite old one.
void write_settings()
Save qt-specific options.
void add_server_source(QIODevice *socket)
Add notifier for server input.
void fc_main(QApplication *)
This is not called simply 'fc_client::main()', since SDL includes ould sometimes cause 'main' to be c...
void set_text_title(const QString &s1, const QString &s2)
Sets text and title and shows message box.
units_select * unit_selector
void update_units()
Updates unit list on tile.
int client_main(int argc, char *argv[])
Entry point for common client code.
void start_quitting()
Mark client as one going to quit as soon as possible,.
void disconnect_from_server()
Get rid of server connection.
enum client_pages get_current_client_page()
Returns current client page.
void real_set_client_page(enum client_pages page)
Sets the "page" that the client should show.
void gui_update_allfonts()
const char * client_string
void editgui_tileset_changed()
Stub for editor function.
#define option_var_set_callback(var, callback)
void editgui_popup_properties(const struct tile_list *tiles, int objtype)
Stub for editor function.
void editgui_notify_object_created(int tag, int id)
Stub for editor function.
void gui_qt_apply_font(struct option *poption)
Change the given font.
static void apply_notify_font(struct option *poption)
Applies help font.
void popup_quit_dialog()
Open dialog to confirm that user wants to quit client.
void options_extra_init()
Extra initializers for client options.
int main(int argc, char **argv)
Entry point for whole freeciv client program.
void real_focus_units_changed()
Called when the set of units in focus (get_units_in_focus()) changes.
void city_font_update()
Updates city font.
void add_net_input(QIODevice *sock)
Wait for data on the given socket.
void gui_update_font(const QString &font_name, const QFont &font)
Updates a gui font style.
void sound_bell()
Make a bell noise (beep).
void ui_exit()
Do any necessary UI-specific cleanup.
void real_conn_list_dialog_update(void *unused)
Update the connected users list at pregame state.
static fc_client * freeciv_qt
static void apply_help_font(struct option *poption)
Applies help font.
static void apply_titlebar(struct option *poption)
Shows/Hides titlebar.
void real_science_report_dialog_update(void *)
Update the science report.
void editgui_notify_object_changed(int objtype, int object_id, bool removal)
Stub for editor function.
class fc_client * king()
Return fc_client instance.
void editgui_popdown_all()
Stub for editor function.
const char *const gui_character_encoding
void ui_main()
The main loop for the UI.
const bool gui_use_transliteration
void editgui_refresh()
Stub for editor function.
void update_help_fonts()
Updates fonts.
const char *const default_font
const char * option_name(const struct option *poption)
Returns the name of the option.
client_options * gui_options
bool option_bool_get(const struct option *poption)
Returns the current value of this boolean option.
QFont option_font_get(const struct option *poption)
Returns the current value of this font option.
pageGame * queen()
Return game instandce.
void gui_clear_theme()
Clears a theme (sets default system theme)
const QStringList & get_data_dirs()
Returns a list of data directory paths, in the order in which they should be searched.
char gui_qt_default_theme_name[512]
int gui_qt_increase_fonts
The base class for options.
bool load_theme(const QString &theme_name)
Loads a theme with the given name.
void tileset_load_tiles(struct tileset *t)
Load the tiles; requires tilespec_read_toplevel() called previously.
void tileset_init(struct tileset *t)
Initialize tileset structure.
void update_map_canvas_visible()
Schedules an update of (only) the visible part of the map at the next unqueue_mapview_update().