def load_tweaks(self, main_window): tweak_files = [ os.path.splitext(os.path.split(f)[-1])[0] for f in glob.glob(os.path.join(self._tweak_dir, "tweak_group_*.py"))] if not gtweak.ENABLE_TEST: try: tweak_files.remove("tweak_group_test") except ValueError: pass groups = [] tweaks = [] mods = __import__("gtweak.tweaks", globals(), locals(), tweak_files, 0) for mod in [getattr(mods, file_name) for file_name in tweak_files]: groups.extend( getattr(mod, "TWEAK_GROUPS", [])) schemas = SchemaList() for g in groups: g.main_window = main_window if g.tweaks: self.add_tweak_group(g) for i in g.tweaks: i.main_window = main_window try: schemas.insert(i.key_name, i.schema_name) except: pass
def load_tweaks(self, main_window): tweak_files = [ os.path.splitext(os.path.split(f)[-1])[0] for f in glob.glob(os.path.join(self._tweak_dir, "tweak_group_*.py")) ] if not gtweak.ENABLE_TEST: try: tweak_files.remove("tweak_group_test") except ValueError: pass groups = [] tweaks = [] mods = __import__("gtweak.tweaks", globals(), locals(), tweak_files, 0) for mod in [getattr(mods, file_name) for file_name in tweak_files]: groups.extend(getattr(mod, "TWEAK_GROUPS", [])) schemas = SchemaList() for g in groups: g.main_window = main_window if g.tweaks: self.add_tweak_group(g) for i in g.tweaks: i.main_window = main_window try: schemas.insert(i.key_name, i.schema_name) except: pass
def reset_cb(self, action, parameter): dialog = Gtk.MessageDialog(self.win, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.OK_CANCEL, _("Reset to Defaults")) dialog.format_secondary_text(_("Reset all tweak settings to the original default state?")) response = dialog.run() if response == Gtk.ResponseType.OK: s = SchemaList() s.reset() dialog.destroy()
def reset_cb(self, action, parameter): dialog = Gtk.MessageDialog(self.win,0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.OK_CANCEL, _("Reset to Defaults")) dialog.format_secondary_text(_("Reset all tweak settings to the original default state?")) response = dialog.run() if response == Gtk.ResponseType.OK: s = SchemaList() s.reset() dialog.destroy()