Beispiel #1
0
    def response_handler(self, dialog, response_id, data = None):
        if response_id == gtk.RESPONSE_OK:
            myself = self.community.get_myself()

            status_icon = None
            for (status, radiobutton) in self.status_buttons.items():
                if radiobutton.get_active():
                    status_icon = status
                    break
            if status_icon == USER_STATUS_LIST[0]:
                status_icon = None
            myself.set('status_icon', status_icon)

            status = self.status_entry.get_text()
            if len(status) == 0:
                status = None
            myself.set('status', status)

            status_icon_pixbuf = get_status_icon(status_icon, STATUSBAR_ICON_SIZE)
            icon = self.community_gui.status_icon.get_children()[0]
            icon.set_from_pixbuf(status_icon_pixbuf)

            self.community.announce_user_change(myself, allowme=True)
            self.community.show_status_change(myself)

        self.window.destroy()
Beispiel #2
0
    def __init__(self, gui):
        GUI_Page.__init__(self, 'Home')
        self.main_gui = gui

        self.notification = get_plugin_by_type(PLUGIN_TYPE_NOTIFICATION)
        self.community = get_plugin_by_type(PLUGIN_TYPE_COMMUNITY)

        # store User_Page instances key = user
        self.user_pages = {}

        # store Community_Page instances key = community
        self.com_pages = {}

        self.com_events = []
        self.user_events = []
        self.user_action_lists = []
        self.com_action_lists = []

        self.item_double_clicking = None

        self.initialize_menu()

        icon = gtk.gdk.pixbuf_new_from_file(join(get_dir(ICON_DIR), self.COMMUNITY_ICON))
        self.com_events.append((icon, "Community", self.manage_community_cb))

        self.itemlist = gtk.ListStore(gtk.gdk.Pixbuf, gobject.TYPE_PYOBJECT, str)
        self.update_communities()

        self.initialize_item_list()
        self.action_list = Community_Action_List(self, self.get_selected)
        self.pack_start(self.action_list.get_widget(), False, True)

        self.show_all()
        gui.add_page(self)
        gui.show_page(self)

        myself = self.community.get_myself()

        page = My_User_Page(gui, myself)
        self.user_pages[myself] = page
        page.show_all()
        gui.add_page(page)

        status_icon_pic = get_status_icon(myself.get('status_icon'), STATUSBAR_ICON_SIZE)
        self.status_icon = gui.add_statusbar_icon(status_icon_pic, 'Change status', self.status_icon_clicked)

        settings = get_plugin_by_type(PLUGIN_TYPE_SETTINGS)
        self.list_view_setting = settings.register('community.list_view', bool, 'Display community members as a list', default=False)

        self.community.register_ui(self)
Beispiel #3
0
        def button_row(statuslist):
            icons_hbox = gtk.HBox(True, 10)
            for status in statuslist:
                radiobutton = gtk.RadioButton(status_group)
                self.status_buttons[status] = radiobutton
                vbox = gtk.VBox()

                image = gtk.image_new_from_pixbuf(get_status_icon(status, STATUSBAR_ICON_SIZE))
                vbox.pack_start(image, False, True)
                vbox.pack_start(gtk.Label(status.title()), False, True)
                radiobutton.set_mode(False)
                if status == myself.get('status_icon'):
                    radiobutton.set_active(True)
                radiobutton.add(vbox)
                icons_hbox.pack_start(radiobutton, False, True)
            return icons_hbox