Freeciv21
Develop your civilization from humble roots to a global empire
options.cpp File Reference
#include <fc_config.h>
#include <cstring>
#include <qglobal.h>
#include <sys/stat.h>
#include <QDir>
#include <QHash>
#include <QUrl>
#include "deprecations.h"
#include "fcintl.h"
#include "log.h"
#include "registry.h"
#include "registry_ini.h"
#include "shared.h"
#include "support.h"
#include "fc_version.h"
#include "events.h"
#include "version.h"
#include "gui_main_g.h"
#include "menu_g.h"
#include "optiondlg_g.h"
#include "repodlgs_g.h"
#include "voteinfo_bar_g.h"
#include "audio/audio.h"
#include "chatline_common.h"
#include "citybar.h"
#include "client_main.h"
#include "climisc.h"
#include "connectdlg_common.h"
#include "global_worklist.h"
#include "governor.h"
#include "mapctrl_common.h"
#include "music.h"
#include "options.h"
#include "overview_common.h"
#include "packhand_gen.h"
#include "qtg_cxxside.h"
#include "themes_common.h"
#include "tileset/tilespec.h"
#include "views/view_cities_data.h"
#include "views/view_map_common.h"
#include "views/view_nations_data.h"
+ Include dependency graph for options.cpp:

Go to the source code of this file.

Classes

struct  option_set
 Option set structure. More...
 
struct  option_common_vtable
 
struct  option_bool_vtable
 
struct  option_int_vtable
 
struct  option_str_vtable
 
struct  option_enum_vtable
 
struct  option_bitwise_vtable
 
struct  option_font_vtable
 
struct  option_color_vtable
 
struct  option
 The base class for options. More...
 
struct  copt_val_name
 
struct  client_option
 Derived class client option, inherinting of base class option. More...
 
struct  server_option
 Derived class server option, inheriting from base class option. More...
 

Macros

#define OPTION(poption)   ((struct option *) (poption))
 
#define OPTION_INIT(optset, spec_type, spec_table_var, common_table, spec_table, changed_cb, cb_data)
 
#define OPTION_BOOL_INIT(optset, common_table, bool_table, changed_cb)
 
#define OPTION_INT_INIT(optset, common_table, int_table, changed_cb)
 
#define OPTION_STR_INIT(optset, common_table, str_table, changed_cb, cb_data)
 
#define OPTION_ENUM_INIT(optset, common_table, enum_table, changed_cb)
 
#define OPTION_BITWISE_INIT(optset, common_table, bitwise_table, changed_cb)
 
#define OPTION_FONT_INIT(optset, common_table, font_table, changed_cb)
 
#define OPTION_COLOR_INIT(optset, common_table, color_table, changed_cb)
 
#define CLIENT_OPTION(poption)   ((struct client_option *) (poption))
 
#define GEN_BOOL_OPTION(oname, odesc, ohelp, ocat, odef, ocb)
 
#define GEN_INT_OPTION(oname, odesc, ohelp, ocat, odef, omin, omax, ocb)
 
#define GEN_STR_OPTION(oname, odesc, ohelp, ocat, odef, ocb, cbd)
 
#define GEN_STR_LIST_OPTION(oname, odesc, ohelp, ocat, odef, oacc, ocb, cbd)
 
#define GEN_ENUM_OPTION(oname, odesc, ohelp, ocat, odef, oacc, ocb)
 
#define GEN_BITWISE_OPTION(oname, odesc, ohelp, ocat, odef, oacc, ocb)
 
#define GEN_FONT_OPTION(oname, otgt, odesc, ohelp, ocat, ocb)
 
#define GEN_COLOR_OPTION(oname, odesc, ohelp, ocat, odef_fg, odef_bg, ocb)
 
#define color_set(color_tgt, color)
 
#define SERVER_OPTION(poption)   ((struct server_option *) (poption))
 
#define handle_server_setting_common(psoption, packet)
 Common part of handle_server_setting_*() functions. More...
 
#define OLD_OPTION_FILE_NAME   ".civclientrc"
 
#define MID_OPTION_FILE_NAME   ".freeciv-client-rc-%d.%d"
 
#define NEW_OPTION_FILE_NAME   "freeciv-client-rc-%d.%d"
 
#define MAJOR_NEW_OPTION_FILE_NAME   MAJOR_VERSION
 
#define MINOR_NEW_OPTION_FILE_NAME   MINOR_VERSION
 
#define FIRST_MAJOR_NEW_OPTION_FILE_NAME   2
 
#define FIRST_MINOR_NEW_OPTION_FILE_NAME   6
 
#define FIRST_MAJOR_MID_OPTION_FILE_NAME   2
 
#define FIRST_MINOR_MID_OPTION_FILE_NAME   2
 
#define FIRST_MAJOR_NEW_BOOLEAN   2
 
#define FIRST_MINOR_NEW_BOOLEAN   3
 
#define SETTING_CASE(ARG_name, ...)
 

Typedefs

typedef QHash< QString, QString > optionsHash
 
typedef QHash< QString, intptr_t > dialOptionsHash
 

Enumerations

enum  client_option_category {
  COC_GRAPHICS , COC_OVERVIEW , COC_SOUND , COC_INTERFACE ,
  COC_MAPIMG , COC_NETWORK , COC_FONT , COC_MAX
}
 

Functions

struct optionoptset_option_by_number (const struct option_set *poptset, int id)
 Returns the option corresponding of the number in this option set. More...
 
struct optionoptset_option_by_name (const struct option_set *poptset, const char *name)
 Returns the option corresponding of the name in this option set. More...
 
struct optionoptset_option_first (const struct option_set *poptset)
 Returns the first option of this option set. More...
 
const char * optset_category_name (const struct option_set *poptset, int category)
 Returns the name (translated) of the category of this option set. More...
 
const struct option_setoption_optset (const struct option *poption)
 Returns the option set owner of this option. More...
 
int option_number (const struct option *poption)
 Returns the number of the option. More...
 
const char * option_name (const struct option *poption)
 Returns the name of the option. More...
 
const char * option_description (const struct option *poption)
 Returns the description (translated) of the option. More...
 
QString option_help_text (const struct option *poption)
 Returns the help text (translated) of the option. More...
 
enum option_type option_type (const struct option *poption)
 Returns the type of the option. More...
 
QString option_category_name (const struct option *poption)
 Returns the name (translated) of the category of the option. More...
 
bool option_is_changeable (const struct option *poption)
 Returns TRUE if this option can be modified. More...
 
struct optionoption_next (const struct option *poption)
 Returns the next option or nullptr if this is the last. More...
 
bool option_reset (struct option *poption)
 Set the option to its default value. More...
 
void option_set_changed_callback (struct option *poption, void(*callback)(struct option *))
 Set the function to call every time this option changes. More...
 
void option_changed (struct option *poption)
 Force to use the option changed callback. More...
 
void option_set_gui_data (struct option *poption, void *data)
 Set the gui data for this option. More...
 
void * option_get_gui_data (const struct option *poption)
 Returns the gui data of this option. More...
 
int option_get_cb_data (const struct option *poption)
 Returns the callback data of this option. More...
 
bool option_bool_get (const struct option *poption)
 Returns the current value of this boolean option. More...
 
bool option_bool_def (const struct option *poption)
 Returns the default value of this boolean option. More...
 
bool option_bool_set (struct option *poption, bool val)
 Sets the value of this boolean option. More...
 
int option_int_get (const struct option *poption)
 Returns the current value of this integer option. More...
 
int option_int_def (const struct option *poption)
 Returns the default value of this integer option. More...
 
int option_int_min (const struct option *poption)
 Returns the minimal value of this integer option. More...
 
int option_int_max (const struct option *poption)
 Returns the maximal value of this integer option. More...
 
bool option_int_set (struct option *poption, int val)
 Sets the value of this integer option. More...
 
const char * option_str_get (const struct option *poption)
 Returns the current value of this string option. More...
 
const char * option_str_def (const struct option *poption)
 Returns the default value of this string option. More...
 
const QVector< QString > * option_str_values (const struct option *poption)
 Returns the possible string values of this string option. More...
 
bool option_str_set (struct option *poption, const char *str)
 Sets the value of this string option. More...
 
int option_enum_str_to_int (const struct option *poption, const char *str)
 Returns the value corresponding to the user-visible (translatable but not translated) string. More...
 
QString option_enum_int_to_str (const struct option *poption, int val)
 Returns the user-visible (translatable but not translated) string corresponding to the value. More...
 
int option_enum_get_int (const struct option *poption)
 Returns the current value of this enum option (as an integer). More...
 
int option_enum_def_int (const struct option *poption)
 Returns the default value of this enum option (as an integer). More...
 
bool option_enum_set_int (struct option *poption, int val)
 Sets the value of this enum option. More...
 
unsigned option_bitwise_get (const struct option *poption)
 Returns the current value of this bitwise option. More...
 
unsigned option_bitwise_def (const struct option *poption)
 Returns the default value of this bitwise option. More...
 
unsigned option_bitwise_mask (const struct option *poption)
 Returns the mask of this bitwise option. More...
 
const QVector< QString > * option_bitwise_values (const struct option *poption)
 Returns a vector of strings describing every bit of this option, as user-visible (translatable but not translated) strings. More...
 
bool option_bitwise_set (struct option *poption, unsigned val)
 Sets the value of this bitwise option. More...
 
QFont option_font_get (const struct option *poption)
 Returns the current value of this font option. More...
 
QFont option_font_def (const struct option *poption)
 Returns the default value of this font option. More...
 
void option_font_set_default (const struct option *poption, const QFont &font)
 Returns the default value of this font option. More...
 
QString option_font_target (const struct option *poption)
 Returns the target style name of this font option. More...
 
bool option_font_set (struct option *poption, const QFont &font)
 Sets the value of this font option. More...
 
struct ft_color option_color_get (const struct option *poption)
 Returns the current value of this color option. More...
 
struct ft_color option_color_def (const struct option *poption)
 Returns the default value of this color option. More...
 
bool option_color_set (struct option *poption, struct ft_color color)
 Sets the value of this color option. More...
 
static struct optionclient_optset_option_by_number (int id)
 Client option set. More...
 
static struct optionclient_optset_option_first ()
 Returns the first valid option pointer for the current gui type. More...
 
static int client_optset_category_number ()
 Returns the number of client option categories. More...
 
static const char * client_optset_category_name (int category)
 Returns the name (translated) of the option class. More...
 
static int client_option_number (const struct option *poption)
 Virtuals tables for the client options. More...
 
static const char * client_option_name (const struct option *poption)
 Returns the name of this client option. More...
 
static const char * client_option_description (const struct option *poption)
 Returns the description of this client option. More...
 
static const char * client_option_help_text (const struct option *poption)
 Returns the help text for this client option. More...
 
static int client_option_category (const struct option *poption)
 Returns the category of this client option. More...
 
static bool client_option_is_changeable (const struct option *poption)
 Returns TRUE if this client option can be modified. More...
 
static struct optionclient_option_next (const struct option *poption)
 Returns the next valid option pointer for the current gui type. More...
 
static bool client_option_bool_get (const struct option *poption)
 Returns the value of this client option of type OT_BOOLEAN. More...
 
