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/Utils/Widgets/Widget.h"
28 #include "Components/Tagging/Expression.h"
29 #include "Utils/Pimpl.h"
30 
35 namespace Tagging
36 {
37  class Editor;
38 }
39 
40 class MetaDataList;
41 class MetaData;
42 
43 UI_FWD(GUI_TagEdit)
44 
45 class GUI_TagEdit :
46  public Gui::Widget
47 {
48  Q_OBJECT
49  UI_CLASS(GUI_TagEdit)
50  PIMPL(GUI_TagEdit)
51 
52 public:
53  explicit GUI_TagEdit(QWidget* parent=nullptr);
54  ~GUI_TagEdit();
55 
60  Tagging::Editor* get_tag_edit() const;
61 
65  void commit();
66 
70  void cancel();
71 
72  void show_close_button(bool show);
73 
74 
75 signals:
76  void sig_ok_clicked(const MetaDataList&);
77  void sig_undo_clicked(int idx);
78  void sig_undo_all_clicked();
79  void sig_cancelled();
80 
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 protected:
300  void showEvent(QShowEvent* e) override;
301 };
302 
303 #endif
Definition: ComboBoxDelegate.h:26
Definition: GUI_TagEdit.h:45
The MetaData class.
Definition: MetaData.h:48
The MetaDataList class.
Definition: MetaDataList.h:38
The GUI_TagEdit class.
Definition: AbstractLibrary.h:42
The TagEdit class Metadata has to be added using the set_metadata(const MetaDataList&) method...
Definition: Editor.h:44