mirror of
https://github.com/markqvist/NomadNet.git
synced 2024-12-28 08:39:30 -05:00
Improved browser UI.
This commit is contained in:
parent
3dbe15b19d
commit
83679cae3d
@ -1 +1 @@
|
|||||||
__version__ = "0.0.7"
|
__version__ = "0.0.8"
|
@ -101,7 +101,8 @@ class Browser:
|
|||||||
|
|
||||||
self.frame = BrowserFrame(self.browser_body, header=self.browser_header, footer=self.browser_footer)
|
self.frame = BrowserFrame(self.browser_body, header=self.browser_header, footer=self.browser_footer)
|
||||||
self.frame.delegate = self
|
self.frame.delegate = self
|
||||||
self.display_widget = urwid.AttrMap(urwid.LineBox(self.frame, title="Remote Node"), "inactive_text")
|
self.linebox = urwid.LineBox(self.frame, title="Remote Node")
|
||||||
|
self.display_widget = urwid.AttrMap(self.linebox, "inactive_text")
|
||||||
|
|
||||||
def make_status_widget(self):
|
def make_status_widget(self):
|
||||||
if self.response_progress > 0:
|
if self.response_progress > 0:
|
||||||
@ -146,9 +147,11 @@ class Browser:
|
|||||||
self.browser_body = urwid.Filler(urwid.Text("Disconnected\n"+self.g["arrow_l"]+" "+self.g["arrow_r"], align="center"), "middle")
|
self.browser_body = urwid.Filler(urwid.Text("Disconnected\n"+self.g["arrow_l"]+" "+self.g["arrow_r"], align="center"), "middle")
|
||||||
self.browser_footer = urwid.Text("")
|
self.browser_footer = urwid.Text("")
|
||||||
self.browser_header = urwid.Text("")
|
self.browser_header = urwid.Text("")
|
||||||
|
self.linebox.set_title("Remote Node")
|
||||||
else:
|
else:
|
||||||
self.display_widget.set_attr_map({None: "body_text"})
|
self.display_widget.set_attr_map({None: "body_text"})
|
||||||
self.browser_header = self.make_control_widget()
|
self.browser_header = self.make_control_widget()
|
||||||
|
self.linebox.set_title(self.app.directory.simplest_display_str(self.destination_hash))
|
||||||
|
|
||||||
if self.status == Browser.DONE:
|
if self.status == Browser.DONE:
|
||||||
self.browser_footer = self.make_status_widget()
|
self.browser_footer = self.make_status_widget()
|
||||||
@ -332,11 +335,14 @@ class Browser:
|
|||||||
timeout = self.timeout
|
timeout = self.timeout
|
||||||
)
|
)
|
||||||
|
|
||||||
self.last_request_receipt = receipt
|
if receipt:
|
||||||
self.last_request_id = receipt.request_id
|
self.last_request_receipt = receipt
|
||||||
|
self.last_request_id = receipt.request_id
|
||||||
|
self.status = Browser.REQUEST_SENT
|
||||||
|
self.update_display()
|
||||||
|
else:
|
||||||
|
self.link.teardown()
|
||||||
|
|
||||||
self.status = Browser.REQUEST_SENT
|
|
||||||
self.update_display()
|
|
||||||
|
|
||||||
|
|
||||||
def link_established(self, link):
|
def link_established(self, link):
|
||||||
|
@ -559,7 +559,7 @@ class ConversationWidget(urwid.WidgetWrap):
|
|||||||
if allowed:
|
if allowed:
|
||||||
self.frame.contents["footer"] = (self.minimal_editor, None)
|
self.frame.contents["footer"] = (self.minimal_editor, None)
|
||||||
else:
|
else:
|
||||||
warning = urwid.AttrMap(urwid.Padding(urwid.Text(g["info"]+" You cannot currently communicate with this peer, since it's identity keys are unknown", align="center")), "msg_header_caution")
|
warning = urwid.AttrMap(urwid.Padding(urwid.Text(g["info"]+" You cannot currently communicate with this peer, since it's identity keys are not known", align="center")), "msg_header_caution")
|
||||||
self.frame.contents["footer"] = (warning, None)
|
self.frame.contents["footer"] = (warning, None)
|
||||||
|
|
||||||
def toggle_focus_area(self):
|
def toggle_focus_area(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user