def __init__(self, account_setting):
        super(IconEditPage, self).__init__(False)
        self.account_setting = account_setting
        self.error_label = Label("", label_width=350, enable_select=False, enable_double_click=False)

        left_align = gtk.Alignment()
        right_align = gtk.Alignment()
        left_align.set_padding(0, 0, 0, 60)
        #right_align.set_padding(0, 0, 0, 60)

        left_vbox = gtk.VBox(False)
        right_vbox = gtk.VBox(False)
        left_vbox.set_spacing(BETWEEN_SPACING)
        right_vbox.set_spacing(BETWEEN_SPACING)

        left_align.add(left_vbox)
        right_align.add(right_vbox)

        self.draw_area = IconEditArea()
        hseparator = HSeparator(app_theme.get_shadow_color("hSeparator").get_color_info(), 0, 0)
        hseparator.set_size_request(-1, 10)
        left_vbox.pack_start(tools.make_align(Label(_("Clip"),
                             app_theme.get_color("globalTitleForeground"),
                             text_size=TITLE_FONT_SIZE, enable_select=False,
                             enable_double_click=False)), False, False)
        left_vbox.pack_start(hseparator, False, False)
        left_vbox.pack_start(tools.make_align(self.draw_area, yalign=0.0, width=300, height=300))

        self.thumbnail_large = gtk.Image()
        self.thumbnail_mid = gtk.Image()
        self.thumbnail_small = gtk.Image()
        self.thumbnail_large.set_size_request(150, 150)
        self.thumbnail_mid.set_size_request(48, 48)
        self.thumbnail_small.set_size_request(24, 24)

        hseparator = HSeparator(app_theme.get_shadow_color("hSeparator").get_color_info(), 0, 0)
        hseparator.set_size_request(-1, 10)
        right_vbox.pack_start(tools.make_align(Label(_("Preview"),
                              app_theme.get_color("globalTitleForeground"),
                              text_size=TITLE_FONT_SIZE, enable_select=False,
                              enable_double_click=False)), False, False)
        right_vbox.pack_start(hseparator, False, False)
        right_vbox.pack_start(tools.make_align(self.thumbnail_large), False, False)
        right_vbox.pack_start(tools.make_align(self.thumbnail_mid), False, False)
        right_vbox.pack_start(tools.make_align(self.thumbnail_small), False, False)
        right_vbox.pack_start(tools.make_align(self.error_label, yalign=0.0))

        self.pack_start(left_align, False, False)
        self.pack_start(right_align, False, False)
        self.connect("expose-event", self.draw_frame_border, left_align, right_align)
        self.draw_area.connect("pixbuf-changed", self.__on_pixbuf_changed_cb)
    def __init__(self):
        super(IconEditArea, self).__init__()

        self.edit_area = gtk.EventBox()
        self.camera_area_vbox = gtk.VBox(False)
        self.camera_area = Webcam()
        self.camera_area_up = gtk.EventBox()
        self.camera_area_down = gtk.EventBox()
        self.camera_area_init_flag = False
        self.button_hbox = gtk.HBox(False)
        self.button_hbox_height = 40
        self.__widget_y = 92

        self.edit_area.set_size_request(self.AREA_WIDTH, self.AREA_HEIGHT)
        #self.camera_area.set_size_request(self.AREA_WIDTH, self.AREA_HEIGHT)
        self.camera_area_vbox.set_size_request(self.AREA_WIDTH, self.AREA_HEIGHT)
        self.camera_area.set_size_request(self.AREA_WIDTH, 225)
        #self.camera_area_up.set_size_request(self.AREA_WIDTH, 37)
        #self.camera_area_down.set_size_request(self.AREA_WIDTH, 37)
        self.button_hbox.set_size_request(self.AREA_WIDTH, self.button_hbox_height)

        self.button_zoom_in = ImageButton(
            app_theme.get_pixbuf("account/zoom_in.png"),
            app_theme.get_pixbuf("account/zoom_in.png"),
            app_theme.get_pixbuf("account/zoom_in.png"),
            _("zoom in"))
        self.button_zoom_out = ImageButton(
            app_theme.get_pixbuf("account/zoom_out.png"),
            app_theme.get_pixbuf("account/zoom_out.png"),
            app_theme.get_pixbuf("account/zoom_out.png"),
            _("zoom out"))
        self.button_camera = ImageButton(
            app_theme.get_pixbuf("account/camera.png"),
            app_theme.get_pixbuf("account/camera.png"),
            app_theme.get_pixbuf("account/camera.png"),
            _("Take a photo"))
        self.button_camera_again = ImageButton(
            app_theme.get_pixbuf("account/camera_again.png"),
            app_theme.get_pixbuf("account/camera_again.png"),
            app_theme.get_pixbuf("account/camera_again.png"),
            _("Try again"))

        self.button_zoom_in_align = tools.make_align(self.button_zoom_in, xalign=0.5, yalign=0.5)
        self.button_zoom_out_align = tools.make_align(self.button_zoom_out, xalign=0.5, yalign=0.5)
        self.button_camera_align = tools.make_align(self.button_camera, xalign=0.5, yalign=0.5)
        self.button_camera_again_align = tools.make_align(self.button_camera_again, xalign=0.5, yalign=0.5)

        self.button_zoom_in.connect("clicked", self.on_zoom_in_clicked_cb)
        self.button_zoom_out.connect("clicked", self.on_zoom_out_clicked_cb)
        self.button_camera.connect("clicked", self.on_camera_clicked_cb)
        self.button_camera_again.connect("clicked", self.on_camera_again_clicked_cb)

        self.box = gtk.VBox(False)
        self.box.pack_start(self.edit_area, False, False)
        #self.box.pack_start(self.button_hbox, False, False)
        #self.box.pack_start(tools.make_align(yalign=0.0, yscale=1.0))
        self.set_size(self.AREA_WIDTH, self.AREA_HEIGHT)
        self.set_size_request(self.AREA_WIDTH, self.AREA_HEIGHT)
        self.connect("expose-event", self.draw_frame_border)
        self.put(self.box, 0, 0)
        #self.put(self.button_hbox, 0, self.AREA_HEIGHT-self.button_hbox_height)

        self.edit_area.set_can_focus(True)
        self.edit_area.set_visible_window(False)
        self.edit_area.add_events(gtk.gdk.ALL_EVENTS_MASK)        
        self.edit_area.connect("button-press-event", self.__on_button_press_cb)
        self.edit_area.connect("button-release-event", self.__on_button_release_cb)
        self.edit_area.connect("motion-notify-event", self.__on_motion_notify_cb)
        #self.edit_area.connect("leave-notify-event", self.__on_leave_notify_cb)
        self.edit_area.connect("expose-event", self.__expose_edit)

        self.camera_area_down.add_events(gtk.gdk.POINTER_MOTION_MASK)
        #self.camera_area.connect("motion-notify-event", self.__on_camera_motion_notify_cb)
        self.camera_area_down.connect("motion-notify-event", self.__on_camera_motion_notify_cb)
        self.camera_area_up.connect("expose-event", self.__on_camera_expose_cb)
        self.camera_area_down.connect("expose-event", self.__on_camera_expose_cb)
        self.camera_area_vbox.pack_start(self.camera_area_up)
        self.camera_area_vbox.pack_start(self.camera_area, False, False)
        self.camera_area_vbox.pack_start(self.camera_area_down)

        #panel_size = self.button_camera.get_size_request()
        #self.panel = Panel(panel_size[0], panel_size[1], gtk.WINDOW_POPUP)
        self.panel = Panel(self.AREA_WIDTH, self.button_hbox_height, gtk.WINDOW_POPUP)
        self.panel_layout = gtk.Fixed()
        #self.panel_layout.put(self.button_camera_align, (self.AREA_WIDTH-panel_size[0])/2, 0)
        self.panel_layout.put(self.button_hbox, 0, 0)
        self.panel.add(self.panel_layout)
        self.panel.hide_panel()
        self.panel.connect("expose-event", self.__draw_panel_background)
        self.panel.connect("size-allocate", lambda w,e: w.queue_draw())

        #self.panel.connect("enter-notify-event", self.__on_camera_enter_notify_cb)
        self.panel.connect("leave-notify-event", self.__on_camera_leave_notify_cb)
        self.camera_focus_flag = True

        self.__refresh_time_id = None
        self.__button_time_id = None
        self.current_mode = self.MODE_EDIT
        self.origin_pixbuf = None
        self.origin_pixbuf_width = 0
        self.origin_pixbuf_height = 0
        self.cache_pixbuf = CachePixbuf()
        self.border_color = "#000000"

        # cursor
        self.cursor = {
            self.POS_IN_DRAG : gtk.gdk.Cursor(gtk.gdk.BOTTOM_RIGHT_CORNER),
            self.POS_IN_MOVE : gtk.gdk.Cursor(gtk.gdk.FLEUR),
            self.POS_OUT : None}
        self.cursor_current = None

        self.press_point_coord = (0, 0)
        self.position = self.POS_OUT
        self.drag_flag = False
        self.move_flag = False
        #
        self.__show_button_flag = True
        self.__button_moving_flag = False
        #self.__refresh_flag = False

        # the pixbuf shown area
        self.pixbuf_offset_x = 0
        self.pixbuf_offset_y = 0
        self.pixbuf_offset_cmp_x = 0
        self.pixbuf_offset_cmp_y = 0
        self.pixbuf_x = 0
        self.pixbuf_y = 0
        self.pixbuf_w = self.AREA_WIDTH
        self.pixbuf_h = self.AREA_HEIGHT
        # the select box area
        self.edit_coord_x = 0
        self.edit_coord_y = 0
        self.edit_coord_w = self.AREA_WIDTH
        self.edit_coord_h = self.AREA_HEIGHT
        self.edit_coord_backup_x = 0
        self.edit_coord_backup_y = 0
        self.edit_coord_backup_w = self.AREA_WIDTH
        self.edit_coord_backup_h = self.AREA_HEIGHT

        self.drag_point_x = 0
        self.drag_point_y = 0
        self.__update_drag_point_coord()
