Freeciv-3.2
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes
option_dialog Struct Reference

#include <optiondlg.h>

+ Inheritance diagram for option_dialog:

Public Member Functions

 option_dialog (const QString &name, const option_set *options, bool client_set, QWidget *parent=nullptr)
 
 ~option_dialog ()
 
void fill (const struct option_set *poptset)
 
void add_option (struct option *poption)
 
void option_dialog_refresh (struct option *poption)
 
void option_dialog_reset (struct option *poption)
 
void full_refresh ()
 
void apply_options ()
 
- Public Member Functions inherited from qfc_dialog
 qfc_dialog (QWidget *parent)
 
void reactivate ()
 

Data Fields

const struct option_setpoptset
 
GtkWidgetshell
 
GtkWidgetnotebook
 
GtkWidget ** vboxes
 
intbox_children
 
struct widgetend_widget_list
 
struct widgetcore_widget_list
 
struct widgetmain_widget_list
 
struct widgetbegin_widget_list
 
struct advanced_dialogadvanced
 
enum option_dialog_mode mode
 
union { 
 
   struct option_dialog_optset   optset 
 
   struct option_dialog_worklist   worklist 
 
};  
 
union { 
 
   struct option_dialog_optset   optset 
 
   struct option_dialog_worklist   worklist 
 
};  
 

Protected Member Functions

void showEvent (QShowEvent *event)
 
void hideEvent (QHideEvent *event)
 
void closeEvent (QCloseEvent *event)
 
- Protected Member Functions inherited from qfc_dialog
void paintEvent (QPaintEvent *event)
 
void mouseMoveEvent (QMouseEvent *event)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 

Private Slots

void apply_option (int response)
 
void select_color ()
 
void select_font ()
 

Private Member Functions

void set_bool (struct option *poption, bool value)
 
void set_int (struct option *poption, int value)
 
void set_string (struct option *poption, const char *string)
 
void set_enum (struct option *poption, int index)
 
void set_bitwise (struct option *poption, unsigned value)
 
void set_color (struct option *poption, struct ft_color color)
 
void set_button_color (QPushButton *button, const char *colorname)
 
void set_font (struct option *poption, QString s)
 
void get_color (struct option *poption, QByteArray &a1, QByteArray &a2)
 
bool get_bool (struct option *poption)
 
int get_int (struct option *poption)
 
QFont get_font (struct option *poption)
 
QByteArray get_button_font (struct option *poption)
 
QByteArray get_string (struct option *poption)
 
int get_enum (struct option *poption)
 
unsigned get_bitwise (struct option *poption)
 
void full_reset ()
 

Private Attributes

QVBoxLayoutmain_layout
 
QTabWidget * tab_widget
 
QDialogButtonBoxbutton_box
 
QList< QStringcategories
 
QMap< QString, QWidget * > widget_map
 
bool client_settings
 
const option_setcurr_options
 

Detailed Description

Definition at line 41 of file optiondlg.c.

Constructor & Destructor Documentation

◆ option_dialog()

option_dialog::option_dialog ( const QString name,
const option_set options,
bool  client_set,
QWidget *  parent = nullptr 
)

Constructor for options dialog.

Definition at line 127 of file optiondlg.cpp.

◆ ~option_dialog()

option_dialog::~option_dialog ( )

Destructor for options dialog.

Definition at line 193 of file optiondlg.cpp.

Member Function Documentation

◆ add_option()

void option_dialog::add_option ( struct option poption)

Create widget for option.

Definition at line 604 of file optiondlg.cpp.

Referenced by fill().

◆ apply_option

void option_dialog::apply_option ( int  response)
privateslot

Apply desired action depending on user's request (clicked button).

Definition at line 204 of file optiondlg.cpp.

Referenced by option_dialog().

◆ apply_options()

void option_dialog::apply_options ( )

Apply all options.

Definition at line 257 of file optiondlg.cpp.

Referenced by apply_option().

◆ closeEvent()

void option_dialog::closeEvent ( QCloseEvent event)
protected

Close event for options dialog

Definition at line 894 of file optiondlg.cpp.

◆ fill()

void option_dialog::fill ( const struct option_set poptset)

Create all widgets.

Definition at line 594 of file optiondlg.cpp.

Referenced by option_dialog().

◆ full_refresh()

void option_dialog::full_refresh ( )

Refresh all options.

Definition at line 540 of file optiondlg.cpp.

Referenced by apply_option().

◆ full_reset()

void option_dialog::full_reset ( )
private

Reset all options.

Definition at line 550 of file optiondlg.cpp.

Referenced by apply_option().

◆ get_bitwise()

unsigned int option_dialog::get_bitwise ( struct option poption)
private

Return the enum value from groupbox.

Definition at line 453 of file optiondlg.cpp.

Referenced by apply_options().

◆ get_bool()

bool option_dialog::get_bool ( struct option poption)
private

Get the boolean value from checkbox.

Definition at line 313 of file optiondlg.cpp.

Referenced by apply_options().

◆ get_button_font()

QByteArray option_dialog::get_button_font ( struct option poption)
private

Get font from pushbutton.

Definition at line 829 of file optiondlg.cpp.

Referenced by apply_options().

◆ get_color()

void option_dialog::get_color ( struct option poption,
QByteArray a1,
QByteArray a2 
)
private

Return selected colors

Definition at line 235 of file optiondlg.cpp.

Referenced by apply_options().

◆ get_enum()

int option_dialog::get_enum ( struct option poption)
private

Get indexed value from combobox.

Definition at line 421 of file optiondlg.cpp.

Referenced by apply_options().

◆ get_font()