static bool client_option_bool_def (const struct option *poption)
 Returns the default value of this client option of type OT_BOOLEAN. More...
 
static bool client_option_bool_set (struct option *poption, bool val)
 Set the value of this client option of type OT_BOOLEAN. More...
 
static int client_option_int_get (const struct option *poption)
 Returns the value of this client option of type OT_INTEGER. More...
 
static int client_option_int_def (const struct option *poption)
 Returns the default value of this client option of type OT_INTEGER. More...
 
static int client_option_int_min (const struct option *poption)
 Returns the minimal value for this client option of type OT_INTEGER. More...
 
static int client_option_int_max (const struct option *poption)
 Returns the maximal value for this client option of type OT_INTEGER. More...
 
static bool client_option_int_set (struct option *poption, int val)
 Set the value of this client option of type OT_INTEGER. More...
 
static const char * client_option_str_get (const struct option *poption)
 Returns the value of this client option of type OT_STRING. More...
 
static const char * client_option_str_def (const struct option *poption)
 Returns the default value of this client option of type OT_STRING. More...
 
static const QVector< QString > * client_option_str_values (const struct option *poption)
 Returns the possible string values of this client option of type OT_STRING. More...
 
static bool client_option_str_set (struct option *poption, const char *str)
 Set the value of this client option of type OT_STRING. More...
 
static QFont client_option_font_get (const struct option *poption)
 Returns the value of this client option of type OT_FONT. More...
 
static QFont client_option_font_def (const struct option *poption)
 Returns the default value of this client option of type OT_FONT. More...
 
static void client_option_font_set_def (const struct option *poption, const QFont &font)
 Returns the default value of this client option of type OT_FONT. More...
 
static QString client_option_font_target (const struct option *poption)
 Returns the default value of this client option of type OT_FONT. More...
 
static bool client_option_font_set (struct option *poption, const QFont &font)
 Set the value of this client option of type OT_FONT. More...
 
static struct ft_color client_option_color_get (const struct option *poption)
 Returns the value of this client option of type OT_COLOR. More...
 
static struct ft_color client_option_color_def (const struct option *poption)
 Returns the default value of this client option of type OT_COLOR. More...
 
static bool client_option_color_set (struct option *poption, struct ft_color color)
 Set the value of this client option of type OT_COLOR. More...
 
static void reqtree_show_icons_callback (struct option *poption)
 Enumerator name accessors. More...
 
static void view_option_changed_callback (struct option *poption)
 Callback for when any view option is changed. More...
 
static void manual_turn_done_callback (struct option *poption)
 Callback for when ai_manual_turn_done is changed. More...
 
static void voteinfo_bar_callback (struct option *poption)
 Callback for when any voteinfo bar option is changed. More...
 
static void font_changed_callback (struct option *poption)
 Callback for font options. More...
 
static void allfont_changed_callback (struct option *poption)
 Callback for font options. More...
 
static void game_music_enable_callback (struct option *poption)
 Callback for mapimg options. More...
 
static void menu_music_enable_callback (struct option *poption)
 Callback for music enabling option. More...
 
static void sound_volume_callback (struct option *poption)
 Callback for changing music volume. More...
 
static void init_client_options ()
 
static struct client_optionclient_option_next_valid (struct client_option *poption)
 Returns the next valid option pointer for the current gui type. More...
 
static const char * client_option_enum_secfile_str (secfile_data_t data, int val)
 Returns the "support" name of the value for this client option of type OT_ENUM (a string suitable for saving in a file). More...
 
static const char * client_option_bitwise_secfile_str (secfile_data_t data, int val)
 Returns the "support" name of a single value for this client option of type OT_BITWISE (a string suitable for saving in a file). More...
 
static bool client_option_load (struct option *poption, struct section_file *sf)
 Load the option from a file. More...
 
static void client_option_save (struct option *poption, struct section_file *sf)
 Save the option to a file. More...
 
static struct optionserver_optset_option_by_number (int id)
 Server option set. More...
 
static struct optionserver_optset_option_first ()
 Returns the first valid (visible) option pointer. More...
 
static int server_optset_category_number ()
 Returns the number of server option categories. More...
 
static const char * server_optset_category_name (int category)
 Returns the name (translated) of the server option category. More...
 
static int server_option_number (const struct option *poption)
 Virtuals tables for the client options. More...
 
static const char * server_option_name (const struct option *poption)
 Returns the name of this server option. More...
 
static const char * server_option_description (const struct option *poption)
 Returns the (translated) description of this server option. More...
 
static const char * server_option_help_text (const struct option *poption)
 Returns the (translated) help text for this server option. More...
 
static int server_option_category (const struct option *poption)
 Returns the category of this server option. More...
 
static bool server_option_is_changeable (const struct option *poption)
 Returns TRUE if this client option can be modified. More...
 
static struct optionserver_option_next (const struct option *poption)
 Returns the next valid (visible) option pointer. More...
 
static bool server_option_bool_get (const struct option *poption)
 Returns the value of this server option of type OT_BOOLEAN. More...
 
static bool server_option_bool_def (const struct option *poption)
 Returns the default value of this server option of type OT_BOOLEAN. More...
 
static bool server_option_bool_set (struct option *poption, bool val)
 Set the value of this server option of type OT_BOOLEAN. More...
 
static int server_option_int_get (const struct option *poption)
 Returns the value of this server option of type OT_INTEGER. More...
 
static int server_option_int_def (const struct option *poption)
 Returns the default value of this server option of type OT_INTEGER. More...
 
static int server_option_int_min (const struct option *poption)
 Returns the minimal value for this server option of type OT_INTEGER. More...
 
static int server_option_int_max (const struct option *poption)
 Returns the maximal value for this server option of type OT_INTEGER. More...
 
static bool server_option_int_set (struct option *poption, int val)
 Set the value of this server option of type OT_INTEGER. More...
 
static const char * server_option_str_get (const struct option *poption)
 Returns the value of this server option of type OT_STRING. More...
 
static const char * server_option_str_def (const struct option *poption)
 Returns the default value of this server option of type OT_STRING. More...
 
static const QVector< QString > * server_option_str_values (const struct option *poption)
 Returns the possible string values of this server option of type OT_STRING. More...
 
static bool server_option_str_set (struct option *poption, const char *str)
 Set the value of this server option of type OT_STRING. More...
 
static int server_option_enum_get (const struct option *poption)
 Returns the current value of this server option of type OT_ENUM. More...
 
static int server_option_enum_def (const struct option *poption)
 Returns the default value of this server option of type OT_ENUM. More...
 
static const QVector< QString > * server_option_enum_pretty (const struct option *poption)
 Returns the user-visible, translatable (but untranslated) "pretty" names of this server option of type OT_ENUM. More...
 
static bool server_option_enum_set (struct option *poption, int val)
 Set the value of this server option of type OT_ENUM. More...
 
static unsigned server_option_bitwise_get (const struct option *poption)
 Returns the current value of this server option of type OT_BITWISE. More...
 
static unsigned server_option_bitwise_def (const struct option *poption)
 Returns the default value of this server option of type OT_BITWISE. More...
 
static const QVector< QString > * server_option_bitwise_pretty (const struct option *poption)
 Returns the user-visible, translatable (but untranslated) "pretty" names of this server option of type OT_BITWISE. More...
 
static bool server_option_bitwise_set (struct option *poption, unsigned val)
 Set the value of this server option of type OT_BITWISE. More...
 
static void desired_settable_option_send (struct option *poption)
 Send the desired server options to the server. More...
 
void server_options_init ()
 Initialize the server options (not received yet). More...
 
static void server_option_free (struct server_option *poption)
 Free one server option. More...
 
void server_options_free ()
 Free the server options, if already received. More...
 
void handle_server_setting_control (const struct packet_server_setting_control *packet)
 Allocate the server options and categories. More...
 
void handle_server_setting_const (const struct packet_server_setting_const *packet)
 Receive a server setting info packet. More...
 
void handle_server_setting_bool (const struct packet_server_setting_bool *packet)
 Receive a boolean server setting info packet. More...
 
void handle_server_setting_int (const struct packet_server_setting_int *packet)
 Receive a integer server setting info packet. More...
 
void handle_server_setting_str (const struct packet_server_setting_str *packet)
 Receive a string server setting info packet. More...
 
void handle_server_setting_enum (const struct packet_server_setting_enum *packet)
 Receive an enumerator server setting info packet. More...
 
void handle_server_setting_bitwise (const struct packet_server_setting_bitwise *packet)
 Receive a bitwise server setting info packet. More...
 
static struct server_optionserver_option_next_valid (struct server_option *poption)
 Returns the next valid option pointer for the current gui type. More...
 
static void server_option_enum_support_name (const struct option *poption, QString *pvalue, QString *pdefault)
 Returns the long support names of the values of the server option of type OT_ENUM. More...
 
static void server_option_bitwise_support_base (const QVector< QString > *values, unsigned val, char *buf, size_t buf_len)
 Compute the long support names of a value. More...
 
static void server_option_bitwise_support_name (const struct option *poption, char *val_buf, size_t val_len, char *def_buf, size_t def_len)
 Compute the long support names of the values of the server option of type OT_BITWISE. More...
 
static void message_options_init ()
 These could be a static table initialisation, except its easier to do it this way. More...
 
static void message_options_free ()
 Free resources allocated for message options system. More...
 
static void message_options_load (struct section_file *file, const char *prefix)
 Load the message options; use the function defined by specnum.h (see also events.h). More...
 
static void message_options_save (struct section_file *file, const char *prefix)
 Save the message options; use the function defined by specnum.h (see also events.h). More...
 
static void load_cma_preset (struct section_file *file, int i)
 Does heavy lifting for looking up a preset. More...
 
static void save_cma_preset (struct section_file *file, int i)
 Does heavy lifting for inserting a preset. More...
 
static void save_cma_presets (struct section_file *file)
 Insert all cma presets. More...
 
static const char * get_current_option_file_name ()
 Returns pointer to static memory containing name of the current option file. More...
 
static const char * get_last_option_file_name (bool *allow_digital_boolean)
 Check the last option file we saved. More...
 
static void tileset_options_migrate_cimpletoon (struct client_options *options)
 Migrate players using cimpletoon/toonhex to amplio2/hexemplio with the cimpletoon option enabled. More...
 
static void tileset_options_load (struct section_file *sf, struct client_options *options)
 Load tileset options. More...
 
static void tileset_options_save (struct section_file *sf, const struct client_options *options)
 Save tileset options. More...
 
static void settable_options_load (struct section_file *sf)
 Load the server options. More...
 
static void settable_options_save (struct section_file *sf)
 Save the desired server options. More...
 
void desired_settable_options_update ()
 Update the desired settable options hash table from the current setting configuration. More...
 
void desired_settable_option_update (const char *op_name, const char *op_value, bool allow_replace)
 Update a desired settable option in the hash table from a value which can be different of the current configuration. More...
 
static bool settable_option_upgrade_value (const struct option *poption, int old_value, char *buf, size_t buf_len)
 Convert old integer to new values (Freeciv 2.2.x to Freeciv 2.3.x). More...
 
