mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #4693 (Bulk edit metadata - can not set rating to 0 stars)
This commit is contained in:
parent
800981cb58
commit
0b04ea9ffd
@ -20,10 +20,8 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
||||
self.db = db
|
||||
self.ids = [ db.id(r) for r in rows]
|
||||
self.write_series = False
|
||||
self.write_rating = False
|
||||
self.changed = False
|
||||
QObject.connect(self.button_box, SIGNAL("accepted()"), self.sync)
|
||||
QObject.connect(self.rating, SIGNAL('valueChanged(int)'), self.rating_changed)
|
||||
|
||||
self.tags.update_tags_cache(self.db.all_tags())
|
||||
self.remove_tags.update_tags_cache(self.db.all_tags())
|
||||
@ -99,7 +97,7 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
||||
aus = unicode(self.author_sort.text())
|
||||
if aus and self.author_sort.isEnabled():
|
||||
self.db.set_author_sort(id, aus, notify=False)
|
||||
if self.write_rating:
|
||||
if self.rating.value() != -1:
|
||||
self.db.set_rating(id, 2*self.rating.value(), notify=False)
|
||||
pub = unicode(self.publisher.text())
|
||||
if pub:
|
||||
@ -134,5 +132,3 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
||||
def series_changed(self):
|
||||
self.write_series = True
|
||||
|
||||
def rating_changed(self):
|
||||
self.write_rating = True
|
||||
|
@ -96,12 +96,21 @@
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::PlusMinus</enum>
|
||||
</property>
|
||||
<property name="specialValueText">
|
||||
<string>No change</string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> stars</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
|
Loading…
x
Reference in New Issue
Block a user