- Timestamp:
- Mar 11, 2020 11:30:30 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r4352 r4360 3904 3904 ''' 3905 3905 def SaveOld(): 3906 '''See if we should save current project and continue 3907 to read another. 3908 returns True if the project load should continue 3909 ''' 3906 3910 if self.dataWindow: 3907 3911 self.dataWindow.ClearData() 3908 dlg = wx.MessageDialog( 3909 self, 3910 'Do you want to overwrite the current project? '+ 3911 'Any unsaved changes in current project will be lost. Press OK to continue.', 3912 'Overwrite?', wx.OK | wx.CANCEL) 3912 dlg = wx.MessageDialog(self, 3913 'Do you want to save and replace the current project?\n(Use No to read without saving or Cancel to continue with current project)', 3914 'Save & Overwrite?', 3915 wx.YES|wx.NO|wx.CANCEL) 3913 3916 try: 3914 3917 result = dlg.ShowModal() 3915 if result == wx.ID_OK:3916 #if GSASIIpath.GetConfigValue('debug'): print('DBG: Starting cleanup')3917 self.GPXtree.DeleteChildren(self.root)3918 #if GSASIIpath.GetConfigValue('debug'): print('DBG: DeleteChildren done')3919 self.GSASprojectfile = ''3920 self.HKL = []3921 if self.G2plotNB.plotList:3922 self.G2plotNB.clear()3923 #if GSASIIpath.GetConfigValue('debug'): print('DBG: cleanup done')3924 3918 finally: 3925 3919 dlg.Destroy() 3926 return result 3920 if result == wx.ID_NO: 3921 result = True 3922 elif result == wx.ID_CANCEL: 3923 return False 3924 else: 3925 if not self.OnFileSave(None): return False 3926 self.GPXtree.DeleteChildren(self.root) 3927 self.GSASprojectfile = '' 3928 self.HKL = [] 3929 if self.G2plotNB.plotList: 3930 self.G2plotNB.clear() 3931 return True 3927 3932 3928 3933 def GetGPX(): … … 3943 3948 3944 3949 self.EnablePlot = False 3945 result = wx.ID_OK3946 3950 if self.GPXtree.GetChildrenCount(self.root,False): 3947 result = SaveOld() 3948 if result != wx.ID_OK: return 3951 if not SaveOld(): return 3949 3952 3950 3953 if not filename: … … 4021 4024 the project. 4022 4025 ''' 4023 dlg = wx.MessageDialog(self, 'Save current project?', ' ', wx.YES | wx.NO | wx.CANCEL) 4026 dlg = wx.MessageDialog(self, 4027 'Do you want to save the current project and start with an empty one?\n(Use No to clear without saving or Cancel to continue with current project)', 4028 'Save & Clear?', 4029 wx.YES | wx.NO | wx.CANCEL) 4024 4030 try: 4025 4031 result = dlg.ShowModal()
Note: See TracChangeset
for help on using the changeset viewer.