Ejemplo n.º 1
0
 def _set_icon(self, icon):
     pixbuf = common.pixbuf_new_from_any_file(
         icon, size=self.icon.get_pixel_size())
     if pixbuf:
         self.icon.set_from_pixbuf(pixbuf)
         self.icon.filename = icon
     self._filechooser_set_folder_from_file(self.filechooser_icon, icon)
Ejemplo n.º 2
0
 def _file_preview(self, filechooser=None):
     filename = self.get_preview_filename()
     if filename and os.path.isfile(filename):
         pixbuf = common.pixbuf_new_from_any_file(filename)
         if pixbuf == None:
             self.set_preview_widget_active(False)
         else:
             self.image_previewer.set_from_pixbuf(pixbuf)
             self.set_preview_widget_active(True)
Ejemplo n.º 3
0
 def _file_preview(self, filechooser = None):
     filename = self.get_preview_filename()
     if filename and os.path.isfile(filename):
         pixbuf = common.pixbuf_new_from_any_file(filename)
         if pixbuf == None:
             self.set_preview_widget_active(False)
         else:
             self.image_previewer.set_from_pixbuf(pixbuf)
             self.set_preview_widget_active(True)
Ejemplo n.º 4
0
 def _set_icon(self, icon):
     pixbuf = common.pixbuf_new_from_any_file(
         icon,
         size = self.icon.get_pixel_size()
     )
     if pixbuf:
         self.icon.set_from_pixbuf(pixbuf)
         self.icon.filename = icon
     self._filechooser_set_folder_from_file(
         self.filechooser_icon,
         icon
     )