Exemplo n.º 1
0
    def _window_action(self, e):
        if e["action"] == u"ONCLOSE":
            if self._monitor_tray_icon:
                e["source"].hide()
                e["cancel"] = True
        if e["action"] == u"NOTIFYICON_ACTIVATE":
            e["source"].show()
            e["source"].to_front()
        elif e["action"] == u"NOTIFYICON_CONTEXTMENU":
            pp = gdi.PopupMenu()
            pp.set_show_position(gdi.POPUP_POSITION_TOPLEFT)
            if not self._app.is_show():
                pp.add_item("show", resources.get_message('monitorShow'))
            else:
                pp.add_item("hide", resources.get_message('monitorHide'))

            if self._cur_status != "NOSERVICE":
                if self._cur_status == "DISABLE":
                    pp.add_item("enable",
                                resources.get_message('monitorEnable'))
                else:
                    pp.add_item("disable",
                                resources.get_message('monitorDisable'))
                pp.add_item("configure",
                            resources.get_message('monitorConfigure'))
            pp.set_action(self._actions_systray)
            pp.show()
Exemplo n.º 2
0
def _test_notify_action(e):
    if e["action"] == u"ACTIVATE":
        e["source"].get_object("window").show()
        e["source"].get_object("window").to_front()
    elif e["action"] == u"CONTEXTMENU":
        pp = gdi.PopupMenu()
        pp.add_item("show", "show")
        pp.add_item("disable", "disable")
        pp.add_item("configure", "configure")
        pp.set_action(_test_popup_menu)
        pp.show()
Exemplo n.º 3
0
def _test_window_action(e):
    if e["action"] == u"NOTIFYICON_ACTIVATE":
        e["source"].show()
        e["source"].to_front()
    elif e["action"] == u"NOTIFYICON_CONTEXTMENU":
        pp = gdi.PopupMenu()
        pp.set_show_position(gdi.POPUP_POSITION_TOPLEFT)
        pp.add_item("show", "show")
        pp.add_item("disable", "disable")
        pp.add_item("configure", "configure")

        pp.set_action(_test_other_window)

        pp.show()
    elif e["action"] == u"ONCLOSE":
        #e["source"].hide()
        #e["cancel"]=True
        None
Exemplo n.º 4
0
    def notify_action(self, e):
        if e["action"] == u"ACTIVATE":
            e["source"].get_object("window").show()
            e["source"].get_object("window").to_front()
        elif e["action"] == u"CONTEXTMENU":
            pp = gdi.PopupMenu()
            if not e["source"].get_object("window").is_show():
                pp.add_item("show", self._get_message('monitorShow'))
            else:
                pp.add_item("hide", self._get_message('monitorHide'))

            if self._cur_status != "NOSERVICE":
                if self._cur_status == "DISABLE":
                    pp.add_item("enable", self._get_message('monitorEnable'))
                else:
                    pp.add_item("disable", self._get_message('monitorDisable'))
                pp.add_item("configure", self._get_message('monitorConfigure'))
            pp.set_action(self._actions_systray)
            pp.show()