def __init__(self, file_transfer): BaseTransferButton.__init__(self, file_transfer) self._ds_object = datastore.create() file_transfer.connect('notify::state', self.__notify_state_cb) file_transfer.connect('notify::transferred-bytes', self.__notify_transferred_bytes_cb) icons = gio.content_type_get_icon(file_transfer.mime_type).props.names icons.append('application-octet-stream') for icon_name in icons: icon_name = 'transfer-from-%s' % icon_name file_name = get_icon_file_name(icon_name) if file_name is not None: self.props.icon_widget.props.icon_name = icon_name self.notif_icon.props.icon_name = icon_name break icon_color = file_transfer.buddy.props.color self.props.icon_widget.props.xo_color = icon_color self.notif_icon.props.xo_color = icon_color frame = jarabe.frame.get_view() frame.add_notification(self.notif_icon, gtk.CORNER_TOP_LEFT)
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)
def __init__(self, file_transfer): BaseTransferButton.__init__(self, file_transfer) icons = Gio.content_type_get_icon(file_transfer.mime_type).props.names icons.append('application-octet-stream') for icon_name in icons: icon_name = 'transfer-to-%s' % icon_name file_name = get_icon_file_name(icon_name) if file_name is not None: self.props.icon_widget.props.icon_name = icon_name self.notif_icon.props.icon_name = icon_name break icon_color = profile.get_color() self.props.icon_widget.props.xo_color = icon_color self.notif_icon.props.xo_color = icon_color frame = jarabe.frame.get_view() frame.add_notification(self.notif_icon, Gtk.CornerType.TOP_LEFT)
def __init__(self, file_transfer): BaseTransferButton.__init__(self, file_transfer) icons = Gio.content_type_get_icon(file_transfer.mime_type).props.names icons.append("application-octet-stream") for icon_name in icons: icon_name = "transfer-to-%s" % icon_name file_name = get_icon_file_name(icon_name) if file_name is not None: self.props.icon_widget.props.icon_name = icon_name self.notif_icon.props.icon_name = icon_name break icon_color = profile.get_color() self.props.icon_widget.props.xo_color = icon_color self.notif_icon.props.xo_color = icon_color frame = jarabe.frame.get_view() frame.add_notification(self.notif_icon, Gtk.CornerType.TOP_LEFT)
def __init__(self, file_transfer): BaseTransferButton.__init__(self, file_transfer) icons = Gio.content_type_get_icon(file_transfer.mime_type).props.names icons.append('application-octet-stream') for icon_name in icons: icon_name = 'transfer-to-%s' % icon_name file_name = get_icon_file_name(icon_name) if file_name is not None: self.props.icon_widget.props.icon_name = icon_name self.notif_icon.props.icon_name = icon_name break client = GConf.Client.get_default() icon_color = XoColor(client.get_string('/desktop/sugar/user/color')) self.props.icon_widget.props.xo_color = icon_color self.notif_icon.props.xo_color = icon_color frame = jarabe.frame.get_view() frame.add_notification(self.notif_icon, Gtk.CornerType.TOP_LEFT)
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)
def __init__(self, file_transfer): BaseTransferButton.__init__(self, file_transfer) icons = gio.content_type_get_icon(file_transfer.mime_type).props.names icons.append('application-octet-stream') for icon_name in icons: icon_name = 'transfer-to-%s' % icon_name file_name = get_icon_file_name(icon_name) if file_name is not None: self.props.icon_widget.props.icon_name = icon_name self.notif_icon.props.icon_name = icon_name break client = gconf.client_get_default() icon_color = XoColor(client.get_string('/desktop/sugar/user/color')) self.props.icon_widget.props.xo_color = icon_color self.notif_icon.props.xo_color = icon_color frame = jarabe.frame.get_view() frame.add_notification(self.notif_icon, gtk.CORNER_TOP_LEFT)
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)
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)
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.CornerType.TOP_LEFT)