Skip to content

Commit

Permalink
Merge pull request HelloZeroNet#201 from TheNain38/patch-3
Browse files Browse the repository at this point in the history
If interface "*" is used open correctly on trayicon click
  • Loading branch information
HelloZeroNet committed Oct 25, 2015
2 parents b961a3f + 708acdf commit 638b9c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions plugins/Trayicon/TrayiconPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def main(self):
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),
Expand All @@ -49,13 +51,13 @@ def hideIcon():
("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))),
("!Open ZeroNet", lambda: self.opensite("http://%s:%s" % (ui_ip, config.ui_port))),
"--",
("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)
super(ActionsPlugin, self).main()
icon._die = True
Expand Down
2 changes: 1 addition & 1 deletion src/Ui/UiServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def start(self):
browser = webbrowser.get()
else:
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.sockets = {}
Expand Down

0 comments on commit 638b9c2

Please sign in to comment.