Example #3
0
    def __init__(self, account_setting):
        super(IconEditPage, self).__init__(False)
        self.account_setting = account_setting
        self.error_label = Label("",
                                 label_width=350,
                                 enable_select=False,
                                 enable_double_click=False)

        left_align = gtk.Alignment()
        right_align = gtk.Alignment()
        left_align.set_padding(0, 0, 0, 60)
        #right_align.set_padding(0, 0, 0, 60)

        left_vbox = gtk.VBox(False)
        right_vbox = gtk.VBox(False)
        left_vbox.set_spacing(BETWEEN_SPACING)
        right_vbox.set_spacing(BETWEEN_SPACING)

        left_align.add(left_vbox)
        right_align.add(right_vbox)

        self.draw_area = IconEditArea()
        hseparator = HSeparator(
            app_theme.get_shadow_color("hSeparator").get_color_info(), 0, 0)
        hseparator.set_size_request(-1, 10)
        left_vbox.pack_start(
            tools.make_align(
                Label(_("Clip"),
                      app_theme.get_color("globalTitleForeground"),
                      text_size=TITLE_FONT_SIZE,
                      enable_select=False,
                      enable_double_click=False)), False, False)
        left_vbox.pack_start(hseparator, False, False)
        left_vbox.pack_start(
            tools.make_align(self.draw_area, yalign=0.0, width=300,
                             height=300))

        self.thumbnail_large = gtk.Image()
        self.thumbnail_mid = gtk.Image()
        self.thumbnail_small = gtk.Image()
        self.thumbnail_large.set_size_request(150, 150)
        self.thumbnail_mid.set_size_request(48, 48)
        self.thumbnail_small.set_size_request(24, 24)

        hseparator = HSeparator(
            app_theme.get_shadow_color("hSeparator").get_color_info(), 0, 0)
        hseparator.set_size_request(-1, 10)
        right_vbox.pack_start(
            tools.make_align(
                Label(_("Preview"),
                      app_theme.get_color("globalTitleForeground"),
                      text_size=TITLE_FONT_SIZE,
                      enable_select=False,
                      enable_double_click=False)), False, False)
        right_vbox.pack_start(hseparator, False, False)
        right_vbox.pack_start(tools.make_align(self.thumbnail_large), False,
                              False)
        right_vbox.pack_start(tools.make_align(self.thumbnail_mid), False,
                              False)
        right_vbox.pack_start(tools.make_align(self.thumbnail_small), False,
                              False)
        right_vbox.pack_start(tools.make_align(self.error_label, yalign=0.0))

        self.pack_start(left_align, False, False)
        self.pack_start(right_align, False, False)
        self.connect("expose-event", self.draw_frame_border, left_align,
                     right_align)
        self.draw_area.connect("pixbuf-changed", self.__on_pixbuf_changed_cb)
