From afeefef650d189ed6e190846e601cdb64d79506b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 14 Sep 2022 13:56:58 +0530 Subject: [PATCH] Fix #1988443 [[Enhancement] Add warning pop-up when deleting custom highlight style](https://bugs.launchpad.net/calibre/+bug/1988443) --- src/pyj/read_book/highlights.pyj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pyj/read_book/highlights.pyj b/src/pyj/read_book/highlights.pyj index 503f640db0..810939ae58 100644 --- a/src/pyj/read_book/highlights.pyj +++ b/src/pyj/read_book/highlights.pyj @@ -473,6 +473,13 @@ class EditNotesAndColors: # {{{ return item def remove_custom_color(self): + question_dialog(_('Are you sure?'), _( + 'Do you want to permanently delete this highlighting style?'), def (yes): + if yes: + self.do_remove_custom_color() + ) + + def do_remove_custom_color(self): item = self.container.getElementsByClassName('current-swatch')[0] cct = JSON.parse(item.dataset.style) p = item.parentNode