def restore_settings(self, plugin_settings, instance_settings): self._filter_box.setText(instance_settings.value('filter_text')) is_regex_int = instance_settings.value('is_regex') if is_regex_int: self._regex_box.setCheckState(Qt.CheckState(is_regex_int)) else: self._regex_box.setCheckState(Qt.CheckState(0)) self.update_filter()
def _restore_state_from_perspective(self): if self._settings.contains('state'): self.restoreState(self._settings.value('state')) # restore area for all toolbars toolbar_settings = self._settings.get_settings('toolbar_areas') for toolbar in self.findChildren(QToolBar): if not toolbar.objectName(): continue area = Qt.ToolBarArea(int(toolbar_settings.value(toolbar.objectName(), Qt.NoToolBarArea))) if area in [Qt.LeftToolBarArea, Qt.RightToolBarArea, Qt.TopToolBarArea, Qt.BottomToolBarArea]: self.addToolBar(area, toolbar)