Changeset ad8872e in sasview


Ignore:
Timestamp:
Feb 14, 2015 11:10:50 AM (10 years ago)
Author:
butler
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
61f32d2b
Parents:
f620870
Message:

Remove help menu items from old documentation

From _add_help_menu

  • changed Sphinx Documentation to Documentation
  • removed checking on wx version
  • removed all mention of old menu items

From _onSphinx

  • added checking for wx version
  • added else for case if wx version less than 2.9 (send to webpage)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/guiframe/gui_manager.py

    rb9a5f0e rad8872e  
    2424import logging 
    2525import httplib 
     26import webbrowser 
     27 
    2628 
    2729from sas.guiframe.events import EVT_CATEGORY 
     
    13251327    def _add_help_menu(self): 
    13261328        """ 
    1327         add help menu 
     1329        add help menu to menu bar.  Includes welcome page, about page, 
     1330        tutorial PDF and documentation pages.  
    13281331        """ 
    13291332        # Help menu 
     
    13361339                id = wx.NewId() 
    13371340                self._help_menu.Append(id, '&Welcome', '') 
    1338                 self._help_menu.AppendSeparator() 
    13391341                wx.EVT_MENU(self, id, self.show_welcome_panel) 
    13401342 
    1341         # Look for help item in plug-ins  
    1342         for item in self.plugins: 
    1343             if hasattr(item, "help"): 
    1344                 id = wx.NewId() 
    1345                 self._help_menu.Append(id,'&%s Help' % item.sub_menu, '') 
    1346                 wx.EVT_MENU(self, id, item.help) 
    1347  
    1348         # Only show new Sphinx docs link if version of wx supports displaying 
    1349         # it correctly. 
    1350         show_sphinx_docs = float(wx.__version__[:3]) >= 2.9 
    1351         if show_sphinx_docs: 
    1352             self._help_menu.AppendSeparator() 
    1353             id = wx.NewId() 
    1354             self._help_menu.Append(id, '&Sphinx Documentation', '') 
    1355             wx.EVT_MENU(self, id, self._onSphinxDocs) 
     1343        self._help_menu.AppendSeparator() 
     1344        id = wx.NewId() 
     1345        self._help_menu.Append(id, '& Documentation', '') 
     1346        wx.EVT_MENU(self, id, self._onSphinxDocs) 
    13561347 
    13571348        if config._do_tutorial and (IS_WIN or sys.platform =='darwin'): 
     
    21622153    def _onSphinxDocs(self, evt): 
    21632154        """ 
    2164         Pop up a Sphinx Documentation dialog. 
     2155        Bring up Sphinx Documentation.  If Wx 2.9 or higher is installed  
     2156        with proper HTML support then Pop up a Sphinx Documentation dialog 
     2157        locally.  If not pop up a new tab in the default system browser  
     2158        calling the documentation website. 
    21652159         
    21662160        :param evt: menu event 
     
    21682162        # Running SasView "in-place" using run.py means the docs will be in a 
    21692163        # different place than they would otherwise. 
    2170         SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 
    2171         if SPHINX_DOC_ENV in os.environ: 
    2172             docs_path = os.path.join(os.environ[SPHINX_DOC_ENV], "index.html") 
     2164 
     2165        show_sphinx_docs = float(wx.__version__[:3]) >= 2.9 
     2166        if show_sphinx_docs: 
     2167            SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 
     2168            if SPHINX_DOC_ENV in os.environ: 
     2169                docs_path = os.path.join(os.environ[SPHINX_DOC_ENV], "index.html") 
     2170            else: 
     2171                docs_path = os.path.join(PATH_APP, "..", "..", "doc", "index.html") 
     2172 
     2173            if os.path.exists(docs_path): 
     2174                from documentation_window import DocumentationWindow 
     2175 
     2176                sphinx_doc_viewer = DocumentationWindow(None, -1, docs_path) 
     2177                sphinx_doc_viewer.Show() 
     2178            else: 
     2179                logging.error("Could not find Sphinx documentation at '%' -- has it been built?" % docs_path) 
    21732180        else: 
    2174             docs_path = os.path.join(PATH_APP, "..", "..", "doc", "index.html") 
    2175  
    2176         if os.path.exists(docs_path): 
    2177             from documentation_window import DocumentationWindow 
    2178  
    2179             sphinx_doc_viewer = DocumentationWindow(None, -1, docs_path) 
    2180             sphinx_doc_viewer.Show() 
    2181         else: 
    2182             logging.error("Could not find Sphinx documentation at '%' -- has it been built?" % docs_path) 
     2181            #For red hat and maybe others who do not have Wx 3.0 
     2182            #just send to webpage of documentation 
     2183            webbrowser.open_new_tab('http://www.sasview.org/sasview') 
    21832184 
    21842185    def set_manager(self, manager): 
Note: See TracChangeset for help on using the changeset viewer.