mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-21 22:26:00 +01: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
4 changed files with 6 additions and 2 deletions
|
|
@ -97,6 +97,9 @@ def mark_dirty(self):
|
|||
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 @@ def run(self):
|
|||
# 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 @@ def format_field(self, val, fmt):
|
|||
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…
Reference in a new issue