From 4afcf8869f83de2b86fad5017b9defa10603f4ee Mon Sep 17 00:00:00 2001 From: Luc <8822552+luc-github@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:56:14 +0800 Subject: [PATCH] POC to hide panel settings if panel is not set as visible to simplify UI --- src/targets/Printer3D/Marlin/preferences.json | 30 +++++++++- .../Printer3D/Repetier/preferences.json | 18 +++++- src/targets/Printer3D/preferences.json | 59 +++++++++++++++++-- src/targets/preferences.json | 46 +++++++++------ 4 files changed, 128 insertions(+), 25 deletions(-) diff --git a/src/targets/Printer3D/Marlin/preferences.json b/src/targets/Printer3D/Marlin/preferences.json index eae74e09..b06811f0 100644 --- a/src/targets/Printer3D/Marlin/preferences.json +++ b/src/targets/Printer3D/Marlin/preferences.json @@ -70,7 +70,8 @@ "id": "sd", "type": "boolean", "label": "S190", - "value": false + "value": false, + "depend":[{"id":"showfilespanel", "value":true}] }, { "id": "sdlistcmd", @@ -86,6 +87,10 @@ { "connection_id": "SDConnection", "value": "=='none'" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -99,6 +104,10 @@ { "id": "sd", "value": true + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -112,6 +121,10 @@ { "id": "sd", "value": true + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -124,6 +137,10 @@ { "connection_id": "SDConnection", "value": "!='none'" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -141,6 +158,10 @@ { "connection_id": "SDConnection", "value": "!='none'" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -158,6 +179,10 @@ { "connection_id": "SDConnection", "value": "!='none'" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -175,6 +200,9 @@ { "connection_id": "SDConnection", "value": "!='none'" + }, { + "id": "showfilespanel", + "value": true } ] } diff --git a/src/targets/Printer3D/Repetier/preferences.json b/src/targets/Printer3D/Repetier/preferences.json index 35bad472..7ca56ce8 100644 --- a/src/targets/Printer3D/Repetier/preferences.json +++ b/src/targets/Printer3D/Repetier/preferences.json @@ -71,7 +71,11 @@ "id": "sd", "type": "boolean", "label": "S190", - "value": false + "value": false, + "depend": [{ + "id": "showfilespanel", + "value": true + }] }, { "id": "sdlistcmd", @@ -87,6 +91,10 @@ { "connection_id": "SDConnection", "value": "=='none'" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -100,6 +108,10 @@ { "id": "sd", "value": true + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -113,6 +125,10 @@ { "id": "sd", "value": true + }, + { + "id": "showfilespanel", + "value": true } ] } diff --git a/src/targets/Printer3D/preferences.json b/src/targets/Printer3D/preferences.json index 58e711bb..e8c57e97 100644 --- a/src/targets/Printer3D/preferences.json +++ b/src/targets/Printer3D/preferences.json @@ -244,18 +244,21 @@ ], "files": [ + { "id": "filesfilter", "type": "text", "label": "S96", "value": "g;G;gco;GCO;gcode;GCODE", - "help": "S97" + "help": "S97", + "depend":[{"id":"showfilespanel", "value":true}] }, { "id": "flashfs", "type": "boolean", "depend": [ - { "connection_id": "FlashFileSystem", "value": "!='none'" } + { "connection_id": "FlashFileSystem", "value": "!='none'" }, + {"id":"showfilespanel", "value":true} ], "label": "S137", "value": true @@ -273,7 +276,8 @@ ], "depend": [ { "connection_id": "Screen", "value": "=='none'" }, - { "connection_id": "FWTargetID", "value": "!='30'" } + { "connection_id": "FWTargetID", "value": "!='30'" }, + { "id":"showfilespanel", "value":true} ] }, { @@ -281,7 +285,10 @@ "type": "boolean", "label": "S188", "value": false, - "depend": [{ "id": "tftfs", "notvalue": "none"}] + "depend": [{ "id": "tftfs", "notvalue": "none"}, { + "id": "showfilespanel", + "value": true + }] }, { "id": "tftbttsdlistcmd", @@ -297,6 +304,9 @@ { "id": "tftfs", "value": "btt" + }, { + "id": "showfilespanel", + "value": true } ] }, @@ -314,6 +324,10 @@ { "id": "tftfs", "value": "btt" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -331,6 +345,10 @@ { "id": "tftfs", "value": "btt" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -348,6 +366,10 @@ { "id": "tftfs", "value": "mks" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -365,6 +387,10 @@ { "id": "tftfs", "value": "mks" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -373,7 +399,10 @@ "type": "boolean", "label": "S189", "value": false, - "depend": [{ "id": "tftfs", "notvalue": "none"}] + "depend": [{ "id": "tftfs", "notvalue": "none"}, { + "id": "showfilespanel", + "value": true + }] }, { "id": "tftbttusblistcmd", @@ -389,6 +418,10 @@ { "id": "tftfs", "value": "btt" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -406,6 +439,10 @@ { "id": "tftfs", "value": "mks" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -423,6 +460,10 @@ { "id": "tftfs", "value": "btt" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -440,6 +481,10 @@ { "id": "tftfs", "value": "btt" + }, + { + "id": "showfilespanel", + "value": true } ] }, @@ -457,6 +502,10 @@ { "id": "tftfs", "value": "mks" + }, + { + "id": "showfilespanel", + "value": true } ] } diff --git a/src/targets/preferences.json b/src/targets/preferences.json index 6a6b926e..c59e7e4f 100644 --- a/src/targets/preferences.json +++ b/src/targets/preferences.json @@ -124,24 +124,33 @@ "label": "S63", "value": true }, - { - "id": "openterminalonstart", - "type": "boolean", - "label": "S93", - "value": true - }, - { - "id": "verbose", - "type": "boolean", - "label": "S76", - "value": true - }, - { - "id": "autoscroll", - "type": "boolean", - "label": "S77", - "value": true + {"id": "terminalsettings", + "type": "group", + "label": "", + "depend":[{"id":"showterminalpanel", "value":true}], + "value": [ + { + "id": "openterminalonstart", + "type": "boolean", + "label": "S93", + "value": true + }, + { + "id": "verbose", + "type": "boolean", + "label": "S76", + "value": true + }, + { + "id": "autoscroll", + "type": "boolean", + "label": "S77", + "value": true + } + ] + } + ], "files": [ { @@ -154,7 +163,8 @@ "id": "openfilesonstart", "type": "boolean", "label": "S93", - "value": true + "value": true, + "depend":[{"id":"showfilespanel", "value":true}] } ], "jog": [