Reworked info box

git-svn-id: http://comictagger.googlecode.com/svn/trunk@40 6c5673fe-1810-88d6-992b-cd32ca31540c
This commit is contained in:
beville@gmail.com 2012-11-15 04:34:33 +00:00
parent db019619ee
commit 33e1b1fa70
2 changed files with 184 additions and 47 deletions

View File

@ -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 )

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>969</width>
<height>501</height>
<width>957</width>
<height>542</height>
</rect>
</property>
<property name="sizePolicy">
@ -33,6 +33,9 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<property name="formAlignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
@ -49,48 +52,143 @@
</layout>
</item>
<item>
<widget class="QLabel" name="lblArchiveInfo">
<widget class="QFrame" name="frameInfoBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblCover">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<sizepolicy hsizetype="Fixed" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>300</height>
<width>220</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>300</height>
<width>220</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="lblFilename">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>filename</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="lblArchiveType">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<italic>false</italic>
</font>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="text">
<string>archive type</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblPageCount">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>page count</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="lblTagList">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>tag list</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="lblCover">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>220</width>
<height>330</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>220</width>
<height>330</height>
</size>
</property>
<property name="frameShape">
@ -110,6 +208,19 @@
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
@ -310,7 +421,7 @@
<x>390</x>
<y>10</y>
<width>151</width>
<height>121</height>
<height>128</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout_3">
@ -410,7 +521,7 @@
<x>10</x>
<y>10</y>
<width>371</width>
<height>231</height>
<height>260</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout_2">
@ -470,9 +581,6 @@
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="leStoryArc"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
@ -500,6 +608,9 @@
<item row="7" column="1">
<widget class="QLineEdit" name="leFormat"/>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="leStoryArc"/>
</item>
</layout>
</widget>
</widget>
@ -792,8 +903,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>969</width>
<height>21</height>
<width>957</width>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="menuComicTagger">