diff --git a/console_backend/src/cli_options.rs b/console_backend/src/cli_options.rs index 1da955c35..d77bd4734 100644 --- a/console_backend/src/cli_options.rs +++ b/console_backend/src/cli_options.rs @@ -120,6 +120,10 @@ pub struct CliOptions { #[clap(long = "show-fileio")] pub show_fileio: bool, + /// Allow File Connections. + #[clap(long = "show-file-connection")] + pub show_file_connection: bool, + /// Don't use opengl in plots. #[clap(long = "no-opengl", parse(from_flag = Not::not))] pub no_opengl: bool, diff --git a/resources/ConnectionScreen.qml b/resources/ConnectionScreen.qml index 6885a985a..c89fab98e 100644 --- a/resources/ConnectionScreen.qml +++ b/resources/ConnectionScreen.qml @@ -82,7 +82,7 @@ Item { RadioButton { id: serialRadio - checked: previous_connection_type == "Serial" + checked: (previous_connection_type == "Serial" || previous_connection_type == "File" && !Globals.showFileConnection) text: serial_usb onToggled: dialogRect.forceActiveFocus() } @@ -98,9 +98,10 @@ Item { RadioButton { id: fileRadio - checked: previous_connection_type == "File" + checked: previous_connection_type == "File" && Globals.showFileConnection text: file onToggled: dialogRect.forceActiveFocus() + visible: Globals.showFileConnection } Item { diff --git a/resources/Constants/Globals.qml b/resources/Constants/Globals.qml index b3f5d3881..2464c7ce9 100644 --- a/resources/Constants/Globals.qml +++ b/resources/Constants/Globals.qml @@ -18,6 +18,7 @@ QtObject { property string copyClipboard: "" property var tablesWithHighlights: [] property var currentSelectedTable: null + property bool showFileConnection: false function clearHighlightedRows() { for (var i in tablesWithHighlights) { diff --git a/swiftnav_console/main.py b/swiftnav_console/main.py index 684d642ee..08d665914 100644 --- a/swiftnav_console/main.py +++ b/swiftnav_console/main.py @@ -790,11 +790,14 @@ def handle_cli_arguments(args: argparse.Namespace, globals_: QObject): ) else: globals_.setProperty("width", args.width) # type: ignore + if args.show_file_connection: + globals_.setProperty("showFileConnection", True) # type: ignore def main(passed_args: Optional[Tuple[str, ...]] = None) -> int: parser = argparse.ArgumentParser(add_help=False, usage=argparse.SUPPRESS) parser.add_argument("--show-fileio", action="store_true") + parser.add_argument("--show-file-connection", action="store_true") parser.add_argument("--no-opengl", action="store_false") parser.add_argument("--refresh-rate", type=int) parser.add_argument("--tab")