mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -18,6 +18,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:window_size/window_size.dart' as window_size;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import 'common/widgets/overlay.dart';
|
||||
import 'mobile/pages/file_manager_page.dart';
|
||||
@@ -618,8 +619,8 @@ class CustomAlertDialog extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
void msgBox(
|
||||
String type, String title, String text, OverlayDialogManager dialogManager,
|
||||
void msgBox(String type, String title, String text, String link,
|
||||
OverlayDialogManager dialogManager,
|
||||
{bool? hasCancel}) {
|
||||
dialogManager.dismissAll();
|
||||
List<Widget> buttons = [];
|
||||
@@ -636,6 +637,12 @@ void msgBox(
|
||||
dialogManager.dismissAll();
|
||||
}
|
||||
|
||||
jumplink() {
|
||||
if (link.startsWith('http')) {
|
||||
launchUrl(Uri.parse(link));
|
||||
}
|
||||
}
|
||||
|
||||
if (type != "connecting" && type != "success" && !type.contains("nook")) {
|
||||
hasOk = true;
|
||||
buttons.insert(0, msgBoxButton(translate('OK'), submit));
|
||||
@@ -654,6 +661,9 @@ void msgBox(
|
||||
dialogManager.dismissAll();
|
||||
}));
|
||||
}
|
||||
if (link.isNotEmpty) {
|
||||
buttons.insert(0, msgBoxButton(translate('JumpLink'), jumplink));
|
||||
}
|
||||
dialogManager.show((setState, close) => CustomAlertDialog(
|
||||
title: _msgBoxTitle(title),
|
||||
content: SelectableText(translate(text),
|
||||
|
||||
@@ -414,7 +414,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
final root = await bind.mainIsRoot();
|
||||
final release = await bind.mainIsRelease();
|
||||
if (Platform.isWindows && release && !installed && !root) {
|
||||
msgBox('custom-elevation-nocancel', 'Prompt', 'elevation_prompt',
|
||||
msgBox('custom-elevation-nocancel', 'Prompt', 'elevation_prompt', '',
|
||||
gFFI.dialogManager);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ import '../../models/model.dart';
|
||||
import '../../models/platform_model.dart';
|
||||
|
||||
void clientClose(OverlayDialogManager dialogManager) {
|
||||
msgBox('', 'Close', 'Are you sure to close the connection?', dialogManager);
|
||||
msgBox('', 'Close', 'Are you sure to close the connection?', '', dialogManager);
|
||||
}
|
||||
|
||||
void showSuccess() {
|
||||
|
||||
@@ -222,26 +222,27 @@ class FfiModel with ChangeNotifier {
|
||||
handleMsgBox(Map<String, dynamic> evt, String id) {
|
||||
if (parent.target == null) return;
|
||||
final dialogManager = parent.target!.dialogManager;
|
||||
var type = evt['type'];
|
||||
var title = evt['title'];
|
||||
var text = evt['text'];
|
||||
final type = evt['type'];
|
||||
final title = evt['title'];
|
||||
final text = evt['text'];
|
||||
final link = evt['link'];
|
||||
if (type == 're-input-password') {
|
||||
wrongPasswordDialog(id, dialogManager);
|
||||
} else if (type == 'input-password') {
|
||||
enterPasswordDialog(id, dialogManager);
|
||||
} else if (type == 'restarting') {
|
||||
showMsgBox(id, type, title, text, false, dialogManager, hasCancel: false);
|
||||
showMsgBox(id, type, title, text, link, false, dialogManager, hasCancel: false);
|
||||
} else {
|
||||
var hasRetry = evt['hasRetry'] == 'true';
|
||||
showMsgBox(id, type, title, text, hasRetry, dialogManager);
|
||||
showMsgBox(id, type, title, text, link, hasRetry, dialogManager);
|
||||
}
|
||||
}
|
||||
|
||||
/// Show a message box with [type], [title] and [text].
|
||||
showMsgBox(String id, String type, String title, String text, bool hasRetry,
|
||||
OverlayDialogManager dialogManager,
|
||||
showMsgBox(String id, String type, String title, String text, String link,
|
||||
bool hasRetry, OverlayDialogManager dialogManager,
|
||||
{bool? hasCancel}) {
|
||||
msgBox(type, title, text, dialogManager, hasCancel: hasCancel);
|
||||
msgBox(type, title, text, link, dialogManager, hasCancel: hasCancel);
|
||||
_timer?.cancel();
|
||||
if (hasRetry) {
|
||||
_timer = Timer(Duration(seconds: _reconnects), () {
|
||||
|
||||
Reference in New Issue
Block a user