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:
Charles Haley 2010-09-26 17:31:39 +01:00
parent ab9c74404a
commit 1cd78a56f2
4 changed files with 6 additions and 2 deletions

View File

@ -97,6 +97,9 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
db = self.gui.library_view.model().db db = self.gui.library_view.model().db
ids = [id for id in db.data.iterallids()] ids = [id for id in db.data.iterallids()]
db.dirtied(ids) 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): def debug_device_detection(self, *args):
from calibre.gui2.preferences.device_debug import DebugDevice from calibre.gui2.preferences.device_debug import DebugDevice

View File

@ -127,7 +127,7 @@
<item row="10" column="0" colspan="2"> <item row="10" column="0" colspan="2">
<widget class="QPushButton" name="button_all_books_dirty"> <widget class="QPushButton" name="button_all_books_dirty">
<property name="text"> <property name="text">
<string>Back up metadata of all books (while you are working)</string> <string>Back up metadata of all books</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -75,6 +75,7 @@ class MetadataBackup(Thread): # {{{
# Give the GUI thread a chance to do something. Python threads don't # Give the GUI thread a chance to do something. Python threads don't
# have priorities, so this thread would naturally keep the processor # have priorities, so this thread would naturally keep the processor
# until some scheduling event happens. The sleep makes such an event # until some scheduling event happens. The sleep makes such an event
print 'do one'
time.sleep(0.1) time.sleep(0.1)
try: try:
raw = metadata_to_opf(mi) raw = metadata_to_opf(mi)

View File

@ -100,7 +100,7 @@ class TemplateFormatter(string.Formatter):
val = func[1](self, val) val = func[1](self, val)
else: else:
val = func[1](self, val, *args) val = func[1](self, val, *args)
else: elif val:
val = string.Formatter.format_field(self, val, fmt) val = string.Formatter.format_field(self, val, fmt)
if not val: if not val:
return '' return ''