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