Changeset 4c01978 in sasview
- Timestamp:
- Mar 25, 2011 11:09:31 AM (14 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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- fcc5680
- Parents:
- d18e208
- Location:
- guiframe
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/config.py
r957723f r4c01978 46 46 #PLUGIN_STATE_EXTENSIONS = ['.prv','.fitv', '.inv'] 47 47 #APPLICATION_STATE_EXTENSION = '.svs' 48 # WLIST = ['SansView files (*.svs)|*.svs','P(r) files (*.prv)|*.prv',48 #PLUGINS_WLIST = ['P(r) files (*.prv)|*.prv', 49 49 # 'Fitting files (*.fitv)|*.fitv', 50 50 # 'Invariant files (*.inv)|*.inv'] 51 51 #APPLICATION_WLIST = 'SansView files (*.svs)|*.svs' 52 APPLICATION_WLIST = '' 53 APPLICATION_STATE_EXTENSION = None 54 PLUGINS_WLIST = [] 52 55 PLUGIN_STATE_EXTENSIONS = [] 53 APPLICATION_STATE_EXTENSION = None54 WLIST = []55 56 SPLASH_SCREEN_PATH = "images/danse_logo.png" 56 57 DEFAULT_STYLE = GUIFRAME.SINGLE_APPLICATION -
guiframe/gui_manager.py
rd18e208 r4c01978 53 53 #read some constants from config 54 54 APPLICATION_STATE_EXTENSION = config.APPLICATION_STATE_EXTENSION 55 56 55 APPLICATION_NAME = config.__appname__ 57 56 SPLASH_SCREEN_PATH = config.SPLASH_SCREEN_PATH … … 70 69 EXTENSIONS = PLUGIN_STATE_EXTENSIONS + extension_list 71 70 try: 72 WLIST = '|'.join(config.WLIST)71 PLUGINS_WLIST = '|'.join(config.PLUGINS_WLIST) 73 72 except: 74 WLIST = ''75 73 PLUGINS_WLIST = '' 74 APPLICATION_WLIST = config.APPLICATION_WLIST 76 75 77 76 class ViewerFrame(wx.Frame): … … 798 797 self._file_menu = wx.Menu() 799 798 style = self.__gui_style & GUIFRAME.DATALOADER_ON 799 style1 = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS 800 800 if style == GUIFRAME.DATALOADER_ON: 801 # some menu of plugin to be seen under file menu 802 hint_load_file = "Read state's files and load" 803 hint_load_file += " them into the application" 801 if style1 == GUIFRAME.MULTIPLE_APPLICATIONS: 802 # some menu of plugin to be seen under file menu 803 hint_load_file = "Read state's files and load" 804 hint_load_file += " them into the application" 805 id = wx.NewId() 806 self._save_appl_menu = self._file_menu.Append(id, 807 '&Load Application', hint_load_file) 808 wx.EVT_MENU(self, id, self._on_open_state_application) 809 804 810 id = wx.NewId() 811 hint_load_file = "read all applications states save previously" 805 812 self._save_appl_menu = self._file_menu.Append(id, 806 '&Open State from File', hint_load_file) 807 wx.EVT_MENU(self, id, self._on_open_state) 808 id = wx.NewId() 809 self._save_appl_menu = self._file_menu.Append(id, 813 '&Load Project', hint_load_file) 814 wx.EVT_MENU(self, id, self._on_open_state_project) 815 816 if style1 == GUIFRAME.MULTIPLE_APPLICATIONS: 817 self._file_menu.AppendSeparator() 818 id = wx.NewId() 819 self._save_appl_menu = self._file_menu.Append(id, 810 820 '&Save Application', 811 821 'Save state of the current active application') 812 wx.EVT_MENU(self, id, self._on_save_application)822 wx.EVT_MENU(self, id, self._on_save_application) 813 823 id = wx.NewId() 814 824 self._file_menu.Append(id, '&Save Project', … … 1069 1079 print error_message 1070 1080 1071 1072 def _on_open_state (self, event):1081 1082 def _on_open_state_application(self, event): 1073 1083 """ 1074 1084 """ … … 1080 1090 "Choose a file", 1081 1091 self._default_save_location, "", 1082 WLIST) 1092 PLUGINS_WLIST) 1093 if dlg.ShowModal() == wx.ID_OK: 1094 path = dlg.GetPath() 1095 if path is not None: 1096 self._default_save_location = os.path.dirname(path) 1097 dlg.Destroy() 1098 self.load_state(path=path) 1099 1100 def _on_open_state_project(self, event): 1101 """ 1102 """ 1103 path = None 1104 if self._default_save_location == None: 1105 self._default_save_location = os.getcwd() 1106 1107 dlg = wx.FileDialog(self, 1108 "Choose a file", 1109 self._default_save_location, "", 1110 APPLICATION_WLIST) 1083 1111 if dlg.ShowModal() == wx.ID_OK: 1084 1112 path = dlg.GetPath()
Note: See TracChangeset
for help on using the changeset viewer.