Esempio n. 1
0
 def load_images(self, obj):
     """
     Load the primary image into the main form if it exists.
     """
     media_list = obj.get_media_list()
     count = 0
     for media_ref in media_list:
         media_handle = media_ref.get_reference_handle()
         media = self.dbstate.db.get_media_from_handle(media_handle)
         full_path = media_path_full(self.dbstate.db, media.get_path())
         mime_type = media.get_mime_type()
         if mime_type and mime_type.startswith("image"):
             photo = Photo(self.uistate.screen_height() < 1000)
             photo.set_image(full_path, mime_type,
                             media_ref.get_rectangle())
             photo.set_uistate(self.uistate, media_handle)
         else:
             photo = Photo(self.uistate.screen_height() < 1000)
             photo.set_pixbuf(
                 full_path,
                 get_thumbnail_image(full_path, mime_type,
                                     media_ref.get_rectangle()))
         self.image_list.append(photo)
         self.top.pack_start(photo, False, False, 0)
         count += 1
     self.top.show_all()
     self.set_has_data(count > 0)
Esempio n. 2
0
 def build_gui(self):
     """
     Build the GUI interface.
     """
     self.top = Gtk.Box()
     if not computer_vision_available:
         vbox = Gtk.Label(_("OpenCV-Python is not installed"))
         self.top.pack_start(vbox, False, False, 0)
         self.top.show_all()
         return self.top
     # first column:
     vbox = Gtk.Box(Gtk.Orientation.VERTICAL)
     self.top.pack_start(vbox, False, False, 0)
     self.photo = Photo()
     vbox.pack_start(self.photo, False, False, 5)
     self.detect_button = Gtk.Button(_("Detect New Faces"))
     self.detect_button.connect('button-press-event', self.detect)
     vbox.pack_start(self.detect_button, False, False, 0)
     # second column
     vbox = Gtk.Box(Gtk.Orientation.VERTICAL)
     vbox.pack_start(Gtk.Label("Image:"), False, False, 0)
     self.top.pack_start(vbox, False, False, 0)
     # show and return:
     self.top.show_all()
     return self.top
Esempio n. 3
0
 def build_gui(self):
     """
     Build the GUI interface.
     """
     self.top = Gtk.Box()
     self.photo = Photo(self.uistate.screen_height() < 1000)
     self.top.pack_start(self.photo, fill=True, expand=False, padding=5)
     self.top.show_all()
     return self.top
Esempio n. 4
0
 def build_gui(self):
     """
     Build the GUI interface.
     """
     top = Gtk.HBox()
     self.photo = Photo()
     self.photo.show()
     view = Gtk.TreeView()
     titles = [(_('Object'), 1, 250)]
     self.model = ListModel(view, titles, list_mode="tree",
                            select_func=self.row_selected)
     top.pack_start(view, True, True, 0)
     top.pack_start(self.photo, True, False, 5)
     top.show_all()
     return top
Esempio n. 5
0
 def build_gui(self):
     """
     Build the GUI interface.
     """
     self.top = Gtk.HBox()
     vbox = Gtk.VBox()
     self.photo = Photo(self.uistate.screen_height() < 1000)
     self.title = Gtk.Label()
     self.title.set_alignment(0, 0)
     self.title.modify_font(Pango.FontDescription('sans bold 12'))
     vbox.pack_start(self.title, False, True, 7)
     self.table = Gtk.Table(n_rows=1, n_columns=2)
     vbox.pack_start(self.table, False, True, 0)
     self.top.pack_start(self.photo, False, True, 5)
     self.top.pack_start(vbox, False, True, 10)
     self.top.show_all()
     return self.top
Esempio n. 6
0
 def build_gui(self):
     """
     Build the GUI interface.
     """
     self.top = Gtk.Box()
     vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
     self.photo = Photo(self.uistate.screen_height() < 1000)
     self.title = Gtk.Label(halign=Gtk.Align.START)
     self.title.override_font(Pango.FontDescription('sans bold 12'))
     vbox.pack_start(self.title, False, True, 7)
     self.grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL)
     self.grid.set_column_spacing(10)
     vbox.pack_start(self.grid, False, True, 0)
     self.top.pack_start(self.photo, False, True, 5)
     self.top.pack_start(vbox, False, True, 10)
     self.top.show_all()
     return self.top
Esempio n. 7
0
 def build_gui(self):
     """
     Build the GUI interface.
     """
     self.top = Gtk.Box()
     vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
     self.photo = Photo(self.uistate.screen_height() < 1000)
     self.photo.show()
     self.name = Gtk.Label(halign=Gtk.Align.START)
     self.name.override_font(Pango.FontDescription('sans bold 12'))
     vbox.pack_start(self.name, fill=True, expand=False, padding=7)
     self.grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL)
     self.grid.set_column_spacing(10)
     vbox.pack_start(self.grid, fill=True, expand=False, padding=5)
     vbox.show_all()
     self.top.pack_start(self.photo, fill=True, expand=False, padding=5)
     self.top.pack_start(vbox, fill=True, expand=True, padding=10)
     return self.top
Esempio n. 8
0
 def build_gui(self):
     """
     Build the GUI interface.
     """
     self.top = Gtk.HBox()
     vbox = Gtk.VBox()
     self.photo = Photo(self.uistate.screen_height() < 1000)
     self.photo.show()
     self.name = Gtk.Label()
     self.name.set_alignment(0, 0)
     self.name.modify_font(Pango.FontDescription('sans bold 12'))
     vbox.pack_start(self.name, fill=True, expand=False, padding=7)
     self.table = Gtk.Table(n_rows=1, n_columns=2)
     vbox.pack_start(self.table, fill=True, expand=False, padding=5)
     vbox.show_all()
     self.top.pack_start(self.photo, fill=True, expand=False, padding=5)
     self.top.pack_start(vbox, fill=True, expand=True, padding=10)
     return self.top
Esempio n. 9
0
 def build_gui(self):
     """
     Build the GUI interface.
     """
     self.top = Gtk.HBox()
     # first column:
     vbox = Gtk.VBox()
     self.top.pack_start(vbox, False, False, 0)
     self.photo = Photo()
     vbox.pack_start(self.photo, False, False, 5)
     self.detect_button = Gtk.Button(_("Detect New Faces"))
     self.detect_button.connect('button-press-event', self.detect)
     vbox.pack_start(self.detect_button, False, False, 0)
     # second column
     vbox = Gtk.VBox()
     vbox.pack_start(Gtk.Label("Image:"), False, False, 0)
     self.top.pack_start(vbox, False, False, 0)
     # show and return:
     self.top.show_all()
     return self.top