Changeset 4085 for trunk/GSASIIdataGUI.py
- Timestamp:
- Aug 10, 2019 10:22:02 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r4075 r4085 464 464 465 465 def _Add_FileMenuItems(self, parent): 466 item = parent.Append(wx.ID_ANY,'&Open project... ','Open a GSAS-II project file (*.gpx)')466 item = parent.Append(wx.ID_ANY,'&Open project...\tCtrl+O','Open a GSAS-II project file (*.gpx)') 467 467 self.Bind(wx.EVT_MENU, self.OnFileOpen, id=item.GetId()) 468 item = parent.Append(wx.ID_ANY,'&Save project','Save project under current name') 468 item = parent.Append(wx.ID_ANY,'Reopen recent...\tCtrl+R','Reopen a previously used GSAS-II project file (*.gpx)') 469 self.Bind(wx.EVT_MENU, self.OnFileReopen, id=item.GetId()) 470 item = parent.Append(wx.ID_ANY,'&Save project\tCtrl+S','Save project under current name') 469 471 self.Bind(wx.EVT_MENU, self.OnFileSave, id=item.GetId()) 470 472 item = parent.Append(wx.ID_ANY,'Save project as...','Save current project to new file') … … 2764 2766 if addhelp: 2765 2767 HelpMenu=G2G.MyHelp(self,includeTree=True, 2766 morehelpitems=[('&Tutorials ','Tutorials'),])2768 morehelpitems=[('&Tutorials\tCtrl+T','Tutorials'),]) 2767 2769 menubar.Append(menu=HelpMenu,title='&Help') 2768 2770 … … 3807 3809 dlg.Destroy() 3808 3810 3811 def OnFileReopen(self, event): 3812 files = GSASIIpath.GetConfigValue('previous_GPX_files') 3813 if not files: 3814 print('no previous projects saved') 3815 return 3816 sellist = [] 3817 for f in files: 3818 dirname,filroot = os.path.split(f) 3819 if os.path.exists(f): 3820 sellist.append("{} from {}".format(filroot,dirname)) 3821 else: 3822 sellist.append("not found: {}".format(f)) 3823 3824 dlg = G2G.G2SingleChoiceDialog(self, 3825 'Select previous project to open', 3826 'Select project',sellist) 3827 if dlg.ShowModal() == wx.ID_OK: 3828 sel = dlg.GetSelection() 3829 dlg.Destroy() 3830 else: 3831 dlg.Destroy() 3832 return 3833 f = files[sel] 3834 if os.path.exists(f): 3835 self.OnFileOpen(event, filename=f) 3836 else: 3837 print('file not found',f) 3838 3809 3839 def OnFileOpen(self, event, filename=None): 3810 3840 '''Gets a GSAS-II .gpx project file in response to the … … 3910 3940 if self.dirname: os.chdir(self.dirname) # to get Mac/Linux to change directory! 3911 3941 pth = os.path.split(os.path.abspath(self.GSASprojectfile))[0] 3912 if GSASIIpath.GetConfigValue('Save_paths'): G2G.SaveGPXdirectory(pth) 3942 if GSASIIpath.GetConfigValue('Save_paths'): 3943 G2G.SaveGPXdirectory(pth,write=False) 3944 config = G2G.GetConfigValsDocs() 3945 GSASIIpath.addPrevGPX(self.GSASprojectfile,config) 3946 G2G.SaveConfigVars(config) 3913 3947 self.LastGPXdir = pth 3914 3948
Note: See TracChangeset
for help on using the changeset viewer.