mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
feat: implement dialog callback
This commit is contained in:
@@ -152,7 +152,7 @@ class FileModel {
|
||||
String title, String content, bool showCheckbox, bool isIdentical) async {
|
||||
fileConfirmCheckboxRemember = false;
|
||||
return await parent.target?.dialogManager.show<bool?>(
|
||||
(setState, Function(bool? v) close) {
|
||||
(setState, Function(bool? v) close, context) {
|
||||
cancel() => close(false);
|
||||
submit() => close(true);
|
||||
return CustomAlertDialog(
|
||||
@@ -547,7 +547,7 @@ class FileController {
|
||||
|
||||
Future<bool?> showRemoveDialog(
|
||||
String title, String content, bool showCheckbox) async {
|
||||
return await dialogManager?.show<bool>((setState, Function(bool v) close) {
|
||||
return await dialogManager?.show<bool>((setState, Function(bool v) close, context) {
|
||||
cancel() => close(false);
|
||||
submit() => close(true);
|
||||
return CustomAlertDialog(
|
||||
|
||||
@@ -383,7 +383,7 @@ class FfiModel with ChangeNotifier {
|
||||
|
||||
void showRelayHintDialog(String id, String type, String title, String text,
|
||||
OverlayDialogManager dialogManager) {
|
||||
dialogManager.show(tag: '$id-$type', (setState, close) {
|
||||
dialogManager.show(tag: '$id-$type', (setState, close, context) {
|
||||
onClose() {
|
||||
closeConnection();
|
||||
close();
|
||||
|
||||
@@ -289,7 +289,7 @@ class ServerModel with ChangeNotifier {
|
||||
toggleService() async {
|
||||
if (_isStart) {
|
||||
final res =
|
||||
await parent.target?.dialogManager.show<bool>((setState, close) {
|
||||
await parent.target?.dialogManager.show<bool>((setState, close, context) {
|
||||
submit() => close(true);
|
||||
return CustomAlertDialog(
|
||||
title: Row(children: [
|
||||
@@ -312,7 +312,7 @@ class ServerModel with ChangeNotifier {
|
||||
}
|
||||
} else {
|
||||
final res =
|
||||
await parent.target?.dialogManager.show<bool>((setState, close) {
|
||||
await parent.target?.dialogManager.show<bool>((setState, close, context) {
|
||||
submit() => close(true);
|
||||
return CustomAlertDialog(
|
||||
title: Row(children: [
|
||||
@@ -481,7 +481,7 @@ class ServerModel with ChangeNotifier {
|
||||
}
|
||||
|
||||
void showLoginDialog(Client client) {
|
||||
parent.target?.dialogManager.show((setState, close) {
|
||||
parent.target?.dialogManager.show((setState, close, context) {
|
||||
cancel() {
|
||||
sendLoginResponse(client, false);
|
||||
close();
|
||||
@@ -699,7 +699,7 @@ String getLoginDialogTag(int id) {
|
||||
}
|
||||
|
||||
showInputWarnAlert(FFI ffi) {
|
||||
ffi.dialogManager.show((setState, close) {
|
||||
ffi.dialogManager.show((setState, close, context) {
|
||||
submit() {
|
||||
AndroidPermissionManager.startAction(kActionAccessibilitySettings);
|
||||
close();
|
||||
@@ -726,7 +726,7 @@ showInputWarnAlert(FFI ffi) {
|
||||
}
|
||||
|
||||
Future<void> showClientsMayNotBeChangedAlert(FFI? ffi) async {
|
||||
await ffi?.dialogManager.show((setState, close) {
|
||||
await ffi?.dialogManager.show((setState, close, context) {
|
||||
return CustomAlertDialog(
|
||||
title: Text(translate("Permissions")),
|
||||
content: Column(
|
||||
|
||||
Reference in New Issue
Block a user