Freeciv-3.2
Loading...
Searching...
No Matches
optiondlg.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifndef FC__OPTIONDLG_H
15#define FC__OPTIONDLG_H
16
17extern "C" {
18#include "optiondlg_g.h"
19}
20
21// Qt
22#include <QDialog>
23#include <QMap>
24
25// qt-client
26#include "dialogs.h"
27
28class Qdialog;
29class QVBoxLayout;
30class QTabWidget;
32class QWidget;
33class QString;
34
35QString split_text(QString text, bool cut);
37
38void option_dialog_popup(QString name, const struct option_set *poptset,
39 bool client);
40
41/****************************************************************************
42 Dialog for client/server options
43****************************************************************************/
44class option_dialog : public qfc_dialog
45{
48 QTabWidget *tab_widget;
52
53public:
54 option_dialog(const QString &name, const option_set *options, bool client_set,
55 QWidget *parent = nullptr);
57 void fill(const struct option_set *poptset);
58 void add_option(struct option *poption);
61 void full_refresh();
62 void apply_options();
63
64private:
65 bool client_settings; // As opposed to server ones
67 void set_bool(struct option *poption, bool value);
68 void set_int(struct option *poption, int value);
69 void set_string(struct option *poption, const char *string);
70 void set_enum(struct option *poption, int index);
71 void set_bitwise(struct option *poption, unsigned value);
72 void set_color(struct option *poption, struct ft_color color);
73 void set_button_color(QPushButton *button, const char *colorname);
74 void set_font(struct option *poption, QString s);
76 bool get_bool(struct option *poption);
77 int get_int(struct option *poption);
81 int get_enum(struct option *poption);
82 unsigned get_bitwise(struct option *poption);
83 void full_reset();
84
85protected:
89
90private slots:
91 void apply_option(int response);
92 void select_color();
93 void select_font();
94};
95
96#endif // FC__OPTIONDLG_H
struct civclient client
char * incite_cost
Definition comments.c:75
enum event_type event
Definition events.c:81
void option_dialog_popup(const char *name, const struct option_set *poptset)
Definition optiondlg.c:972
QString split_text(QString text, bool cut)
Definition optiondlg.cpp:62
QString cut_helptext(QString text)
const char * name
Definition inputfile.c:127
struct player_slot * slots
Definition player.c:51
Definition colors.h:21
unsigned get_bitwise(struct option *poption)
const option_set * curr_options
Definition optiondlg.h:66
void select_color()
void hideEvent(QHideEvent *event)
QTabWidget * tab_widget
Definition optiondlg.h:48
QMap< QString, QWidget * > widget_map
Definition optiondlg.h:51
QByteArray get_button_font(struct option *poption)
void get_color(struct option *poption, QByteArray &a1, QByteArray &a2)
bool get_bool(struct option *poption)
QDialogButtonBox * button_box
Definition optiondlg.h:49
void set_string(struct option *poption, const char *string)
void set_int(struct option *poption, int value)
void full_reset()
QList< QString > categories
Definition optiondlg.h:50
void showEvent(QShowEvent *event)
QByteArray get_string(struct option *poption)
int get_enum(struct option *poption)
void select_font()
void add_option(struct option *poption)
void set_bool(struct option *poption, bool value)
void set_enum(struct option *poption, int index)
void apply_option(int response)
void closeEvent(QCloseEvent *event)
QVBoxLayout * main_layout
Definition optiondlg.h:47
void apply_options()
void full_refresh()
void set_font(struct option *poption, QString s)
QFont get_font(struct option *poption)
const struct option_set * poptset
Definition optiondlg.c:42
void option_dialog_reset(struct option *poption)
void set_color(struct option *poption, struct ft_color color)
void fill(const struct option_set *poptset)
void option_dialog_refresh(struct option *poption)
int get_int(struct option *poption)
void set_button_color(QPushButton *button, const char *colorname)
void set_bitwise(struct option *poption, unsigned value)
bool client_settings
Definition optiondlg.h:65