Example #4
0
    def __init__(self):
        super(IconEditArea, self).__init__()

        self.edit_area = gtk.EventBox()
        self.camera_area_vbox = gtk.VBox(False)
        self.camera_area = Webcam()
        self.camera_area_up = gtk.EventBox()
        self.camera_area_down = gtk.EventBox()
        self.camera_area_init_flag = False
        self.button_hbox = gtk.HBox(False)
        self.button_hbox_height = 40
        self.__widget_y = 92

        self.edit_area.set_size_request(self.AREA_WIDTH, self.AREA_HEIGHT)
        #self.camera_area.set_size_request(self.AREA_WIDTH, self.AREA_HEIGHT)
        self.camera_area_vbox.set_size_request(self.AREA_WIDTH,
                                               self.AREA_HEIGHT)
        self.camera_area.set_size_request(self.AREA_WIDTH, 225)
        #self.camera_area_up.set_size_request(self.AREA_WIDTH, 37)
        #self.camera_area_down.set_size_request(self.AREA_WIDTH, 37)
        self.button_hbox.set_size_request(self.AREA_WIDTH,
                                          self.button_hbox_height)

        self.button_zoom_in = ImageButton(
            app_theme.get_pixbuf("account/zoom_in.png"),
            app_theme.get_pixbuf("account/zoom_in.png"),
            app_theme.get_pixbuf("account/zoom_in.png"), _("zoom in"))
        self.button_zoom_out = ImageButton(
            app_theme.get_pixbuf("account/zoom_out.png"),
            app_theme.get_pixbuf("account/zoom_out.png"),
            app_theme.get_pixbuf("account/zoom_out.png"), _("zoom out"))
        self.button_camera = ImageButton(
            app_theme.get_pixbuf("account/camera.png"),
            app_theme.get_pixbuf("account/camera.png"),
            app_theme.get_pixbuf("account/camera.png"), _("Take a photo"))
        self.button_camera_again = ImageButton(
            app_theme.get_pixbuf("account/camera_again.png"),
            app_theme.get_pixbuf("account/camera_again.png"),
            app_theme.get_pixbuf("account/camera_again.png"), _("Try again"))

        self.button_zoom_in_align = tools.make_align(self.button_zoom_in,
                                                     xalign=0.5,
                                                     yalign=0.5)
        self.button_zoom_out_align = tools.make_align(self.button_zoom_out,
                                                      xalign=0.5,
                                                      yalign=0.5)
        self.button_camera_align = tools.make_align(self.button_camera,
                                                    xalign=0.5,
                                                    yalign=0.5)
        self.button_camera_again_align = tools.make_align(
            self.button_camera_again, xalign=0.5, yalign=0.5)

        self.button_zoom_in.connect("clicked", self.on_zoom_in_clicked_cb)
        self.button_zoom_out.connect("clicked", self.on_zoom_out_clicked_cb)
        self.button_camera.connect("clicked", self.on_camera_clicked_cb)
        self.button_camera_again.connect("clicked",
                                         self.on_camera_again_clicked_cb)

        self.box = gtk.VBox(False)
        self.box.pack_start(self.edit_area, False, False)
        #self.box.pack_start(self.button_hbox, False, False)
        #self.box.pack_start(tools.make_align(yalign=0.0, yscale=1.0))
        self.set_size(self.AREA_WIDTH, self.AREA_HEIGHT)
        self.set_size_request(self.AREA_WIDTH, self.AREA_HEIGHT)
        self.connect("expose-event", self.draw_frame_border)
        self.put(self.box, 0, 0)
        #self.put(self.button_hbox, 0, self.AREA_HEIGHT-self.button_hbox_height)

        self.edit_area.set_can_focus(True)
        self.edit_area.set_visible_window(False)
        self.edit_area.add_events(gtk.gdk.ALL_EVENTS_MASK)
        self.edit_area.connect("button-press-event", self.__on_button_press_cb)
        self.edit_area.connect("button-release-event",
                               self.__on_button_release_cb)
        self.edit_area.connect("motion-notify-event",
                               self.__on_motion_notify_cb)
        #self.edit_area.connect("leave-notify-event", self.__on_leave_notify_cb)
        self.edit_area.connect("expose-event", self.__expose_edit)

        self.camera_area_down.add_events(gtk.gdk.POINTER_MOTION_MASK)
        #self.camera_area.connect("motion-notify-event", self.__on_camera_motion_notify_cb)
        self.camera_area_down.connect("motion-notify-event",
                                      self.__on_camera_motion_notify_cb)
        self.camera_area_up.connect("expose-event", self.__on_camera_expose_cb)
        self.camera_area_down.connect("expose-event",
                                      self.__on_camera_expose_cb)
        self.camera_area_vbox.pack_start(self.camera_area_up)
        self.camera_area_vbox.pack_start(self.camera_area, False, False)
        self.camera_area_vbox.pack_start(self.camera_area_down)

        #panel_size = self.button_camera.get_size_request()
        #self.panel = Panel(panel_size[0], panel_size[1], gtk.WINDOW_POPUP)
        self.panel = Panel(self.AREA_WIDTH, self.button_hbox_height,
                           gtk.WINDOW_POPUP)
        self.panel_layout = gtk.Fixed()
        #self.panel_layout.put(self.button_camera_align, (self.AREA_WIDTH-panel_size[0])/2, 0)
        self.panel_layout.put(self.button_hbox, 0, 0)
        self.panel.add(self.panel_layout)
        self.panel.hide_panel()
        self.panel.connect("expose-event", self.__draw_panel_background)
        self.panel.connect("size-allocate", lambda w, e: w.queue_draw())

        #self.panel.connect("enter-notify-event", self.__on_camera_enter_notify_cb)
        self.panel.connect("leave-notify-event",
                           self.__on_camera_leave_notify_cb)
        self.camera_focus_flag = True

        self.__refresh_time_id = None
        self.__button_time_id = None
        self.current_mode = self.MODE_EDIT
        self.origin_pixbuf = None
        self.origin_pixbuf_width = 0
        self.origin_pixbuf_height = 0
        self.cache_pixbuf = CachePixbuf()
        self.border_color = "#000000"

        # cursor
        self.cursor = {
            self.POS_IN_DRAG: gtk.gdk.Cursor(gtk.gdk.BOTTOM_RIGHT_CORNER),
            self.POS_IN_MOVE: gtk.gdk.Cursor(gtk.gdk.FLEUR),
            self.POS_OUT: None
        }
        self.cursor_current = None

        self.press_point_coord = (0, 0)
        self.position = self.POS_OUT
        self.drag_flag = False
        self.move_flag = False
        #
        self.__show_button_flag = True
        self.__button_moving_flag = False
        #self.__refresh_flag = False

        # the pixbuf shown area
        self.pixbuf_offset_x = 0
        self.pixbuf_offset_y = 0
        self.pixbuf_offset_cmp_x = 0
        self.pixbuf_offset_cmp_y = 0
        self.pixbuf_x = 0
        self.pixbuf_y = 0
        self.pixbuf_w = self.AREA_WIDTH
        self.pixbuf_h = self.AREA_HEIGHT
        # the select box area
        self.edit_coord_x = 0
        self.edit_coord_y = 0
        self.edit_coord_w = self.AREA_WIDTH
        self.edit_coord_h = self.AREA_HEIGHT
        self.edit_coord_backup_x = 0
        self.edit_coord_backup_y = 0
        self.edit_coord_backup_w = self.AREA_WIDTH
        self.edit_coord_backup_h = self.AREA_HEIGHT

        self.drag_point_x = 0
        self.drag_point_y = 0
        self.__update_drag_point_coord()
    def __init__(self, account_setting):
        super(IconSetPage, self).__init__(False)
        #self.set_spacing(BETWEEN_SPACING)
        self.account_setting = account_setting

        self.choose_menu_without_camera = Menu(
            [(None, _("Local picture"), self.choose_from_picture), (None, _("Take a screeshot"), self.choose_from_screenshot),], True)
        self.choose_menu_with_camera = Menu(
            [(None, _("Local picture"), self.choose_from_picture),
             (None, _("Take a screeshot"), self.choose_from_screenshot),
             (None, _("From camera"), self.choose_from_camera)], True)
        self.tips_label = Label("Set icon", label_width=460, enable_select=False, enable_double_click=False)
        self.error_label = Label("", wrap_width=560, enable_select=False, enable_double_click=False)

        set_page_sw = ScrolledWindow()
        self.pack_start(set_page_sw)
        main_vbox = gtk.VBox(False)
        set_page_sw.add_child(main_vbox)
        self.icon_list_tabel = gtk.Table()
        self.icon_list_tabel.set_row_spacings(4)
        self.icon_list_tabel.set_col_spacings(4)
        main_vbox.pack_start(tools.make_align(self.tips_label), False, False)
        main_vbox.pack_start(tools.make_align(height=20), False, False)

        self.history_list_hbox = gtk.HBox(False)
        self.history_list_hbox.set_size_request(-1, 56)
        self.history_list_hbox.set_spacing(4)

        main_vbox.pack_start(tools.make_align(Label(_("Choose a new picture for your account"), label_width=460, enable_select=False, enable_double_click=False), height=CONTAINNER_HEIGHT), False, False)
        main_vbox.pack_start(tools.make_align(self.icon_list_tabel), False, False)
        main_vbox.pack_start(tools.make_align(height=20), False, False)

        main_vbox.pack_start(tools.make_align(Label(_("Previously used pictures"), label_width=460, enable_select=False, enable_double_click=False), height=CONTAINNER_HEIGHT), False, False)
        main_vbox.pack_start(tools.make_align(self.history_list_hbox), False, False)
        main_vbox.pack_start(tools.make_align(height=20), False, False)

        main_vbox.pack_start(tools.make_align(self.error_label), False, False)

        # public picture list
        #face_dir = '/usr/share/pixmaps/faces'
        face_dir = '/var/lib/AccountsService/icons'
        if os.path.exists(face_dir):
            pic_list = os.listdir(face_dir)
        else:
            pic_list = []
        pic_list.sort()
        self.public_icon_list = []
        inital_list = ['001.jpg', '002.jpg', '003.jpg', '004.jpg', '005.jpg',
                       '006.jpg', '007.jpg', '008.jpg', '009.jpg', '010.jpg',
                       '011.jpg', '012.jpg', '013.jpg', '014.jpg', '015.jpg',
                       '016.jpg', '017.jpg', '018.jpg', '019.jpg', '020.jpg']

        for pic in pic_list:
            if pic not in inital_list:
                continue
            try:
                icon_pixbuf = gtk.gdk.pixbuf_new_from_file(
                    "%s/%s" %(face_dir, pic)).scale_simple(48, 48, gtk.gdk.INTERP_TILES)
            except:
                continue
            icon_bt = IconButton(icon_pixbuf, "%s/%s" %(face_dir, pic), has_frame=True)
            icon_bt.connect("pressed", self.on_icon_bt_pressed_cb)
            self.public_icon_list.append(icon_bt)

        self.more_icon_button = IconButton(app_theme.get_pixbuf("%s/more.png" % MODULE_NAME).get_pixbuf(), has_frame=True)
        self.more_icon_button.connect("button-press-event", self.choose_more_picture)
        main_vbox.connect("expose-event", self.draw_white_background)