static void options_dialogs_load (struct section_file *sf)
 Load the city and player report dialog options. More...
 
static void options_dialogs_save (struct section_file *sf)
 Save the city and player report dialog options. More...
 
void options_dialogs_update ()
 This set the city and player report dialog options to the current ones. More...
 
void options_dialogs_set ()
 This set the city and player report dialog options. More...
 
void options_load ()
 Load from the rc file any options that are not ruleset specific. More...
 
static void option_save_output_window_callback (QtMsgType lvl, const QString &msg)
 Write messages from option saving to the output window. More...
 
void options_save (option_save_log_callback log_cb)
 Save all options. More...
 
static void options_init_names (const struct copt_val_name *(*acc)(int), QVector< QString > **support, QVector< QString > **pretty)
 Initialize lists of names for a client option. More...
 
void options_init ()
 Initialize the option module. More...
 
void options_free ()
 Free the option module. More...
 
const char * tileset_name_for_topology (int topology_id)
 Option framework wrapper for mapimg_get_format_list() More...
 
static bool is_ts_option_unset (const char *optname)
 Does topology-specific tileset option lack value? More...
 
void fill_topo_ts_default ()
 Fill default tilesets for topology-specific settings. More...
 

Variables

const char *const TILESET_OPTIONS_PREFIX = "tileset_"
 
client_optionsgui_options = nullptr
 
static bool options_fully_initialized = false
 
static struct option_set client_optset_static
 
const struct option_setclient_optset = &client_optset_static
 
static const struct option_common_vtable client_option_common_vtable
 
static const struct option_bool_vtable client_option_bool_vtable
 
static const struct option_int_vtable client_option_int_vtable
 
static const struct option_str_vtable client_option_str_vtable
 
static const struct option_font_vtable client_option_font_vtable
 
static const struct option_color_vtable client_option_color_vtable
 
static std::vector< client_optionclient_options
 
static char ** server_options_categories = nullptr
 Server options variables. More...
 
static struct server_optionserver_options = nullptr
 
static int server_options_categories_num = 0
 
static int server_options_num = 0
 
static struct option_set server_optset_static
 
const struct option_setserver_optset = &server_optset_static
 
static const struct option_common_vtable server_option_common_vtable
 
static const struct option_bool_vtable server_option_bool_vtable
 
static const struct option_int_vtable server_option_int_vtable
 
static const struct option_str_vtable server_option_str_vtable
 
static const struct option_enum_vtable server_option_enum_vtable
 
static const struct option_bitwise_vtable server_option_bitwise_vtable
 
int messages_where [E_COUNT]
 Message Options: More...
 

Macro Definition Documentation

◆ CLIENT_OPTION

#define CLIENT_OPTION (   poption)    ((struct client_option *) (poption))

Definition at line 1020 of file options.cpp.

◆ color_set

#define color_set (   color_tgt,
  color 
)
Value:
if (nullptr == color_tgt) { \
if (nullptr != color) { \
color_tgt = fc_strdup(color); \
changed = true; \
} \
} else { \
if (nullptr == color) { \
delete[] color_tgt; \
color_tgt = nullptr; \
changed = true; \
} else if (0 != strcmp(color_tgt, color)) { \
delete[] color_tgt; \
color_tgt = fc_strdup(color); \
changed = true; \
} \
}
#define fc_strdup(str)
Definition: support.h:111

◆ FIRST_MAJOR_MID_OPTION_FILE_NAME

#define FIRST_MAJOR_MID_OPTION_FILE_NAME   2

Definition at line 3718 of file options.cpp.

◆ FIRST_MAJOR_NEW_BOOLEAN

#define FIRST_MAJOR_NEW_BOOLEAN   2

Definition at line 3721 of file options.cpp.

◆ FIRST_MAJOR_NEW_OPTION_FILE_NAME

#define FIRST_MAJOR_NEW_OPTION_FILE_NAME   2

Definition at line 3715 of file options.cpp.

◆ FIRST_MINOR_MID_OPTION_FILE_NAME

#define FIRST_MINOR_MID_OPTION_FILE_NAME   2

Definition at line 3719 of file options.cpp.

◆ FIRST_MINOR_NEW_BOOLEAN

#define FIRST_MINOR_NEW_BOOLEAN   3

Definition at line 3722 of file options.cpp.

◆ FIRST_MINOR_NEW_OPTION_FILE_NAME

#define FIRST_MINOR_NEW_OPTION_FILE_NAME   6

Definition at line 3716 of file options.cpp.

◆ GEN_BITWISE_OPTION

#define GEN_BITWISE_OPTION (   oname,
  odesc,
  ohelp,
  ocat,
  odef,
  oacc,
  ocb 
)
Value:
{ \
client_option_bitwise_vtable, ocb), \
.name = #oname, .description = odesc, .help_text = ohelp, \
.category = ocat, .u = { \
.bitwise = {.pvalue = &gui_options->oname, \
.def = odef, \
.support_names = nullptr, /* Set in options_init(). */ \
.pretty_names = nullptr, \
.name_accessor = oacc} \
} \
}
#define OPTION_BITWISE_INIT(optset, common_table, bitwise_table, changed_cb)
Definition: options.cpp:266
client_options * gui_options
Definition: options.cpp:74
static struct option_set client_optset_static
Definition: options.cpp:855
static const struct option_common_vtable client_option_common_vtable
Definition: options.cpp:880
Derived class client option, inherinting of base class option.
Definition: options.cpp:962
struct option base_option
Definition: options.cpp:963

Definition at line 1196 of file options.cpp.

◆ GEN_BOOL_OPTION

#define GEN_BOOL_OPTION (   oname,
  odesc,
  ohelp,
  ocat,
  odef,
  ocb 
)
Value:
{ \
.name = #oname, .description = odesc, .help_text = ohelp, \
.category = ocat, \
.u = \
{.boolean = { \
.pvalue = &gui_options->oname, \
.def = odef, \
} } \
}
static const struct option_bool_vtable client_option_bool_vtable
Definition: options.cpp:893
#define OPTION_BOOL_INIT(optset, common_table, bool_table, changed_cb)
Definition: options.cpp:253

Definition at line 1038 of file options.cpp.

◆ GEN_COLOR_OPTION

#define GEN_COLOR_OPTION (   oname,
  odesc,
  ohelp,
  ocat,
  odef_fg,
  odef_bg,
  ocb 
)
Value:
{ \
.name = #oname, .description = odesc, .help_text = ohelp, \
.category = ocat, .u = { \
.color = {.pvalue = &gui_options->oname, \
.def = FT_COLOR(odef_fg, odef_bg)} \
} \
}
#define FT_COLOR(fg, bg)
static const struct option_color_vtable client_option_color_vtable
Definition: options.cpp:943
#define OPTION_COLOR_INIT(optset, common_table, color_table, changed_cb)
Definition: options.cpp:273

Definition at line 1258 of file options.cpp.

◆ GEN_ENUM_OPTION

#define GEN_ENUM_OPTION (   oname,
  odesc,
  ohelp,
  ocat,
  odef,
  oacc,
  ocb 
)
Value:
{ \
client_option_enum_vtable, ocb), \
.name = #oname, .description = odesc, .help_text = ohelp, \
.category = ocat, .u = { \
.enumerator = {.pvalue = (int *) &gui_options->oname, \
.def = odef, \
.support_names = nullptr, /* Set in options_init(). */ \
.pretty_names = nullptr, \
.name_accessor = oacc} \
} \
}
#define OPTION_ENUM_INIT(optset, common_table, enum_table, changed_cb)
Definition: options.cpp:263

Definition at line 1165 of file options.cpp.

◆ GEN_FONT_OPTION

#define GEN_FONT_OPTION (   oname,
  otgt,
  odesc,
  ohelp,
  ocat,
  ocb 
)
Value:
{ \
.name = #oname, .description = odesc, .help_text = ohelp, \
.category = ocat, \
.u = \
{.font = { \
.value = &gui_options->oname, \
.def = QFont(), \
.target = otgt, \
} } \
}
#define OPTION_FONT_INIT(optset, common_table, font_table, changed_cb)
Definition: options.cpp:270
static const struct option_font_vtable client_option_font_vtable
Definition: options.cpp:931

Definition at line 1228 of file options.cpp.

◆ GEN_INT_OPTION

#define GEN_INT_OPTION (   oname,
  odesc,
  ohelp,
  ocat,
  odef,
  omin,
  omax,
  ocb 
)
Value:
{ \
.name = #oname, .description = odesc, .help_text = ohelp, \
.category = ocat, .u = { \
.integer = {.pvalue = &gui_options->oname, \
.def = odef, \
.min = omin, \
.max = omax} \
} \
}
static const struct option_int_vtable client_option_int_vtable
Definition: options.cpp:904

Definition at line 1069 of file options.cpp.

◆ GEN_STR_LIST_OPTION

#define GEN_STR_LIST_OPTION (   oname,
  odesc,
  ohelp,
  ocat,
  odef,
  oacc,
  ocb,
  cbd 
)
Value:
{ \
.name = #oname, .description = odesc, .help_text = ohelp, \
.category = ocat, .u = { \
.string = {.pvalue = gui_options->oname, \
.size = sizeof(gui_options->oname), \
.def = odef, \
.val_accessor = oacc} \
} \
}
static const struct option_str_vtable client_option_str_vtable
Definition: options.cpp:917

Definition at line 1134 of file options.cpp.

◆ GEN_STR_OPTION

#define GEN_STR_OPTION (   oname,
  odesc,
  ohelp,
  ocat,
  odef,
  ocb,
  cbd 
)
Value:
{ \
.name = #oname, .description = odesc, .help_text = ohelp, \
.category = ocat, .u = { \
.string = {.pvalue = gui_options->oname, \
.size = sizeof(gui_options->oname), \
.def = odef, \
.val_accessor = nullptr} \
} \
}

Definition at line 1100 of file options.cpp.

◆ handle_server_setting_common

#define handle_server_setting_common (   psoption,
  packet 
)
Value:
psoption->is_changeable = packet->is_changeable; \
psoption->setdef = packet->setdef; \
psoption->is_visible = packet->is_visible; \
\
if (!psoption->desired_sent && psoption->is_visible \
&& psoption->is_changeable && is_server_running() \
&& packet->initial_setting) { \
/* Only send our private settings if we are running \
* on a forked local server, i.e. started by the \
* client with the "Start New Game" button. \
* Do now override settings that are already saved to savegame \
* and now loaded. */ \
desired_settable_option_send(OPTION(poption)); \
psoption->desired_sent = true; \
} \
\
/* Update the GUI. */ \
option_gui_update(poption);
bool is_server_running()
The general chain of events:
#define OPTION(poption)
Definition: options.cpp:244

Common part of handle_server_setting_*() functions.

See below.

Definition at line 2707 of file options.cpp.

◆ MAJOR_NEW_OPTION_FILE_NAME

#define MAJOR_NEW_OPTION_FILE_NAME   MAJOR_VERSION

Definition at line 3707 of file options.cpp.

◆ MID_OPTION_FILE_NAME

#define MID_OPTION_FILE_NAME   ".freeciv-client-rc-%d.%d"

Definition at line 3701 of file options.cpp.

