def saveWindowGeometry(self): """ saves window position and size to the settings file """ self.detailsWindow.saveWindowGeometry() settings.setSettings(windowX=self.winfo_x(), windowY=self.winfo_y(), windowWidth=self.winfo_width(), windowHeight=self.winfo_height())
def doSettings(self): if settings.lowCPUMode: if not tk.messagebox.askokcancel( "你确定吗?", "在低CPU占用舰队模式中,设置" + "将会在舰队模式关闭后才会被应用。\n\n" + "It will also remove most of your settings."): return settingsToApply = {} for option, frame in self.options: returnValue = frame.doSettings() if returnValue == None: return settingsToApply.update(returnValue) settings.setSettings(**settingsToApply) self.mainWindow.animator.changeSettings() self.destroy()
def doSettings(self): if settings.lowCPUMode: if not tk.messagebox.askokcancel("Are you sure?", "Applying settings while in 'Low CPU Fleet Mode'" + " will not apply until after you end Fleet Mode.\n\n" + "It will also remove most of your settings."): return settingsToApply = {} for option, frame in self.options: returnValue = frame.doSettings() if returnValue == None: return settingsToApply.update(returnValue) settings.setSettings(**settingsToApply) self.mainWindow.animator.changeSettings() self.destroy()