def save_state(self): """Restores the state of the current window""" cfg.size = self.size() cfg.pos = self.pos() cfg._initial_window_geometry = self.saveGeometry() cfg._initial_window_state = self.saveState() cfg.auto_response = self.experiment.auto_response cfg.toolbar_text = self.ui.toolbar_main.toolButtonStyle() == \ QtCore.Qt.ToolButtonTextUnderIcon cfg.recent_files = u";;".join(self.recent_files) cfg.save()