Sayonara Player
TagFromPath.h
1 /* TagFromPath.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 
22 
23 #ifndef TAGFROMPATH_H
24 #define TAGFROMPATH_H
25 
26 #include "GUI/Utils/Widgets/Widget.h"
27 #include "GUI/Utils/GuiClass.h"
28 #include "Utils/Pimpl.h"
29 
30 #include "Components/Tagging/Expression.h"
31 
32 UI_FWD(GUI_TagFromPath)
33 
34 class QPushButton;
35 
36 namespace Tagging
37 {
38  class Editor;
39 }
40 class MetaData;
42  public Gui::Widget
43 {
44  Q_OBJECT
45  UI_CLASS(GUI_TagFromPath)
46  PIMPL(GUI_TagFromPath)
47 
48 signals:
49  void sig_apply();
50  void sig_apply_all();
51 
52 
53 public:
54  GUI_TagFromPath(QWidget* parent=nullptr);
55  ~GUI_TagFromPath();
56 
57  void set_filepath(const QString& filepath);
58  void add_invalid_filepath(const QString& filepath);
59  void clear_invalid_filepaths();
60  QString get_regex_string() const;
61 
62  void reset();
63 
64 protected:
65  void language_changed();
66 
67 private:
72  void set_tag_colors(bool valid);
73  bool replace_selected_tag_text(Tagging::TagName t, bool b);
74  void btn_checked(QPushButton* btn, bool b, Tagging::TagName tag_name);
75  void show_error_frame(bool b);
76 
77 private slots:
78 
82  void btn_tag_help_clicked();
83 
87  void tag_text_changed(const QString&);
88 
89  void btn_title_checked(bool b);
90  void btn_artist_checked(bool b);
91  void btn_album_checked(bool b);
92  void btn_track_nr_checked(bool b);
93  void btn_disc_nr_checked(bool b);
94  void btn_year_checked(bool b);
95 };
96 
97 #endif // TAGFROMPATH_H
The MetaData class.
Definition: MetaData.h:44
The GUI_TagEdit class.
Definition: GenreFetcher.h:32
Widget with Settings connection. Also contains triggers for language_changed() and skin_changed() wi...
Definition: Widget.h:38
Definition: TagFromPath.h:41