mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-03 18:01:28 +03:00
add option to hide stop-service when service is running (#14563)
* add option to hide stop-service when service is running Signed-off-by: 21pages <sunboeasy@gmail.com> * update hbb_common to upstream Signed-off-by: 21pages <sunboeasy@gmail.com> --------- Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -458,18 +458,27 @@ class _GeneralState extends State<_General> {
|
||||
return const Offstage();
|
||||
}
|
||||
|
||||
return _Card(title: 'Service', children: [
|
||||
Obx(() => _Button(serviceStop.value ? 'Start' : 'Stop', () {
|
||||
() async {
|
||||
serviceBtnEnabled.value = false;
|
||||
await start_service(serviceStop.value);
|
||||
// enable the button after 1 second
|
||||
Future.delayed(const Duration(seconds: 1), () {
|
||||
serviceBtnEnabled.value = true;
|
||||
});
|
||||
}();
|
||||
}, enabled: serviceBtnEnabled.value))
|
||||
]);
|
||||
final hideStopService =
|
||||
bind.mainGetBuildinOption(key: kOptionHideStopService) == 'Y';
|
||||
|
||||
return Obx(() {
|
||||
if (hideStopService && !serviceStop.value) {
|
||||
return const Offstage();
|
||||
}
|
||||
|
||||
return _Card(title: 'Service', children: [
|
||||
_Button(serviceStop.value ? 'Start' : 'Stop', () {
|
||||
() async {
|
||||
serviceBtnEnabled.value = false;
|
||||
await start_service(serviceStop.value);
|
||||
// enable the button after 1 second
|
||||
Future.delayed(const Duration(seconds: 1), () {
|
||||
serviceBtnEnabled.value = true;
|
||||
});
|
||||
}();
|
||||
}, enabled: serviceBtnEnabled.value)
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
Widget other() {
|
||||
|
||||
Reference in New Issue
Block a user