Ejemplo n.º 1
0
 def toggleConsole(self):
     if self.console:
         notificationicon.hideConsole()
         self.console = False
     else:
         notificationicon.showConsole()
         self.console = True
Ejemplo n.º 2
0
 def toggleConsole(self):
     if self.console:
         notificationicon.hideConsole()
         self.console = False
     else:
         notificationicon.showConsole()
         self.console = True
Ejemplo n.º 3
0
    def main(self):
        global notificationicon, winfolders
        from lib import notificationicon, winfolders
        import gevent.threadpool

        self.main = sys.modules["main"]

        fs_encoding = sys.getfilesystemencoding()

        icon = notificationicon.NotificationIcon(
            os.path.join(
                os.path.dirname(os.path.abspath(__file__).decode(fs_encoding)),
                'trayicon.ico'), "ZeroNet %s" % config.version)
        self.icon = icon

        if not config.debug:  # Hide console if not in debug mode
            notificationicon.hideConsole()
            self.console = False
        else:
            self.console = True

        @atexit.register
        def hideIcon():
            icon.die()

        ui_ip = config.ui_ip if config.ui_ip != "*" else "127.0.0.1"

        icon.items = (
            (self.titleIp, False),
            (self.titleConnections, False),
            (self.titleTransfer, False),
            (self.titleConsole, self.toggleConsole),
            (self.titleAutorun, self.toggleAutorun),
            "--",
            (_["ZeroNet Twitter"],
             lambda: self.opensite("https://twitter.com/HelloZeroNet")),
            (_["ZeroNet Reddit"],
             lambda: self.opensite("http://www.reddit.com/r/zeronet/")),
            (_["ZeroNet Github"],
             lambda: self.opensite("https://github.com/HelloZeroNet/ZeroNet")),
            (_["Report bug/request feature"], lambda: self.opensite(
                "https://github.com/HelloZeroNet/ZeroNet/issues")),
            "--",
            (_["!Open ZeroNet"],
             lambda: self.opensite("http://%s:%s/%s" %
                                   (ui_ip, config.ui_port, config.homepage))),
            "--",
            (_["Quit"], self.quit),
        )
        icon.clicked = lambda: self.opensite("http://%s:%s/%s" % (
            ui_ip, config.ui_port, config.homepage))
        self.quit_servers_event = gevent.threadpool.ThreadResult(
            lambda res: gevent.spawn_later(0.1, self.quitServers)
        )  # Fix gevent thread switch error
        gevent.threadpool.start_new_thread(
            icon._run, ())  # Start in real thread (not gevent compatible)
        super(ActionsPlugin, self).main()
        icon._die = True
Ejemplo n.º 4
0
    def main(self):
        global notificationicon, winfolders
        from lib import notificationicon, winfolders
        import gevent.threadpool

        self.main = sys.modules["main"]

        fs_encoding = sys.getfilesystemencoding()

        icon = notificationicon.NotificationIcon(
            os.path.join(os.path.dirname(os.path.abspath(__file__).decode(fs_encoding)), 'trayicon.ico'),
            "ZeroNet %s" % config.version
        )
        self.icon = icon

        if not config.debug:  # Hide console if not in debug mode
            notificationicon.hideConsole()
            self.console = False
        else:
            self.console = True

        @atexit.register
        def hideIcon():
            icon.die()

        ui_ip = config.ui_ip if config.ui_ip != "*" else "127.0.0.1"

        icon.items = [
            (self.titleIp, False),
            (self.titleConnections, False),
            (self.titleTransfer, False),
            (self.titleConsole, self.toggleConsole),
            (self.titleAutorun, self.toggleAutorun),
            "--",
            (_["ZeroNet Twitter"], lambda: self.opensite("https://twitter.com/HelloZeroNet")),
            (_["ZeroNet Reddit"], lambda: self.opensite("http://www.reddit.com/r/zeronet/")),
            (_["ZeroNet Github"], lambda: self.opensite("https://github.com/HelloZeroNet/ZeroNet")),
            (_["Report bug/request feature"], lambda: self.opensite("https://github.com/HelloZeroNet/ZeroNet/issues")),
            "--",
            (_["!Open ZeroNet"], lambda: self.opensite("http://%s:%s/%s" % (ui_ip, config.ui_port, config.homepage))),
            "--",
            (_["Quit"], self.quit),
        ]

        if not notificationicon.hasConsole():
            del icon.items[3]

        icon.clicked = lambda: self.opensite("http://%s:%s/%s" % (ui_ip, config.ui_port, config.homepage))
        self.quit_servers_event = gevent.threadpool.ThreadResult(
            lambda res: gevent.spawn_later(0.1, self.quitServers), gevent.threadpool.get_hub(), lambda: True
        )  # Fix gevent thread switch error
        gevent.threadpool.start_new_thread(icon._run, ())  # Start in real thread (not gevent compatible)
        super(ActionsPlugin, self).main()
        icon._die = True
