Skip to content

Commit 82abcbb

Browse files
committed
allow keyboard shortcuts for "send all..."
1 parent 26739d3 commit 82abcbb

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

h2o/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def __init__(self):
8080
self.l.addWidget(self.title_linebreak)
8181

8282
# note formatting info
83-
format_info = "The following formatting options are available. " + \
83+
format_info = "<b>The following formatting options are available.</b> " + \
8484
"To use one, put it in curly brackets, as in {title} or {blockquote}."
8585
self.note_format_label = QLabel(format_info, self)
8686
self.l.addWidget(self.note_format_label)
@@ -174,7 +174,7 @@ def make_format_info_label(self):
174174
"location", "timestamp",
175175
"bookid", "uuid",
176176
]
177-
f_opt_str = '"' + '", "'.join(format_options) + '"'
177+
f_opt_str = "'" + "', '".join(format_options) + "'"
178178

179179
strs = []
180180
char_count = 0

h2o/menu_button.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ def __init__(self, parent, site_customization):
1818
super().__init__(parent, site_customization)
1919
self.new_highlights_action = None
2020
self.resend_highlights_action = None
21-
self.new_selected_books_action = None
21+
self.new_selected_action = None
22+
self.all_highlights_action = None
23+
self.all_selected_action = None
2224
self.user_config_action = None
2325
self.open_help_action = None
2426

@@ -55,10 +57,16 @@ def genesis(self):
5557
rh = "Resend Highlights to Obsidian"
5658
rhd = "Resend last highlights sent to Obsidian"
5759
self.resend_highlights_action = ma(un + rh, rh, description=rhd, shortcut=None, triggered=self.resend)
60+
ah = "Send All Highlights to Obsidian"
61+
ahd = "Send all highlights of all books Obsidian"
62+
self.all_highlights_action = ma(un + ah, ah, description=ahd, shortcut=None, triggered=self.send_all)
5863
nsh = "Send New Highlights of Selected Books"
5964
nshd = "Send new highlights of selected books to Obsidian. Will prevent non-selected highlights from being " \
6065
+ "sent by 'Send New Highlights'."
61-
self.new_selected_books_action = ma(un + nsh, nsh, description=nshd, shortcut=None, triggered=self.send_new_selected)
66+
self.new_selected_action = ma(un + nsh, nsh, description=nshd, shortcut=None, triggered=self.send_new_selected)
67+
ash = "Send All Highlights of Selected Books"
68+
ashd = "Send all highlights of selected books to Obsidian"
69+
self.all_selected_action = ma(un + ash, ash, description=ashd, shortcut=None, triggered=self.send_all_selected)
6270
ocd = "Open config settings for Highlights to Obsidian"
6371
self.user_config_action = ma(un + "Config", "Config", description=ocd, shortcut=False, triggered=self.open_config)
6472
hd = "Open help menu for Highlights to Obsidian"
@@ -81,6 +89,12 @@ def resend(self):
8189
def send_new_selected(self):
8290
b_acts.send_new_selected_highlights(self.gui, self.gui.current_db.new_api)
8391

92+
def send_all(self):
93+
b_acts.send_all_highlights(self.gui, self.gui.current_db.new_api)
94+
95+
def send_all_selected(self):
96+
b_acts.send_all_selected_highlights(self.gui, self.gui.current_db.new_api)
97+
8498
def open_config(self):
8599
do_user_config = self.interface_action_base_plugin.do_user_config
86100
do_user_config(parent=self.gui)

0 commit comments

Comments
 (0)