def __init__(self, ui,id):
     self.builder = Gtk.Builder()
     self.ui = os.path.join(data.get_data_path(),ui)
     self.builder.add_from_file(self.ui)
     self.page = self.builder.get_object(id)
     self.page.unparent()
     self.handler={}
 def __init__(self,controlObj):
     ''' Initialise a FileChooser element from a dictionary'''
     self.builder = Gtk.Builder()
     self.ui = os.path.join(data.get_data_path(),'filechooser-theme.ui')
     self.builder.add_from_file(self.ui)
     self.widget=self.builder.get_object('themeselector')
     self.builder.connect_signals(self)
 def __init__(self, ui,id):
     self.builder = Gtk.Builder()
     self.ui = os.path.join(data.get_data_path(),ui)
     self.builder.add_from_file(self.ui)
     self.page = self.builder.get_object(id)
     self.page.unparent()
     self.handler={}
 def __init__(self, controlObj):
     ''' Initialise a FileChooser element from a dictionary'''
     self.builder = Gtk.Builder()
     self.ui = os.path.join(data.get_data_path(), 'filechooser-theme.ui')
     self.builder.add_from_file(self.ui)
     self.widget = self.builder.get_object('themeselector')
     self.builder.connect_signals(self)
 def __init__(self, ui,id):
     self.builder = Gtk.Builder()
     self.builder.set_translation_domain('unity-tweak-tool')
     self.ui = os.path.join(data.get_data_path(),ui)
     self.builder.add_from_file(self.ui)
     self.page = self.builder.get_object(id)
     self.page.unparent()
     self.handler={}
 def __init__(self, ui, id):
     self.builder = Gtk.Builder()
     self.builder.set_translation_domain('unity-tweak-tool')
     self.ui = os.path.join(data.get_data_path(), ui)
     self.builder.add_from_file(self.ui)
     self.page = self.builder.get_object(id)
     self.page.unparent()
     self.handler = {}
 def __init__(self):
     """Handler Initialisations.
     Obtain all references here."""
     self.builder = Gtk.Builder()
     self.glade = os.path.join(get_data_path(), "about.ui")
     self.builder.add_from_file(self.glade)
     self.builder.connect_signals(self)
     self.dialog = self.builder.get_object("about_unitytweak")
     self.dialog.run()
     self.dialog.destroy()
Exemple #8
0
 def __init__(self):
     '''Handler Initialisations.
     Obtain all references here.'''
     self.builder = Gtk.Builder()
     self.glade = (os.path.join(get_data_path(), 'about.ui'))
     self.builder.add_from_file(self.glade)
     self.builder.connect_signals(self)
     self.dialog = self.builder.get_object('about_unitytweak')
     self.dialog.run()
     self.dialog.destroy()
def init(page=0):
    print('Initialising...')
    from UnityTweakTool.config.data import get_data_path
    global notebook
    builder=Gtk.Builder()
    ui=os.path.join(get_data_path(),'unitytweak.ui')
    builder.add_from_file(ui)
    notebook=builder.get_object('nb_unitytweak')
    connectpages()
    notebook.set_current_page(page)
    connecthandlers(builder)
    builder.get_object('unitytweak_main').show_all()
    builder.get_object('unitytweak_main').connect('delete-event',Gtk.main_quit)
    Gtk.main()
def test_schema(schema):
    if schema in Gio.Settings.list_relocatable_schemas():
        pass
    elif schema in Gio.Settings.list_schemas():
        pass
    else:
        print("Error: schema %s not installed" % schema)
        builder=Gtk.Builder()
        builder.set_translation_domain('unity-tweak-tool')
        ui = os.path.join(data.get_data_path(),'errordialog.ui')
        builder.add_from_file(ui)
        dialog = builder.get_object('errordialog')
        message = schema + "\n\nIn order to work properly, Unity Tweak Tool recommends you install the necessary packages"
        dialog.format_secondary_text(message)
        dialog.run()
        sys.exit()
def test_schema(schema):
    if schema in Gio.Settings.list_relocatable_schemas():
        pass
    elif schema in Gio.Settings.list_schemas():
        pass
    else:
        print("Error: schema %s not installed" % schema)
        builder = Gtk.Builder()
        builder.set_translation_domain('unity-tweak-tool')
        ui = os.path.join(data.get_data_path(), 'errordialog.ui')
        builder.add_from_file(ui)
        dialog = builder.get_object('errordialog')
        message = schema + "\n\nIn order to work properly, Unity Tweak Tool recommends you install the necessary packages"
        dialog.format_secondary_text(message)
        dialog.run()
        sys.exit()
    def run(self,pageid):
        from UnityTweakTool.config.data import get_data_path
        self.builder=Gtk.Builder()
        self.builder.set_translation_domain('unity-tweak-tool')
        self.ui=os.path.join(get_data_path(),'unitytweak.ui')
        self.builder.add_from_file(self.ui)
        self.notebook=self.builder.get_object('nb_unitytweak')
        self.connectpages()
        self.connecthandlers()
