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/AlternativeCovers/ui_GUI_AlternativeCovers.h"
33 #include "GUI/Helper/SayonaraWidget/SayonaraDialog.h"
34 #include "Components/CoverLookup/CoverLocation.h"
35 
36 #include <QPixmap>
37 #include <QList>
38 #include <QModelIndex>
39 
40 class Album;
41 class Artist;
45 
47  public SayonaraDialog,
48  private Ui::AlternativeCovers
49 {
50 
51  Q_OBJECT
52 public:
53  GUI_AlternativeCovers(QWidget* parent=nullptr);
54  virtual ~GUI_AlternativeCovers();
55 
56 signals:
57  void sig_cover_changed(const CoverLocation&);
58 
59 public slots:
60  void start(const Album& album, const CoverLocation& cl = CoverLocation());
61  void start(int album_id, quint8 db_id, const CoverLocation& cl = CoverLocation());
62  void start(QString album_name, QString artist_name, const CoverLocation& cl = CoverLocation());
63  void start(const Artist& artist, const CoverLocation& cl = CoverLocation());
64  void start(QString artist_name, const CoverLocation& cl = CoverLocation());
65 
66 private slots:
67  void save_button_pressed();
68  void cancel_button_pressed();
69  void search_button_pressed();
70  void cover_pressed(const QModelIndex& idx);
71  void open_file_dialog();
72  void cl_new_cover(const CoverLocation& path);
73  void cl_finished(bool);
74 
75 private:
76 
77  int _cur_idx;
78  QString _last_path;
79  CoverLocation _cover_location;
80  QList<CoverLocation> _filelist;
81  bool _is_searching;
82 
83  AlternateCoverItemDelegate* _delegate=nullptr;
84  AlternateCoverItemModel* _model=nullptr;
85 
86  CoverLookupAlternative* _cl_alternative=nullptr;
87 
88  void reset_model();
89  void connect_and_start();
90  void delete_all_files();
91 
92 protected:
93  void closeEvent(QCloseEvent* e) override;
94  void language_changed() override;
95 };
96 
97 #endif /* GUI_ALTERNATE_COVERS_H_ */
Definition: AlternativeCoverItemModel.h:51
The CoverLookupAlternative class.
Definition: CoverLookupAlternative.h:34
The CoverLocation class.
Definition: CoverLocation.h:37
Definition: GUI_AlternativeCovers.h:46
Definition: ui_GUI_AlternativeCovers.h:219
Definition: AlternativeCoverItemDelegate.h:37
The Album class.
Definition: Album.h:41
Dialog with Settings connection. Also contains triggers for language_changed() and skin_changed()...
Definition: SayonaraDialog.h:38
The Artist class.
Definition: Artist.h:36