Exemplo n.º 1
0
    def __init__(self):
        HTray.__init__(self)

        self._buttons = {}
        self._buttons_by_name = {}
        self._invite_to_item = {}
        self._freeze_button_clicks = False

        self._home_model = shell.get_model()
        self._home_model.connect('activity-added', self.__activity_added_cb)
        self._home_model.connect('activity-removed',
                                 self.__activity_removed_cb)
        self._home_model.connect('active-activity-changed',
                                 self.__activity_changed_cb)
        self._home_model.connect('tabbing-activity-changed',
                                 self.__tabbing_activity_changed_cb)

        self._invites = invites.get_instance()
        for invite in self._invites:
            self._add_invite(invite)
        self._invites.connect('invite-added', self.__invite_added_cb)
        self._invites.connect('invite-removed', self.__invite_removed_cb)

        filetransfer.new_file_transfer.connect(self.__new_file_transfer_cb)

        service = notifications.get_service()
        service.notification_received.connect(self.__notification_received_cb)
        service.buffer_cleared.connect(self.__buffer_cleared_cb)
Exemplo n.º 2
0
    def __init__(self, name):
        Gtk.VBox.__init__(self)
        self._name = name

        self._notifications_box = Gtk.VBox()
        self._notifications_box.show()

        self._scrolled_window = Gtk.ScrolledWindow()
        self._scrolled_window.add_with_viewport(self._notifications_box)
        self._scrolled_window.set_policy(Gtk.PolicyType.NEVER,
                                         Gtk.PolicyType.AUTOMATIC)
        self._scrolled_window.show()

        separator = PaletteMenuItemSeparator()
        separator.show()

        clear_item = PaletteMenuItem(_('Clear notifications'), 'dialog-cancel')
        clear_item.connect('activate', self.__clear_cb)
        clear_item.show()

        self.add(self._scrolled_window)
        self.add(separator)
        self.add(clear_item)

        self._service = notifications.get_service()
        entries = self._service.retrieve_by_name(self._name)

        if entries:
            for entry in entries:
                self._add(entry['summary'], entry['body'])

        self._service.notification_received.connect(
            self.__notification_received_cb)

        self.connect('destroy', self.__destroy_cb)
Exemplo n.º 3
0
    def __init__(self):
        logging.debug('STARTUP: Loading the frame')

        self.settings = Gio.Settings('org.sugarlabs.frame')
        self._palette_group = palettegroup.get_group('frame')

        self._left_panel = None
        self._right_panel = None
        self._top_panel = None
        self._bottom_panel = None

        self._wanted = False
        self.current_position = 0.0
        self._animator = None

        self._event_area = EventArea(self.settings)
        self._event_area.connect('enter', self._enter_corner_cb)
        self._event_area.show()

        self._top_panel = self._create_top_panel()
        self._bottom_panel = self._create_bottom_panel()
        self._left_panel = self._create_left_panel()
        self._right_panel = self._create_right_panel()

        screen = Gdk.Screen.get_default()
        screen.connect('size-changed', self._size_changed_cb)

        self._notif_by_icon = {}

        notification_service = notifications.get_service()
        notification_service.notification_received.connect(
            self.__notification_received_cb)
        notification_service.notification_cancelled.connect(
            self.__notification_cancelled_cb)
Exemplo n.º 4
0
    def __init__(self):
        logging.debug('STARTUP: Loading the frame')

        self._palette_group = palettegroup.get_group('frame')

        self._left_panel = None
        self._right_panel = None
        self._top_panel = None
        self._bottom_panel = None

        self.current_position = 0.0
        self._animator = None

        self._event_area = EventArea()
        self._event_area.connect('enter', self._enter_corner_cb)
        self._event_area.show()

        self._top_panel = self._create_top_panel()
        self._bottom_panel = self._create_bottom_panel()
        self._left_panel = self._create_left_panel()
        self._right_panel = self._create_right_panel()

        screen = Gdk.Screen.get_default()
        screen.connect('size-changed', self._size_changed_cb)

        self._key_listener = _KeyListener(self)

        self._notif_by_icon = {}

        notification_service = notifications.get_service()
        notification_service.notification_received.connect(
            self.__notification_received_cb)
        notification_service.notification_cancelled.connect(
            self.__notification_cancelled_cb)
Exemplo n.º 5
0
    def __init__(self, name):
        Gtk.VBox.__init__(self)
        self._name = name

        self._notifications_box = Gtk.VBox()
        self._notifications_box.show()

        self._scrolled_window = Gtk.ScrolledWindow()
        self._scrolled_window.add_with_viewport(self._notifications_box)
        self._scrolled_window.set_policy(Gtk.PolicyType.NEVER,
                                         Gtk.PolicyType.AUTOMATIC)
        self._scrolled_window.show()

        separator = PaletteMenuItemSeparator()
        separator.show()

        clear_item = PaletteMenuItem(_('Clear notifications'), 'dialog-cancel')
        clear_item.connect('activate', self.__clear_cb)
        clear_item.show()

        self.add(self._scrolled_window)
        self.add(separator)
        self.add(clear_item)

        self._service = notifications.get_service()
        entries = self._service.retrieve_by_name(self._name)

        if entries:
            for entry in entries:
                self._add(entry['summary'], entry['body'])

        self._service.notification_received.connect(
            self.__notification_received_cb)

        self.connect('destroy', self.__destroy_cb)
Exemplo n.º 6
0
    def __init__(self):
        logging.debug('STARTUP: Loading the frame')
        self.mode = None

        self._palette_group = palettegroup.get_group('frame')
        self._palette_group.connect('popdown', self._palette_group_popdown_cb)

        self._left_panel = None
        self._right_panel = None
        self._top_panel = None
        self._bottom_panel = None

        self.current_position = 0.0
        self._animator = None

        self._event_area = EventArea()
        self._event_area.connect('enter', self._enter_corner_cb)
        self._event_area.show()

        self._top_panel = self._create_top_panel()
        self._bottom_panel = self._create_bottom_panel()
        self._left_panel = self._create_left_panel()
        self._right_panel = self._create_right_panel()

        screen = gtk.gdk.screen_get_default()
        screen.connect('size-changed', self._size_changed_cb)

        self._key_listener = _KeyListener(self)
        self._mouse_listener = _MouseListener(self)

        self._notif_by_icon = {}

        notification_service = notifications.get_service()
        notification_service.notification_received.connect(
                self.__notification_received_cb)
        notification_service.notification_cancelled.connect(
                self.__notification_cancelled_cb)
Exemplo n.º 7
0
 def __destroy_cb(self, box):
     logging.debug('NotificationBox.__destroy_cb')
     service = notifications.get_service()
     service.notification_received.disconnect(
         self. __notification_received_cb)
Exemplo n.º 8
0
 def __destroy_cb(self, box):
     logging.debug('NotificationBox.__destroy_cb')
     service = notifications.get_service()
     service.notification_received.disconnect(
         self. __notification_received_cb)
Exemplo n.º 9
0
 def _alert(self, name, summary, body, hints):
     service = notifications.get_service()
     service.Notify(name, 0, '', summary, body, [], hints, -1)