2023-10-22 22:32:13 +13:00
|
|
|
import { Button, VerticalBox , HorizontalBox, TabWidget, ListView, StandardListView, StandardTableView, CheckBox} from "std-widgets.slint";
|
|
|
|
import {LeftSidePanel} from "left_side_panel.slint";
|
|
|
|
import {MainList} from "main_lists.slint";
|
|
|
|
import {CurrentTab} from "common.slint";
|
|
|
|
|
|
|
|
|
|
|
|
export component ActionButtons {
|
|
|
|
callback deleted;
|
2023-10-27 07:57:17 +13:00
|
|
|
callback scan_stopping;
|
|
|
|
callback scan_starting(CurrentTab);
|
|
|
|
|
|
|
|
in-out property <bool> stop_requested: false;
|
2023-10-22 22:32:13 +13:00
|
|
|
in-out property <bool> scanning;
|
|
|
|
in-out property <CurrentTab> active-tab;
|
|
|
|
|
|
|
|
HorizontalBox {
|
|
|
|
height: 50px;
|
|
|
|
scan_button:= Button {
|
|
|
|
enabled: !scanning;
|
|
|
|
text: "Scan";
|
|
|
|
clicked => {
|
2023-10-27 07:57:17 +13:00
|
|
|
root.scanning = true;
|
|
|
|
root.scan_starting(active-tab);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stop_button:= Button {
|
|
|
|
enabled: scanning && !stop_requested;
|
|
|
|
text: "Stop";
|
|
|
|
clicked => {
|
|
|
|
root.scan_stopping();
|
|
|
|
root.stop_requested = true;
|
2023-10-22 22:32:13 +13:00
|
|
|
}
|
|
|
|
}
|
|
|
|
delete_button:= Button {
|
|
|
|
enabled: !scanning;
|
|
|
|
text: "Delete";
|
|
|
|
clicked => {
|
|
|
|
root.deleted();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|