Compare commits

..

18 Commits

Author SHA1 Message Date
pdxlocations
08f19e653a add note in draw_node_list 2025-02-09 20:46:55 -08:00
pdxlocations
6e05446d6a Merge branch 'main' into fix-startup-error 2025-02-09 06:45:53 -08:00
pdxlocations
a0cb4f9480 sir locks a lilttle less 2025-02-08 21:07:54 -08:00
pdxlocations
89d5890338 sir locks a lot 2025-02-08 21:04:51 -08:00
pdxlocations
a645e41146 lock it down 2025-02-08 18:07:12 -08:00
pdxlocations
aa736472cc fix conflict 2025-02-08 18:02:49 -08:00
pdxlocations
4dc1b4b791 try a threading lock 2025-02-08 18:02:25 -08:00
pdxlocations
41050577aa Merge branch 'main' into fix-startup-error 2025-02-08 15:57:46 -08:00
pdxlocations
d9c249af56 db snapshot 2025-02-08 14:21:44 -08:00
pdxlocations
ad64004e79 back up 2025-02-08 13:25:27 -08:00
pdxlocations
d9a84c4b29 more global 2025-02-08 13:19:48 -08:00
pdxlocations
6cf46a202a grasping at straws 2025-02-08 11:48:07 -08:00
pdxlocations
351f4d7f8f less is more 2025-02-08 08:38:35 -08:00
pdxlocations
5f0277c460 refactor 2025-02-08 08:29:57 -08:00
pdxlocations
f34db01a78 typo 2025-02-08 08:04:52 -08:00
pdxlocations
463b655684 more checks 2025-02-08 08:03:59 -08:00
pdxlocations
14aa5c00a3 none isn't better than nothing 2025-02-08 08:00:20 -08:00
pdxlocations
a201bcccb2 more excuses 2025-02-08 07:57:09 -08:00
3 changed files with 2 additions and 22 deletions

13
main.py
View File

@@ -3,7 +3,7 @@
'''
Contact - A Console UI for Meshtastic by http://github.com/pdxlocations
Powered by Meshtastic.org
V 1.2.1
V 1.2.0
'''
import curses
@@ -17,9 +17,7 @@ from utilities.arg_parser import setup_parser
from utilities.interfaces import initialize_interface
from message_handlers.rx_handler import on_receive
from ui.curses_ui import main_ui, draw_splash
from input_handlers import get_list_input
from utilities.utils import get_channels, get_node_list, get_nodeNum
from settings import set_region
from db_handler import init_nodedb, load_messages_from_db
import default_config as config
import globals
@@ -52,7 +50,6 @@ def main(stdscr):
logging.info("Initializing interface %s", args)
with globals.lock:
globals.interface = initialize_interface(args)
logging.info("Interface initialized")
globals.myNodeNum = get_nodeNum()
globals.channel_list = get_channels()
@@ -61,14 +58,6 @@ def main(stdscr):
init_nodedb()
load_messages_from_db()
logging.info("Starting main UI")
if globals.interface.localNode.localConfig.lora.region == 0:
confirmation = get_list_input("Your region is UNSET. Set it now?", "Yes", ["Yes", "No"])
if confirmation == "Yes":
set_region()
globals.interface.close()
globals.interface = initialize_interface(args)
main_ui(stdscr)
except Exception as e:
logging.error("An error occurred: %s", e)

View File

@@ -9,7 +9,6 @@ from ui.menus import generate_menu_from_protobuf
from ui.colors import setup_colors, get_color
from utilities.arg_parser import setup_parser
from utilities.interfaces import initialize_interface
from ui.dialog import dialog
from user_config import json_editor
import globals
@@ -349,14 +348,6 @@ def settings_menu(stdscr, interface):
menu_win.refresh()
break
def set_region():
node = globals.interface.getNode('^local')
device_config = node.localConfig
regions = [region.name for region in device_config.lora.DESCRIPTOR.fields_by_name["region"].enum_type.values]
new_region = get_list_input('Select your region:', 'UNSET', regions)
node.localConfig.lora.region = new_region
node.writeConfig("lora")
def main(stdscr):
logging.basicConfig( # Run `tail -f client.log` in another terminal to view live

View File

@@ -422,7 +422,7 @@ def draw_node_list():
# nodes_pad = curses.newpad(1, 1)
nodes_pad = curses.newpad(1, 1)
try:
nodes_pad.erase()
box_width = nodes_win.getmaxyx()[1]