mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More automatic migration
This commit is contained in:
parent
e09ecee421
commit
673dee204d
@ -21,7 +21,7 @@ class EditMetadataAction(object):
|
||||
set_social_metadata=None):
|
||||
rows = self.gui.library_view.selectionModel().selectedRows()
|
||||
if not rows or len(rows) == 0:
|
||||
d = error_dialog(self, _('Cannot download metadata'),
|
||||
d = error_dialog(self.gui, _('Cannot download metadata'),
|
||||
_('No books selected'))
|
||||
d.exec_()
|
||||
return
|
||||
@ -71,12 +71,12 @@ class EditMetadataAction(object):
|
||||
details = ['%s: %s'%(title, reason) for title,
|
||||
reason in x.failures.values()]
|
||||
details = '%s\n'%('\n'.join(details))
|
||||
warning_dialog(self, _('Failed to download some metadata'),
|
||||
warning_dialog(self.gui, _('Failed to download some metadata'),
|
||||
_('Failed to download metadata for the following:'),
|
||||
det_msg=details).exec_()
|
||||
else:
|
||||
err = _('Failed to download metadata:')
|
||||
error_dialog(self, _('Error'), err, det_msg=x.tb).exec_()
|
||||
error_dialog(self.gui, _('Error'), err, det_msg=x.tb).exec_()
|
||||
|
||||
|
||||
def edit_metadata(self, checked, bulk=None):
|
||||
@ -86,7 +86,7 @@ class EditMetadataAction(object):
|
||||
rows = self.gui.library_view.selectionModel().selectedRows()
|
||||
previous = self.gui.library_view.currentIndex()
|
||||
if not rows or len(rows) == 0:
|
||||
d = error_dialog(self, _('Cannot edit metadata'),
|
||||
d = error_dialog(self.gui, _('Cannot edit metadata'),
|
||||
_('No books selected'))
|
||||
d.exec_()
|
||||
return
|
||||
@ -122,7 +122,7 @@ class EditMetadataAction(object):
|
||||
rows = [r.row() for r in \
|
||||
self.gui.library_view.selectionModel().selectedRows()]
|
||||
if not rows or len(rows) == 0:
|
||||
d = error_dialog(self, _('Cannot edit metadata'),
|
||||
d = error_dialog(self.gui, _('Cannot edit metadata'),
|
||||
_('No books selected'))
|
||||
d.exec_()
|
||||
return
|
||||
@ -143,10 +143,10 @@ class EditMetadataAction(object):
|
||||
return
|
||||
rows = self.gui.library_view.selectionModel().selectedRows()
|
||||
if not rows or len(rows) == 0:
|
||||
return error_dialog(self, _('Cannot merge books'),
|
||||
return error_dialog(self.gui, _('Cannot merge books'),
|
||||
_('No books selected'), show=True)
|
||||
if len(rows) < 2:
|
||||
return error_dialog(self, _('Cannot merge books'),
|
||||
return error_dialog(self.gui, _('Cannot merge books'),
|
||||
_('At least two books must be selected for merging'),
|
||||
show=True)
|
||||
dest_id, src_books, src_ids = self.books_to_merge(rows)
|
||||
|
@ -21,7 +21,7 @@ class FetchNewsAction(object):
|
||||
Dispatcher(self.scheduled_recipe_fetched), func, args=args,
|
||||
description=desc)
|
||||
self.conversion_jobs[job] = (temp_files, fmt, arg)
|
||||
self.status_bar.show_message(_('Fetching news from ')+arg['title'], 2000)
|
||||
self.gui.status_bar.show_message(_('Fetching news from ')+arg['title'], 2000)
|
||||
|
||||
def scheduled_recipe_fetched(self, job):
|
||||
temp_files, fmt, arg = self.conversion_jobs.pop(job)
|
||||
@ -35,7 +35,7 @@ class FetchNewsAction(object):
|
||||
sync.add(id)
|
||||
dynamic.set('news_to_be_synced', sync)
|
||||
self.scheduler.recipe_downloaded(arg)
|
||||
self.status_bar.show_message(arg['title'] + _(' fetched.'), 3000)
|
||||
self.gui.status_bar.show_message(arg['title'] + _(' fetched.'), 3000)
|
||||
self.email_news(id)
|
||||
self.sync_news()
|
||||
|
||||
|
@ -30,7 +30,7 @@ class SaveToDiskAction(object):
|
||||
def save_to_disk(self, checked, single_dir=False, single_format=None):
|
||||
rows = self.gui.current_view().selectionModel().selectedRows()
|
||||
if not rows or len(rows) == 0:
|
||||
return error_dialog(self, _('Cannot save to disk'),
|
||||
return error_dialog(self.gui, _('Cannot save to disk'),
|
||||
_('No books selected'), show=True)
|
||||
path = choose_dir(self, 'save to disk dialog',
|
||||
_('Choose destination directory'))
|
||||
@ -39,7 +39,7 @@ class SaveToDiskAction(object):
|
||||
dpath = os.path.abspath(path).replace('/', os.sep)
|
||||
lpath = self.gui.library_view.model().db.library_path.replace('/', os.sep)
|
||||
if dpath.startswith(lpath):
|
||||
return error_dialog(self, _('Not allowed'),
|
||||
return error_dialog(self.gui, _('Not allowed'),
|
||||
_('You are trying to save files into the calibre '
|
||||
'library. This can cause corruption of your '
|
||||
'library. Save to disk is meant to export '
|
||||
@ -74,7 +74,7 @@ class SaveToDiskAction(object):
|
||||
def _books_saved(self, path, failures, error):
|
||||
self._saver = None
|
||||
if error:
|
||||
return error_dialog(self, _('Error while saving'),
|
||||
return error_dialog(self.gui, _('Error while saving'),
|
||||
_('There was an error while saving.'),
|
||||
error, show=True)
|
||||
if failures:
|
||||
@ -82,7 +82,7 @@ class SaveToDiskAction(object):
|
||||
(title, '\n\t'.join(err.splitlines())) for title, err in
|
||||
failures]
|
||||
|
||||
warning_dialog(self, _('Could not save some books'),
|
||||
warning_dialog(self.gui, _('Could not save some books'),
|
||||
_('Could not save some books') + ', ' +
|
||||
_('Click the show details button to see which ones.'),
|
||||
u'\n\n'.join(failures), show=True)
|
||||
|
@ -69,7 +69,7 @@ class ViewAction(object):
|
||||
def view_specific_format(self, triggered):
|
||||
rows = self.gui.library_view.selectionModel().selectedRows()
|
||||
if not rows or len(rows) == 0:
|
||||
d = error_dialog(self, _('Cannot view'), _('No book selected'))
|
||||
d = error_dialog(self.gui, _('Cannot view'), _('No book selected'))
|
||||
d.exec_()
|
||||
return
|
||||
|
||||
@ -83,7 +83,7 @@ class ViewAction(object):
|
||||
def _view_check(self, num, max_=3):
|
||||
if num <= max_:
|
||||
return True
|
||||
return question_dialog(self, _('Multiple Books Selected'),
|
||||
return question_dialog(self.gui, _('Multiple Books Selected'),
|
||||
_('You are attempting to open %d books. Opening too many '
|
||||
'books at once can be slow and have a negative effect on the '
|
||||
'responsiveness of your computer. Once started the process '
|
||||
@ -93,7 +93,7 @@ class ViewAction(object):
|
||||
def view_folder(self, *args):
|
||||
rows = self.gui.current_view().selectionModel().selectedRows()
|
||||
if not rows or len(rows) == 0:
|
||||
d = error_dialog(self, _('Cannot open folder'),
|
||||
d = error_dialog(self.gui, _('Cannot open folder'),
|
||||
_('No book selected'))
|
||||
d.exec_()
|
||||
return
|
||||
@ -130,7 +130,7 @@ class ViewAction(object):
|
||||
formats = self.gui.library_view.model().db.formats(row)
|
||||
title = self.gui.library_view.model().db.title(row)
|
||||
if not formats:
|
||||
error_dialog(self, _('Cannot view'),
|
||||
error_dialog(self.gui, _('Cannot view'),
|
||||
_('%s has no available formats.')%(title,), show=True)
|
||||
continue
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user