Beispiel #1
0
    def __init__(self, config):
        self.config = config
        self.bhandlers = dict()

        # Create objects for alternative and prewiew
        self.alternatives = Prospector(
            config.getdir("Directories", "alternatives"))

        # Read icon size settins from config
        self.VIEW_ICON_SIZE = config.getint("PreviewSize", "group")

        # Load GUI
        self.builder = Gtk.Builder()
        self.builder.add_from_file(
            os.path.join(acyls.dirs['gui'], "alternatives.glade"))

        gui_elements = (
            'alternatives_grid',
            'alt_theme_combo',
            'alt_group_combo',
            'alt_icon_view',
        )
        self.gui = {
            element: self.builder.get_object(element)
            for element in gui_elements
        }

        # Mainpage buttnons hanlers
        self.mhandlers = dict()
        self.mhandlers['apply_button'] = self.on_apply_click

        # Build store
        self.store = Gtk.ListStore(Pixbuf)
        self.gui['alt_icon_view'].set_model(self.store)
        self.gui['alt_icon_view'].set_pixbuf_column(0)
        self.iconview_lock = TreeViewHolder(self.gui['alt_icon_view'])

        # Fill up GUI
        for name in self.alternatives.structure[0]['directories']:
            self.gui['alt_group_combo'].append_text(name.capitalize())

        # connect signals
        self.gui['alt_group_combo'].connect("changed",
                                            self.on_alt_group_combo_changed)
        self.gui['alt_theme_combo'].connect("changed",
                                            self.on_alt_theme_combo_changed)

        # setup
        self.gui['alt_group_combo'].set_active(0)
Beispiel #2
0
    def __init__(self, config):
        super().__init__()
        self.bhandlers = dict()
        self.mhandlers = dict()
        self.pixbufs = []

        # Create object for iconview
        self.iconview = Prospector(config.getdir("Directories", "real"))

        # Read icon size settins from config
        self.VIEW_ICON_SIZE = config.getint("PreviewSize", "group")

        # Load GUI
        self.builder = Gtk.Builder()
        self.builder.add_from_file(
            os.path.join(acyls.dirs['gui'], "viewer.glade"))

        gui_elements = (
            'iconview_grid',
            'iconview_combo',
            'icons_view',
        )
        self.gui = {
            element: self.builder.get_object(element)
            for element in gui_elements
        }

        # Build store
        self.store = Gtk.ListStore(Pixbuf)
        self.gui['icons_view'].set_model(self.store)
        self.gui['icons_view'].set_pixbuf_column(0)
        self.iconview_lock = TreeViewHolder(self.gui['icons_view'])

        # Fill up GUI
        for name in self.iconview.structure[0]['directories']:
            self.gui['iconview_combo'].append_text(name.capitalize())

        # connect signals
        self.gui['iconview_combo'].connect("changed",
                                           self.on_iconview_combo_changed)
        self.connect("icons_loaded", self.on_icons_loaded)

        # setup
        self.gui['iconview_combo'].set_active(0)