Sayonara Player
GUI_AlternativeCovers.h
1 /* GUI_AlternativeCovers.h */
2 
3 /* Copyright (C) 2011-2016 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  * GUI_AlternativeCovers.h
24  *
25  * Created on: Jul 1, 2011
26  * Author: Lucio Carreras
27  */
28 
29 #ifndef GUI_ALTERNATE_COVERS_H_
30 #define GUI_ALTERNATE_COVERS_H_
31 
32 #include "GUI/Covers/ui_GUI_AlternativeCovers.h"
33 #include "GUI/Helper/SayonaraWidget/SayonaraDialog.h"
34 #include "Components/Covers/CoverLocation.h"
35 
36 #include <QPixmap>
37 #include <QList>
38 #include <QModelIndex>
39 
40 class Album;
41 class Artist;
45 
51  public SayonaraDialog,
52  private Ui::AlternativeCovers
53 {
54 
55  Q_OBJECT
56 public:
57  GUI_AlternativeCovers(QWidget* parent=nullptr);
58  virtual ~GUI_AlternativeCovers();
59 
60 signals:
61  void sig_cover_changed(const CoverLocation&);
62 
63 public slots:
64 
65  void start(const CoverLocation& cl);
66 
67 private slots:
68  void ok_clicked();
69  void apply_clicked();
70  void search_clicked();
71  void cover_pressed(const QModelIndex& idx);
72  void open_file_dialog();
73  void cl_new_cover(const QString& cover_path);
74  void cl_finished(bool);
75 
76 private:
77 
78  int _cur_idx;
79  QString _last_path;
80  CoverLocation _cover_location;
81  QStringList _filelist;
82  bool _is_searching;
83 
84  AlternativeCoverItemModel* _model=nullptr;
85  AlternativeCoverItemDelegate* _delegate=nullptr;
86 
87  CoverLookupAlternative* _cl_alternative=nullptr;
88 
89  void reset_model();
90  void connect_and_start();
91  void delete_all_files();
92 
93 protected:
94  void closeEvent(QCloseEvent* e) override;
95  void language_changed() override;
96 };
97 
98 #endif /* GUI_ALTERNATE_COVERS_H_ */
The AlternativeCoverItemModel class.
Definition: AlternativeCoverItemModel.h:56
The AlternativeCoverItemDelegate class.
Definition: AlternativeCoverItemDelegate.h:42
The CoverLookupAlternative class.
Definition: CoverLookupAlternative.h:35
The CoverLocation class.
Definition: CoverLocation.h:38
The GUI_AlternativeCovers class.
Definition: GUI_AlternativeCovers.h:50
Definition: ui_GUI_AlternativeCovers.h:216
The Album class.
Definition: Album.h:40
Dialog with Settings connection. Also contains triggers for language_changed() and skin_changed()...
Definition: SayonaraDialog.h:38
The Artist class.
Definition: Artist.h:36