def closeEvent(self, event): #overloaded method """ also useful for any QWidget """ if not self.tray.isVisible(): x, y, w, h = self.geometry().getRect() self.hide() self.save_session() self.preferences.on_close() conf.set_window_settings(x, y, w, h) conf.save() event.accept() else: #hide only self.hide() event.ignore()
def closeEvent(self, event): #overloaded method """ also useful for any QWidget """ if self.can_close: #if self.canExit(): x, y, w, h = self.geometry().getRect() self.hide() self.save_session() self.addons_save() conf.set_window_settings(x, y, w, h) conf.save() event.accept() else: #hide only self.hide() event.ignore()