2012-11-06 12:56:30 -08:00
|
|
|
"""
|
|
|
|
A PyQT4 dialog to select specific series/volume from list
|
|
|
|
"""
|
|
|
|
|
|
|
|
"""
|
2014-03-23 10:30:23 -07:00
|
|
|
Copyright 2012-2014 Anthony Beville
|
2012-11-06 12:56:30 -08:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
2015-02-12 14:57:46 -08:00
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
2012-11-06 12:56:30 -08:00
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
"""
|
|
|
|
|
2012-11-02 13:54:17 -07:00
|
|
|
import sys
|
2012-11-12 16:12:43 -08:00
|
|
|
import time
|
|
|
|
import os
|
2015-02-13 15:08:07 -08:00
|
|
|
|
2012-11-02 13:54:17 -07:00
|
|
|
from PyQt4 import QtCore, QtGui, uic
|
2012-11-12 16:12:43 -08:00
|
|
|
from PyQt4.QtCore import QObject
|
|
|
|
from PyQt4.QtCore import QUrl,pyqtSignal
|
2012-11-02 13:54:17 -07:00
|
|
|
from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest
|
|
|
|
|
2012-11-28 12:15:20 -08:00
|
|
|
from comicvinetalker import ComicVineTalker, ComicVineTalkerException
|
2012-11-02 13:54:17 -07:00
|
|
|
from issueselectionwindow import IssueSelectionWindow
|
2012-11-10 12:29:07 -08:00
|
|
|
from issueidentifier import IssueIdentifier
|
|
|
|
from genericmetadata import GenericMetadata
|
2012-11-12 16:12:43 -08:00
|
|
|
from imagefetcher import ImageFetcher
|
|
|
|
from progresswindow import IDProgressWindow
|
2012-11-13 13:25:15 -08:00
|
|
|
from settings import ComicTaggerSettings
|
2012-11-17 16:32:01 -08:00
|
|
|
from matchselectionwindow import MatchSelectionWindow
|
2013-02-04 11:11:57 -08:00
|
|
|
from coverimagewidget import CoverImageWidget
|
2013-02-04 20:49:44 -08:00
|
|
|
import utils
|
2012-11-12 16:12:43 -08:00
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
|
|
|
|
class SearchThread(QtCore.QThread):
|
2012-11-12 16:12:43 -08:00
|
|
|
|
2015-02-12 14:57:46 -08:00
|
|
|
searchComplete = pyqtSignal()
|
|
|
|
progressUpdate = pyqtSignal(int, int)
|
|
|
|
|
|
|
|
def __init__(self, series_name, refresh):
|
|
|
|
QtCore.QThread.__init__(self)
|
|
|
|
self.series_name = series_name
|
|
|
|
self.refresh = refresh
|
|
|
|
self.error_code = None
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
comicVine = ComicVineTalker()
|
|
|
|
try:
|
|
|
|
self.cv_error = False
|
2015-02-13 15:08:07 -08:00
|
|
|
self.cv_search_results = comicVine.searchForSeries(self.series_name, callback=self.prog_callback, refresh_cache=self.refresh)
|
2015-02-12 14:57:46 -08:00
|
|
|
except ComicVineTalkerException as e:
|
|
|
|
self.cv_search_results = []
|
|
|
|
self.cv_error = True
|
|
|
|
self.error_code = e.code
|
|
|
|
|
|
|
|
finally:
|
|
|
|
self.searchComplete.emit()
|
|
|
|
|
|
|
|
def prog_callback(self, current, total):
|
|
|
|
self.progressUpdate.emit(current, total)
|
2012-11-12 16:12:43 -08:00
|
|
|
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
class IdentifyThread(QtCore.QThread):
|
2012-11-12 16:12:43 -08:00
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
identifyComplete = pyqtSignal()
|
|
|
|
identifyLogMsg = pyqtSignal(str)
|
|
|
|
identifyProgress = pyqtSignal(int, int)
|
2015-02-12 14:57:46 -08:00
|
|
|
|
|
|
|
def __init__(self, identifier):
|
|
|
|
QtCore.QThread.__init__(self)
|
|
|
|
self.identifier = identifier
|
2015-02-13 15:08:07 -08:00
|
|
|
self.identifier.setOutputFunction(self.logOutput)
|
|
|
|
self.identifier.setProgressCallback(self.progressCallback)
|
2012-11-12 16:12:43 -08:00
|
|
|
|
2015-02-12 14:57:46 -08:00
|
|
|
def logOutput(self, text):
|
2015-02-13 15:08:07 -08:00
|
|
|
self.identifyLogMsg.emit(text)
|
2012-11-12 16:12:43 -08:00
|
|
|
|
2015-02-12 14:57:46 -08:00
|
|
|
def progressCallback(self, cur, total):
|
2015-02-13 15:08:07 -08:00
|
|
|
self.identifyProgress.emit(cur, total)
|
2012-11-12 16:12:43 -08:00
|
|
|
|
2015-02-12 14:57:46 -08:00
|
|
|
def run(self):
|
|
|
|
matches =self.identifier.search()
|
2015-02-13 15:08:07 -08:00
|
|
|
self.identifyComplete.emit()
|
2012-11-12 16:12:43 -08:00
|
|
|
|
|
|
|
|
|
|
|
class VolumeSelectionWindow(QtGui.QDialog):
|
|
|
|
|
2015-02-12 14:57:46 -08:00
|
|
|
def __init__(self, parent, series_name, issue_number, year, issue_count, cover_index_list, comic_archive, settings, autoselect=False):
|
|
|
|
super(VolumeSelectionWindow, self).__init__(parent)
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
uic.loadUi(ComicTaggerSettings.getUIFile('volumeselectionwindow.ui'), self)
|
2015-02-12 14:57:46 -08:00
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
self.imageWidget = CoverImageWidget(self.imageContainer, CoverImageWidget.URLMode)
|
|
|
|
gridlayout = QtGui.QGridLayout(self.imageContainer)
|
|
|
|
gridlayout.addWidget(self.imageWidget)
|
2015-02-12 14:57:46 -08:00
|
|
|
gridlayout.setContentsMargins(0,0,0,0)
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
utils.reduceWidgetFontSize(self.teDetails, 1)
|
|
|
|
utils.reduceWidgetFontSize(self.twList)
|
2015-02-12 14:57:46 -08:00
|
|
|
|
|
|
|
self.setWindowFlags(self.windowFlags() |
|
|
|
|
QtCore.Qt.WindowSystemMenuHint |
|
|
|
|
QtCore.Qt.WindowMaximizeButtonHint)
|
|
|
|
|
|
|
|
self.settings = settings
|
|
|
|
self.series_name = series_name
|
|
|
|
self.issue_number = issue_number
|
|
|
|
self.year = year
|
|
|
|
self.issue_count = issue_count
|
|
|
|
self.volume_id = 0
|
|
|
|
self.comic_archive = comic_archive
|
|
|
|
self.immediate_autoselect = autoselect
|
|
|
|
self.cover_index_list = cover_index_list
|
|
|
|
self.cv_search_results = None
|
|
|
|
|
|
|
|
self.twList.resizeColumnsToContents()
|
|
|
|
self.twList.currentItemChanged.connect(self.currentItemChanged)
|
|
|
|
self.twList.cellDoubleClicked.connect(self.cellDoubleClicked)
|
|
|
|
self.btnRequery.clicked.connect(self.requery)
|
|
|
|
self.btnIssues.clicked.connect(self.showIssues)
|
|
|
|
self.btnAutoSelect.clicked.connect(self.autoSelect)
|
|
|
|
|
|
|
|
self.updateButtons()
|
|
|
|
self.performQuery()
|
|
|
|
self.twList.selectRow(0)
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def updateButtons(self):
|
2015-02-12 14:57:46 -08:00
|
|
|
if self.cv_search_results is not None and len(self.cv_search_results) > 0:
|
|
|
|
enabled = True
|
|
|
|
else:
|
|
|
|
enabled = False
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
self.btnRequery.setEnabled(enabled)
|
|
|
|
self.btnIssues.setEnabled(enabled)
|
|
|
|
self.btnAutoSelect.setEnabled(enabled)
|
|
|
|
self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(enabled)
|
2015-02-12 14:57:46 -08:00
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def requery(self,):
|
|
|
|
self.performQuery(refresh=True)
|
2015-02-12 14:57:46 -08:00
|
|
|
self.twList.selectRow(0)
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def autoSelect(self):
|
2015-02-12 14:57:46 -08:00
|
|
|
|
|
|
|
if self.comic_archive is None:
|
|
|
|
QtGui.QMessageBox.information(self,"Auto-Select", "You need to load a comic first!")
|
|
|
|
return
|
|
|
|
|
|
|
|
if self.issue_number is None or self.issue_number == "":
|
|
|
|
QtGui.QMessageBox.information(self,"Auto-Select", "Can't auto-select without an issue number (yet!)")
|
|
|
|
return
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
self.iddialog = IDProgressWindow(self)
|
2015-02-12 14:57:46 -08:00
|
|
|
self.iddialog.setModal(True)
|
2015-02-13 15:08:07 -08:00
|
|
|
self.iddialog.rejected.connect(self.identifyCancel)
|
2015-02-12 14:57:46 -08:00
|
|
|
self.iddialog.show()
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
self.ii = IssueIdentifier(self.comic_archive, self.settings)
|
2015-02-12 14:57:46 -08:00
|
|
|
|
|
|
|
md = GenericMetadata()
|
|
|
|
md.series = self.series_name
|
|
|
|
md.issue = self.issue_number
|
|
|
|
md.year = self.year
|
|
|
|
md.issueCount = self.issue_count
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
self.ii.setAdditionalMetadata(md)
|
2015-02-12 14:57:46 -08:00
|
|
|
self.ii.onlyUseAdditionalMetaData = True
|
|
|
|
|
|
|
|
self.ii.cover_page_index = int(self.cover_index_list[0])
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
self.id_thread = IdentifyThread(self.ii)
|
|
|
|
self.id_thread.identifyComplete.connect(self.identifyComplete)
|
|
|
|
self.id_thread.identifyLogMsg.connect(self.logIDOutput)
|
|
|
|
self.id_thread.identifyProgress.connect(self.identifyProgress)
|
2015-02-12 14:57:46 -08:00
|
|
|
|
|
|
|
self.id_thread.start()
|
|
|
|
|
|
|
|
self.iddialog.exec_()
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def logIDOutput(self, text):
|
2015-02-12 14:57:46 -08:00
|
|
|
print unicode(text),
|
|
|
|
self.iddialog.textEdit.ensureCursorVisible()
|
|
|
|
self.iddialog.textEdit.insertPlainText(text)
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def identifyProgress(self, cur, total):
|
|
|
|
self.iddialog.progressBar.setMaximum(total)
|
|
|
|
self.iddialog.progressBar.setValue(cur)
|
2015-02-12 14:57:46 -08:00
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def identifyCancel(self):
|
2015-02-12 14:57:46 -08:00
|
|
|
self.ii.cancel = True
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def identifyComplete(self):
|
2015-02-12 14:57:46 -08:00
|
|
|
|
|
|
|
matches = self.ii.match_list
|
|
|
|
result = self.ii.search_result
|
|
|
|
match_index = 0
|
|
|
|
|
|
|
|
found_match = None
|
|
|
|
choices = False
|
|
|
|
if result == self.ii.ResultNoMatches:
|
|
|
|
QtGui.QMessageBox.information(self,"Auto-Select Result", " No matches found :-(")
|
|
|
|
elif result == self.ii.ResultFoundMatchButBadCoverScore:
|
|
|
|
QtGui.QMessageBox.information(self,"Auto-Select Result", " Found a match, but cover doesn't seem the same. Verify before commiting!")
|
|
|
|
found_match = matches[0]
|
|
|
|
elif result == self.ii.ResultFoundMatchButNotFirstPage :
|
|
|
|
QtGui.QMessageBox.information(self,"Auto-Select Result", " Found a match, but not with the first page of the archive.")
|
|
|
|
found_match = matches[0]
|
|
|
|
elif result == self.ii.ResultMultipleMatchesWithBadImageScores:
|
|
|
|
QtGui.QMessageBox.information(self,"Auto-Select Result", " Found some possibilities, but no confidence. Proceed manually.")
|
|
|
|
choices = True
|
|
|
|
elif result == self.ii.ResultOneGoodMatch:
|
|
|
|
found_match = matches[0]
|
|
|
|
elif result == self.ii.ResultMultipleGoodMatches:
|
|
|
|
QtGui.QMessageBox.information(self,"Auto-Select Result", " Found multiple likely matches. Please select.")
|
|
|
|
choices = True
|
|
|
|
|
|
|
|
if choices:
|
2015-02-13 15:08:07 -08:00
|
|
|
selector = MatchSelectionWindow(self, matches, self.comic_archive)
|
2015-02-12 14:57:46 -08:00
|
|
|
selector.setModal(True)
|
|
|
|
selector.exec_()
|
|
|
|
if selector.result():
|
|
|
|
#we should now have a list index
|
|
|
|
found_match = selector.currentMatch()
|
|
|
|
|
|
|
|
if found_match is not None:
|
|
|
|
self.iddialog.accept()
|
|
|
|
|
|
|
|
self.volume_id = found_match['volume_id']
|
|
|
|
self.issue_number = found_match['issue_number']
|
|
|
|
self.selectByID()
|
|
|
|
self.showIssues()
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def showIssues(self):
|
|
|
|
selector = IssueSelectionWindow(self, self.settings, self.volume_id, self.issue_number)
|
2015-02-12 14:57:46 -08:00
|
|
|
title = ""
|
|
|
|
for record in self.cv_search_results:
|
|
|
|
if record['id'] == self.volume_id:
|
|
|
|
title = record['name']
|
|
|
|
title += " (" + unicode(record['start_year']) + ")"
|
|
|
|
title += " - "
|
|
|
|
break
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
selector.setWindowTitle(title + "Select Issue")
|
|
|
|
selector.setModal(True)
|
2015-02-12 14:57:46 -08:00
|
|
|
selector.exec_()
|
|
|
|
if selector.result():
|
|
|
|
#we should now have a volume ID
|
|
|
|
self.issue_number = selector.issue_number
|
|
|
|
self.accept()
|
|
|
|
return
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def selectByID(self):
|
2015-02-12 14:57:46 -08:00
|
|
|
for r in range(0, self.twList.rowCount()):
|
2015-02-13 15:08:07 -08:00
|
|
|
volume_id, b = self.twList.item(r, 0).data(QtCore.Qt.UserRole).toInt()
|
2015-02-12 14:57:46 -08:00
|
|
|
if (volume_id == self.volume_id):
|
2015-02-13 15:08:07 -08:00
|
|
|
self.twList.selectRow(r)
|
2015-02-12 14:57:46 -08:00
|
|
|
break
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def performQuery(self, refresh=False):
|
2015-02-12 14:57:46 -08:00
|
|
|
|
|
|
|
self.progdialog = QtGui.QProgressDialog("Searching Online", "Cancel", 0, 100, self)
|
2015-02-13 15:08:07 -08:00
|
|
|
self.progdialog.setWindowTitle("Online Search")
|
|
|
|
self.progdialog.canceled.connect(self.searchCanceled)
|
2015-02-12 14:57:46 -08:00
|
|
|
self.progdialog.setModal(True)
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
self.search_thread = SearchThread(self.series_name, refresh)
|
|
|
|
self.search_thread.searchComplete.connect(self.searchComplete)
|
|
|
|
self.search_thread.progressUpdate.connect(self.searchProgressUpdate)
|
2015-02-12 14:57:46 -08:00
|
|
|
self.search_thread.start()
|
|
|
|
|
|
|
|
#QtCore.QCoreApplication.processEvents()
|
|
|
|
self.progdialog.exec_()
|
|
|
|
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def searchCanceled(self):
|
|
|
|
print("query cancelled")
|
|
|
|
self.search_thread.searchComplete.disconnect(self.searchComplete)
|
|
|
|
self.search_thread.progressUpdate.disconnect(self.searchProgressUpdate)
|
|
|
|
self.progdialog.canceled.disconnect(self.searchCanceled)
|
2015-02-12 14:57:46 -08:00
|
|
|
self.progdialog.reject()
|
|
|
|
QtCore.QTimer.singleShot(200, self.closeMe)
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def closeMe(self):
|
|
|
|
print("closeme")
|
2015-02-12 14:57:46 -08:00
|
|
|
self.reject()
|
|
|
|
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def searchProgressUpdate(self , current, total):
|
2015-02-12 14:57:46 -08:00
|
|
|
self.progdialog.setMaximum(total)
|
|
|
|
self.progdialog.setValue(current)
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def searchComplete(self):
|
2015-02-12 14:57:46 -08:00
|
|
|
self.progdialog.accept()
|
|
|
|
if self.search_thread.cv_error:
|
|
|
|
if self.search_thread.error_code == ComicVineTalkerException.RateLimit:
|
|
|
|
QtGui.QMessageBox.critical(self, self.tr("Comic Vine Error"), ComicVineTalker.getRateLimitMessage())
|
|
|
|
else:
|
|
|
|
QtGui.QMessageBox.critical(self, self.tr("Network Issue"), self.tr("Could not connect to ComicVine to search for series!"))
|
|
|
|
return
|
|
|
|
|
|
|
|
self.cv_search_results = self.search_thread.cv_search_results
|
|
|
|
self.updateButtons()
|
|
|
|
|
|
|
|
self.twList.setSortingEnabled(False)
|
|
|
|
|
|
|
|
while self.twList.rowCount() > 0:
|
|
|
|
self.twList.removeRow(0)
|
|
|
|
|
|
|
|
row = 0
|
|
|
|
for record in self.cv_search_results:
|
|
|
|
self.twList.insertRow(row)
|
|
|
|
|
|
|
|
item_text = record['name']
|
2015-02-13 15:08:07 -08:00
|
|
|
item = QtGui.QTableWidgetItem(item_text)
|
|
|
|
item.setData(QtCore.Qt.ToolTipRole, item_text)
|
|
|
|
item.setData(QtCore.Qt.UserRole ,record['id'])
|
2015-02-12 14:57:46 -08:00
|
|
|
item.setFlags(QtCore.Qt.ItemIsSelectable| QtCore.Qt.ItemIsEnabled)
|
|
|
|
self.twList.setItem(row, 0, item)
|
|
|
|
|
|
|
|
item_text = str(record['start_year'])
|
|
|
|
item = QtGui.QTableWidgetItem(item_text)
|
2015-02-13 15:08:07 -08:00
|
|
|
item.setData(QtCore.Qt.ToolTipRole, item_text)
|
2015-02-12 14:57:46 -08:00
|
|
|
item.setFlags(QtCore.Qt.ItemIsSelectable| QtCore.Qt.ItemIsEnabled)
|
|
|
|
self.twList.setItem(row, 1, item)
|
|
|
|
|
|
|
|
item_text = record['count_of_issues']
|
|
|
|
item = QtGui.QTableWidgetItem(item_text)
|
2015-02-13 15:08:07 -08:00
|
|
|
item.setData(QtCore.Qt.ToolTipRole, item_text)
|
2015-02-12 14:57:46 -08:00
|
|
|
item.setData(QtCore.Qt.DisplayRole, record['count_of_issues'])
|
|
|
|
item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
|
|
|
self.twList.setItem(row, 2, item)
|
|
|
|
|
|
|
|
if record['publisher'] is not None:
|
|
|
|
item_text = record['publisher']['name']
|
2015-02-13 15:08:07 -08:00
|
|
|
item.setData(QtCore.Qt.ToolTipRole, item_text)
|
2015-02-12 14:57:46 -08:00
|
|
|
item = QtGui.QTableWidgetItem(item_text)
|
|
|
|
item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
|
|
|
self.twList.setItem(row, 3, item)
|
|
|
|
|
|
|
|
row += 1
|
|
|
|
|
|
|
|
self.twList.resizeColumnsToContents()
|
|
|
|
self.twList.setSortingEnabled(True)
|
2015-02-13 15:08:07 -08:00
|
|
|
self.twList.sortItems(2 , QtCore.Qt.DescendingOrder)
|
2015-02-12 14:57:46 -08:00
|
|
|
self.twList.selectRow(0)
|
|
|
|
self.twList.resizeColumnsToContents()
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
if len(self.cv_search_results) == 0:
|
2015-02-12 14:57:46 -08:00
|
|
|
QtCore.QCoreApplication.processEvents()
|
|
|
|
QtGui.QMessageBox.information(self,"Search Result", "No matches found!")
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
if self.immediate_autoselect and len(self.cv_search_results) > 0:
|
2015-02-12 14:57:46 -08:00
|
|
|
# defer the immediate autoselect so this dialog has time to pop up
|
|
|
|
QtCore.QCoreApplication.processEvents()
|
|
|
|
QtCore.QTimer.singleShot(10, self.doImmediateAutoselect)
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def doImmediateAutoselect(self):
|
2015-02-12 14:57:46 -08:00
|
|
|
self.immediate_autoselect = False
|
|
|
|
self.autoSelect()
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def cellDoubleClicked(self, r, c):
|
2015-02-12 14:57:46 -08:00
|
|
|
self.showIssues()
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
def currentItemChanged(self, curr, prev):
|
2015-02-12 14:57:46 -08:00
|
|
|
|
|
|
|
if curr is None:
|
|
|
|
return
|
|
|
|
if prev is not None and prev.row() == curr.row():
|
|
|
|
return
|
|
|
|
|
2015-02-13 15:08:07 -08:00
|
|
|
self.volume_id, b = self.twList.item(curr.row(), 0).data(QtCore.Qt.UserRole).toInt()
|
2015-02-12 14:57:46 -08:00
|
|
|
|
|
|
|
# list selection was changed, update the info on the volume
|
|
|
|
for record in self.cv_search_results:
|
|
|
|
if record['id'] == self.volume_id:
|
|
|
|
if record['description'] is None:
|
2015-02-13 15:08:07 -08:00
|
|
|
self.teDetails.setText ("")
|
2015-02-12 14:57:46 -08:00
|
|
|
else:
|
2015-02-13 15:08:07 -08:00
|
|
|
self.teDetails.setText (record['description'])
|
|
|
|
self.imageWidget.setURL(record['image']['super_url'])
|
2015-02-12 14:57:46 -08:00
|
|
|
break
|