◆ MINOR_NEW_OPTION_FILE_NAME

#define MINOR_NEW_OPTION_FILE_NAME   MINOR_VERSION

Definition at line 3711 of file options.cpp.

◆ NEW_OPTION_FILE_NAME

#define NEW_OPTION_FILE_NAME   "freeciv-client-rc-%d.%d"

Definition at line 3702 of file options.cpp.

◆ OLD_OPTION_FILE_NAME

#define OLD_OPTION_FILE_NAME   ".civclientrc"

Definition at line 3699 of file options.cpp.

◆ OPTION

#define OPTION (   poption)    ((struct option *) (poption))

Definition at line 244 of file options.cpp.

◆ OPTION_BITWISE_INIT

#define OPTION_BITWISE_INIT (   optset,
  common_table,
  bitwise_table,
  changed_cb 
)
Value:
OPTION_INIT(optset, OT_BITWISE, bitwise_vtable, common_table, \
bitwise_table, changed_cb, 0)
#define OPTION_INIT(optset, spec_type, spec_table_var, common_table, spec_table, changed_cb, cb_data)
Definition: options.cpp:246

Definition at line 266 of file options.cpp.

◆ OPTION_BOOL_INIT

#define OPTION_BOOL_INIT (   optset,
  common_table,
  bool_table,
  changed_cb 
)
Value:
OPTION_INIT(optset, OT_BOOLEAN, bool_vtable, common_table, bool_table, \
changed_cb, 0)

Definition at line 253 of file options.cpp.

◆ OPTION_COLOR_INIT

#define OPTION_COLOR_INIT (   optset,
  common_table,
  color_table,
  changed_cb 
)
Value:
OPTION_INIT(optset, OT_COLOR, color_vtable, common_table, color_table, \
changed_cb, 0)

Definition at line 273 of file options.cpp.

◆ OPTION_ENUM_INIT

#define OPTION_ENUM_INIT (   optset,
  common_table,
  enum_table,
  changed_cb 
)
Value:
OPTION_INIT(optset, OT_ENUM, enum_vtable, common_table, enum_table, \
changed_cb, 0)

Definition at line 263 of file options.cpp.

◆ OPTION_FONT_INIT

#define OPTION_FONT_INIT (   optset,
  common_table,
  font_table,
  changed_cb 
)
Value:
OPTION_INIT(optset, OT_FONT, font_vtable, common_table, font_table, \
changed_cb, 0)

Definition at line 270 of file options.cpp.

◆ OPTION_INIT

#define OPTION_INIT (   optset,
  spec_type,
  spec_table_var,
  common_table,
  spec_table,
  changed_cb,
  cb_data 
)
Value:
{ \
.poptset = optset, .type = spec_type, .common_vtable = &common_table, \
.spec_table_var = &spec_table, .changed_callback = changed_cb, \
.callback_data = cb_data, .gui_data = nullptr \
}

Definition at line 246 of file options.cpp.

◆ OPTION_INT_INIT

#define OPTION_INT_INIT (   optset,
  common_table,
  int_table,
  changed_cb 
)
Value:
OPTION_INIT(optset, OT_INTEGER, int_vtable, common_table, int_table, \
changed_cb, 0)

Definition at line 256 of file options.cpp.

◆ OPTION_STR_INIT

#define OPTION_STR_INIT (   optset,
  common_table,
  str_table,
  changed_cb,
  cb_data 
)
Value:
OPTION_INIT(optset, OT_STRING, str_vtable, common_table, str_table, \
changed_cb, cb_data)

Definition at line 259 of file options.cpp.

◆ SERVER_OPTION

#define SERVER_OPTION (   poption)    ((struct server_option *) (poption))

Definition at line 2559 of file options.cpp.

◆ SETTING_CASE

#define SETTING_CASE (   ARG_name,
  ... 
)
Value:
if (0 == strcmp(ARG_name, name)) { \
static const char *values[] = {__VA_ARGS__}; \
if (0 <= old_value && old_value < ARRAY_SIZE(values) \
&& nullptr != values[old_value]) { \
fc_strlcpy(buf, values[old_value], buf_len); \
return true; \
} else { \
return false; \
} \
}
const char * name
Definition: inputfile.cpp:118
#define ARRAY_SIZE(x)
Definition: shared.h:79

Typedef Documentation

◆ dialOptionsHash

typedef QHash<QString, intptr_t> dialOptionsHash

Definition at line 72 of file options.cpp.

◆ optionsHash

typedef QHash<QString, QString> optionsHash

Definition at line 71 of file options.cpp.

Enumeration Type Documentation

◆ client_option_category

Enumerator
COC_GRAPHICS 
COC_OVERVIEW 
COC_SOUND 
COC_INTERFACE 
COC_MAPIMG 
COC_NETWORK 
COC_FONT 
COC_MAX 

Definition at line 948 of file options.cpp.

Function Documentation

◆ allfont_changed_callback()

static void allfont_changed_callback ( struct option poption)
static

Callback for font options.

Definition at line 4779 of file options.cpp.

Referenced by init_client_options().

◆ client_option_bitwise_secfile_str()

static const char* client_option_bitwise_secfile_str ( secfile_data_t  data,
int  val 
)
static

Returns the "support" name of a single value for this client option of type OT_BITWISE (a string suitable for saving in a file).

The prototype must match the 'secfile_enum_name_data_fn_t' type.

Definition at line 2180 of file options.cpp.

Referenced by client_option_load(), and client_option_save().

◆ client_option_bool_def()

static bool client_option_bool_def ( const struct option poption)
static

Returns the default value of this client option of type OT_BOOLEAN.

Definition at line 2038 of file options.cpp.

◆ client_option_bool_get()

static bool client_option_bool_get ( const struct option poption)
static

Returns the value of this client option of type OT_BOOLEAN.

Definition at line 2030 of file options.cpp.

◆ client_option_bool_set()

static bool client_option_bool_set ( struct option poption,
bool  val 
)
static

Set the value of this client option of type OT_BOOLEAN.

Returns TRUE if the value changed.

Definition at line 2047 of file options.cpp.

◆ client_option_category()

static int client_option_category ( const struct option poption)
static

Returns the category of this client option.

Definition at line 2005 of file options.cpp.

◆ client_option_color_def()

static struct ft_color client_option_color_def ( const struct option poption)
static

Returns the default value of this client option of type OT_COLOR.

Definition at line 2227 of file options.cpp.

◆ client_option_color_get()

static struct ft_color client_option_color_get ( const struct option poption)
static

Returns the value of this client option of type OT_COLOR.

Definition at line 2227 of file options.cpp.

◆ client_option_color_set()

static bool client_option_color_set ( struct option poption,
struct ft_color  color 
)
static

Set the value of this client option of type OT_COLOR.

Returns TRUE if the value changed.

Definition at line 2259 of file options.cpp.

◆ client_option_description()

static const char * client_option_description ( const struct option poption)
static

Returns the description of this client option.

Definition at line 1989 of file options.cpp.

◆ client_option_enum_secfile_str()

static const char* client_option_enum_secfile_str ( secfile_data_t  data,
int  val 
)
static

Returns the "support" name of the value for this client option of type OT_ENUM (a string suitable for saving in a file).

The prototype must match the 'secfile_enum_name_data_fn_t' type.

Definition at line 2165 of file options.cpp.

Referenced by client_option_load(), and client_option_save().

◆ client_option_font_def()

static QFont client_option_font_def ( const struct option poption)
static

Returns the default value of this client option of type OT_FONT.

Definition at line 2201 of file options.cpp.

◆ client_option_font_get()

static QFont client_option_font_get ( const struct option poption)
static

Returns the value of this client option of type OT_FONT.

Definition at line 2193 of file options.cpp.

◆ client_option_font_set()

static bool client_option_font_set ( struct option poption,
const QFont &  font 
)
static

Set the value of this client option of type OT_FONT.

Returns TRUE if the value changed.

Definition at line 2227 of file options.cpp.

◆ client_option_font_set_def()

static void client_option_font_set_def ( const struct option poption,
const QFont &  font 
)
static

Returns the default value of this client option of type OT_FONT.

Definition at line 2209 of file options.cpp.

◆ client_option_font_target()

static QString client_option_font_target ( const struct option poption)
static

Returns the default value of this client option of type OT_FONT.

Definition at line 2218 of file options.cpp.

◆ client_option_help_text()

static const char * client_option_help_text ( const struct option poption)
static

Returns the help text for this client option.

Definition at line 1997 of file options.cpp.

◆ client_option_int_def()

static int client_option_int_def ( const struct option poption)
static

Returns the default value of this client option of type OT_INTEGER.

Definition at line 2070 of file options.cpp.

◆ client_option_int_get()

static int client_option_int_get ( const struct option poption)
static

Returns the value of this client option of type OT_INTEGER.

Definition at line 2062 of file options.cpp.

◆ client_option_int_max()

static int client_option_int_max ( const struct option poption)
static

Returns the maximal value for this client option of type OT_INTEGER.

Definition at line 2086 of file options.cpp.

◆ client_option_int_min()

static int client_option_int_min ( const struct option poption)
static

Returns the minimal value for this client option of type OT_INTEGER.

Definition at line 2078 of file options.cpp.

◆ client_option_int_set()

static bool client_option_int_set ( struct option poption,
int  val 
)
static

Set the value of this client option of type OT_INTEGER.

Returns TRUE if the value changed.

Definition at line 2095 of file options.cpp.

◆ client_option_is_changeable()

static bool client_option_is_changeable ( const struct option poption)
static

Returns TRUE if this client option can be modified.

Definition at line 2013 of file options.cpp.

◆ client_option_load()

static bool client_option_load ( struct option poption,
struct section_file sf 
)
static

Load the option from a file.

Returns TRUE if the option changed.

Definition at line 2294 of file options.cpp.

◆ client_option_name()

static const char * client_option_name ( const struct option poption)
static

Returns the name of this client option.

Definition at line 1981 of file options.cpp.

◆ client_option_next()

static struct option * client_option_next ( const struct option poption)
static

Returns the next valid option pointer for the current gui type.

Definition at line 2022 of file options.cpp.

◆ client_option_next_valid()

static struct client_option* client_option_next_valid ( struct client_option poption)
static

Returns the next valid option pointer for the current gui type.

Definition at line 1911 of file options.cpp.

Referenced by client_option_next(), and client_optset_option_first().

◆ client_option_number()

static int client_option_number ( const struct option poption)
static

Virtuals tables for the client options.

Returns the number of this client option.

Definition at line 1973 of file options.cpp.

◆ client_option_save()

static void client_option_save ( struct option poption,
struct section_file sf 
)
static

Save the option to a file.

Definition at line 2363 of file options.cpp.

Referenced by options_save().

◆ client_option_str_def()

static const char * client_option_str_def ( const struct option poption)
static

Returns the default value of this client option of type OT_STRING.

Definition at line 2119 of file options.cpp.

◆ client_option_str_get()

static const char * client_option_str_get ( const struct option poption)
static

Returns the value of this client option of type OT_STRING.

Definition at line 2111 of file options.cpp.

◆ client_option_str_set()

static bool client_option_str_set ( struct option poption,
const char *  str 
)
static

