77 lines
3.2 KiB
Diff
77 lines
3.2 KiB
Diff
|
From 6d0f24b91a472519c85fb2b93fb60b0809ca4c1c Mon Sep 17 00:00:00 2001
|
||
|
From: Sambhav Kothari <sambhavs.email@gmail.com>
|
||
|
Date: Sun, 22 Jan 2017 20:31:57 +0530
|
||
|
Subject: [PATCH 8/9] Add view coverart changes button
|
||
|
|
||
|
---
|
||
|
picard/ui/coverartbox.py | 10 ++++++++++
|
||
|
picard/ui/mainwindow.py | 3 ++-
|
||
|
2 files changed, 12 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/picard/ui/coverartbox.py b/picard/ui/coverartbox.py
|
||
|
index fb1e6e37..2b3b4cfa 100644
|
||
|
--- a/picard/ui/coverartbox.py
|
||
|
+++ b/picard/ui/coverartbox.py
|
||
|
@@ -151,6 +151,7 @@ class CoverArtBox(QtGui.QGroupBox):
|
||
|
QtGui.QGroupBox.__init__(self, "")
|
||
|
self.layout = QtGui.QVBoxLayout()
|
||
|
self.layout.setSpacing(6)
|
||
|
+ self.parent = parent
|
||
|
# Kills off any borders
|
||
|
self.setStyleSheet('''QGroupBox{background-color:none;border:1px;}''')
|
||
|
self.setFlat(True)
|
||
|
@@ -162,20 +163,29 @@ class CoverArtBox(QtGui.QGroupBox):
|
||
|
self.orig_cover_art = CoverArtThumbnail(False, False, parent)
|
||
|
self.orig_cover_art_label.setAlignment(QtCore.Qt.AlignTop | QtCore.Qt.AlignHCenter)
|
||
|
self.orig_cover_art.setHidden(True)
|
||
|
+ self.view_changes_button = QtGui.QPushButton(_(u'View all changes'), self)
|
||
|
+ self.view_changes_button.setHidden(True)
|
||
|
self.layout.addWidget(self.cover_art_label)
|
||
|
self.layout.addWidget(self.cover_art)
|
||
|
self.layout.addWidget(self.orig_cover_art_label)
|
||
|
self.layout.addWidget(self.orig_cover_art)
|
||
|
+ self.layout.addWidget(self.view_changes_button)
|
||
|
self.setLayout(self.layout)
|
||
|
+ self.view_changes_button.clicked.connect(self.show_cover_art_info)
|
||
|
+
|
||
|
+ def show_cover_art_info(self):
|
||
|
+ self.parent.view_info(default_tab=1)
|
||
|
|
||
|
def _show(self):
|
||
|
# We want to show the 2 coverarts only if they are different
|
||
|
# and orig_cover_art is not None
|
||
|
if getattr(self.orig_cover_art, 'data', None) is None or self.cover_art == self.orig_cover_art:
|
||
|
+ self.view_changes_button.setHidden(True)
|
||
|
self.orig_cover_art.setHidden(True)
|
||
|
self.cover_art_label.setText('')
|
||
|
self.orig_cover_art_label.setText('')
|
||
|
else:
|
||
|
+ self.view_changes_button.setHidden(False)
|
||
|
self.orig_cover_art.setHidden(False)
|
||
|
self.cover_art_label.setText(_(u'New Cover-Art'))
|
||
|
self.orig_cover_art_label.setText(_(u'Original Cover-Art'))
|
||
|
diff --git a/picard/ui/mainwindow.py b/picard/ui/mainwindow.py
|
||
|
index e34e24ce..4c89dfe2 100644
|
||
|
--- a/picard/ui/mainwindow.py
|
||
|
+++ b/picard/ui/mainwindow.py
|
||
|
@@ -818,7 +818,7 @@ class MainWindow(QtGui.QMainWindow):
|
||
|
dialog.show_similar_albums(obj)
|
||
|
dialog.exec_()
|
||
|
|
||
|
- def view_info(self):
|
||
|
+ def view_info(self, default_tab=0):
|
||
|
if isinstance(self.selected_objects[0], Album):
|
||
|
album = self.selected_objects[0]
|
||
|
dialog = AlbumInfoDialog(album, self)
|
||
|
@@ -828,6 +828,7 @@ class MainWindow(QtGui.QMainWindow):
|
||
|
else:
|
||
|
file = self.tagger.get_files_from_objects(self.selected_objects)[0]
|
||
|
dialog = FileInfoDialog(file, self)
|
||
|
+ dialog.ui.tabWidget.setCurrentIndex(default_tab)
|
||
|
dialog.exec_()
|
||
|
|
||
|
def cluster(self):
|
||
|
--
|
||
|
2.11.0
|
||
|
|