Sayonara Player
GUI_StyleSettings.h
1 /* GUI_StyleSettings.h */
2 
3 /* Copyright (C) 2011-2016 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 
23 #ifndef STYLESETTINGS_H
24 #define STYLESETTINGS_H
25 
26 #include "StyleTypes.h"
27 
28 #include "GUI/PlayerPlugins/Engine/ui_GUI_Style.h"
29 #include "GUI/Helper/SayonaraWidget/SayonaraDialog.h"
30 
31 
32 #include <QList>
33 #include <QCloseEvent>
34 
35 class DatabaseConnector;
37 {
38  Q_OBJECT
39 public:
40  explicit GUI_StyleSettings(QWidget *parent=nullptr);
41 
42 signals:
43  void sig_style_update();
44 
45 public slots:
46  void show(int);
47 
48 
49 private slots:
50  void combo_styles_changed(int);
51  void combo_text_changed(const QString&);
52  void col1_activated();
53  void col2_activated();
54  void col3_activated();
55  void col4_activated();
56  void save_pressed();
57  void del_pressed();
58  void undo_pressed();
59  void spin_box_changed(int);
60  void col_changed();
61 
62 
63 private:
64  DatabaseConnector* _db=nullptr;
65 
66  QList<RawColorStyle> _styles;
67  QList<RawColorStyle> _styles_old;
68 
69  RawColorStyle _cur_style;
70  QColor _colors[4];
71 
72  QString _cur_text;
73  int _cur_idx;
74  bool _sth_changed;
75 
76 
77  void init();
78 
79  void connect_spinbox(const QSpinBox* box);
80  void disconnect_spinbox(const QSpinBox* box);
81  void connect_spinboxes();
82  void disconnect_spinboxes();
83  void set_sth_changed(bool b);
84 
85 protected:
86  void closeEvent(QCloseEvent *);
87  virtual void language_changed();
88 
89  void connect_combo_idx_changed();
90  void disconnect_combo_idx_changed();
91 };
92 
93 #endif // STYLESETTINGS_H
Definition: StyleTypes.h:51
Definition: DatabaseConnector.h:40
Definition: GUI_StyleSettings.h:36
Dialog with Settings connection. Also contains triggers for language_changed() and skin_changed()...
Definition: SayonaraDialog.h:38
Definition: ui_GUI_Style.h:458