Set the value of this client option of type OT_STRING.

Returns TRUE if the value changed.

Definition at line 2140 of file options.cpp.

◆ client_option_str_values()

static const QVector< QString > * client_option_str_values ( const struct option poption)
static

Returns the possible string values of this client option of type OT_STRING.

Definition at line 2129 of file options.cpp.

Referenced by client_option_str_set().

◆ client_optset_category_name()

static const char * client_optset_category_name ( int  category)
static

Returns the name (translated) of the option class.

Definition at line 1943 of file options.cpp.

◆ client_optset_category_number()

static int client_optset_category_number ( )
static

Returns the number of client option categories.

Definition at line 1938 of file options.cpp.

◆ client_optset_option_by_number()

static struct option * client_optset_option_by_number ( int  id)
static

Client option set.

Returns the option corresponding to this id.

Definition at line 1919 of file options.cpp.

◆ client_optset_option_first()

static struct option * client_optset_option_first ( )
static

Returns the first valid option pointer for the current gui type.

Definition at line 1930 of file options.cpp.

◆ desired_settable_option_send()

static void desired_settable_option_send ( struct option poption)
static

Send the desired server options to the server.

Definition at line 4177 of file options.cpp.

◆ desired_settable_option_update()

void desired_settable_option_update ( const char *  op_name,
const char *  op_value,
bool  allow_replace 
)

Update a desired settable option in the hash table from a value which can be different of the current configuration.

Definition at line 4126 of file options.cpp.

◆ desired_settable_options_update()

void desired_settable_options_update ( )

Update the desired settable options hash table from the current setting configuration.

Desired settable options.

Definition at line 4064 of file options.cpp.

Referenced by option_dialog::apply_option().

◆ fill_topo_ts_default()

void fill_topo_ts_default ( )

Fill default tilesets for topology-specific settings.

Definition at line 4906 of file options.cpp.

Referenced by client_main().

◆ font_changed_callback()

static void font_changed_callback ( struct option poption)
static

Callback for font options.

Definition at line 4788 of file options.cpp.

Referenced by init_client_options().

◆ game_music_enable_callback()

static void game_music_enable_callback ( struct option poption)
static

Callback for mapimg options.

Callback for music enabling option.

Definition at line 4822 of file options.cpp.

Referenced by init_client_options().

◆ get_current_option_file_name()

static const char* get_current_option_file_name ( )
static

Returns pointer to static memory containing name of the current option file.

Usually used for saving. Ie, based on FREECIV_OPT env var, and freeciv storage root dir. (or a OPTION_FILE_NAME define defined in fc_config.h) Or nullptr if problem.

Definition at line 3731 of file options.cpp.

Referenced by options_save().

◆ get_last_option_file_name()

static const char* get_last_option_file_name ( bool *  allow_digital_boolean)
static

Check the last option file we saved.

Usually used to load. Ie, based on FREECIV_OPT env var, and home dir. (or a OPTION_FILE_NAME define defined in fc_config.h), or nullptr if not found.

Set in allow_digital_boolean if we should look for old boolean values (saved as 0 and 1), so if the rc file version is older than 2.3.0.

Definition at line 3765 of file options.cpp.

◆ handle_server_setting_bitwise()

void handle_server_setting_bitwise ( const struct packet_server_setting_bitwise *  packet)

Receive a bitwise server setting info packet.

Definition at line 2920 of file options.cpp.

◆ handle_server_setting_bool()

void handle_server_setting_bool ( const struct packet_server_setting_bool *  packet)

Receive a boolean server setting info packet.

Definition at line 2726 of file options.cpp.

◆ handle_server_setting_const()

void handle_server_setting_const ( const struct packet_server_setting_const *  packet)

Receive a server setting info packet.

Definition at line 2685 of file options.cpp.

◆ handle_server_setting_control()

void handle_server_setting_control ( const struct packet_server_setting_control *  packet)

Allocate the server options and categories.

Definition at line 2653 of file options.cpp.

◆ handle_server_setting_enum()

void handle_server_setting_enum ( const struct packet_server_setting_enum *  packet)

Receive an enumerator server setting info packet.

Definition at line 2837 of file options.cpp.

◆ handle_server_setting_int()

void handle_server_setting_int ( const struct packet_server_setting_int *  packet)

Receive a integer server setting info packet.

Definition at line 2759 of file options.cpp.

◆ handle_server_setting_str()

void handle_server_setting_str ( const struct packet_server_setting_str *  packet)

Receive a string server setting info packet.

Definition at line 2794 of file options.cpp.

◆ init_client_options()

static void init_client_options ( )
static

Definition at line 1290 of file options.cpp.

Referenced by options_init().

◆ is_ts_option_unset()

static bool is_ts_option_unset ( const char *  optname)
static

Does topology-specific tileset option lack value?

Definition at line 4887 of file options.cpp.

◆ load_cma_preset()

static void load_cma_preset ( struct section_file file,
int  i 
)
static

Does heavy lifting for looking up a preset.

Definition at line 3624 of file options.cpp.

◆ manual_turn_done_callback()

static void manual_turn_done_callback ( struct option poption)
static

Callback for when ai_manual_turn_done is changed.

Definition at line 4745 of file options.cpp.

Referenced by init_client_options().

◆ menu_music_enable_callback()

static void menu_music_enable_callback ( struct option poption)
static

Callback for music enabling option.

Definition at line 4837 of file options.cpp.

Referenced by init_client_options().

◆ message_options_free()

static void message_options_free ( )
static

Free resources allocated for message options system.

Definition at line 3429 of file options.cpp.

Referenced by options_free().

◆ message_options_init()

static void message_options_init ( )
static

These could be a static table initialisation, except its easier to do it this way.

Definition at line 3389 of file options.cpp.

Referenced by options_init().

◆ message_options_load()

static void message_options_load ( struct section_file file,
const char *  prefix 
)
static

Load the message options; use the function defined by specnum.h (see also events.h).

Definition at line 3435 of file options.cpp.

◆ message_options_save()

static void message_options_save ( struct section_file file,
const char *  prefix 
)
static

Save the message options; use the function defined by specnum.h (see also events.h).

Definition at line 3603 of file options.cpp.

Referenced by options_save().

◆ option_bitwise_def()

unsigned option_bitwise_def ( const struct option poption)

Returns the default value of this bitwise option.

Definition at line 693 of file options.cpp.

Referenced by option_dialog::option_dialog_reset(), and option_reset().

◆ option_bitwise_get()

unsigned option_bitwise_get ( const struct option poption)

Returns the current value of this bitwise option.

Definition at line 682 of file options.cpp.

Referenced by client_option_save(), client_ss_val_bitwise_get(), and option_dialog::option_dialog_refresh().

◆ option_bitwise_mask()

unsigned option_bitwise_mask ( const struct option poption)

Returns the mask of this bitwise option.

Definition at line 704 of file options.cpp.

Referenced by option_bitwise_set().

◆ option_bitwise_set()

bool option_bitwise_set ( struct option poption,
unsigned  val 
)

Sets the value of this bitwise option.

Returns TRUE if the value changed.

Definition at line 732 of file options.cpp.

Referenced by option_dialog::apply_options(), client_option_load(), and option_reset().

◆ option_bitwise_values()

const QVector<QString>* option_bitwise_values ( const struct option poption)

Returns a vector of strings describing every bit of this option, as user-visible (translatable but not translated) strings.

Definition at line 721 of file options.cpp.

Referenced by option_dialog::add_option().

◆ option_bool_def()

bool option_bool_def ( const struct option poption)

Returns the default value of this boolean option.

Definition at line 468 of file options.cpp.

Referenced by option_dialog::option_dialog_reset(), and option_reset().

◆ option_bool_get()

bool option_bool_get ( const struct option poption)

◆ option_bool_set()

bool option_bool_set ( struct option poption,
bool  val 
)

Sets the value of this boolean option.

Returns TRUE if the value changed.

Definition at line 479 of file options.cpp.

Referenced by option_dialog::apply_options(), client_option_load(), and option_reset().

◆ option_category_name()

QString option_category_name ( const struct option poption)

Returns the name (translated) of the category of the option.

Definition at line 340 of file options.cpp.

Referenced by option_dialog::add_option().

◆ option_changed()

void option_changed ( struct option poption)

Force to use the option changed callback.

Definition at line 408 of file options.cpp.

Referenced by option_bitwise_set(), option_bool_set(), option_color_def(), option_color_set(), option_enum_set_int(), option_int_set(), and option_str_set().

◆ option_color_def()

struct ft_color option_color_def ( const struct option poption)

Returns the default value of this color option.

Definition at line 793 of file options.cpp.

Referenced by option_dialog::option_dialog_reset(), and option_reset().

◆ option_color_get()

struct ft_color option_color_get ( const struct option poption)

Returns the current value of this color option.

Definition at line 793 of file options.cpp.

Referenced by client_option_save(), option_dialog::option_dialog_refresh(), and option_dialog::set_color().

◆ option_color_set()

bool option_color_set ( struct option poption,
struct ft_color  color 
)

Sets the value of this color option.

Returns TRUE if the value changed.

Definition at line 835 of file options.cpp.

Referenced by option_dialog::apply_options(), client_option_load(), and option_reset().

◆ option_description()

const char* option_description ( const struct option poption)

Returns the description (translated) of the option.

Definition at line 310 of file options.cpp.

Referenced by option_dialog::add_option().

◆ option_enum_def_int()

int option_enum_def_int ( const struct option poption)

Returns the default value of this enum option (as an integer).

Definition at line 656 of file options.cpp.

Referenced by option_dialog::option_dialog_reset(), and option_reset().

◆ option_enum_get_int()

int option_enum_get_int ( const struct option poption)

Returns the current value of this enum option (as an integer).

Definition at line 645 of file options.cpp.

Referenced by client_option_save(), and option_dialog::option_dialog_refresh().

◆ option_enum_int_to_str()

QString option_enum_int_to_str ( const struct option poption,
int  val 
)

Returns the user-visible (translatable but not translated) string corresponding to the value.

Returns nullptr on error.

Definition at line 626 of file options.cpp.

Referenced by option_dialog::add_option().

◆ option_enum_set_int()

bool option_enum_set_int ( struct option poption,
int  val 
)

Sets the value of this enum option.

Returns TRUE if the value changed.

Definition at line 667 of file options.cpp.

Referenced by option_dialog::apply_options(), client_option_load(), and option_reset().

◆ option_enum_str_to_int()

int option_enum_str_to_int ( const struct option poption,
const char *  str 
)

Returns the value corresponding to the user-visible (translatable but not translated) string.

Returns -1 if not matched.

Definition at line 603 of file options.cpp.

◆ option_font_def()

QFont option_font_def ( const struct option poption)

Returns the default value of this font option.

Definition at line 760 of file options.cpp.

Referenced by option_dialog::option_dialog_reset(), and option_reset().

◆ option_font_get()

QFont option_font_get ( const struct option poption)

◆ option_font_set()

bool option_font_set ( struct option poption,
const QFont &  font 
)

Sets the value of this font option.

Returns TRUE if the value changed.

Definition at line 793 of file options.cpp.

