Sling GUI
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
import { Button, LineEdit, CheckBox, Spinner, GridBox, VerticalBox, HorizontalBox } from "std-widgets.slint";
|
||||
|
||||
export component MainWindow inherits Window {
|
||||
title: "Sane Vector Log Decoder";
|
||||
preferred-width: 640px;
|
||||
preferred-height: 320px;
|
||||
|
||||
in-out property <string> dbc-path;
|
||||
in-out property <string> asc-label;
|
||||
in-out property <bool> has-asc;
|
||||
in-out property <string> output-dir;
|
||||
in-out property <bool> laps;
|
||||
in-out property <bool> busy;
|
||||
in-out property <string> status;
|
||||
|
||||
callback browse-dbc();
|
||||
callback browse-asc();
|
||||
callback browse-output();
|
||||
callback decode();
|
||||
|
||||
VerticalBox {
|
||||
padding: 12px;
|
||||
spacing: 8px;
|
||||
|
||||
GridBox {
|
||||
spacing: 8px;
|
||||
|
||||
Row {
|
||||
Text {
|
||||
text: "DBC file:";
|
||||
vertical-alignment: center;
|
||||
}
|
||||
LineEdit {
|
||||
read-only: true;
|
||||
text: root.dbc-path;
|
||||
}
|
||||
Button {
|
||||
text: "Browse...";
|
||||
clicked => { root.browse-dbc(); }
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
Text {
|
||||
text: "ASC file(s):";
|
||||
vertical-alignment: center;
|
||||
}
|
||||
LineEdit {
|
||||
read-only: true;
|
||||
text: root.asc-label;
|
||||
}
|
||||
Button {
|
||||
text: "Browse...";
|
||||
clicked => { root.browse-asc(); }
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
Text {
|
||||
text: "Output dir:";
|
||||
vertical-alignment: center;
|
||||
}
|
||||
LineEdit {
|
||||
read-only: true;
|
||||
text: root.output-dir;
|
||||
}
|
||||
Button {
|
||||
text: "Browse...";
|
||||
clicked => { root.browse-output(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: "Generate lap beacons";
|
||||
checked <=> root.laps;
|
||||
}
|
||||
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
|
||||
HorizontalBox {
|
||||
padding: 0px;
|
||||
spacing: 8px;
|
||||
|
||||
if root.busy: Spinner {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
indeterminate: true;
|
||||
}
|
||||
|
||||
Text {
|
||||
text: root.status;
|
||||
horizontal-stretch: 1;
|
||||
vertical-alignment: center;
|
||||
overflow: elide;
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Decode!";
|
||||
enabled: !root.busy
|
||||
&& root.dbc-path != ""
|
||||
&& root.has-asc
|
||||
&& root.output-dir != "";
|
||||
clicked => { root.decode(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user