mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix problem where :0>3s produced a string of all zeros for null fields.
Add a confirmation dialog to the backup pushbutton
This commit is contained in:
parent
ab9c74404a
commit
1cd78a56f2
@ -97,6 +97,9 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
||||
db = self.gui.library_view.model().db
|
||||
ids = [id for id in db.data.iterallids()]
|
||||
db.dirtied(ids)
|
||||
info_dialog(self, _('Backup metadata'),
|
||||
_('Metadata will be backed up while calibre is running, at the '
|
||||
'rate of 30 books per minute.'), show=True)
|
||||
|
||||
def debug_device_detection(self, *args):
|
||||
from calibre.gui2.preferences.device_debug import DebugDevice
|
||||
|
@ -127,7 +127,7 @@
|
||||
<item row="10" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="button_all_books_dirty">
|
||||
<property name="text">
|
||||
<string>Back up metadata of all books (while you are working)</string>
|
||||
<string>Back up metadata of all books</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -75,6 +75,7 @@ class MetadataBackup(Thread): # {{{
|
||||
# Give the GUI thread a chance to do something. Python threads don't
|
||||
# have priorities, so this thread would naturally keep the processor
|
||||
# until some scheduling event happens. The sleep makes such an event
|
||||
print 'do one'
|
||||
time.sleep(0.1)
|
||||
try:
|
||||
raw = metadata_to_opf(mi)
|
||||
|
@ -100,7 +100,7 @@ class TemplateFormatter(string.Formatter):
|
||||
val = func[1](self, val)
|
||||
else:
|
||||
val = func[1](self, val, *args)
|
||||
else:
|
||||
elif val:
|
||||
val = string.Formatter.format_field(self, val, fmt)
|
||||
if not val:
|
||||
return ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user