QFont option_dialog::get_font ( struct option poption)
private

Get font from option.

Definition at line 816 of file optiondlg.cpp.

Referenced by add_option().

◆ get_int()

int option_dialog::get_int ( struct option poption)
private

Get int value from spinbox.

Definition at line 361 of file optiondlg.cpp.

Referenced by apply_options().

◆ get_string()

QByteArray option_dialog::get_string ( struct option poption)
private

Get string for desired option from combobox or lineedit.

Definition at line 393 of file optiondlg.cpp.

Referenced by apply_options().

◆ hideEvent()

void option_dialog::hideEvent ( QHideEvent event)
protected

Hide event for options dialog

Definition at line 882 of file optiondlg.cpp.

◆ option_dialog_refresh()

void option_dialog::option_dialog_refresh ( struct option poption)

Refresh one given option for option dialog.

Definition at line 506 of file optiondlg.cpp.

Referenced by add_option(), full_refresh(), and option_gui_update().

◆ option_dialog_reset()

void option_dialog::option_dialog_reset ( struct option poption)

Reset one option.

Definition at line 560 of file optiondlg.cpp.

Referenced by full_reset().

◆ select_color

void option_dialog::select_color ( )
privateslot

Ask user for the color option value

Definition at line 842 of file optiondlg.cpp.

Referenced by add_option().

◆ select_font

void option_dialog::select_font ( )
privateslot

Ask user for the font option value

Definition at line 796 of file optiondlg.cpp.

Referenced by add_option().

◆ set_bitwise()

void option_dialog::set_bitwise ( struct option poption,
unsigned  value 
)
private

Set the enum value of the option.

Definition at line 432 of file optiondlg.cpp.

Referenced by option_dialog_refresh(), and option_dialog_reset().

◆ set_bool()

void option_dialog::set_bool ( struct option poption,
bool  value 
)
private

Set the boolean value of the option.

Definition at line 298 of file optiondlg.cpp.

Referenced by option_dialog_refresh(), and option_dialog_reset().

◆ set_button_color()

void option_dialog::set_button_color ( QPushButton *  button,
const char colorname 
)
private

Update color button stylesheet to show new color

Definition at line 474 of file optiondlg.cpp.

Referenced by select_color(), and set_color().

◆ set_color()

void option_dialog::set_color ( struct option poption,
struct ft_color  color 
)
private

Set color of the buttons depending on given colors.

Definition at line 490 of file optiondlg.cpp.

Referenced by option_dialog_refresh(), and option_dialog_reset().

◆ set_enum()

void option_dialog::set_enum ( struct option poption,
int  index 
)
private

Set desired index(text) in combobox.

Definition at line 410 of file optiondlg.cpp.

Referenced by option_dialog_refresh(), and option_dialog_reset().

◆ set_font()

void option_dialog::set_font ( struct option poption,
QString  s 
)
private

Sets desired font name in button text and sets global font for that option That function is not executed when user changes font, but when applying or resetting options.

Definition at line 341 of file optiondlg.cpp.

Referenced by option_dialog_refresh(), and option_dialog_reset().

◆ set_int()

void option_dialog::set_int ( struct option poption,
int  value 
)
private

Set the integer value of the option.

Definition at line 328 of file optiondlg.cpp.

Referenced by option_dialog_refresh(), and option_dialog_reset().

◆ set_string()

void option_dialog::set_string ( struct option poption,
const char string 
)
private

Set the string value of the option.

Definition at line 372 of file optiondlg.cpp.

Referenced by option_dialog_refresh(), and option_dialog_reset().

◆ showEvent()

void option_dialog::showEvent ( QShowEvent event)
protected

Show event for options dialog

Definition at line 866 of file optiondlg.cpp.

Field Documentation

◆ [union]

union { ... } option_dialog

◆ [union]

union { ... } option_dialog

◆ advanced

struct advanced_dialog * option_dialog::advanced

◆ begin_widget_list

struct widget * option_dialog::begin_widget_list

◆ box_children

int * option_dialog::box_children

◆ button_box

QDialogButtonBox* option_dialog::button_box
private

Definition at line 49 of file optiondlg.h.

Referenced by option_dialog().

◆ categories

QList<QString> option_dialog::categories
private

Definition at line 50 of file optiondlg.h.

Referenced by add_option(), and option_dialog().

◆ client_settings

bool option_dialog::client_settings
private

Definition at line 65 of file optiondlg.h.

Referenced by closeEvent(), hideEvent(), and showEvent().

◆ core_widget_list

struct widget * option_dialog::core_widget_list

◆ curr_options

const option_set* option_dialog::curr_options
private

◆ end_widget_list

struct widget * option_dialog::end_widget_list

◆ main_layout

QVBoxLayout* option_dialog::main_layout
private

Definition at line 47 of file optiondlg.h.

Referenced by option_dialog().

◆ main_widget_list

struct widget * option_dialog::main_widget_list

◆ mode

enum option_dialog_mode option_dialog::mode

◆ notebook

GtkWidget * option_dialog::notebook

◆ optset

struct option_dialog_optset option_dialog::optset

◆ poptset

const struct option_set * option_dialog::poptset

◆ shell

GtkWidget * option_dialog::shell

◆ tab_widget

QTabWidget* option_dialog::tab_widget
private

Definition at line 48 of file optiondlg.h.

Referenced by add_option(), and option_dialog().

◆ vboxes

GtkWidget ** option_dialog::vboxes

◆ widget_map

QMap<QString, QWidget *> option_dialog::widget_map
private

Definition at line 51 of file optiondlg.h.

Referenced by add_option().

◆ worklist

struct option_dialog_worklist option_dialog::worklist