Referenced by option_dialog::apply_options(), client_option_load(), option_reset(), and fcFont::setSizeAll().

◆ option_font_set_default()

void option_font_set_default ( const struct option poption,
const QFont &  font 
)

Returns the default value of this font option.

Definition at line 771 of file options.cpp.

Referenced by configure_font().

◆ option_font_target()

QString option_font_target ( const struct option poption)

Returns the target style name of this font option.

Definition at line 782 of file options.cpp.

Referenced by font_changed_callback().

◆ option_get_cb_data()

int option_get_cb_data ( const struct option poption)

Returns the callback data of this option.

Definition at line 447 of file options.cpp.

Referenced by get_tileset_list(), and tilespec_reread_callback().

◆ option_get_gui_data()

◆ option_help_text()

QString option_help_text ( const struct option poption)

Returns the help text (translated) of the option.

Definition at line 320 of file options.cpp.

Referenced by option_dialog::add_option().

◆ option_int_def()

int option_int_def ( const struct option poption)

Returns the default value of this integer option.

Definition at line 505 of file options.cpp.

Referenced by option_dialog::option_dialog_reset(), option_reset(), and options_init().

◆ option_int_get()

int option_int_get ( const struct option poption)

Returns the current value of this integer option.

Definition at line 494 of file options.cpp.

Referenced by client_option_save(), client_ss_val_int_get(), desired_settable_option_send(), and option_dialog::option_dialog_refresh().

◆ option_int_max()

int option_int_max ( const struct option poption)

Returns the maximal value of this integer option.

Definition at line 527 of file options.cpp.

Referenced by option_dialog::add_option(), and options_init().

◆ option_int_min()

int option_int_min ( const struct option poption)

Returns the minimal value of this integer option.

Definition at line 516 of file options.cpp.

Referenced by option_dialog::add_option(), and options_init().

◆ option_int_set()

bool option_int_set ( struct option poption,
int  val 
)

Sets the value of this integer option.

Returns TRUE if the value changed.

Definition at line 538 of file options.cpp.

Referenced by option_dialog::apply_options(), client_option_load(), pregame_options::max_players_change(), and option_reset().

◆ option_is_changeable()

bool option_is_changeable ( const struct option poption)

Returns TRUE if this option can be modified.

Definition at line 351 of file options.cpp.

Referenced by option_dialog::add_option().

◆ option_name()

◆ option_next()

struct option* option_next ( const struct option poption)

Returns the next option or nullptr if this is the last.

Definition at line 361 of file options.cpp.

◆ option_number()

int option_number ( const struct option poption)

◆ option_optset()

const struct option_set* option_optset ( const struct option poption)

Returns the option set owner of this option.

Definition at line 280 of file options.cpp.

Referenced by option_gui_update().

◆ option_reset()

bool option_reset ( struct option poption)

Set the option to its default value.

Returns TRUE if the option changed.

Definition at line 371 of file options.cpp.

Referenced by options_init().

◆ option_save_output_window_callback()

static void option_save_output_window_callback ( QtMsgType  lvl,
const QString &  msg 
)
static

Write messages from option saving to the output window.

Definition at line 4486 of file options.cpp.

Referenced by options_save().

◆ option_set_changed_callback()

void option_set_changed_callback ( struct option poption,
void(*)(struct option *)  callback 
)

Set the function to call every time this option changes.

Can be nullptr.

Definition at line 397 of file options.cpp.

◆ option_set_gui_data()

void option_set_gui_data ( struct option poption,
void *  data 
)

Set the gui data for this option.

Definition at line 427 of file options.cpp.

Referenced by option_dialog::add_option().

◆ option_str_def()

const char* option_str_def ( const struct option poption)

Returns the default value of this string option.

Definition at line 564 of file options.cpp.

Referenced by option_dialog::option_dialog_reset(), option_reset(), and options_init().

◆ option_str_get()

◆ option_str_set()

bool option_str_set ( struct option poption,
const char *  str 
)

Sets the value of this string option.

Returns TRUE if the value changed.

Definition at line 586 of file options.cpp.

Referenced by option_dialog::apply_options(), client_option_load(), races_dialog::nationset_changed(), and option_reset().

◆ option_str_values()

const QVector<QString>* option_str_values ( const struct option poption)

Returns the possible string values of this string option.

Definition at line 575 of file options.cpp.

Referenced by option_dialog::add_option(), option_dialog::get_string(), options_init(), and option_dialog::set_string().

◆ option_type()

◆ options_dialogs_load()

static void options_dialogs_load ( struct section_file sf)
static

Load the city and player report dialog options.

Definition at line 4260 of file options.cpp.

◆ options_dialogs_save()

static void options_dialogs_save ( struct section_file sf)
static

Save the city and player report dialog options.

Definition at line 4288 of file options.cpp.

Referenced by options_save().

◆ options_dialogs_set()

void options_dialogs_set ( )

This set the city and player report dialog options.

It's called when the client goes to C_S_RUNNING state.

Definition at line 4332 of file options.cpp.

Referenced by client_state().

◆ options_dialogs_update()

void options_dialogs_update ( )

This set the city and player report dialog options to the current ones.

Dialog report options.

It's called when the client goes to C_S_DISCONNECTED state.

Definition at line 4306 of file options.cpp.

Referenced by client_state(), and options_dialogs_save().

◆ options_free()

void options_free ( )

Free the option module.

Definition at line 4677 of file options.cpp.

Referenced by client_exit().

◆ options_init()

void options_init ( )

Initialize the option module.

Definition at line 4582 of file options.cpp.

Referenced by client_main().

◆ options_init_names()

static void options_init_names ( const struct copt_val_name *(*)(int)  acc,
QVector< QString > **  support,
QVector< QString > **  pretty 
)
static

Initialize lists of names for a client option.

Definition at line 4564 of file options.cpp.

Referenced by options_init().

◆ options_load()

void options_load ( )

Load from the rc file any options that are not ruleset specific.

It is called after ui_init(), yet before ui_main(). Unfortunately, this means that some clients cannot display. Instead, use log_*().

Definition at line 4362 of file options.cpp.

Referenced by client_main().

◆ options_save()

void options_save ( option_save_log_callback  log_cb)

Save all options.

Definition at line 4496 of file options.cpp.

Referenced by option_dialog::apply_option(), client_exit(), disconnect_from_server(), and mr_menu::save_options_now().

◆ optset_category_name()

const char* optset_category_name ( const struct option_set poptset,
int  category 
)

Returns the name (translated) of the category of this option set.

Definition at line 138 of file options.cpp.

Referenced by option_category_name().

◆ optset_option_by_name()

struct option* optset_option_by_name ( const struct option_set poptset,
const char *  name 
)

◆ optset_option_by_number()

struct option* optset_option_by_number ( const struct option_set poptset,
int  id 
)

Returns the option corresponding of the number in this option set.

Definition at line 99 of file options.cpp.

Referenced by client_ss_name_get(), client_ss_val_bitwise_get(), client_ss_val_bool_get(), and client_ss_val_int_get().

◆ optset_option_first()

struct option* optset_option_first ( const struct option_set poptset)

Returns the first option of this option set.

Definition at line 128 of file options.cpp.

◆ reqtree_show_icons_callback()

static void reqtree_show_icons_callback ( struct option poption)
static

Enumerator name accessors.

Callback when the reqtree show icons option is changed.

The tree is recalculated.

Definition at line 4726 of file options.cpp.

Referenced by init_client_options().

◆ save_cma_preset()

static void save_cma_preset ( struct section_file file,
int  i 
)
static

Does heavy lifting for inserting a preset.

Definition at line 3655 of file options.cpp.

Referenced by save_cma_presets().

◆ save_cma_presets()

static void save_cma_presets ( struct section_file file)
static

Insert all cma presets.

Definition at line 3685 of file options.cpp.

Referenced by options_save().

◆ server_option_bitwise_def()

static unsigned server_option_bitwise_def ( const struct option poption)
static

Returns the default value of this server option of type OT_BITWISE.

Definition at line 3306 of file options.cpp.

◆ server_option_bitwise_get()

static unsigned server_option_bitwise_get ( const struct option poption)
static

Returns the current value of this server option of type OT_BITWISE.

Definition at line 3298 of file options.cpp.

◆ server_option_bitwise_pretty()

static const QVector< QString > * server_option_bitwise_pretty ( const struct option poption)
static

Returns the user-visible, translatable (but untranslated) "pretty" names of this server option of type OT_BITWISE.

Definition at line 3316 of file options.cpp.

◆ server_option_bitwise_set()

static bool server_option_bitwise_set ( struct option poption,
unsigned  val 
)
static

Set the value of this server option of type OT_BITWISE.

Returns TRUE if the value changed.

Definition at line 3345 of file options.cpp.

◆ server_option_bitwise_support_base()

static void server_option_bitwise_support_base ( const QVector< QString > *  values,
unsigned  val,
char *  buf,
size_t  buf_len 
)
static

Compute the long support names of a value.

Definition at line 3325 of file options.cpp.

◆ server_option_bitwise_support_name()

static void server_option_bitwise_support_name ( const struct option poption,
char *  val_buf,
size_t  val_len,
char *  def_buf,
size_t  def_len 
)
static

Compute the long support names of the values of the server option of type OT_BITWISE.

Definition at line 3364 of file options.cpp.

Referenced by desired_settable_option_send().

◆ server_option_bool_def()

static bool server_option_bool_def ( const struct option poption)
static

Returns the default value of this server option of type OT_BOOLEAN.

Definition at line 3117 of file options.cpp.

◆ server_option_bool_get()

static bool server_option_bool_get ( const struct option poption)
static

Returns the value of this server option of type OT_BOOLEAN.

Definition at line 3109 of file options.cpp.

◆ server_option_bool_set()

static bool server_option_bool_set ( struct option poption,
bool  val 
)
static

Set the value of this server option of type OT_BOOLEAN.

Returns TRUE if the value changed.

Definition at line 3126 of file options.cpp.

◆ server_option_category()

static int server_option_category ( const struct option poption)
static

Returns the category of this server option.

Definition at line 3085 of file options.cpp.

◆ server_option_description()

static const char * server_option_description ( const struct option poption)
static

Returns the (translated) description of this server option.

Definition at line 3069 of file options.cpp.

◆ server_option_enum_def()

static int server_option_enum_def ( const struct option poption)
static

Returns the default value of this server option of type OT_ENUM.

Definition at line 3242 of file options.cpp.

◆ server_option_enum_get()

static int server_option_enum_get ( const struct option poption)
static

Returns the current value of this server option of type OT_ENUM.

Definition at line 3234 of file options.cpp.

◆ server_option_enum_pretty()

static const QVector< QString > * server_option_enum_pretty ( const struct option poption)
static

Returns the user-visible, translatable (but untranslated) "pretty" names of this server option of type OT_ENUM.

Definition at line 3252 of file options.cpp.

◆ server_option_enum_set()

static bool server_option_enum_set ( struct option poption,
int  val 
)
static

Set the value of this server option of type OT_ENUM.

Returns TRUE if the value changed.

Definition at line 3261 of file options.cpp.

◆ server_option_enum_support_name()

static void server_option_enum_support_name ( const struct option poption,
QString *  pvalue,
QString *  pdefault 
)
static

