From 33e1b1fa70ac73caace02b901305f09d92a8da81 Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Thu, 15 Nov 2012 04:34:33 +0000 Subject: [PATCH] Reworked info box git-svn-id: http://comictagger.googlecode.com/svn/trunk@40 6c5673fe-1810-88d6-992b-cd32ca31540c --- taggerwindow.py | 40 ++++++++-- taggerwindow.ui | 191 ++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 184 insertions(+), 47 deletions(-) diff --git a/taggerwindow.py b/taggerwindow.py index db4ef96..dccfd99 100644 --- a/taggerwindow.py +++ b/taggerwindow.py @@ -1,3 +1,4 @@ +# coding=utf-8 """ The main window of the comictagger app """ @@ -34,6 +35,7 @@ from crediteditorwindow import CreditEditorWindow from settingswindow import SettingsWindow from settings import ComicTaggerSettings from pagebrowser import PageBrowserWindow +from filenameparser import FileNameParser import utils import ctversion @@ -301,14 +303,34 @@ class TaggerWindow( QtGui.QMainWindow): def updateInfoBox( self ): ca = self.comic_archive - info_text = os.path.basename( ca.path ) + "\n" - info_text += str(ca.getNumberOfPages()) + " pages \n" - if ca.hasCIX(): - info_text += "* ComicRack tags\n" - if ca.hasCBI(): - info_text += "* ComicBookLover tags\n" + + filename = os.path.basename( ca.path ) + filename = os.path.splitext(filename)[0] + filename = FileNameParser().fixSpaces(filename) + + self.lblFilename.setText( filename ) + + if ca.isZip(): + self.lblArchiveType.setText( "ZIP archive" ) + elif ca.isRar(): + self.lblArchiveType.setText( "RAR archive" ) + elif ca.isFolder(): + self.lblArchiveType.setText( "Folder archive" ) + else: + self.lblArchiveType.setText( "" ) - self.lblArchiveInfo.setText( info_text ) + page_count = " ({0} pages)".format(ca.getNumberOfPages()) + self.lblPageCount.setText( page_count) + + tag_info = "" + if ca.hasCIX(): + tag_info = u"• ComicRack tags" + if ca.hasCBI(): + if tag_info != "": + tag_info += "\n" + tag_info += u"• ComicBookLover tags" + + self.lblTagList.setText( tag_info ) def setDirtyFlag( self, param1=None, param2=None, param3=None ): @@ -822,6 +844,10 @@ class TaggerWindow( QtGui.QMainWindow): self.cbMaturityRating.addItem( "X18+", "" ) self.cbMaturityRating.addItem( "Adults Only 18+", "" ) self.cbMaturityRating.addItem( "Rating Pending", "" ) + + # Add entries to the format combobox + #self.cbFormat.addItem( "Rating Pending", "" ) + def removeCBLTags( self ): self.removeTags( MetaDataStyle.CBI ) diff --git a/taggerwindow.ui b/taggerwindow.ui index b5fbb1c..75fa425 100644 --- a/taggerwindow.ui +++ b/taggerwindow.ui @@ -6,8 +6,8 @@ 0 0 - 969 - 501 + 957 + 542 @@ -33,6 +33,9 @@ + + QFormLayout::AllNonFixedFieldsGrow + Qt::AlignHCenter|Qt::AlignTop @@ -49,48 +52,143 @@ - + - - 0 - 0 - - - - - 200 - 16777215 - - - - QFrame::Panel - - - QFrame::Sunken - - - - - - - - - - + 0 0 - 200 - 300 + 220 + 0 - 200 - 300 + 220 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 0 + + + + + 75 + true + + + + filename + + + true + + + + + + + + + + 0 + 0 + + + + + 200 + 16777215 + + + + + false + + + + QFrame::NoFrame + + + QFrame::Sunken + + + archive type + + + false + + + + + + + + 0 + 0 + + + + + true + + + + page count + + + + + + + + + + 0 + 0 + + + + tag list + + + + + + + + + + + 0 + 0 + + + + + 220 + 330 + + + + + 220 + 330 @@ -110,6 +208,19 @@ + + + + Qt::Vertical + + + + 20 + 20 + + + + @@ -310,7 +421,7 @@ 390 10 151 - 121 + 128 @@ -410,7 +521,7 @@ 10 10 371 - 231 + 260 @@ -470,9 +581,6 @@ - - - @@ -500,6 +608,9 @@ + + + @@ -792,8 +903,8 @@ 0 0 - 969 - 21 + 957 + 25