@@ -60,7 +60,8 @@ def make_sender() -> HighlightSender:
6060 prefs ["last_send_time" ] = strftime ("%Y-%m-%d %H:%M:%S" , gmtime ())
6161
6262 info = f"Success: { amt } highlight{ ' has' if amt == 1 else 's have' } been sent to obsidian."
63- info_dialog (parent , "Highlights Sent" , info , show = True )
63+ if prefs ['highlights_sent_dialog' ]:
64+ info_dialog (parent , "Highlights Sent" , info , show = True )
6465 else :
6566 info_dialog (parent , "No Highlights Sent" , "No highlights to send." , show = True )
6667
@@ -97,14 +98,17 @@ def send_all_highlights(parent, db):
9798 :param parent: QDialog or other window that is the parent of the info dialogs this function makes
9899 :param db: calibre database: Cache().new_api
99100 """
100- confirm = QMessageBox ()
101- confirm .setText ("Are you sure you want to send ALL highlights to obsidian? This cannot be undone." )
102- confirm .setStandardButtons (QMessageBox .Yes | QMessageBox .No )
103- confirm .setIcon (QMessageBox .Question )
104- confirmed = confirm .exec ()
101+ if prefs ['confirm_send_all' ]:
102+ confirm = QMessageBox ()
103+ confirm .setText ("Are you sure you want to send ALL highlights to obsidian? This cannot be undone." )
104+ confirm .setStandardButtons (QMessageBox .Yes | QMessageBox .No )
105+ confirm .setIcon (QMessageBox .Question )
106+ confirmed = confirm .exec ()
105107
106- if confirmed == QMessageBox .Yes :
107- send_highlights (parent , db )
108+ if confirmed != QMessageBox .Yes :
109+ return
110+
111+ send_highlights (parent , db )
108112
109113
110114def send_new_selected_highlights (parent , db ):
@@ -145,14 +149,15 @@ def send_all_selected_highlights(parent, db):
145149 :param db: calibre database: Cache().new_api
146150 """
147151
148- confirm = QMessageBox ()
149- confirm .setText ("Are you sure you want to send ALL highlights of the selected books to obsidian? This cannot be undone." )
150- confirm .setStandardButtons (QMessageBox .Yes | QMessageBox .No )
151- confirm .setIcon (QMessageBox .Question )
152- confirmed = confirm .exec ()
152+ if prefs ['confirm_send_all' ]:
153+ confirm = QMessageBox ()
154+ confirm .setText ("Are you sure you want to send ALL highlights of the selected books to obsidian? This cannot be undone." )
155+ confirm .setStandardButtons (QMessageBox .Yes | QMessageBox .No )
156+ confirm .setIcon (QMessageBox .Question )
157+ confirmed = confirm .exec ()
153158
154- if confirmed != QMessageBox .Yes :
155- return
159+ if confirmed != QMessageBox .Yes :
160+ return
156161
157162 try :
158163 parent .library_view # check if this exists
0 commit comments