Example #6
0
    def __init__(self, account_setting):
        super(IconSetPage, self).__init__(False)
        #self.set_spacing(BETWEEN_SPACING)
        self.account_setting = account_setting

        self.choose_menu_without_camera = Menu([
            (None, _("Local picture"), self.choose_from_picture),
            (None, _("Take a screeshot"), self.choose_from_screenshot),
        ], True)
        self.choose_menu_with_camera = Menu(
            [(None, _("Local picture"), self.choose_from_picture),
             (None, _("Take a screeshot"), self.choose_from_screenshot),
             (None, _("From camera"), self.choose_from_camera)], True)
        self.tips_label = Label("Set icon",
                                label_width=460,
                                enable_select=False,
                                enable_double_click=False)
        self.error_label = Label("",
                                 wrap_width=560,
                                 enable_select=False,
                                 enable_double_click=False)

        set_page_sw = ScrolledWindow()
        self.pack_start(set_page_sw)
        main_vbox = gtk.VBox(False)
        set_page_sw.add_child(main_vbox)
        self.icon_list_tabel = gtk.Table()
        self.icon_list_tabel.set_row_spacings(4)
        self.icon_list_tabel.set_col_spacings(4)
        main_vbox.pack_start(tools.make_align(self.tips_label), False, False)
        main_vbox.pack_start(tools.make_align(height=20), False, False)

        self.history_list_hbox = gtk.HBox(False)
        self.history_list_hbox.set_size_request(-1, 56)
        self.history_list_hbox.set_spacing(4)

        main_vbox.pack_start(
            tools.make_align(Label(_("Choose a new picture for your account"),
                                   label_width=460,
                                   enable_select=False,
                                   enable_double_click=False),
                             height=CONTAINNER_HEIGHT), False, False)
        main_vbox.pack_start(tools.make_align(self.icon_list_tabel), False,
                             False)
        main_vbox.pack_start(tools.make_align(height=20), False, False)

        main_vbox.pack_start(
            tools.make_align(Label(_("Previously used pictures"),
                                   label_width=460,
                                   enable_select=False,
                                   enable_double_click=False),
                             height=CONTAINNER_HEIGHT), False, False)
        main_vbox.pack_start(tools.make_align(self.history_list_hbox), False,
                             False)
        main_vbox.pack_start(tools.make_align(height=20), False, False)

        main_vbox.pack_start(tools.make_align(self.error_label), False, False)

        # public picture list
        #face_dir = '/usr/share/pixmaps/faces'
        face_dir = '/var/lib/AccountsService/icons'
        if os.path.exists(face_dir):
            pic_list = os.listdir(face_dir)
        else:
            pic_list = []
        pic_list.sort()
        self.public_icon_list = []
        inital_list = [
            '001.jpg', '002.jpg', '003.jpg', '004.jpg', '005.jpg', '006.jpg',
            '007.jpg', '008.jpg', '009.jpg', '010.jpg', '011.jpg', '012.jpg',
            '013.jpg', '014.jpg', '015.jpg', '016.jpg', '017.jpg', '018.jpg',
            '019.jpg', '020.jpg'
        ]

        for pic in pic_list:
            if pic not in inital_list:
                continue
            try:
                icon_pixbuf = gtk.gdk.pixbuf_new_from_file(
                    "%s/%s" % (face_dir, pic)).scale_simple(
                        48, 48, gtk.gdk.INTERP_TILES)
            except:
                continue
            icon_bt = IconButton(icon_pixbuf,
                                 "%s/%s" % (face_dir, pic),
                                 has_frame=True)
            icon_bt.connect("pressed", self.on_icon_bt_pressed_cb)
            self.public_icon_list.append(icon_bt)

        self.more_icon_button = IconButton(app_theme.get_pixbuf(
            "%s/more.png" % MODULE_NAME).get_pixbuf(),
                                           has_frame=True)
        self.more_icon_button.connect("button-press-event",
                                      self.choose_more_picture)
        main_vbox.connect("expose-event", self.draw_white_background)