Skip to content

Commit

Permalink
Make modified releases a bit more obvious using a specific icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
zas committed Jul 2, 2013
1 parent 258e9c2 commit 86ed552
Show file tree
Hide file tree
Showing 8 changed files with 371 additions and 32 deletions.
8 changes: 8 additions & 0 deletions picard/album.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,14 @@ def is_complete(self):
else:
return True

def is_modified(self):
if self.tracks:
for track in self.tracks:
for file in track.linked_files:
if not file.is_saved():
return True
return False

def get_num_unsaved_files(self):
count = 0
for track in self.tracks:
Expand Down
378 changes: 348 additions & 30 deletions picard/resources.py

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions picard/ui/itemviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ def create_icons(self):
else:
ClusterItem.icon_dir = icontheme.lookup('folder', icontheme.ICON_SIZE_MENU)
AlbumItem.icon_cd = icontheme.lookup('media-optical', icontheme.ICON_SIZE_MENU)
AlbumItem.icon_cd_modified = icontheme.lookup('media-optical-modified', icontheme.ICON_SIZE_MENU)
AlbumItem.icon_cd_saved = icontheme.lookup('media-optical-saved', icontheme.ICON_SIZE_MENU)
AlbumItem.icon_cd_saved_modified = icontheme.lookup('media-optical-saved-modified',
icontheme.ICON_SIZE_MENU)
AlbumItem.icon_error = icontheme.lookup('media-optical-error', icontheme.ICON_SIZE_MENU)
TrackItem.icon_note = QtGui.QIcon(":/images/note.png")
FileItem.icon_file = QtGui.QIcon(":/images/file.png")
Expand Down Expand Up @@ -639,9 +642,15 @@ def update(self, update_tracks=True):
if album.errors:
self.setIcon(0, AlbumItem.icon_error)
elif album.is_complete():
self.setIcon(0, AlbumItem.icon_cd_saved)
if album.is_modified():
self.setIcon(0, AlbumItem.icon_cd_saved_modified)
else:
self.setIcon(0, AlbumItem.icon_cd_saved)
else:
self.setIcon(0, AlbumItem.icon_cd)
if album.is_modified():
self.setIcon(0, AlbumItem.icon_cd_modified)
else:
self.setIcon(0, AlbumItem.icon_cd)
for i, column in enumerate(MainPanel.columns):
self.setText(i, album.column(column[1]))
if self.isSelected():
Expand Down
Binary file added resources/images/16x16/media-optical-modified.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/media-optical-modified.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/picard.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<file>images/16x16/edit-paste.png</file>
<file>images/16x16/folder.png</file>
<file>images/16x16/media-optical-error.png</file>
<file>images/16x16/media-optical-modified.png</file>
<file>images/16x16/media-optical-saved-modified.png</file>
<file>images/16x16/media-optical-saved.png</file>
<file>images/16x16/media-optical.png</file>
<file>images/16x16/picard.png</file>
Expand All @@ -20,6 +22,8 @@
<file>images/22x22/list-remove.png</file>
<file>images/22x22/lookup-musicbrainz.png</file>
<file>images/22x22/media-optical-error.png</file>
<file>images/22x22/media-optical-modified.png</file>
<file>images/22x22/media-optical-saved-modified.png</file>
<file>images/22x22/media-optical-saved.png</file>
<file>images/22x22/media-optical.png</file>
<file>images/22x22/picard-analyze.png</file>
Expand Down

0 comments on commit 86ed552

Please sign in to comment.