Freeciv21
Develop your civilization from humble roots to a global empire
ratesdlg.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  part of Freeciv21. Freeciv21 is free software: you can redistribute it
4  and/or modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation, either version 3 of the
6  License, or (at your option) any later version. You should have received
7  a copy of the GNU General Public License along with Freeciv21. If not,
8  see https://www.gnu.org/licenses/.
9 **************************************************************************/
10 #pragma once
11 
12 // Qt
13 #include <QDialog>
14 #include <QList>
15 // client
16 #include "dialogs.h"
17 #include "widgets/multi_slider.h"
18 
19 class QMouseEvent;
20 class QObject;
21 class QPaintEvent;
22 class QPushButton;
23 class QSize;
24 class QSlider;
25 
26 /**************************************************************************
27  * Dialog used to change national budget
28  */
30  Q_OBJECT
31 
32 public:
33  national_budget_dialog(QWidget *parent = 0);
34 
35  void refresh();
36 
37 private:
39  bool slider_init = false;
40  QLabel *m_info;
41 
42  void apply();
43 };
44 
45 /**************************************************************************
46  * Dialog used to change policies
47  */
48 class multipler_rates_dialog : public QDialog {
49  Q_OBJECT
50 
51 public:
52  explicit multipler_rates_dialog(QWidget *parent = 0);
53 
54 private:
55  QList<QSlider *> slider_list;
56  QPushButton *cancel_button;
57  QPushButton *ok_button;
58 private slots:
59  void slot_set_value(int i);
62 };
63 
A widget that lets the user distribute a fixed number of items across multiple categories.
Definition: multi_slider.h:13
void slot_cancel_button_pressed()
Cancel pressed.
Definition: ratesdlg.cpp:204
QPushButton * ok_button
Definition: ratesdlg.h:57
void slot_set_value(int i)
Slider value changed.
Definition: ratesdlg.cpp:188
QList< QSlider * > slider_list
Definition: ratesdlg.h:55
void slot_ok_button_pressed()
Ok pressed - send mulipliers value.
Definition: ratesdlg.cpp:213
QPushButton * cancel_button
Definition: ratesdlg.h:56
multipler_rates_dialog(QWidget *parent=0)
Multipler rates dialog constructor Inheriting from qfc_dialog will cause crash in Qt5....
Definition: ratesdlg.cpp:134
void refresh()
Refreshes tax rate data.
Definition: ratesdlg.cpp:87
void apply()
Send info to the server.
Definition: ratesdlg.cpp:121
freeciv::multi_slider * slider
Definition: ratesdlg.h:38
national_budget_dialog(QWidget *parent=0)
Dialog constructor for changing rates with sliders.
Definition: ratesdlg.cpp:40
void popup_multiplier_dialog()
Popups multiplier dialog.
Definition: ratesdlg.cpp:261