~martijnbraam/thumbdrives

24338890799c4b3435a07406a19f23ae37a9222a — Martijn Braam 2 years ago 58f44d4 0.1.0
Added checkmarks
1 files changed, 27 insertions(+), 0 deletions(-)

M src/window.py
M src/window.py => src/window.py +27 -0
@@ 69,6 69,8 @@ class ThumbdrivesWindow(Gtk.ApplicationWindow):
        box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=8)
        icon = Gtk.Image()
        label = Gtk.Label(path.name.replace(".img", ""), xalign=0)
        label.set_margin_top(8)
        label.set_margin_bottom(8)
        box.pack_start(icon, False, False, False)
        box.pack_start(label, True, True, False)
        box.filename = str(path)


@@ 92,6 94,31 @@ class ThumbdrivesWindow(Gtk.ApplicationWindow):
        else:
            self.headerbar.set_subtitle("Loaded " + os.path.basename(filename))

        for row_wrapper in self.thumbdrive_list:
            box = row_wrapper.get_child()
            filename = box.filename
            icon = None
            for widget in box:
                if isinstance(widget, Gtk.Image):
                    icon = widget
            if filename == filename:
                icon.set_from_icon_name('object-select-symbolic', Gtk.IconSize.BUTTON)
            else:
                icon.clear()

        for row_wrapper in self.iso_list:
            box = row_wrapper.get_child()
            filename = box.filename
            icon = None
            for widget in box:
                if isinstance(widget, Gtk.Image):
                    icon = widget
            if filename == filename:
                icon.set_from_icon_name('object-select-symbolic', Gtk.IconSize.BUTTON)
            else:
                icon.clear()


    @Gtk.Template.Callback()
    def on_image_row_activated(self, listbox, row):
        box = row.get_child()