mirror of
https://github.com/gnuradio/gnuradio-companion.git
synced 2025-12-11 23:33:47 -06:00
grc: added url to wiki page for each block in docs tab
This commit is contained in:
parent
914cacfebd
commit
c65ce732df
4
00-grc-docs.conf.in
Normal file
4
00-grc-docs.conf.in
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# This should link to the wiki page-per-block documentation, when the block label (e.g., FFT) is appended to the end of the string
|
||||||
|
|
||||||
|
[grc-docs]
|
||||||
|
wiki_block_docs_url_prefix = @GRC_DOCS_URL_PREFIX@
|
||||||
@ -101,7 +101,7 @@ GR_REGISTER_COMPONENT("gnuradio-companion" ENABLE_GRC
|
|||||||
if(ENABLE_GRC)
|
if(ENABLE_GRC)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Create and install the grc conf file
|
# Create and install the grc and grc-docs conf file
|
||||||
########################################################################
|
########################################################################
|
||||||
file(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${GRC_BLOCKS_DIR} blocksdir)
|
file(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${GRC_BLOCKS_DIR} blocksdir)
|
||||||
if(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
|
if(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
|
||||||
@ -132,6 +132,16 @@ install(
|
|||||||
DESTINATION ${GR_PREFSDIR}
|
DESTINATION ${GR_PREFSDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/00-grc-docs.conf.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/00-grc-docs.conf
|
||||||
|
@ONLY)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/00-grc-docs.conf
|
||||||
|
DESTINATION ${GR_PREFSDIR}
|
||||||
|
)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Install (+ compile) python sources and data files
|
# Install (+ compile) python sources and data files
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|||||||
@ -96,6 +96,10 @@ class Config(CoreConfig):
|
|||||||
def xterm_executable(self):
|
def xterm_executable(self):
|
||||||
return self._gr_prefs.get_string('grc', 'xterm_executable', 'xterm')
|
return self._gr_prefs.get_string('grc', 'xterm_executable', 'xterm')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def wiki_block_docs_url_prefix(self):
|
||||||
|
return self._gr_prefs.get_string('grc-docs', 'wiki_block_docs_url_prefix', '')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def default_canvas_size(self):
|
def default_canvas_size(self):
|
||||||
try: # ugly, but matches current code style
|
try: # ugly, but matches current code style
|
||||||
|
|||||||
@ -57,6 +57,7 @@ class PropsDialog(Gtk.Dialog):
|
|||||||
|
|
||||||
self._block = block
|
self._block = block
|
||||||
self._hash = 0
|
self._hash = 0
|
||||||
|
self._config = parent.config
|
||||||
|
|
||||||
vpaned = Gtk.VPaned()
|
vpaned = Gtk.VPaned()
|
||||||
self.vbox.pack_start(vpaned, True, True, 0)
|
self.vbox.pack_start(vpaned, True, True, 0)
|
||||||
@ -211,6 +212,12 @@ class PropsDialog(Gtk.Dialog):
|
|||||||
buf.delete(buf.get_start_iter(), buf.get_end_iter())
|
buf.delete(buf.get_start_iter(), buf.get_end_iter())
|
||||||
pos = buf.get_end_iter()
|
pos = buf.get_end_iter()
|
||||||
|
|
||||||
|
# Add link to wiki page for this block, at the top
|
||||||
|
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')
|
||||||
|
|
||||||
docstrings = self._block.documentation.copy()
|
docstrings = self._block.documentation.copy()
|
||||||
if not docstrings:
|
if not docstrings:
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user