Returns the long support names of the values of the server option of type OT_ENUM.

Definition at line 3280 of file options.cpp.

Referenced by desired_settable_option_send().

◆ server_option_free()

static void server_option_free ( struct server_option poption)
static

Free one server option.

Definition at line 2577 of file options.cpp.

Referenced by server_options_free().

◆ server_option_help_text()

static const char * server_option_help_text ( const struct option poption)
static

Returns the (translated) help text for this server option.

Definition at line 3077 of file options.cpp.

◆ server_option_int_def()

static int server_option_int_def ( const struct option poption)
static

Returns the default value of this server option of type OT_INTEGER.

Definition at line 3150 of file options.cpp.

◆ server_option_int_get()

static int server_option_int_get ( const struct option poption)
static

Returns the value of this server option of type OT_INTEGER.

Definition at line 3142 of file options.cpp.

◆ server_option_int_max()

static int server_option_int_max ( const struct option poption)
static

Returns the maximal value for this server option of type OT_INTEGER.

Definition at line 3166 of file options.cpp.

◆ server_option_int_min()

static int server_option_int_min ( const struct option poption)
static

Returns the minimal value for this server option of type OT_INTEGER.

Definition at line 3158 of file options.cpp.

◆ server_option_int_set()

static bool server_option_int_set ( struct option poption,
int  val 
)
static

Set the value of this server option of type OT_INTEGER.

Returns TRUE if the value changed.

Definition at line 3175 of file options.cpp.

◆ server_option_is_changeable()

static bool server_option_is_changeable ( const struct option poption)
static

Returns TRUE if this client option can be modified.

Definition at line 3093 of file options.cpp.

◆ server_option_name()

static const char * server_option_name ( const struct option poption)
static

Returns the name of this server option.

Definition at line 3061 of file options.cpp.

◆ server_option_next()

static struct option * server_option_next ( const struct option poption)
static

Returns the next valid (visible) option pointer.

Definition at line 3101 of file options.cpp.

◆ server_option_next_valid()

static struct server_option* server_option_next_valid ( struct server_option poption)
static

Returns the next valid option pointer for the current gui type.

Definition at line 3002 of file options.cpp.

Referenced by server_option_next(), and server_optset_option_first().

◆ server_option_number()

static int server_option_number ( const struct option poption)
static

Virtuals tables for the client options.

Returns the number of this server option.

Definition at line 3053 of file options.cpp.

◆ server_option_str_def()

static const char * server_option_str_def ( const struct option poption)
static

Returns the default value of this server option of type OT_STRING.

Definition at line 3199 of file options.cpp.

◆ server_option_str_get()

static const char * server_option_str_get ( const struct option poption)
static

Returns the value of this server option of type OT_STRING.

Definition at line 3191 of file options.cpp.

◆ server_option_str_set()

static bool server_option_str_set ( struct option poption,
const char *  str 
)
static

Set the value of this server option of type OT_STRING.

Returns TRUE if the value changed.

Definition at line 3219 of file options.cpp.

◆ server_option_str_values()

static const QVector< QString > * server_option_str_values ( const struct option poption)
static

Returns the possible string values of this server option of type OT_STRING.

Definition at line 3209 of file options.cpp.

◆ server_options_free()

void server_options_free ( )

Free the server options, if already received.

Definition at line 2619 of file options.cpp.

Referenced by client_game_free().

◆ server_options_init()

void server_options_init ( )

Initialize the server options (not received yet).

Definition at line 2566 of file options.cpp.

Referenced by client_game_init().

◆ server_optset_category_name()

const char * server_optset_category_name ( int  category)
static

Returns the name (translated) of the server option category.

Definition at line 3041 of file options.cpp.

◆ server_optset_category_number()

int server_optset_category_number ( )
static

Returns the number of server option categories.

Definition at line 3036 of file options.cpp.

◆ server_optset_option_by_number()

struct option * server_optset_option_by_number ( int  id)
static

Server option set.

Returns the server option associated to the number.

Definition at line 3017 of file options.cpp.

Referenced by handle_server_setting_bitwise(), handle_server_setting_bool(), handle_server_setting_const(), handle_server_setting_enum(), handle_server_setting_int(), and handle_server_setting_str().

◆ server_optset_option_first()

struct option * server_optset_option_first ( )
static

Returns the first valid (visible) option pointer.

Definition at line 3028 of file options.cpp.

◆ settable_option_upgrade_value()

static bool settable_option_upgrade_value ( const struct option poption,
int  old_value,
char *  buf,
size_t  buf_len 
)
static

Convert old integer to new values (Freeciv 2.2.x to Freeciv 2.3.x).

Very ugly hack. TODO: Remove this later.

Definition at line 4137 of file options.cpp.

Referenced by desired_settable_option_send().

◆ settable_options_load()

static void settable_options_load ( struct section_file sf)
static

Load the server options.

Definition at line 3966 of file options.cpp.

◆ settable_options_save()

static void settable_options_save ( struct section_file sf)
static

Save the desired server options.

Definition at line 4029 of file options.cpp.

Referenced by options_save().

◆ sound_volume_callback()

static void sound_volume_callback ( struct option poption)
static

Callback for changing music volume.

Definition at line 4761 of file options.cpp.

Referenced by init_client_options().

◆ tileset_name_for_topology()

const char* tileset_name_for_topology ( int  topology_id)

Option framework wrapper for mapimg_get_format_list()

What is the user defined tileset for the given topology

Definition at line 4864 of file options.cpp.

Referenced by handle_set_topology().

◆ tileset_options_load()

static void tileset_options_load ( struct section_file sf,
struct client_options options 
)
static

Load tileset options.

Every tileset has its own section called tileset_xxx. The options are saved as name=value pairs.

See also
tileset_options_save

Definition at line 3909 of file options.cpp.

◆ tileset_options_migrate_cimpletoon()

static void tileset_options_migrate_cimpletoon ( struct client_options options)
static

Migrate players using cimpletoon/toonhex to amplio2/hexemplio with the cimpletoon option enabled.

Since
3.1

Definition at line 3885 of file options.cpp.

◆ tileset_options_save()

static void tileset_options_save ( struct section_file sf,
const struct client_options options 
)
static

Save tileset options.

See also
tileset_options_load

Definition at line 3952 of file options.cpp.

Referenced by options_save().

◆ view_option_changed_callback()

static void view_option_changed_callback ( struct option poption)
static

Callback for when any view option is changed.

Definition at line 4735 of file options.cpp.

Referenced by init_client_options().

◆ voteinfo_bar_callback()

static void voteinfo_bar_callback ( struct option poption)
static

Callback for when any voteinfo bar option is changed.

Definition at line 4770 of file options.cpp.

Referenced by init_client_options().

Variable Documentation

◆ client_option_bool_vtable