# from gi.repository import Unity
#        self.launcher = Unity.LauncherEntry.get_for_desktop_id("unity-tweak-tool.desktop")        
        self.window=self.builder.get_object('unitytweak_main')
        self.window.show_all()
        self.window.connect('delete-event',self.quit)
        if pageid is not None:
            self.switch_to_page(pageid)
        Gtk.main()
Exemple #13
0
    def run(self,pageid):
        from UnityTweakTool.config.data import get_data_path
        self.builder=Gtk.Builder()
        self.builder.set_translation_domain('unity-tweak-tool')
        self.ui=os.path.join(get_data_path(),'unitytweak.ui')
        self.builder.add_from_file(self.ui)
        self.notebook=self.builder.get_object('nb_unitytweak')
        self.connectpages()
        self.connecthandlers()
# from gi.repository import Unity
#        self.launcher = Unity.LauncherEntry.get_for_desktop_id("unity-tweak-tool.desktop")        
        self.window=self.builder.get_object('unitytweak_main')
        self.window.show_all()
        self.window.connect('delete-event',Gtk.main_quit)
        if pageid is not None:
            self.switch_to_page(pageid)
        Gtk.main()
Exemple #14
0
def init(page=0):
    print('Initialising...')
    from UnityTweakTool.config.data import get_data_path
    from UnityTweakTool.config.ui import ui
    global notebook
    builder = Gtk.Builder()
    glade = os.path.join(get_data_path(), 'unitytweak.ui')
    builder.add_from_file(glade)
    interface = ui(builder)

    # Symbolic icon
    def on_style_context_change(widget):
        main_fg_color = style_context.get_color(Gtk.StateFlags.ACTIVE)

        overview_symbolic_icon = icons.lookup_icon(
            'unity-tweak-tool-overview-symbolic', 24,
            Gtk.IconLookupFlags.FORCE_SIZE)
        if overview_symbolic_icon:
            overview_symbolic_icon_pixbuf, was_sym = overview_symbolic_icon.load_symbolic(
                main_fg_color, None, None, None)
            interface['image_overview'].set_from_pixbuf(
                overview_symbolic_icon_pixbuf)

    icons = Gtk.IconTheme.get_default()
    style_context = interface['toolbar_main'].get_style_context()
    style_context.add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
    style_context.connect('changed', on_style_context_change)

    notebook = builder.get_object('nb_unitytweak')
    connectpages()
    notebook.set_current_page(page)
    connecthandlers(builder)
    builder.get_object('unitytweak_main').show_all()
    builder.get_object('unitytweak_main').connect('delete-event',
                                                  Gtk.main_quit)
    Gtk.main()
Exemple #15
0
def init(page=0):
    print("Initialising...")
    from UnityTweakTool.config.data import get_data_path
    from UnityTweakTool.config.ui import ui

    global notebook
    builder = Gtk.Builder()
    glade = os.path.join(get_data_path(), "unitytweak.ui")
    builder.add_from_file(glade)
    interface = ui(builder)

    # Symbolic icon
    def on_style_context_change(widget):
        main_fg_color = style_context.get_color(Gtk.StateFlags.ACTIVE)

        overview_symbolic_icon = icons.lookup_icon(
            "unity-tweak-tool-overview-symbolic", 24, Gtk.IconLookupFlags.FORCE_SIZE
        )
        if overview_symbolic_icon:
            overview_symbolic_icon_pixbuf, was_sym = overview_symbolic_icon.load_symbolic(
                main_fg_color, None, None, None
            )
            interface["image_overview"].set_from_pixbuf(overview_symbolic_icon_pixbuf)

    icons = Gtk.IconTheme.get_default()
    style_context = interface["toolbar_main"].get_style_context()
    style_context.add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
    style_context.connect("changed", on_style_context_change)

    notebook = builder.get_object("nb_unitytweak")
    connectpages()
    notebook.set_current_page(page)
    connecthandlers(builder)
    builder.get_object("unitytweak_main").show_all()
    builder.get_object("unitytweak_main").connect("delete-event", Gtk.main_quit)
    Gtk.main()