Ejemplo n.º 1
0
    def __init__(self):
        layout = SpreadLayout()

        # Round off icon size to an even number to ensure that the icon
        self._owner_icon = BuddyIcon(buddy=get_owner_instance(),
                                     pixel_size=style.XLARGE_ICON_SIZE & ~1)
        ViewContainer.__init__(self, layout, self._owner_icon)

        self._animator = animator.Animator(0.3)
        self._animator.connect('completed', self._animation_completed_cb)
Ejemplo n.º 2
0
    def _add_buddy(self, buddy_model):
        buddy_model.connect('notify::current-activity',
                            self.__buddy_notify_current_activity_cb)
        if buddy_model.props.current_activity is not None:
            return
        icon = BuddyIcon(buddy_model)
        if buddy_model.is_owner():
            self._owner_icon = icon
        self._layout.add(icon)

        if hasattr(icon, 'set_filter'):
            icon.set_filter(self._query)

        self._buddies[buddy_model.props.key] = icon
Ejemplo n.º 3
0
    def __init__(self):
        gobject.GObject.__init__(self)

        self._box = hippo.CanvasBox()
        self._box.props.background_color = style.COLOR_WHITE.get_int()
        self.set_root(self._box)

        self._layout = _Layout()
        self._box.set_layout(self._layout)

        self._my_icon = BuddyIcon(buddy=get_owner_instance(),
                                  size=style.XLARGE_ICON_SIZE)
        self._box.append(self._my_icon)

        self._animator = animator.Animator(0.3)
        self._animator.connect('completed', self._animation_completed_cb)
Ejemplo n.º 4
0
    def __init__(self, buddy, **kwargs):
        hippo.CanvasBox.__init__(self, **kwargs)

        self._buddy = buddy
        self._buddy_icon = BuddyIcon(buddy)
        self._buddy_icon.props.size = style.LARGE_ICON_SIZE
        self.append(self._buddy_icon)

        self._activity_icon = CanvasIcon(size=style.LARGE_ICON_SIZE)
        self._activity_icon_visible = False

        self._update_activity()

        self._buddy.connect('notify::current-activity',
                            self.__buddy_notify_current_activity_cb)
        self._buddy.connect('notify::present', self.__buddy_notify_present_cb)
        self._buddy.connect('notify::color', self.__buddy_notify_color_cb)
Ejemplo n.º 5
0
    def __init__(self, buddy, **kwargs):
        Gtk.VBox.__init__(self)

        # round icon sizes to an even number so that it can be accurately
        # centered in a larger bounding box also of even dimensions
        size = style.LARGE_ICON_SIZE & ~1

        self._buddy = buddy
        self._buddy_icon = BuddyIcon(buddy)
        self._buddy_icon.props.pixel_size = size
        self.add(self._buddy_icon)
        self._buddy_icon.show()

        self._activity_icon = CanvasIcon(pixel_size=size)
        self._update_activity()

        self._buddy.connect('notify::current-activity',
                            self.__buddy_notify_current_activity_cb)
        self._buddy.connect('notify::present', self.__buddy_notify_present_cb)
        self._buddy.connect('notify::color', self.__buddy_notify_color_cb)
Ejemplo n.º 6
0
    def __init__(self, toolbar):
        logging.debug('STARTUP: Loading the mesh view')

        layout = SpreadLayout()

        # Round off icon size to an even number to ensure that the icon
        owner_icon = BuddyIcon(get_owner_instance(),
                               style.STANDARD_ICON_SIZE & ~1)
        ViewContainer.__init__(self, layout, owner_icon)
        self.set_can_focus(False)

        self.wireless_networks = {}
        self._adhoc_manager = None
        self._adhoc_networks = []

        self._model = neighborhood.get_model()
        self._buddies = {}
        self._activities = {}
        self._mesh = []
        self._buddy_to_activity = {}
        self._suspended = True
        self._query = ''

        toolbar.connect('query-changed', self._toolbar_query_changed_cb)
        toolbar.search_entry.connect('icon-press',
                                     self.__clear_icon_pressed_cb)

        for buddy_model in self._model.get_buddies():
            self._add_buddy(buddy_model)

        self._model.connect('buddy-added', self._buddy_added_cb)
        self._model.connect('buddy-removed', self._buddy_removed_cb)

        for activity_model in self._model.get_activities():
            self._add_activity(activity_model)

        self._model.connect('activity-added', self._activity_added_cb)
        self._model.connect('activity-removed', self._activity_removed_cb)

        netmgr_observer = NetworkManagerObserver(self)
        netmgr_observer.listen()
Ejemplo n.º 7
0
    def __init__(self, toolbar):
        logging.debug('STARTUP: Loading the group view')

        layout = SpreadLayout()

        # Round off icon size to an even number to ensure that the icon
        owner_icon = BuddyIcon(get_owner_instance(),
                               style.LARGE_ICON_SIZE & ~1)
        ViewContainer.__init__(self, layout, owner_icon)

        self._query = ''
        toolbar.connect('query-changed', self._toolbar_query_changed_cb)
        toolbar.search_entry.connect('icon-press',
                                     self.__clear_icon_pressed_cb)
        self._friends = {}

        friends_model = friends.get_model()

        for friend in friends_model:
            self.add_friend(friend)

        friends_model.connect('friend-added', self._friend_added_cb)
        friends_model.connect('friend-removed', self._friend_removed_cb)
Ejemplo n.º 8
0
 def _add_buddy(self, buddy):
     icon = BuddyIcon(buddy, style.STANDARD_ICON_SIZE)
     self._icons[buddy.props.key] = icon
     self.add_icon(icon)
     icon.show()