Changeset 998ca90 in sasview for src/sas/sasgui/guiframe/gui_manager.py
- Timestamp:
- Oct 7, 2016 10:21:40 AM (7 years ago)
- 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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- ff3f5821
- Parents:
- cb823f0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/gui_manager.py
r3fac0df r998ca90 1904 1904 if self._default_save_location == None: 1905 1905 self._default_save_location = os.getcwd() 1906 wx.PostEvent(self, StatusEvent(status="Loading Project file...")) 1907 dlg = wx.FileDialog(self, 1906 msg = "This operation will set SasView to its freshly opened state " 1907 msg += "before loading the project. Do you wish to continue?" 1908 if not self._data_panel.on_remove(None, msg): 1909 wx.PostEvent(self, StatusEvent(status="Loading Project file...")) 1910 dlg = wx.FileDialog(self, 1908 1911 "Choose a file", 1909 1912 self._default_save_location, "", 1910 1913 APPLICATION_WLIST) 1911 if dlg.ShowModal() == wx.ID_OK:1912 path = dlg.GetPath()1914 if dlg.ShowModal() == wx.ID_OK: 1915 path = dlg.GetPath() 1913 1916 if path is not None: 1914 1917 self._default_save_location = os.path.dirname(path) 1915 dlg.Destroy() 1916 1917 self.load_state(path=path, is_project=True) 1918 dlg.Destroy() 1919 1920 # Reset to a base state 1921 self._on_reset_state() 1922 1923 # Load the project file 1924 self.load_state(path=path, is_project=True) 1925 1926 def _on_reset_state(self): 1927 """ 1928 Resets SasView to its freshly opened state. 1929 :return: None 1930 """ 1931 # Reset all plugins to their base state 1932 for plugin in self.plugins: 1933 plugin.clear_panel() 1934 # Reset plot number to 0 1935 self.graph_num = 0 1936 # Remove all loaded data 1937 self._data_panel.selection_cbox.SetValue('Select all Data') 1938 self._data_panel._on_selection_type(None) 1918 1939 1919 1940 def _on_save_application(self, event): … … 2063 2084 except: 2064 2085 logging.info("Failed to connect to www.sasview.org") 2065 self._process_version(version_info, standalone=event == None) 2066 2067 2068 2069 # 2070 # try: 2071 # req = urllib2.Request(config.__update_URL__) 2072 # res = urllib2.urlopen(req) 2073 # content = res.read().strip() 2074 # logging.info("Connected to www.sasview.org. Latest version: %s" 2075 # % (content)) 2076 # version_info = json.loads(content) 2077 # except: 2078 # logging.info("Failed to connect to www.sasview.org") 2079 # version_info = {"version": "0.0.0"} 2080 # self._process_version(version_info, standalone=event == None) 2086 self._process_version(version_info, standalone=event == None) 2081 2087 2082 2088 def _process_version(self, version_info, standalone=True):
Note: See TracChangeset
for help on using the changeset viewer.