Changes in src/sas/sasgui/guiframe/gui_manager.py [adb0851:e6de6b8] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/gui_manager.py
radb0851 re6de6b8 1152 1152 self.delete_panel(ID) 1153 1153 break 1154 self.cpanel_on_focus.SetFocus() 1154 if self.cpanel_on_focus is not None: 1155 self.cpanel_on_focus.SetFocus() 1155 1156 1156 1157 … … 1333 1334 self._applications_menu_name = name 1334 1335 1335 def _on_marketplace_click(self, event):1336 """1337 Click event for the help menu item linking to the Marketplace.1338 """1339 import webbrowser1340 webbrowser.open_new(config.marketplace_url)1341 1342 1336 def _add_help_menu(self): 1343 1337 """ … … 1345 1339 tutorial PDF and documentation pages. 1346 1340 """ 1341 # Help menu 1347 1342 self._help_menu = wx.Menu() 1343 style = self.__gui_style & GUIFRAME.WELCOME_PANEL_ON 1348 1344 1349 1345 wx_id = wx.NewId() 1350 1346 self._help_menu.Append(wx_id, '&Documentation', '') 1351 1347 wx.EVT_MENU(self, wx_id, self._onSphinxDocs) 1348 self._help_menu.AppendSeparator() 1352 1349 1353 1350 if config._do_tutorial and (IS_WIN or sys.platform == 'darwin'): … … 1355 1352 self._help_menu.Append(wx_id, '&Tutorial', 'Software tutorial') 1356 1353 wx.EVT_MENU(self, wx_id, self._onTutorial) 1354 self._help_menu.AppendSeparator() 1355 1357 1356 1358 1357 if config._do_acknowledge: … … 1360 1359 self._help_menu.Append(wx_id, '&Acknowledge', 'Acknowledging SasView') 1361 1360 wx.EVT_MENU(self, wx_id, self._onAcknowledge) 1361 self._help_menu.AppendSeparator() 1362 1362 1363 1363 1364 if config._do_aboutbox: … … 1366 1367 self._help_menu.Append(wx_id, '&About', 'Software information') 1367 1368 wx.EVT_MENU(self, wx_id, self._onAbout) 1368 1369 if config.marketplace_url: 1370 wx_id = wx.NewId() 1371 self._help_menu.Append(wx_id, '&Model marketplace', '') 1372 wx.EVT_MENU(self, wx_id, self._on_marketplace_click) 1369 self._help_menu.AppendSeparator() 1370 1373 1371 1374 1372 # Checking for updates … … 1907 1905 if self._default_save_location == None: 1908 1906 self._default_save_location = os.getcwd() 1909 wx.PostEvent(self, StatusEvent(status="Loading Project file...")) 1910 dlg = wx.FileDialog(self, 1907 msg = "This operation will set SasView to its freshly opened state " 1908 msg += "before loading the project. Do you wish to continue?" 1909 if not self._data_panel.on_remove(None, msg): 1910 wx.PostEvent(self, StatusEvent(status="Loading Project file...")) 1911 dlg = wx.FileDialog(self, 1911 1912 "Choose a file", 1912 1913 self._default_save_location, "", 1913 1914 APPLICATION_WLIST) 1914 if dlg.ShowModal() == wx.ID_OK:1915 path = dlg.GetPath()1915 if dlg.ShowModal() == wx.ID_OK: 1916 path = dlg.GetPath() 1916 1917 if path is not None: 1917 1918 self._default_save_location = os.path.dirname(path) 1918 dlg.Destroy() 1919 1920 self.load_state(path=path, is_project=True) 1919 dlg.Destroy() 1920 # Reset to a base state 1921 self._on_reset_state() 1922 # Load the project file 1923 self.load_state(path=path, is_project=True) 1924 1925 def _on_reset_state(self): 1926 """ 1927 Resets SasView to its freshly opened state. 1928 :return: None 1929 """ 1930 # Reset all plugins to their base state 1931 self._data_panel.set_panel_on_focus() 1932 # Remove all loaded data 1933 self._data_panel.selection_cbox.SetValue('Select all Data') 1934 self._data_panel._on_selection_type(None) 1935 for plugin in self.plugins: 1936 plugin.clear_panel() 1937 # Reset plot number to 0 1938 self.graph_num = 0 1921 1939 1922 1940 def _on_save_application(self, event): … … 2066 2084 except: 2067 2085 logging.info("Failed to connect to www.sasview.org") 2068 self._process_version(version_info, standalone=event == None) 2069 2070 2071 2072 # 2073 # try: 2074 # req = urllib2.Request(config.__update_URL__) 2075 # res = urllib2.urlopen(req) 2076 # content = res.read().strip() 2077 # logging.info("Connected to www.sasview.org. Latest version: %s" 2078 # % (content)) 2079 # version_info = json.loads(content) 2080 # except: 2081 # logging.info("Failed to connect to www.sasview.org") 2082 # version_info = {"version": "0.0.0"} 2083 # self._process_version(version_info, standalone=event == None) 2086 self._process_version(version_info, standalone=event == None) 2084 2087 2085 2088 def _process_version(self, version_info, standalone=True):
Note: See TracChangeset
for help on using the changeset viewer.