Merge pull request #201 from TheNain38/patch-3
If interface "*" is used open correctly on trayicon click
This commit is contained in:
commit
638b9c2c2d
2 changed files with 5 additions and 3 deletions
|
@ -37,6 +37,8 @@ class ActionsPlugin(object):
|
||||||
def hideIcon():
|
def hideIcon():
|
||||||
icon.die()
|
icon.die()
|
||||||
|
|
||||||
|
ui_ip = config.ui_ip if config.ui_ip != "*" else "127.0.0.1"
|
||||||
|
|
||||||
icon.items = (
|
icon.items = (
|
||||||
(self.titleIp, False),
|
(self.titleIp, False),
|
||||||
(self.titleConnections, False),
|
(self.titleConnections, False),
|
||||||
|
@ -49,13 +51,13 @@ class ActionsPlugin(object):
|
||||||
("ZeroNet Github", lambda: self.opensite("https://github.com/HelloZeroNet/ZeroNet")),
|
("ZeroNet Github", lambda: self.opensite("https://github.com/HelloZeroNet/ZeroNet")),
|
||||||
("Report bug/request feature", lambda: self.opensite("https://github.com/HelloZeroNet/ZeroNet/issues")),
|
("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))),
|
("!Open ZeroNet", lambda: self.opensite("http://%s:%s" % (ui_ip, config.ui_port))),
|
||||||
"--",
|
"--",
|
||||||
("Quit", self.quit),
|
("Quit", self.quit),
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
icon.clicked = lambda: self.opensite("http://%s:%s" % (config.ui_ip, config.ui_port))
|
icon.clicked = lambda: self.opensite("http://%s:%s" % (ui_ip, config.ui_port))
|
||||||
gevent.threadpool.start_new_thread(icon._run, ()) # Start in real thread (not gevent compatible)
|
gevent.threadpool.start_new_thread(icon._run, ()) # Start in real thread (not gevent compatible)
|
||||||
super(ActionsPlugin, self).main()
|
super(ActionsPlugin, self).main()
|
||||||
icon._die = True
|
icon._die = True
|
||||||
|
|
|
@ -115,7 +115,7 @@ class UiServer:
|
||||||
browser = webbrowser.get()
|
browser = webbrowser.get()
|
||||||
else:
|
else:
|
||||||
browser = webbrowser.get(config.open_browser)
|
browser = webbrowser.get(config.open_browser)
|
||||||
browser.open("http://%s:%s" % (config.ui_ip, config.ui_port), new=2)
|
browser.open("http://%s:%s" % (config.ui_ip if config.ui_ip != "*" else "127.0.0.1", config.ui_port), new=2)
|
||||||
|
|
||||||
self.server = WSGIServer((self.ip.replace("*", ""), self.port), handler, handler_class=UiWSGIHandler, log=self.log)
|
self.server = WSGIServer((self.ip.replace("*", ""), self.port), handler, handler_class=UiWSGIHandler, log=self.log)
|
||||||
self.server.sockets = {}
|
self.server.sockets = {}
|
||||||
|
|
Loading…
Reference in a new issue