Ejemplo n.º 5
0
    def main(self):
        global notificationicon, winfolders
        from lib import notificationicon, winfolders
        import gevent.threadpool

        self.main = sys.modules["main"]

        icon = notificationicon.NotificationIcon(
            os.path.join(os.path.dirname(os.path.abspath(__file__)),
                         'trayicon.ico'), "ZeroNet %s" % config.version)
        self.icon = icon

        if not config.debug:  # Hide console if not in debug mode
            notificationicon.hideConsole()
            self.console = False
        else:
            self.console = True

        @atexit.register
        def hideIcon():
            icon.die()

        icon.items = (
            (self.titleIp, False),
            (self.titleConnections, False),
            (self.titleTransfer, False),
            (self.titleConsole, self.toggleConsole),
            (self.titleAutorun, self.toggleAutorun),
            "--",
            ("ZeroNet Twitter",
             lambda: self.opensite("https://twitter.com/HelloZeroNet")),
            ("ZeroNet Reddit",
             lambda: self.opensite("http://www.reddit.com/r/zeronet/")),
            ("ZeroNet Github",
             lambda: self.opensite("https://github.com/HelloZeroNet/ZeroNet")),
            ("Report bug/request feature", lambda: self.opensite(
                "https://github.com/HelloZeroNet/ZeroNet/issues")),
            "--",
            ("!Open ZeroNet",
             lambda: self.opensite("http://%s:%s" %
                                   (config.ui_ip, config.ui_port))),
            #"--",
            #("Start ZeroNet when Windows starts", quit),
            "--",
            ("Quit", self.quit),
        )

        icon.clicked = lambda: self.opensite("http://%s:%s" %
                                             (config.ui_ip, config.ui_port))
        gevent.threadpool.start_new_thread(
            icon._run, ())  # Start in real thread (not gevent compatible)
        super(ActionsPlugin, self).main()
        icon._die = True
Ejemplo n.º 6
0
    def main(self):
        global notificationicon, winfolders
        from lib import notificationicon, winfolders
        import gevent.threadpool

        self.main = sys.modules["main"]

        fs_encoding = sys.getfilesystemencoding()

        icon = notificationicon.NotificationIcon(
            os.path.join(os.path.dirname(os.path.abspath(__file__).decode(fs_encoding)), 'trayicon.ico'),
            "sbtc_wallet %s" % config.version
        )
        self.icon = icon

        if not config.debug:  # Hide console if not in debug mode
            notificationicon.hideConsole()
            self.console = False
        else:
            self.console = True

        @atexit.register
        def hideIcon():
            icon.die()
        icon.items = [
            (_["Report Bugs"], lambda: self.opensite("https://github.com/superbitcoin/Wallet/issues")),
            "--",
            (_["SBTC Twitter"], lambda: self.opensite("https://twitter.com/SuperBTC2")),
            # (_["SBTC Reddit"], lambda: self.opensite("http://www.reddit.com/r/zeronet/")),
            (_["SBTC Github"], lambda: self.opensite("https://github.com/superbitcoin")),
            "--",
            (_["!Open Wallet"], lambda: self.opensite("http://%s:%s/%s" % (ui_ip, config.ui_port, config.homepage))),
            "--",
            (_["Quit"], self.quit),
        ]

        ui_ip = config.ui_ip if config.ui_ip != "*" else "127.0.0.1"


        # if not notificationicon.hasConsole():
        #     del icon.items[4]

        icon.clicked = lambda: self.opensite("http://%s:%s/%s" % (ui_ip, config.ui_port, config.homepage))
        self.quit_servers_event = gevent.threadpool.ThreadResult(
            lambda res: gevent.spawn_later(0.1, self.quitServers)
        )  # Fix gevent thread switch error
        gevent.threadpool.start_new_thread(icon._run, ())  # Start in real thread (not gevent compatible)
        super(ActionsPlugin, self).main()
        icon._die = True
