mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-06-22 13:14:15 -04:00
Added node saving from announce stream
This commit is contained in:
parent
848514ec54
commit
efc24d361b
3 changed files with 21 additions and 7 deletions
|
@ -436,8 +436,8 @@ announce_at_start = yes
|
||||||
intro_time = 1
|
intro_time = 1
|
||||||
|
|
||||||
# You can specify the display theme.
|
# You can specify the display theme.
|
||||||
# theme = dark
|
# theme = light
|
||||||
theme = light
|
theme = dark
|
||||||
|
|
||||||
# Specify the number of colors to use
|
# Specify the number of colors to use
|
||||||
# valid colormodes are:
|
# valid colormodes are:
|
||||||
|
@ -492,12 +492,12 @@ enable_node = no
|
||||||
node_name = None
|
node_name = None
|
||||||
|
|
||||||
# Automatic announce interval in minutes.
|
# Automatic announce interval in minutes.
|
||||||
# 12 hours by default.
|
# 6 hours by default.
|
||||||
|
|
||||||
announce_interval = 720
|
announce_interval = 360
|
||||||
|
|
||||||
# Whether to announce when the node starts
|
# Whether to announce when the node starts
|
||||||
|
|
||||||
announce_at_start = No
|
announce_at_start = Yes
|
||||||
|
|
||||||
'''.splitlines()
|
'''.splitlines()
|
|
@ -423,7 +423,8 @@ class ConversationsDisplay():
|
||||||
|
|
||||||
if trust_level != DirectoryEntry.TRUSTED:
|
if trust_level != DirectoryEntry.TRUSTED:
|
||||||
display_text += " <"+source_hash+">"
|
display_text += " <"+source_hash+">"
|
||||||
else:
|
|
||||||
|
if trust_level != DirectoryEntry.UNTRUSTED:
|
||||||
if unread:
|
if unread:
|
||||||
if source_hash != self.currently_displayed_conversation:
|
if source_hash != self.currently_displayed_conversation:
|
||||||
display_text += " "+g["unread"]
|
display_text += " "+g["unread"]
|
||||||
|
|
|
@ -110,6 +110,12 @@ class AnnounceInfo(urwid.WidgetWrap):
|
||||||
self.parent.browser.retrieve_url(RNS.hexrep(source_hash, delimit=False))
|
self.parent.browser.retrieve_url(RNS.hexrep(source_hash, delimit=False))
|
||||||
show_announce_stream(None)
|
show_announce_stream(None)
|
||||||
|
|
||||||
|
def save_node(sender):
|
||||||
|
node_entry = DirectoryEntry(source_hash, display_name=data_str, trust_level=trust_level, hosts_node=True)
|
||||||
|
self.app.directory.remember(node_entry)
|
||||||
|
self.app.ui.main_display.sub_displays.network_display.directory_change_callback()
|
||||||
|
show_announce_stream(None)
|
||||||
|
|
||||||
def converse(sender):
|
def converse(sender):
|
||||||
show_announce_stream(None)
|
show_announce_stream(None)
|
||||||
try:
|
try:
|
||||||
|
@ -133,8 +139,15 @@ class AnnounceInfo(urwid.WidgetWrap):
|
||||||
|
|
||||||
if is_node:
|
if is_node:
|
||||||
type_button = ("weight", 0.45, urwid.Button("Connect", on_press=connect))
|
type_button = ("weight", 0.45, urwid.Button("Connect", on_press=connect))
|
||||||
|
save_button = ("weight", 0.45, urwid.Button("Save", on_press=save_node))
|
||||||
else:
|
else:
|
||||||
type_button = ("weight", 0.45, urwid.Button("Converse", on_press=converse))
|
type_button = ("weight", 0.45, urwid.Button("Converse", on_press=converse))
|
||||||
|
save_button = None
|
||||||
|
|
||||||
|
if is_node:
|
||||||
|
button_columns = urwid.Columns([("weight", 0.45, urwid.Button("Back", on_press=show_announce_stream)), ("weight", 0.1, urwid.Text("")), save_button, ("weight", 0.1, urwid.Text("")), type_button])
|
||||||
|
else:
|
||||||
|
button_columns = urwid.Columns([("weight", 0.45, urwid.Button("Back", on_press=show_announce_stream)), ("weight", 0.1, urwid.Text("")), type_button])
|
||||||
|
|
||||||
pile_widgets = [
|
pile_widgets = [
|
||||||
urwid.Text("Time : "+ts_string, align="left"),
|
urwid.Text("Time : "+ts_string, align="left"),
|
||||||
|
@ -145,7 +158,7 @@ class AnnounceInfo(urwid.WidgetWrap):
|
||||||
urwid.Divider(g["divider1"]),
|
urwid.Divider(g["divider1"]),
|
||||||
urwid.Text(["Announce Data: \n", (data_style, data_str)], align="left"),
|
urwid.Text(["Announce Data: \n", (data_style, data_str)], align="left"),
|
||||||
urwid.Divider(g["divider1"]),
|
urwid.Divider(g["divider1"]),
|
||||||
urwid.Columns([("weight", 0.45, urwid.Button("Back", on_press=show_announce_stream)), ("weight", 0.1, urwid.Text("")), type_button])
|
button_columns
|
||||||
]
|
]
|
||||||
|
|
||||||
if is_node:
|
if is_node:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue