Fix series editing GUI.

This commit is contained in:
Kovid Goyal 2007-09-07 19:44:51 +00:00
parent 0c681ccf5f
commit 31a8fc84f4
3 changed files with 16 additions and 9 deletions

View File

@ -163,12 +163,26 @@ class LRFSingleDialog(QDialog, Ui_LRFSingleDialog):
self.tags.setText(tags if tags else '')
comments = self.db.comments(row)
self.gui_comment.setPlainText(comments if comments else '')
all_series = self.db.all_series()
series_id = self.db.series_id(row)
idx, c = None, 0
for i in all_series:
id, name = i
if id == series_id:
idx = c
self.series.addItem(name)
c += 1
self.series.lineEdit().setText('')
if idx is not None:
self.series.setCurrentIndex(idx)
cover = self.db.cover(row)
if cover:
pm = QPixmap()
pm.loadFromData(cover)
if not pm.isNull():
self.cover.setPixmap(pm)
self.cover.setPixmap(pm)
def initialize_options(self):
'''Initialize non metadata options from the defaults.'''
@ -271,7 +285,6 @@ class LRFSingleDialog(QDialog, Ui_LRFSingleDialog):
if not t:
t = 'Unknown'
aus = t.split(',')[0].strip()
print aus
self.db.set_author_sort(self.id, aus)
self.db.set_publisher(self.id, qstring_to_unicode(self.gui_publisher.text()))
self.db.set_tags(self.id, qstring_to_unicode(self.tags.text()).split(','))

View File

@ -283,9 +283,6 @@
</item>
<item row="4" column="2" colspan="3" >
<widget class="QSpinBox" name="series_index" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="toolTip" >
<string>Series index.</string>
</property>

View File

@ -166,10 +166,6 @@ class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog):
ext = ''
Format(self.formats, ext)
if qstring_to_unicode(self.series.currentText()):
self.enable_series_index()
all_series = self.db.all_series()
series_id = self.db.series_id(row)
idx, c = None, 0
@ -183,6 +179,7 @@ class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog):
self.series.lineEdit().setText('')
if idx is not None:
self.series.setCurrentIndex(idx)
self.enable_series_index()
self.series_index.setValue(self.db.series_index(row))
QObject.connect(self.series, SIGNAL('currentIndexChanged(int)'), self.enable_series_index)