Beispiel #1
0
    def __notification_received_cb(self, **kwargs):
        logging.debug('__notification_received_cb')
        icon = NotificationIcon()
        icon.show_badge()
        icon.connect('button-release-event', self.__button_release_event_cb)

        hints = kwargs['hints']

        icon_file_name = hints.get('x-sugar-icon-file-name', '')
        icon_name = hints.get('x-sugar-icon-name', '')
        if icon_file_name:
            icon.props.icon_filename = icon_file_name
        elif icon_name:
            icon.props.icon_name = icon_name
        else:
            icon.props.icon_name = 'application-octet-stream'

        icon_colors = hints.get('x-sugar-icon-colors', '')
        if not icon_colors:
            icon_colors = profile.get_color()
        icon.props.xo_color = icon_colors

        duration = kwargs.get('expire_timeout', -1)
        if duration == -1:
            duration = _NOTIFICATION_DURATION

        self.add_notification(icon, Gtk.CornerType.TOP_LEFT, duration)
Beispiel #2
0
 def show_notification(self):
     self._notif_icon = NotificationIcon()
     self._notif_icon.props.icon_name = self._icon.props.icon_name
     self._notif_icon.props.xo_color = \
         XoColor('%s,%s' % (self._icon.props.stroke_color,
                            self._icon.props.fill_color))
     frame = jarabe.frame.get_view()
     frame.add_notification(self._notif_icon, Gtk.CornerType.BOTTOM_LEFT)
Beispiel #3
0
 def show_notification(self):
     self._notif_icon = NotificationIcon()
     self._notif_icon.props.icon_name = self._icon.props.icon_name
     self._notif_icon.props.xo_color = \
         XoColor('%s,%s' % (self._icon.props.stroke_color,
                            self._icon.props.fill_color))
     frame = jarabe.frame.get_view()
     self._timeout_id = frame.add_notification(self._notif_icon,
                                               Gtk.CornerType.BOTTOM_LEFT)
     self._notif_icon.connect('drag-data-get', self._drag_data_get_cb)
     self._notif_icon.connect('drag-begin', self._drag_begin_cb)
     self._notif_icon.drag_source_set(Gdk.ModifierType.BUTTON1_MASK,
                                      self._get_targets(),
                                      Gdk.DragAction.COPY)
Beispiel #4
0
    def __init__(self, file_transfer):
        ToolButton.__init__(self)

        self.file_transfer = file_transfer
        file_transfer.connect('notify::state', self.__notify_state_cb)

        icon = Icon()
        self.props.icon_widget = icon
        icon.show()

        self.notif_icon = NotificationIcon()
        self.notif_icon.connect('button-release-event',
                                 self.__button_release_event_cb)

        self.connect('clicked', self.__button_clicked_cb)
Beispiel #5
0
    def __notification_received_cb(self, **kwargs):
        logging.debug('__notification_received_cb')
        icon = NotificationIcon()

        hints = kwargs['hints']

        icon_file_name = hints.get('x-sugar-icon-file-name', '')
        if icon_file_name:
            icon.props.icon_filename = icon_file_name
        else:
            icon.props.icon_name = 'application-octet-stream'

        icon_colors = hints.get('x-sugar-icon-colors', '')
        if not icon_colors:
            icon_colors = profile.get_color()
        icon.props.xo_color = icon_colors

        duration = kwargs.get('expire_timeout', -1)
        if duration == -1:
            duration = _NOTIFICATION_DURATION

        self.add_notification(icon, gtk.CORNER_TOP_RIGHT, duration)
Beispiel #6
0
    def __init__(self, invite):
        ToolButton.__init__(self)

        self._invite = invite

        self.connect('clicked', self.__clicked_cb)
        self.connect('destroy', self.__destroy_cb)

        bundle_registry = bundleregistry.get_registry()
        bundle = bundle_registry.get_bundle(invite.get_bundle_id())

        self._icon = Icon()
        self._icon.props.xo_color = invite.get_color()
        if bundle is not None:
            self._icon.props.file = bundle.get_icon()
        else:
            self._icon.props.icon_name = 'image-missing'
        self.set_icon_widget(self._icon)
        self._icon.show()

        palette = InvitePalette(invite)
        palette.props.invoker = FrameWidgetInvoker(self)
        palette.set_group_id('frame')
        palette.connect('remove-invite', self.__remove_invite_cb)
        self.set_palette(palette)

        self._notif_icon = NotificationIcon()
        self._notif_icon.connect('button-release-event',
                                 self.__button_release_event_cb)

        self._notif_icon.props.xo_color = invite.get_color()
        if bundle is not None:
            self._notif_icon.props.icon_filename = bundle.get_icon()
        else:
            self._notif_icon.props.icon_name = 'image-missing'

        frame = jarabe.frame.get_view()
        frame.add_notification(self._notif_icon, gtk.CORNER_TOP_LEFT)