From 6b85665584ab862e778fc585cd76e4ed53f66475 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 12 May 2020 19:59:40 +0530 Subject: [PATCH] Confirm on remove highlight --- src/calibre/gui2/viewer/highlights.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/viewer/highlights.py b/src/calibre/gui2/viewer/highlights.py index 8a41869085..0dd1a13f9a 100644 --- a/src/calibre/gui2/viewer/highlights.py +++ b/src/calibre/gui2/viewer/highlights.py @@ -12,7 +12,7 @@ from PyQt5.Qt import ( ) from calibre.constants import plugins -from calibre.gui2 import error_dialog +from calibre.gui2 import error_dialog, question_dialog from calibre.gui2.viewer.search import SearchInput from polyglot.builtins import range @@ -143,7 +143,10 @@ class HighlightsPanel(QWidget): h = self.highlights.current_highlight if h is None: return self.no_selected_highlight() - self.request_highlight_action.emit(h['uuid'], 'delete') + if question_dialog(self, _('Are you sure?'), _( + 'Are you sure you want to delete this highlight permanently?') + ): + self.request_highlight_action.emit(h['uuid'], 'delete') def add_highlight(self): self.request_highlight_action.emit(None, 'create')