Commit fa7e5588 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[gui][lib] Add links to the online documentation

parent 4183e452
......@@ -275,6 +275,45 @@
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="gui_doc_menu">
<property name="visible">True</property>
<property name="label" translatable="yes">GUI documentation</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="stock">gtk-help</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="command_line_doc_menu">
<property name="visible">True</property>
<property name="label" translatable="yes">Command line documentation</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="stock">gtk-help</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="workflow_doc_menu">
<property name="visible">True</property>
<property name="label" translatable="yes">Example of workflow</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="stock">gtk-help</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="legend_menu">
<property name="visible">True</property>
......
......@@ -154,9 +154,15 @@ class Charter(object):
menu_bar.set_size_request(0, 25)
menu_item = self.wtree.get_widget("doc_menu")
menu_item.connect("activate", self.show_doc)
menu_item.connect("activate", self.on_show_doc)
menu_item = self.wtree.get_widget("gui_doc_menu")
menu_item.connect("activate", self.on_gui_doc_menu)
menu_item = self.wtree.get_widget("doc_menu")
menu_item.connect("activate", self.on_command_line_doc_menu)
menu_item = self.wtree.get_widget("doc_menu")
menu_item.connect("activate", self.on_workflow_doc_menu)
menu_item = self.wtree.get_widget("legend_menu")
menu_item.connect("activate", self.show_legend)
menu_item.connect("activate", self.on_show_legend)
menu_item = self.wtree.get_widget("New_model")
self.add_accelerator(menu_item, "<Control>n")
......@@ -907,18 +913,24 @@ class Charter(object):
cancel_warn("Unknown picture format")
## Extra menu items ########################################################
def show_doc(self, widget):
"""
Doc
"""
url = "http://cadbiom.genouest.org/cw_support.html"
webbrowser.open(url)
return
def on_show_doc(self, widget):
"""Go to the main documentation site"""
webbrowser.open(cm.MAIN_DOC_URL)
def show_legend(self, widget):
"""
Doc
"""
def on_gui_doc_menu(self, widget):
"""Go to the doc of the GUI"""
webbrowser.open(cm.GUI_DOC_URL)
def on_command_line_doc_menu(self, widget):
"""Go to the doc of the command line"""
webbrowser.open(cm.COMMAND_LINE_DOC_URL)
def on_workflow_doc_menu(self, widget):
"""Go to the example workflow"""
webbrowser.open(cm.WORKFLOW_DOC_URL)
def on_show_legend(self, widget):
"""Show graph editor legend"""
self.legend = LegendWindow(self)
@check_curent_model
......
......@@ -47,6 +47,12 @@ LOG_LEVELS = {'debug': logging.DEBUG,
# Miscellaneous
TOOLTIPS_DELAY = 200 # (ms)
# Website
CADBIOM_WEBSITE_URL = "http://cadbiom.genouest.org/"
MAIN_DOC_URL = CADBIOM_WEBSITE_URL + "documentation.html"
GUI_DOC_URL = CADBIOM_WEBSITE_URL + "doc/cadbiom/gui_package.html"
COMMAND_LINE_DOC_URL = CADBIOM_WEBSITE_URL + "doc/cadbiom/command_line_usage.html"
WORKFLOW_DOC_URL = CADBIOM_WEBSITE_URL + "doc/cadbiom/examples.html"
################################################################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment