Esempio n. 1
0
    def do_activate(self):
        self.staticon = Gtk.StatusIcon()
        # FIXME: Support a scalable image!
        self.read_pix = Liferea.icon_create_from_file("available.png")
        self.unread_pix = Liferea.icon_create_from_file("unread.png")

        self.staticon.set_from_pixbuf(
            Liferea.icon_create_from_file("unread.png"))
        self.staticon.connect("activate", self.trayicon_click)
        self.staticon.connect("popup_menu", self.trayicon_popup)
        self.staticon.connect("size-changed", self.trayicon_size_changed)
        self.staticon.set_visible(True)

        self.menu = Gtk.Menu()
        menuitem_toggle = Gtk.MenuItem("Show / Hide")
        menuitem_close_behavior = Gtk.CheckMenuItem(
            "Minimize to tray on close")
        menuitem_quit = Gtk.MenuItem("Quit")

        self.config_path = self.get_config_path()
        self.min_enabled = self.get_config()

        if self.min_enabled == "True":
            menuitem_close_behavior.set_active(True)
        else:
            menuitem_close_behavior.set_active(False)

        menuitem_toggle.connect("activate", self.trayicon_toggle)
        menuitem_close_behavior.connect("toggled",
                                        self.trayicon_close_behavior)
        menuitem_quit.connect("activate", self.trayicon_quit)
        self.menu.append(menuitem_toggle)
        self.menu.append(menuitem_close_behavior)
        self.menu.append(menuitem_quit)
        self.menu.show_all()

        self.window = self.shell.get_window()
        self.delete_signal_id = GObject.signal_lookup("delete_event",
                                                      Gtk.Window)
        GObject.signal_handlers_block_matched(
            self.window,
            GObject.SignalMatchType.ID | GObject.SignalMatchType.DATA,
            self.delete_signal_id, 0, None, None, None)
        self.window.connect("delete_event", self.trayicon_close_action)
        self.window.connect("window-state-event", self.window_state_event_cb)

        # show the window if it is hidden when starting liferea
        self.window.deiconify()
        self.window.show()

        feedlist = self.shell.props.feed_list
        self.feedlist_new_items_cb(feedlist)
        sigid = feedlist.connect("new-items", self.feedlist_new_items_cb)
        self.feedlist_new_items_cb_id = sigid
        self.feedlist = feedlist
Esempio n. 2
0
    def do_activate (self):
        self.staticon = Gtk.StatusIcon ()
	# FIXME: Support a scalable image!
	self.staticon.set_from_pixbuf (Liferea.icon_create_from_file ("unread.png"))
        self.staticon.connect ("activate", self.trayicon_activate)
        self.staticon.connect ("popup_menu", self.trayicon_popup)
        self.staticon.set_visible (True)
Esempio n. 3
0
    def do_activate(self):
        self.staticon = Gtk.StatusIcon ()
        # FIXME: Support a scalable image!
        self.staticon.set_from_pixbuf(Liferea.icon_create_from_file("unread.png"))
        self.staticon.connect("activate", self.trayicon_click)
        self.staticon.connect("popup_menu", self.trayicon_popup)
        self.staticon.set_visible(True)

        self.menu = Gtk.Menu()
        menuitem_toggle = Gtk.MenuItem("Show / Hide")
        menuitem_quit = Gtk.MenuItem("Quit")
        menuitem_toggle.connect("activate", self.trayicon_toggle)
        menuitem_quit.connect("activate", self.trayicon_quit)
        self.menu.append(menuitem_toggle)
        self.menu.append(menuitem_quit)
        self.menu.show_all()

        self.window = self.shell.get_window()
        self.minimize_to_tray_delete_handler = self.window.connect("delete_event",
                                                                   self.trayicon_minimize_on_close)
        self.minimize_to_tray_minimize_handler = self.window.connect("window-state-event",
                                                                     self.window_state_event_cb)

        # show the window if it is hidden when starting liferea
        self.window.deiconify()
        self.window.show()
Esempio n. 4
0
    def do_activate(self):
        self.staticon = Gtk.StatusIcon()
        # FIXME: Support a scalable image!
        self.staticon.set_from_pixbuf(
            Liferea.icon_create_from_file("unread.png"))
        self.staticon.connect("activate", self.trayicon_click)
        self.staticon.connect("popup_menu", self.trayicon_popup)
        self.staticon.set_visible(True)

        self.menu = Gtk.Menu()
        menuitem_toggle = Gtk.MenuItem("Show / Hide")
        menuitem_quit = Gtk.MenuItem("Quit")
        menuitem_toggle.connect("activate", self.trayicon_toggle)
        menuitem_quit.connect("activate", self.trayicon_quit)
        self.menu.append(menuitem_toggle)
        self.menu.append(menuitem_quit)
        self.menu.show_all()

        self.window = self.shell.get_window()
        self.minimize_to_tray_delete_handler = self.window.connect(
            "delete_event", self.trayicon_minimize_on_close)
        self.minimize_to_tray_minimize_handler = self.window.connect(
            "window-state-event", self.window_state_event_cb)

        # show the window if it is hidden when starting liferea
        self.window.deiconify()
        self.window.show()
Esempio n. 5
0
 def do_activate(self):
     self.staticon = Gtk.StatusIcon()
     # FIXME: Support a scalable image!
     self.staticon.set_from_pixbuf(
         Liferea.icon_create_from_file("unread.png"))
     self.staticon.connect("activate", self.trayicon_activate)
     self.staticon.connect("popup_menu", self.trayicon_popup)
     self.staticon.set_visible(True)
Esempio n. 6
0
 def do_activate (self):
     self.staticon = Gtk.StatusIcon ()
     # FIXME: Support a scalable image!
     self.staticon.set_from_pixbuf (Liferea.icon_create_from_file ("unread.png"))
     self.staticon.connect ("activate", self.trayicon_activate)
     self.staticon.connect ("popup_menu", self.trayicon_popup)
     self.staticon.set_visible (True)
     self.maximizing = False
     window = self.shell.get_window ()
     self.minimize_to_tray_handler_id = window.connect('window-state-event', self.window_state_event_cb)
Esempio n. 7
0
    def do_activate(self):
        self.staticon = Gtk.StatusIcon ()
        # FIXME: Support a scalable image!
        self.read_pix = Liferea.icon_create_from_file ("available.png")
        self.unread_pix = Liferea.icon_create_from_file ("unread.png")

        self.staticon.set_from_pixbuf(Liferea.icon_create_from_file("unread.png"))
        self.staticon.connect("activate", self.trayicon_click)
        self.staticon.connect("popup_menu", self.trayicon_popup)
        self.staticon.connect("size-changed", self.trayicon_size_changed)
        self.staticon.set_visible(True)

        self.menu = Gtk.Menu()
        menuitem_toggle = Gtk.MenuItem("Show / Hide")
        menuitem_quit = Gtk.MenuItem("Quit")
        menuitem_toggle.connect("activate", self.trayicon_toggle)
        menuitem_quit.connect("activate", self.trayicon_quit)
        self.menu.append(menuitem_toggle)
        self.menu.append(menuitem_quit)
        self.menu.show_all()

        self.window = self.shell.get_window()
        self.delete_signal_id = GObject.signal_lookup("delete_event", Gtk.Window)
        GObject.signal_handlers_block_matched (self.window,
                                               GObject.SignalMatchType.ID | GObject.SignalMatchType.DATA,
                                               self.delete_signal_id, 0, None, None, None)
        self.window.connect("delete_event", self.trayicon_minimize_on_close)
        self.window.connect("window-state-event", self.window_state_event_cb)

        # show the window if it is hidden when starting liferea
        self.window.deiconify()
        self.window.show()

        feedlist = self.shell.props.feed_list
        self.feedlist_new_items_cb(feedlist)
        sigid = feedlist.connect("new-items", self.feedlist_new_items_cb)
        self.feedlist_new_items_cb_id = sigid
        self.feedlist = feedlist