Sayonara Player
GUI_StyleSettings.h
1 /* GUI_StyleSettings.h */
2 
3 /* Copyright (C) 2011-2017 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 #ifndef STYLESETTINGS_H
22 #define STYLESETTINGS_H
23 
24 #include "StyleTypes.h"
25 
26 #include "GUI/Plugins/Engine/ui_GUI_Style.h"
27 #include "GUI/Helper/SayonaraWidget/SayonaraDialog.h"
28 
29 #include <QList>
30 
31 class DatabaseConnector;
33 {
34  Q_OBJECT
35 public:
36  explicit GUI_StyleSettings(QWidget *parent=nullptr);
37  virtual ~GUI_StyleSettings();
38 
39 signals:
40  void sig_style_update();
41 
42 public slots:
43  void show(int);
44 
45 
46 private slots:
47  void combo_styles_changed(int);
48  void combo_text_changed(const QString&);
49  void col1_activated();
50  void col2_activated();
51  void col3_activated();
52  void col4_activated();
53  void save_pressed();
54  void del_pressed();
55  void undo_pressed();
56  void spin_box_changed(int);
57  void col_changed();
58 
59 
60 private:
61  DatabaseConnector* _db=nullptr;
62 
63  QList<RawColorStyle> _styles;
64  QList<RawColorStyle> _styles_old;
65 
66  RawColorStyle _cur_style;
67  QColor _colors[4];
68 
69  QString _cur_text;
70  int _cur_idx;
71  bool _sth_changed;
72 
73 
74  void init();
75 
76  void connect_spinbox(const QSpinBox* box);
77  void disconnect_spinbox(const QSpinBox* box);
78  void connect_spinboxes();
79  void disconnect_spinboxes();
80  void set_sth_changed(bool b);
81 
82 protected:
83  void closeEvent(QCloseEvent *);
84  virtual void language_changed();
85 
86  void connect_combo_idx_changed();
87  void disconnect_combo_idx_changed();
88 };
89 
90 #endif // STYLESETTINGS_H
Definition: StyleTypes.h:51
Definition: DatabaseConnector.h:38
Definition: GUI_StyleSettings.h:32
Dialog with Settings connection. Also contains triggers for language_changed() and skin_changed()...
Definition: SayonaraDialog.h:33
Definition: ui_GUI_Style.h:458