From 4675ce0579ba99b9ebe2fce9ac37e5420f325ee6 Mon Sep 17 00:00:00 2001 From: Jeff Long <willcode4@gmail.com> Date: Sun, 22 Nov 2020 16:45:16 -0500 Subject: grc: add wiki link to properties dialog docs (#3933) So user's don't have to copy/paste the URL --- grc/gui/PropsDialog.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'grc/gui/PropsDialog.py') diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py index 634d6f9d45..e7dd72edcf 100644 --- a/grc/gui/PropsDialog.py +++ b/grc/gui/PropsDialog.py @@ -65,7 +65,11 @@ class PropsDialog(Gtk.Dialog): doc_view.get_buffer().create_tag('b', weight=Pango.Weight.BOLD) self._docs_box = Gtk.ScrolledWindow() self._docs_box.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) - self._docs_box.add(self._docs_text_display) + self._docs_vbox = Gtk.VBox(homogeneous=False, spacing=0) + self._docs_box.add(self._docs_vbox) + self._docs_link = Gtk.Label(use_markup=True) + self._docs_vbox.pack_start(self._docs_link, False, False, 0) + self._docs_vbox.pack_end(self._docs_text_display, True, True, 0) notebook.append_page(self._docs_box, Gtk.Label(label="Documentation")) # Generated code for the block @@ -208,7 +212,10 @@ class PropsDialog(Gtk.Dialog): note = "Wiki Page for this Block: " prefix = self._config.wiki_block_docs_url_prefix suffix = self._block.label.replace(" ", "_") - buf.insert(pos, note + prefix + suffix + '\n\n') + href = f'<a href="{prefix+suffix}">Visit Wiki Page</a>' + self._docs_link.set_markup(href) + else: + self._docs_link.set_markup('Out of Tree Block') docstrings = self._block.documentation.copy() if not docstrings: -- cgit v1.2.3