Sayonara Player
GUI_TagEdit.h
1 /* GUI_TagEdit.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 GUI_TAGEDIT_H_
22 #define GUI_TAGEDIT_H_
23 
24 #include <QLineEdit>
25 #include <QString>
26 
27 #include "GUI/Helper/SayonaraWidget/SayonaraWidget.h"
28 #include "Components/TagEdit/TagExpression.h"
29 #include "Helper/Pimpl.h"
30 
35 class TagEdit;
36 class MetaDataList;
37 class MetaData;
38 
39 namespace Ui
40 {
41  class GUI_TagEdit;
42 }
43 
44 class GUI_TagEdit :
45  public SayonaraWidget
46 {
47  Q_OBJECT
48 
49 public:
50  explicit GUI_TagEdit(QWidget* parent=nullptr);
51  ~GUI_TagEdit();
52 
57  TagEdit* get_tag_edit() const;
58 
62  void commit();
63 
67  void cancel();
68 
69  void show_close_button(bool show);
70 
71 
72 signals:
73  void sig_ok_clicked(const MetaDataList&);
74  void sig_undo_clicked(int idx);
75  void sig_undo_all_clicked();
76  void sig_cancelled();
77 
78 private:
79  PIMPL(GUI_TagEdit)
80  Ui::GUI_TagEdit* ui=nullptr;
81 
82 private:
83  bool is_cover_replacement_active() const;
84  void update_cover(int idx, const QString& cover_path);
85  void set_cover(const MetaData& md);
86  void show_replacement_field(bool b);
87  void init_completer();
88 
89 
96  bool replace_selected_tag_text(Tag t, bool activate);
97 
98 
103  void apply_tag(int idx);
104 
105 
109  void track_idx_changed();
110 
111 
115  void reset();
116 
117 
122  void write_changes(int idx);
123 
124 
130  bool check_idx(int idx) const;
131 
132 
133 private slots:
137  void next_button_clicked();
138 
139 
143  void prev_button_clicked();
144 
145 
149  void apply_tag_clicked();
150  void apply_tag_all_clicked();
151 
152 
156  void album_all_changed(bool b);
157 
158 
162  void artist_all_changed(bool b);
163 
168  void album_artist_all_changed(bool b);
169 
170 
174  void genre_all_changed(bool b);
175 
176 
180  void year_all_changed(bool b);
181 
182 
186  void discnumber_all_changed(bool b);
187 
188 
192  void rating_all_changed(bool b);
193 
197  void cover_all_changed(bool b);
198 
199 
204  void btn_title_checked(bool b);
205 
206 
211  void btn_artist_checked(bool b);
212 
213 
218  void btn_album_checked(bool b);
219 
220 
225  void btn_track_nr_checked(bool b);
226 
227 
232  void btn_disc_nr_checked(bool b);
233 
234 
239  void btn_year_checked(bool b);
240 
241 
245  void btn_tag_help_clicked();
246 
250  void tag_text_changed(const QString&);
251 
252 
257  void set_tag_colors(bool valid);
258 
259 
263  void undo_clicked();
264 
265 
269  void undo_all_clicked();
270 
271 
276  void progress_changed(int val);
277 
278 
282  void metadata_changed(const MetaDataList&);
283 
284 
288  void language_changed() override;
289 
293  void commit_finished();
294 
295 
296  void rb_dont_replace_toggled(bool b);
297 };
298 
299 #endif
Definition: GUI_SomaFM.h:34
The TagEdit class Metadata has to be added using the set_metadata(const MetaDataList&) method...
Definition: TagEdit.h:41
Definition: GUI_TagEdit.h:44
The MetaData class.
Definition: MetaData.h:55
Definition: MetaDataList.h:39
Widget with Settings connection. Also contains triggers for language_changed() and skin_changed() wi...
Definition: SayonaraWidget.h:36
Definition: ui_GUI_TagEdit.h:685