Sayonara Player
GUI_InfoDialog.h
1 /* GUI_InfoDialog.h
2 
3  * Copyright (C) 2011-2020 Michael Lugmair (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  * created by Michael Lugmair (Lucio Carreras),
21  * Jul 19, 2012
22  *
23  */
24 
25 #ifndef GUI_INFODIALOG_H_
26 #define GUI_INFODIALOG_H_
27 
28 #include "Gui/Utils/Widgets/Dialog.h"
29 #include "Utils/Pimpl.h"
30 
31 class GUI_TagEdit;
32 class GUI_Lyrics;
34 namespace Cover
35 {
36  class Location;
37 }
38 
39 UI_FWD(InfoDialog)
40 
41 
46  public Gui::Dialog
47 {
48  Q_OBJECT
49  PIMPL(GUI_InfoDialog)
50  UI_CLASS(InfoDialog)
51 
52 public:
53  enum class Tab : uint8_t
54  {
55  Info=0,
56  Lyrics=1,
57  Edit=2
58  };
59 
60  explicit GUI_InfoDialog(InfoDialogContainer* container, QWidget* parent=nullptr);
61  ~GUI_InfoDialog() override;
62 
63  void setMetadata(const MetaDataList& tracks, MD::Interpretation interpretation);
64  bool hasMetadata() const;
65 
66  GUI_InfoDialog::Tab show(GUI_InfoDialog::Tab tab);
67  void showCoverEditTab();
68 
69  void setBusy(bool b);
70 
71 protected:
72  void skinChanged() override;
73  void languageChanged() override;
74 
75 private slots:
76  void tabIndexChangedInt(int idx);
77 
78  void writeCoversToTracksClicked();
79  void coverChanged();
80 
81 private:
82  void init();
83  void initTagEdit();
84  void initLyrics();
85 
86  void showInfoTab();
87  void showLyricsTab();
88  void showTagEditTab();
89 
90  void prepareCover(const Cover::Location& cover_path);
91  void prepareInfo(MD::Interpretation mode);
92  void prepareTab(GUI_InfoDialog::Tab idx);
93 
94 protected:
95  void closeEvent(QCloseEvent* e) override;
96  void showEvent(QShowEvent* e) override;
97  void resizeEvent(QResizeEvent* e) override;
98 
99  using Gui::Dialog::show;
100 };
101 
102 #endif /* GUI_INFODIALOG_H_ */
The GUI_InfoDialog class.
Definition: GUI_InfoDialog.h:45
An interface used to abstract the usage of the info dialog. An implementing class has to return the i...
Definition: InfoDialogContainer.h:61
Definition: GUI_TagEdit.h:43
The GUI_Lyrics class.
Definition: GUI_Lyrics.h:33
The MetaDataList class.
Definition: MetaDataList.h:35
The CoverLocation class.
Definition: CoverLocation.h:38