def saveLayout(self, event): if event.GetId() == 301: wildcard='Layout files (*.layout)|*.layout' fileSelector = wx.FileDialog(self, message="Save layout", defaultDir=guiconfig.guiConfigDir, style=wx.FD_SAVE, wildcard=wildcard) if fileSelector.ShowModal() == wx.ID_OK: files = fileSelector.GetPaths() fName = str(files[0]) guiconfig.saveLayout(self.getLayout(), fName) fileSelector.Destroy() elif event.GetId() == 302: guiconfig.saveAsFavouriteLayout(self.getLayout())
def saveLayout(self, event): if event.GetId() == 301: wildcard = 'Layout files (*.layout)|*.layout' fileSelector = wx.FileDialog(self, message="Save layout", defaultDir=guiconfig.guiConfigDir, style=wx.FD_SAVE, wildcard=wildcard) if fileSelector.ShowModal() == wx.ID_OK: files = fileSelector.GetPaths() fName = str(files[0]) guiconfig.saveLayout(self.getLayout(), fName) fileSelector.Destroy() elif event.GetId() == 302: guiconfig.saveAsFavouriteLayout(self.getLayout())
def quitApp(self): # save preferences guiconfig.savePreferences() # save favourite layout if required if guiconfig.preferences['save layout']: # find the frame which currently has the focus activeFrames = [ x for x in self.openFrames if x.IsActive() ] if activeFrames: guiconfig.saveAsFavouriteLayout(activeFrames[0].getLayout()) # save favourite session if required if guiconfig.preferences['save session']: self.saveSession(guiconfig.lastSessionFileName) # /!\ do not save the session if no frame is open # this can happen if the user cancels the program from the start # saving the session and automatically loading it at program startup # would result in the program exiting immediately self.Exit() sys.exit(0)
def quitApp(self): # save preferences guiconfig.savePreferences() # save favourite layout if required if guiconfig.preferences['save layout']: # find the frame which currently has the focus activeFrames = [x for x in self.openFrames if x.IsActive()] if activeFrames: guiconfig.saveAsFavouriteLayout(activeFrames[0].getLayout()) # save favourite session if required if guiconfig.preferences['save session']: self.saveSession(guiconfig.lastSessionFileName) # /!\ do not save the session if no frame is open # this can happen if the user cancels the program from the start # saving the session and automatically loading it at program startup # would result in the program exiting immediately self.Exit() sys.exit(0)