def __refresh__(self, b): """ @summary: Handle for refresh button event. @param b: Button associated with the event. """ self.__cbModel__.clear() albums = self.__gdata__.getPhotoAlbums() if (albums != None): for album in albums.entry: __log__.debug("Album detected: %s" % album.title.text) UIUtils.addIterListView(self.__cbModel__, (album.title.text, album.gphoto_id.text, albums.entry.index(album)), doGObject=False) else: __log__.info("It could not retrieve albums.")
def __refresh__(self, b): """ @summary: Handle for refresh button event. @param b: Button associated with the event. """ self.__cbModel__.clear() albums = self.__facebook__.getPhotoAlbums() if albums != None: for album in albums: __log__.debug("Album detected: %s" % album["name"]) UIUtils.addIterListView( self.__cbModel__, (album["name"], album["aid"], albums.index(album)), doGObject=False ) else: __log__.info("No se han recuperado albums.")
def __initUI__(self): """ @summary: Initialize UI of dialog. """ tBox = gtk.Table(rows=4, columns=2, homogeneous=False) tBox.set_col_spacings(5) tBox.set_row_spacings(5) # Radio buttons. self.__rbPixel__ = gtk.RadioButton(label=self.__trans__("Pixels")) self.__rbPixel__.set_name("__rbPixel__") self.__rbPixel__.set_active(True) self.__rbPixel__.connect("toggled", self.__changeScaleEvent__) self.__rbCM__ = gtk.RadioButton(group=self.__rbPixel__, label=self.__trans__("CM")) self.__rbCM__.set_name("__rbCM__") self.__rbCM__.set_active(False) self.__rbCM__.connect("toggled", self.__changeScaleEvent__) self.__rbPercentage__ = gtk.RadioButton(group=self.__rbPixel__, label=self.__trans__("Percentaje")) self.__rbPercentage__.set_name("__rbPercentage__") self.__rbPercentage__.set_active(False) self.__rbPercentage__.connect("toggled", self.__changeScaleEvent__) hBoxChoice = gtk.HBox() hBoxChoice.pack_start(self.__rbPixel__, False, False) hBoxChoice.pack_start(self.__rbCM__, False, False) hBoxChoice.pack_start(self.__rbPercentage__, False, False) tBox.attach(hBoxChoice, 0, 2, 0, 1, yoptions=0) tBox.attach(gtk.HSeparator(), 0, 2, 1, 2, yoptions=0) # Inputs. hBoxWidth = gtk.HBox() self.__spWidth__ = gtk.SpinButton(climb_rate=1.00) self.__spWidth__.set_name("__spWidth__") self.__spWidth__.set_increments(1.00, 10.00) self.__spWidth__.set_range(0.00, sys.maxint) self.__spWidth__.set_numeric(True) self.__spWidth__.set_editable(True) self.__spWidth__.set_update_policy(gtk.UPDATE_IF_VALID) self.__spWidth__.connect("focus-out-event", self.__valueChangedEvent__) hBoxWidth.pack_start(gtk.Label(str=self.__trans__("Width")), False, False) hBoxWidth.pack_start(self.__spWidth__, False, True) tBox.attach(hBoxWidth, 0, 1, 2, 3, yoptions=gtk.FILL, xoptions=0) hBoxHeight = gtk.HBox() self.__spHeight__ = gtk.SpinButton(climb_rate=1.00) self.__spHeight__.set_name("__spHeight__") self.__spHeight__.set_increments(1.00, 10.00) self.__spHeight__.set_range(0.00, sys.maxint) self.__spHeight__.set_numeric(True) self.__spHeight__.set_editable(True) self.__spHeight__.set_update_policy(gtk.UPDATE_IF_VALID) self.__spHeight__.connect("focus-out-event", self.__valueChangedEvent__) hBoxHeight.pack_start(gtk.Label(str=self.__trans__("Height")), False, False) hBoxHeight.pack_start(self.__spHeight__, False, True) tBox.attach(hBoxHeight, 0, 1, 3, 4, yoptions=gtk.FILL, xoptions=0) self.__tbLock__ = gtk.ToggleButton() self.__tbLock__.set_active(True) self.__tbLock__.connect("toggled", self.__lockToggledEvent__) imgLock = gtk.Image() UIUtils.setImageToButton(self.__tbLock__, os.path.join(__ICONS_FOLDER__, "lock.png"), doGObject=False) tBox.attach(self.__tbLock__, 1, 2, 2, 4, xoptions=0, yoptions=0) self.get_child().pack_start(tBox, True, True) tBox.show_all()