mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Fix series editing GUI.
This commit is contained in:
parent
0c681ccf5f
commit
31a8fc84f4
@ -163,6 +163,20 @@ class LRFSingleDialog(QDialog, Ui_LRFSingleDialog):
|
|||||||
self.tags.setText(tags if tags else '')
|
self.tags.setText(tags if tags else '')
|
||||||
comments = self.db.comments(row)
|
comments = self.db.comments(row)
|
||||||
self.gui_comment.setPlainText(comments if comments else '')
|
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)
|
cover = self.db.cover(row)
|
||||||
if cover:
|
if cover:
|
||||||
pm = QPixmap()
|
pm = QPixmap()
|
||||||
@ -271,7 +285,6 @@ class LRFSingleDialog(QDialog, Ui_LRFSingleDialog):
|
|||||||
if not t:
|
if not t:
|
||||||
t = 'Unknown'
|
t = 'Unknown'
|
||||||
aus = t.split(',')[0].strip()
|
aus = t.split(',')[0].strip()
|
||||||
print aus
|
|
||||||
self.db.set_author_sort(self.id, 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_publisher(self.id, qstring_to_unicode(self.gui_publisher.text()))
|
||||||
self.db.set_tags(self.id, qstring_to_unicode(self.tags.text()).split(','))
|
self.db.set_tags(self.id, qstring_to_unicode(self.tags.text()).split(','))
|
||||||
|
@ -283,9 +283,6 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="4" column="2" colspan="3" >
|
<item row="4" column="2" colspan="3" >
|
||||||
<widget class="QSpinBox" name="series_index" >
|
<widget class="QSpinBox" name="series_index" >
|
||||||
<property name="enabled" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip" >
|
<property name="toolTip" >
|
||||||
<string>Series index.</string>
|
<string>Series index.</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -166,10 +166,6 @@ class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog):
|
|||||||
ext = ''
|
ext = ''
|
||||||
Format(self.formats, ext)
|
Format(self.formats, ext)
|
||||||
|
|
||||||
if qstring_to_unicode(self.series.currentText()):
|
|
||||||
self.enable_series_index()
|
|
||||||
|
|
||||||
|
|
||||||
all_series = self.db.all_series()
|
all_series = self.db.all_series()
|
||||||
series_id = self.db.series_id(row)
|
series_id = self.db.series_id(row)
|
||||||
idx, c = None, 0
|
idx, c = None, 0
|
||||||
@ -183,6 +179,7 @@ class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog):
|
|||||||
self.series.lineEdit().setText('')
|
self.series.lineEdit().setText('')
|
||||||
if idx is not None:
|
if idx is not None:
|
||||||
self.series.setCurrentIndex(idx)
|
self.series.setCurrentIndex(idx)
|
||||||
|
self.enable_series_index()
|
||||||
|
|
||||||
self.series_index.setValue(self.db.series_index(row))
|
self.series_index.setValue(self.db.series_index(row))
|
||||||
QObject.connect(self.series, SIGNAL('currentIndexChanged(int)'), self.enable_series_index)
|
QObject.connect(self.series, SIGNAL('currentIndexChanged(int)'), self.enable_series_index)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user