mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Use a standard delete confirmation for deleting highlights
This commit is contained in:
parent
4bf48d8d99
commit
31acd459a9
@ -14,7 +14,8 @@ from PyQt5.Qt import (
|
||||
|
||||
from calibre.constants import plugins
|
||||
from calibre.ebooks.epub.cfi.parse import cfi_sort_key
|
||||
from calibre.gui2 import choose_save_file, error_dialog, question_dialog
|
||||
from calibre.gui2 import choose_save_file, error_dialog
|
||||
from calibre.gui2.dialogs.confirm_delete import confirm
|
||||
from calibre.gui2.library.annotations import Details, render_notes
|
||||
from calibre.gui2.viewer.config import vprefs
|
||||
from calibre.gui2.viewer.search import SearchInput
|
||||
@ -347,10 +348,12 @@ class HighlightsPanel(QWidget):
|
||||
highlights = tuple(self.highlights.selected_highlights)
|
||||
if not highlights:
|
||||
return self.no_selected_highlight()
|
||||
if question_dialog(self, _('Are you sure?'), ngettext(
|
||||
if confirm(
|
||||
ngettext(
|
||||
'Are you sure you want to delete this highlight permanently?',
|
||||
'Are you sure you want to delete all {} highlights permanently?',
|
||||
len(highlights)).format(len(highlights))
|
||||
len(highlights)).format(len(highlights)),
|
||||
'delete-highlight-from-viewer', parent=self, config_set=vprefs
|
||||
):
|
||||
for h in highlights:
|
||||
self.request_highlight_action.emit(h['uuid'], 'delete')
|
||||
|
Loading…
x
Reference in New Issue
Block a user