~ubuntu-branches/ubuntu/saucy/clementine/saucy

« back to all changes in this revision

Viewing changes to src/ui/albumcovermanager.h

  • Committer: Package Import Robot
  • Author(s): Thomas PIERSON
  • Date: 2012-01-01 20:43:39 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120101204339-lsb6nndwhfy05sde
Tags: 1.0.1+dfsg-1
New upstream release. (Closes: #653926, #651611, #657391)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
#include "gtest/gtest_prod.h"
26
26
 
27
 
#include "core/albumcoverloader.h"
28
27
#include "core/backgroundthread.h"
29
28
#include "core/song.h"
 
29
#include "covers/albumcoverloader.h"
 
30
#include "covers/coversearchstatistics.h"
30
31
 
31
32
class AlbumCoverChoiceController;
32
33
class AlbumCoverFetcher;
33
34
class AlbumCoverSearcher;
 
35
class CoverProviders;
34
36
class LibraryBackend;
35
37
class LineEditInterface;
36
38
class SongMimeData;
44
46
class AlbumCoverManager : public QMainWindow {
45
47
  Q_OBJECT
46
48
 public:
47
 
  AlbumCoverManager(LibraryBackend* backend, QWidget *parent = 0,
 
49
  AlbumCoverManager(LibraryBackend* backend,
 
50
                    CoverProviders* cover_providers,
 
51
                    QWidget *parent = 0,
48
52
                    QNetworkAccessManager* network = 0);
49
53
  ~AlbumCoverManager();
50
54
 
56
60
  void Reset();
57
61
  void Init();
58
62
 
 
63
  void ResetFetchCoversButton();
 
64
 
59
65
  SongList GetSongsInAlbum(const QModelIndex& index) const;
60
66
  SongList GetSongsInAlbums(const QModelIndexList& indexes) const;
61
67
  SongMimeData* GetMimeDataForAlbums(const QModelIndexList& indexes) const;
66
72
 protected:
67
73
  void showEvent(QShowEvent *);
68
74
  void closeEvent(QCloseEvent *);
69
 
  bool event(QEvent *);
70
75
 
71
76
  // For the album view context menu events
72
77
  bool eventFilter(QObject *obj, QEvent *event);
77
82
  void CoverImageLoaded(quint64 id, const QImage& image);
78
83
  void UpdateFilter();
79
84
  void FetchAlbumCovers();
80
 
  void AlbumCoverFetched(quint64 id, const QImage& image);
 
85
  void AlbumCoverFetched(quint64 id, const QImage& image,
 
86
                         const CoverSearchStatistics& statistics);
81
87
 
82
88
  // On the context menu
83
89
  void FetchSingleCover();
108
114
    Role_AlbumName,
109
115
    Role_PathAutomatic,
110
116
    Role_PathManual,
111
 
    Role_FirstFilename,
 
117
    Role_FirstUrl,
112
118
  };
113
119
 
114
120
  enum HideCovers {
137
143
  void SaveAndSetCover(QListWidgetItem* item, const QImage& image);
138
144
 
139
145
 private:
140
 
  bool constructed_;
141
 
 
142
146
  Ui_CoverManager* ui_;
143
147
 
 
148
  CoverProviders* cover_providers_;
144
149
  AlbumCoverChoiceController* album_cover_choice_controller_;
145
150
  LibraryBackend* backend_;
146
151
 
153
158
 
154
159
  AlbumCoverFetcher* cover_fetcher_;
155
160
  QMap<quint64, QListWidgetItem*> cover_fetching_tasks_;
 
161
  CoverSearchStatistics fetch_statistics_;
156
162
 
157
163
  AlbumCoverSearcher* cover_searcher_;
158
164
 
159
165
  QIcon artist_icon_;
160
166
  QIcon all_artists_icon_;
161
167
  QIcon no_cover_icon_;
 
168
  QImage no_cover_image_;
162
169
 
163
170
  QMenu* context_menu_;
164
171
  QList<QListWidgetItem*> context_menu_items_;
165
172
 
166
173
  QProgressBar* progress_bar_;
167
174
  int jobs_;
168
 
  int got_covers_;
169
 
  int missing_covers_;
170
175
 
171
176
  LineEditInterface* filter_;
172
177