From cdb22347ab658ee3ee7e359221fea3c6140559d6 Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Fri, 16 Nov 2012 22:45:35 +0000 Subject: [PATCH] More text in selection dialog titles Always search with no articles removed git-svn-id: http://comictagger.googlecode.com/svn/trunk@53 6c5673fe-1810-88d6-992b-cd32ca31540c --- comicvinetalker.py | 9 +++++++-- issueidentifier.py | 2 -- issueselectionwindow.py | 4 +--- taggerwindow.py | 5 ++++- todo.txt | 9 ++------- utils.py | 1 + volumeselectionwindow.py | 10 ++++++++++ 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/comicvinetalker.py b/comicvinetalker.py index a39a17f..b47712c 100644 --- a/comicvinetalker.py +++ b/comicvinetalker.py @@ -57,6 +57,9 @@ class ComicVineTalker(QObject): def searchForSeries( self, series_name , callback=None, refresh_cache=False ): + # remove cruft from the search string + series_name = utils.removearticles( series_name ).lower().strip() + # before we search online, look in our cache, since we might have # done this same search recently cvc = ComicVineCacher( ComicTaggerSettings.getSettingsFolder() ) @@ -88,7 +91,8 @@ class ComicVineTalker(QObject): current_result_count = cv_response['number_of_page_results'] total_result_count = cv_response['number_of_total_results'] - print ("Found {0} of {1} results".format( cv_response['number_of_page_results'], cv_response['number_of_total_results'])) + if callback is None: + print ("Found {0} of {1} results".format( cv_response['number_of_page_results'], cv_response['number_of_total_results'])) search_results.extend( cv_response['results']) offset = 0 @@ -97,7 +101,8 @@ class ComicVineTalker(QObject): # see if we need to keep asking for more pages... while ( current_result_count < total_result_count ): - print ("getting another page of results {0} of {1}...".format( current_result_count, total_result_count)) + if callback is None: + print ("getting another page of results {0} of {1}...".format( current_result_count, total_result_count)) offset += limit resp = urllib2.urlopen( search_url + "&offset="+str(offset) ) content = resp.read() diff --git a/issueidentifier.py b/issueidentifier.py index eb73582..a5b3818 100644 --- a/issueidentifier.py +++ b/issueidentifier.py @@ -185,8 +185,6 @@ class IssueIdentifier: #self.log_msg( ( "Searching for " + keys['series'] + "...") self.log_msg( "Searching for {0} #{1} ...".format( keys['series'], keys['issue_number']) ) - keys['series'] = utils.removearticles( keys['series'] ) - cv_search_results = comicVine.searchForSeries( keys['series'] ) #self.log_msg( "Found " + str(len(cv_search_results)) + " initial results" ) diff --git a/issueselectionwindow.py b/issueselectionwindow.py index a9d9ac8..df9a7d8 100644 --- a/issueselectionwindow.py +++ b/issueselectionwindow.py @@ -64,10 +64,8 @@ class IssueSelectionWindow(QtGui.QDialog): self.twList.selectRow( r ) break - - def performQuery( self ): - + QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.WaitCursor)) while self.twList.rowCount() > 0: diff --git a/taggerwindow.py b/taggerwindow.py index 1d4795a..c9f1f76 100644 --- a/taggerwindow.py +++ b/taggerwindow.py @@ -850,6 +850,10 @@ class TaggerWindow( QtGui.QMainWindow): issue_number = str(self.leIssueNum.text()).strip() selector = VolumeSelectionWindow( self, self.settings.cv_api_key, series_name, issue_number, self.comic_archive, self.settings, autoselect ) + + title = "Search: '" + series_name + "' - " + selector.setWindowTitle( title + "Select Series") + selector.setModal(True) selector.exec_() @@ -899,7 +903,6 @@ class TaggerWindow( QtGui.QMainWindow): r = 0 while r < self.twCredits.rowCount(): if str(self.twCredits.item(r, 0).text()).lower() not in cix_credits: - print "Bad credit for CIX:", self.twCredits.item(r, 0).text() self.twCredits.item(r, 0).setBackgroundColor( inactive_color ) else: self.twCredits.item(r, 0).setBackgroundColor( active_color ) diff --git a/todo.txt b/todo.txt index 4df86d0..7cd3afc 100644 --- a/todo.txt +++ b/todo.txt @@ -3,10 +3,6 @@ Features ---------------- -Update the ABout Box with better graphic and more info - -Issue Selection Dialog title -Series Selection Dialog title Auto-select: msgbox on autoselect failure, or warning @@ -79,9 +75,8 @@ Image Hashes: Filename parsing: Concatenation of Name and Issue?? "1602" - -CV search - Maybe remove "the" and leading "A" before searching and matching for closer - + +Issue identifier - compare names with aricles removed App option to covert RAR to ZIP diff --git a/utils.py b/utils.py index 7343f6f..773c047 100644 --- a/utils.py +++ b/utils.py @@ -66,6 +66,7 @@ def removearticles( text ): newText = newText.replace(":", "") newText = newText.replace(".", "") newText = newText.replace(",", "") + newText = newText.replace("-", " ") return newText diff --git a/volumeselectionwindow.py b/volumeselectionwindow.py index 7c4d337..874068a 100644 --- a/volumeselectionwindow.py +++ b/volumeselectionwindow.py @@ -159,6 +159,16 @@ class VolumeSelectionWindow(QtGui.QDialog): def showIssues( self ): selector = IssueSelectionWindow( self, self.settings, self.volume_id, self.issue_number ) selector.setModal(True) + + title = "" + for record in self.cv_search_results: + if record['id'] == self.volume_id: + title = record['name'] + title += " (" + str(record['start_year']) + ")" + title += " - " + break + + selector.setWindowTitle( title + "Select Issue") selector.exec_() if selector.result(): #we should now have a volume ID