const struct option_bool_vtable client_option_bool_vtable
static
Initial value:
= {
static bool client_option_bool_get(const struct option *poption)
Returns the value of this client option of type OT_BOOLEAN.
Definition: options.cpp:2030
static bool client_option_bool_def(const struct option *poption)
Returns the default value of this client option of type OT_BOOLEAN.
Definition: options.cpp:2038
static bool client_option_bool_set(struct option *poption, bool val)
Set the value of this client option of type OT_BOOLEAN.
Definition: options.cpp:2047

Definition at line 891 of file options.cpp.

◆ client_option_color_vtable

const struct option_color_vtable client_option_color_vtable
static
Initial value:
= {
static struct ft_color client_option_color_def(const struct option *poption)
Returns the default value of this client option of type OT_COLOR.
Definition: options.cpp:2250
static bool client_option_color_set(struct option *poption, struct ft_color color)
Set the value of this client option of type OT_COLOR.
Definition: options.cpp:2259
static struct ft_color client_option_color_get(const struct option *poption)
Returns the value of this client option of type OT_COLOR.
Definition: options.cpp:2242

Definition at line 940 of file options.cpp.

◆ client_option_common_vtable

const struct option_common_vtable client_option_common_vtable
static
Initial value:
= {
.description = client_option_description,
.is_changeable = client_option_is_changeable,
static const char * client_option_name(const struct option *poption)
Returns the name of this client option.
Definition: options.cpp:1981
static const char * client_option_description(const struct option *poption)
Returns the description of this client option.
Definition: options.cpp:1989
static struct option * client_option_next(const struct option *poption)
Returns the next valid option pointer for the current gui type.
Definition: options.cpp:2022
static bool client_option_is_changeable(const struct option *poption)
Returns TRUE if this client option can be modified.
Definition: options.cpp:2013
static const char * client_option_help_text(const struct option *poption)
Returns the help text for this client option.
Definition: options.cpp:1997
static int client_option_number(const struct option *poption)
Virtuals tables for the client options.
Definition: options.cpp:1973
client_option_category
Definition: options.cpp:948

Definition at line 878 of file options.cpp.

◆ client_option_font_vtable

const struct option_font_vtable client_option_font_vtable
static
Initial value:
= {
static QFont client_option_font_get(const struct option *poption)
Returns the value of this client option of type OT_FONT.
Definition: options.cpp:2193
static QFont client_option_font_def(const struct option *poption)
Returns the default value of this client option of type OT_FONT.
Definition: options.cpp:2201
static bool client_option_font_set(struct option *poption, const QFont &font)
Set the value of this client option of type OT_FONT.
Definition: options.cpp:2227
static void client_option_font_set_def(const struct option *poption, const QFont &font)
Returns the default value of this client option of type OT_FONT.
Definition: options.cpp:2209
static QString client_option_font_target(const struct option *poption)
Returns the default value of this client option of type OT_FONT.
Definition: options.cpp:2218

Definition at line 928 of file options.cpp.

◆ client_option_int_vtable

const struct option_int_vtable client_option_int_vtable
static
Initial value:
= {
static int client_option_int_min(const struct option *poption)
Returns the minimal value for this client option of type OT_INTEGER.
Definition: options.cpp:2078
static int client_option_int_get(const struct option *poption)
Returns the value of this client option of type OT_INTEGER.
Definition: options.cpp:2062
static int client_option_int_def(const struct option *poption)
Returns the default value of this client option of type OT_INTEGER.
Definition: options.cpp:2070
static int client_option_int_max(const struct option *poption)
Returns the maximal value for this client option of type OT_INTEGER.
Definition: options.cpp:2086
static bool client_option_int_set(struct option *poption, int val)
Set the value of this client option of type OT_INTEGER.
Definition: options.cpp:2095

Definition at line 902 of file options.cpp.

◆ client_option_str_vtable

const struct option_str_vtable client_option_str_vtable
static
Initial value:
= {
static const QVector< QString > * client_option_str_values(const struct option *poption)
Returns the possible string values of this client option of type OT_STRING.
Definition: options.cpp:2129
static const char * client_option_str_def(const struct option *poption)
Returns the default value of this client option of type OT_STRING.
Definition: options.cpp:2119
static const char * client_option_str_get(const struct option *poption)
Returns the value of this client option of type OT_STRING.
Definition: options.cpp:2111
static bool client_option_str_set(struct option *poption, const char *str)
Set the value of this client option of type OT_STRING.
Definition: options.cpp:2140

Definition at line 915 of file options.cpp.

◆ client_options

std::vector<client_option> client_options
static

Definition at line 1289 of file options.cpp.

◆ client_optset

◆ client_optset_static

struct option_set client_optset_static
static
Initial value:
= {
.option_by_number = client_optset_option_by_number,
.option_first = client_optset_option_first,
.category_number = client_optset_category_number,
.category_name = client_optset_category_name}
static const char * client_optset_category_name(int category)
Returns the name (translated) of the option class.
Definition: options.cpp:1943
static int client_optset_category_number()
Returns the number of client option categories.
Definition: options.cpp:1938
static struct option * client_optset_option_by_number(int id)
Client option set.
Definition: options.cpp:1919
static struct option * client_optset_option_first()
Returns the first valid option pointer for the current gui type.
Definition: options.cpp:1930

Definition at line 853 of file options.cpp.

◆ gui_options

client_options* gui_options = nullptr

Definition at line 74 of file options.cpp.

Referenced by animate_unit_explosion(), append_city_buycost_string(), audio_play_sound(), audio_select_plugin(), auto_center_on_focus_unit(), calculate_overview_dimensions(), map_view::center_on_tile(), chat_widget::chat_widget(), city_widget::city_view(), client_exit(), client_main(), client_state(), connect_to_server(), control_mouse_cursor(), cr_entry_building(), citybar_painter::current(), current_focus_append(), fc_client::current_page(), decrease_unit_hp_smooth(), disconnect_from_server(), freeciv::layer::do_draw_unit(), do_map_click(), do_move_unit(), draw_calculated_trade_routes(), draw_reqtree(), draw_trade_routes(), minimap_view::draw_viewport(), enter_goto_state(), fc_client::fc_client(), freeciv::layer_water::fill_irrigation_sprite_array(), freeciv::layer_background::fill_sprite_array(), freeciv::layer_city::fill_sprite_array(), freeciv::layer_city_size::fill_sprite_array(), freeciv::layer_fog::fill_sprite_array(), freeciv::layer_grid::fill_sprite_array(), freeciv::layer_overlays::fill_sprite_array(), freeciv::layer_units::fill_sprite_array(), find_visible_unit(), game_music_enable_callback(), get_city_dialog_production(), get_turn_done_button_state(), get_unit_nation_flag_sprite(), get_useable_themes_in_directory(), fcFont::getFont(), gui_to_overview_pos(), gui_update_allfonts(), handle_city_info(), handle_city_name_suggestion_info(), handle_city_short_info(), handle_event(), handle_new_year(), handle_player_info(), handle_ruleset_control(), handle_start_phase(), handle_traderoute_info(), handle_unit_actions(), handle_unit_bombard_info(), handle_unit_combat_info(), handle_unit_packet_common(), minimap_view::heightForWidth(), is_extra_drawing_enabled(), manual_turn_done_callback(), mapimg_client_define(), menu_music_enable_callback(), meswin_clear_older(), meswin_popup_city(), minimap_view::mousePressEvent(), move_unit_map_canvas(), music_finished_callback(), node_rectangle_minimum_size(), options_free(), options_init(), options_save(), overview_free(), overview_tile_color(), overview_to_map_pos(), overview_update_tile(), page_load::page_load(), simple_citybar_painter::paint(), traditional_citybar_painter::paint(), polished_citybar_painter::paint(), minimap_view::paint(), put_one_element(), put_overview_tile_area(), real_timer_callback(), redraw_overview(), request_move_unit_direction(), request_toggle_city_buycost(), request_toggle_city_growth(), request_toggle_city_names(), request_toggle_city_outlines(), request_toggle_city_output(), request_toggle_city_productions(), request_toggle_city_trade_routes(), request_toggle_map_borders(), request_toggle_map_grid(), request_toggle_map_native(), request_units_return(), chat_listener::send_chat_message(), map_view::set_scale(), mr_menu::setup_menus(), minimap_panel::setup_minimap_menu(), map_view::shortcut_pressed(), should_ask_server_for_actions(), minimap_view::sizeHint(), mr_menu::slot_fullscreen(), mr_menu::slot_set_citybar(), freeciv::layer::solid_background(), sound_volume_callback(), start_menu_music(), start_style_music(), page_load::state_preview(), tileset_name_for_topology(), tileset_set_option(), tileset_setup_options(), ui_main(), unit_drawn_with_city_outline(), unit_focus_advance(), freeciv::map_updates_handler::update(), page_load::update_load_page(), voteinfo_queue_add(), and mr_menu::zoom_scale_fonts().

◆ messages_where

int messages_where[E_COUNT]

Message Options:

Definition at line 3383 of file options.cpp.

Referenced by message_dlg::apply_changes(), message_dlg::fill_data(), and handle_event().

◆ options_fully_initialized

bool options_fully_initialized = false
static

Definition at line 78 of file options.cpp.

Referenced by option_changed().

◆ server_option_bitwise_vtable

const struct option_bitwise_vtable server_option_bitwise_vtable
static
Initial value:
= {
static unsigned server_option_bitwise_def(const struct option *poption)
Returns the default value of this server option of type OT_BITWISE.
Definition: options.cpp:3306
static unsigned server_option_bitwise_get(const struct option *poption)
Returns the current value of this server option of type OT_BITWISE.
Definition: options.cpp:3298
static const QVector< QString > * server_option_bitwise_pretty(const struct option *poption)
Returns the user-visible, translatable (but untranslated) "pretty" names of this server option of typ...
Definition: options.cpp:3316
static bool server_option_bitwise_set(struct option *poption, unsigned val)
Set the value of this server option of type OT_BITWISE.
Definition: options.cpp:3345

Definition at line 2503 of file options.cpp.

Referenced by handle_server_setting_bitwise().

◆ server_option_bool_vtable

const struct option_bool_vtable server_option_bool_vtable
static
Initial value:
= {
static bool server_option_bool_get(const struct option *poption)
Returns the value of this server option of type OT_BOOLEAN.
Definition: options.cpp:3109
static bool server_option_bool_set(struct option *poption, bool val)
Set the value of this server option of type OT_BOOLEAN.
Definition: options.cpp:3126
static bool server_option_bool_def(const struct option *poption)
Returns the default value of this server option of type OT_BOOLEAN.
Definition: options.cpp:3117

Definition at line 2454 of file options.cpp.

Referenced by handle_server_setting_bool().

◆ server_option_common_vtable

const struct option_common_vtable server_option_common_vtable
static
Initial value:
= {
.description = server_option_description,
.is_changeable = server_option_is_changeable,
static const char * server_option_name(const struct option *poption)
Returns the name of this server option.
Definition: options.cpp:3061
static const char * server_option_description(const struct option *poption)
Returns the (translated) description of this server option.
Definition: options.cpp:3069
static struct option * server_option_next(const struct option *poption)
Returns the next valid (visible) option pointer.
Definition: options.cpp:3101
static int server_option_category(const struct option *poption)
Returns the category of this server option.
Definition: options.cpp:3085
static int server_option_number(const struct option *poption)
Virtuals tables for the client options.
Definition: options.cpp:3053
static const char * server_option_help_text(const struct option *poption)
Returns the (translated) help text for this server option.
Definition: options.cpp:3077
static bool server_option_is_changeable(const struct option *poption)
Returns TRUE if this client option can be modified.
Definition: options.cpp:3093

Definition at line 2441 of file options.cpp.

Referenced by handle_server_setting_bitwise(), handle_server_setting_bool(), handle_server_setting_enum(), handle_server_setting_int(), and handle_server_setting_str().

◆ server_option_enum_vtable

const struct option_enum_vtable server_option_enum_vtable
static
Initial value:
= {
.cmp = strcmp}
static const QVector< QString > * server_option_enum_pretty(const struct option *poption)
Returns the user-visible, translatable (but untranslated) "pretty" names of this server option of typ...
Definition: options.cpp:3252
static int server_option_enum_def(const struct option *poption)
Returns the default value of this server option of type OT_ENUM.
Definition: options.cpp:3242
static bool server_option_enum_set(struct option *poption, int val)
Set the value of this server option of type OT_ENUM.
Definition: options.cpp:3261
static int server_option_enum_get(const struct option *poption)
Returns the current value of this server option of type OT_ENUM.
Definition: options.cpp:3234

Definition at line 2490 of file options.cpp.

Referenced by handle_server_setting_enum().

◆ server_option_int_vtable

const struct option_int_vtable server_option_int_vtable
static
Initial value:
= {
static int server_option_int_max(const struct option *poption)
Returns the maximal value for this server option of type OT_INTEGER.
Definition: options.cpp:3166
static int server_option_int_min(const struct option *poption)
Returns the minimal value for this server option of type OT_INTEGER.
Definition: options.cpp:3158
static int server_option_int_def(const struct option *poption)
Returns the default value of this server option of type OT_INTEGER.
Definition: options.cpp:3150
static bool server_option_int_set(struct option *poption, int val)
Set the value of this server option of type OT_INTEGER.
Definition: options.cpp:3175
static int server_option_int_get(const struct option *poption)
Returns the value of this server option of type OT_INTEGER.
Definition: options.cpp:3142

Definition at line 2465 of file options.cpp.

Referenced by handle_server_setting_int().

◆ server_option_str_vtable

const struct option_str_vtable server_option_str_vtable
static
Initial value:
= {
static bool server_option_str_set(struct option *poption, const char *str)
Set the value of this server option of type OT_STRING.
Definition: options.cpp:3219
static const QVector< QString > * server_option_str_values(const struct option *poption)
Returns the possible string values of this server option of type OT_STRING.
Definition: options.cpp:3209
static const char * server_option_str_get(const struct option *poption)
Returns the value of this server option of type OT_STRING.
Definition: options.cpp:3191
static const char * server_option_str_def(const struct option *poption)
Returns the default value of this server option of type OT_STRING.
Definition: options.cpp:3199

Definition at line 2478 of file options.cpp.

Referenced by handle_server_setting_str().

◆ server_options

◆ server_options_categories

char** server_options_categories = nullptr
static

Server options variables.

Definition at line 2411 of file options.cpp.

Referenced by handle_server_setting_control(), server_options_free(), server_options_init(), and server_optset_category_name().

◆ server_options_categories_num

int server_options_categories_num = 0
static

◆ server_options_num

int server_options_num = 0
static

◆ server_optset

◆ server_optset_static

struct option_set server_optset_static
static
Initial value:
= {
.option_by_number = server_optset_option_by_number,
.option_first = server_optset_option_first,
.category_number = server_optset_category_number,
.category_name = server_optset_category_name}
static const char * server_optset_category_name(int category)
Returns the name (translated) of the server option category.
Definition: options.cpp:3041
static struct option * server_optset_option_first()
Returns the first valid (visible) option pointer.
Definition: options.cpp:3028
static struct option * server_optset_option_by_number(int id)
Server option set.
Definition: options.cpp:3017
static int server_optset_category_number()
Returns the number of server option categories.
Definition: options.cpp:3036

Definition at line 2423 of file options.cpp.

◆ TILESET_OPTIONS_PREFIX

const char* const TILESET_OPTIONS_PREFIX = "tileset_"

Definition at line 69 of file options.cpp.