Ejemplo n.º 7
0
    def main(self):
        global notificationicon, winfolders
        from lib import notificationicon, winfolders
        import gevent.threadpool

        self.main = sys.modules["main"]

        fs_encoding = sys.getfilesystemencoding()

        icon = notificationicon.NotificationIcon(
            os.path.join(os.path.dirname(os.path.abspath(__file__).decode(fs_encoding)), 'trayicon.ico'),
            "ZeroNet %s" % config.version
        )
        self.icon = icon

        if not config.debug:  # Hide console if not in debug mode
            notificationicon.hideConsole()
            self.console = False
        else:
            self.console = True

        @atexit.register
        def hideIcon():
            icon.die()

        icon.items = (
            (self.titleIp, False),
            (self.titleConnections, False),
            (self.titleTransfer, False),
            (self.titleConsole, self.toggleConsole),
            (self.titleAutorun, self.toggleAutorun),
            "--",
            ("ZeroNet Twitter", lambda: self.opensite("https://twitter.com/HelloZeroNet")),
            ("ZeroNet Reddit", lambda: self.opensite("http://www.reddit.com/r/zeronet/")),
            ("ZeroNet Github", lambda: self.opensite("https://github.com/HelloZeroNet/ZeroNet")),
            ("Report bug/request feature", lambda: self.opensite("https://github.com/HelloZeroNet/ZeroNet/issues")),
            "--",
            ("!Open ZeroNet", lambda: self.opensite("http://%s:%s" % (config.ui_ip, config.ui_port))),
            "--",
            ("Quit", self.quit),

        )

        icon.clicked = lambda: self.opensite("http://%s:%s" % (config.ui_ip, config.ui_port))
        gevent.threadpool.start_new_thread(icon._run, ())  # Start in real thread (not gevent compatible)
        super(ActionsPlugin, self).main()
        icon._die = True
Ejemplo n.º 8
0
    def main(self):
        global notificationicon, winfolders
        from lib import notificationicon, winfolders
        import gevent.threadpool

        self.main = sys.modules["main"]

        fs_encoding = sys.getfilesystemencoding()

        icon = notificationicon.NotificationIcon(
            os.path.join(os.path.dirname(os.path.abspath(__file__).decode(fs_encoding)), 'trayicon.ico'),
            "Phantom %s" % config.version
        )
        self.icon = icon

        if not config.debug:  # Hide console if not in debug mode
            notificationicon.hideConsole()
            self.console = False
        else:
            self.console = True

        @atexit.register
        def hideIcon():
            icon.die()

        ui_ip = config.ui_ip if config.ui_ip != "*" else "127.0.0.1"

        icon.items = (
            (self.titleIp, False),
            (self.titleConnections, False),
            (self.titleTransfer, False),
            (self.titleConsole, self.toggleConsole),
            (self.titleAutorun, self.toggleAutorun),
            "--",
            "--",
            ("!Open Phantom", lambda: self.opensite("http://%s:%s/%s" % (ui_ip, config.ui_port, config.homepage) )),
            "--",
            ("Quit", self.quit),

        )

        icon.clicked = lambda: self.opensite("http://%s:%s/%s" % (ui_ip, config.ui_port, config.homepage) )
        gevent.threadpool.start_new_thread(icon._run, ())  # Start in real thread (not gevent compatible)
        super(ActionsPlugin, self).main()
        icon._die = True