Merge pull request #1646 from Heap-Hop/master
opt: mobile and desktop flutter
This commit is contained in:
commit
f38a114d63
@ -136,8 +136,9 @@ class MyTheme {
|
|||||||
titleLarge: TextStyle(fontSize: 19, color: Colors.black87),
|
titleLarge: TextStyle(fontSize: 19, color: Colors.black87),
|
||||||
titleSmall: TextStyle(fontSize: 14, color: Colors.black87),
|
titleSmall: TextStyle(fontSize: 14, color: Colors.black87),
|
||||||
bodySmall: TextStyle(fontSize: 12, color: Colors.black87, height: 1.25),
|
bodySmall: TextStyle(fontSize: 12, color: Colors.black87, height: 1.25),
|
||||||
bodyMedium: TextStyle(fontSize: 14, color: Colors.black87, height: 1.25),
|
bodyMedium:
|
||||||
),
|
TextStyle(fontSize: 14, color: Colors.black87, height: 1.25),
|
||||||
|
labelLarge: TextStyle(fontSize: 16.0, color: MyTheme.accent80)),
|
||||||
hintColor: Color(0xFFAAAAAA),
|
hintColor: Color(0xFFAAAAAA),
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||||
@ -166,7 +167,9 @@ class MyTheme {
|
|||||||
titleLarge: TextStyle(fontSize: 19),
|
titleLarge: TextStyle(fontSize: 19),
|
||||||
titleSmall: TextStyle(fontSize: 14),
|
titleSmall: TextStyle(fontSize: 14),
|
||||||
bodySmall: TextStyle(fontSize: 12, height: 1.25),
|
bodySmall: TextStyle(fontSize: 12, height: 1.25),
|
||||||
bodyMedium: TextStyle(fontSize: 14, height: 1.25)),
|
bodyMedium: TextStyle(fontSize: 14, height: 1.25),
|
||||||
|
labelLarge: TextStyle(
|
||||||
|
fontSize: 16.0, fontWeight: FontWeight.bold, color: accent80)),
|
||||||
cardColor: Color(0xFF252525),
|
cardColor: Color(0xFF252525),
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||||
@ -558,6 +561,7 @@ class CustomAlertDialog extends StatelessWidget {
|
|||||||
required this.content,
|
required this.content,
|
||||||
this.actions,
|
this.actions,
|
||||||
this.contentPadding,
|
this.contentPadding,
|
||||||
|
this.contentBoxConstraints = const BoxConstraints(maxWidth: 500),
|
||||||
this.onSubmit,
|
this.onSubmit,
|
||||||
this.onCancel})
|
this.onCancel})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
@ -566,6 +570,7 @@ class CustomAlertDialog extends StatelessWidget {
|
|||||||
final Widget content;
|
final Widget content;
|
||||||
final List<Widget>? actions;
|
final List<Widget>? actions;
|
||||||
final double? contentPadding;
|
final double? contentPadding;
|
||||||
|
final BoxConstraints contentBoxConstraints;
|
||||||
final Function()? onSubmit;
|
final Function()? onSubmit;
|
||||||
final Function()? onCancel;
|
final Function()? onCancel;
|
||||||
|
|
||||||
@ -597,7 +602,8 @@ class CustomAlertDialog extends StatelessWidget {
|
|||||||
title: title,
|
title: title,
|
||||||
contentPadding: EdgeInsets.symmetric(
|
contentPadding: EdgeInsets.symmetric(
|
||||||
horizontal: contentPadding ?? 25, vertical: 10),
|
horizontal: contentPadding ?? 25, vertical: 10),
|
||||||
content: content,
|
content:
|
||||||
|
ConstrainedBox(constraints: contentBoxConstraints, child: content),
|
||||||
actions: actions,
|
actions: actions,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -642,9 +648,7 @@ void msgBox(
|
|||||||
}
|
}
|
||||||
dialogManager.show((setState, close) => CustomAlertDialog(
|
dialogManager.show((setState, close) => CustomAlertDialog(
|
||||||
title: _msgBoxTitle(title),
|
title: _msgBoxTitle(title),
|
||||||
content: ConstrainedBox(
|
content: Text(translate(text), style: const TextStyle(fontSize: 15)),
|
||||||
constraints: BoxConstraints(maxWidth: 500),
|
|
||||||
child: Text(translate(text), style: const TextStyle(fontSize: 15))),
|
|
||||||
actions: buttons,
|
actions: buttons,
|
||||||
onSubmit: hasOk ? submit : null,
|
onSubmit: hasOk ? submit : null,
|
||||||
onCancel: hasCancel == true ? cancel : null,
|
onCancel: hasCancel == true ? cancel : null,
|
||||||
|
@ -155,3 +155,54 @@ void changeWhiteList({Function()? callback}) async {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<String> changeDirectAccessPort(
|
||||||
|
String currentIP, String currentPort) async {
|
||||||
|
final controller = TextEditingController(text: currentPort);
|
||||||
|
await gFFI.dialogManager.show((setState, close) {
|
||||||
|
return CustomAlertDialog(
|
||||||
|
title: Text(translate("Change Local Port")),
|
||||||
|
content: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 8.0),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: TextField(
|
||||||
|
maxLines: null,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: '21118',
|
||||||
|
isCollapsed: true,
|
||||||
|
prefix: Text('$currentIP : '),
|
||||||
|
suffix: IconButton(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
icon: const Icon(Icons.clear, size: 16),
|
||||||
|
onPressed: () => controller.clear())),
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.allow(RegExp(
|
||||||
|
r'^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$')),
|
||||||
|
],
|
||||||
|
controller: controller,
|
||||||
|
focusNode: FocusNode()..requestFocus()),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(onPressed: close, child: Text(translate("Cancel"))),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () async {
|
||||||
|
await bind.mainSetOption(
|
||||||
|
key: 'direct-access-port', value: controller.text);
|
||||||
|
close();
|
||||||
|
},
|
||||||
|
child: Text(translate("OK"))),
|
||||||
|
],
|
||||||
|
onCancel: close,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
return controller.text;
|
||||||
|
}
|
||||||
|
@ -669,7 +669,7 @@ class RecentPeerCard extends BasePeerCard {
|
|||||||
_connectAction(context, peer),
|
_connectAction(context, peer),
|
||||||
_transferFileAction(context, peer.id),
|
_transferFileAction(context, peer.id),
|
||||||
];
|
];
|
||||||
if (isDesktop) {
|
if (isDesktop && peer.platform != 'Android') {
|
||||||
menuItems.add(_tcpTunnelingAction(context, peer.id));
|
menuItems.add(_tcpTunnelingAction(context, peer.id));
|
||||||
}
|
}
|
||||||
menuItems.add(await _forceAlwaysRelayAction(peer.id));
|
menuItems.add(await _forceAlwaysRelayAction(peer.id));
|
||||||
@ -701,7 +701,7 @@ class FavoritePeerCard extends BasePeerCard {
|
|||||||
_connectAction(context, peer),
|
_connectAction(context, peer),
|
||||||
_transferFileAction(context, peer.id),
|
_transferFileAction(context, peer.id),
|
||||||
];
|
];
|
||||||
if (isDesktop) {
|
if (isDesktop && peer.platform != 'Android') {
|
||||||
menuItems.add(_tcpTunnelingAction(context, peer.id));
|
menuItems.add(_tcpTunnelingAction(context, peer.id));
|
||||||
}
|
}
|
||||||
menuItems.add(await _forceAlwaysRelayAction(peer.id));
|
menuItems.add(await _forceAlwaysRelayAction(peer.id));
|
||||||
@ -735,7 +735,7 @@ class DiscoveredPeerCard extends BasePeerCard {
|
|||||||
_connectAction(context, peer),
|
_connectAction(context, peer),
|
||||||
_transferFileAction(context, peer.id),
|
_transferFileAction(context, peer.id),
|
||||||
];
|
];
|
||||||
if (isDesktop) {
|
if (isDesktop && peer.platform != 'Android') {
|
||||||
menuItems.add(_tcpTunnelingAction(context, peer.id));
|
menuItems.add(_tcpTunnelingAction(context, peer.id));
|
||||||
}
|
}
|
||||||
menuItems.add(await _forceAlwaysRelayAction(peer.id));
|
menuItems.add(await _forceAlwaysRelayAction(peer.id));
|
||||||
@ -760,7 +760,7 @@ class AddressBookPeerCard extends BasePeerCard {
|
|||||||
_connectAction(context, peer),
|
_connectAction(context, peer),
|
||||||
_transferFileAction(context, peer.id),
|
_transferFileAction(context, peer.id),
|
||||||
];
|
];
|
||||||
if (isDesktop) {
|
if (isDesktop && peer.platform != 'Android') {
|
||||||
menuItems.add(_tcpTunnelingAction(context, peer.id));
|
menuItems.add(_tcpTunnelingAction(context, peer.id));
|
||||||
}
|
}
|
||||||
menuItems.add(await _forceAlwaysRelayAction(peer.id));
|
menuItems.add(await _forceAlwaysRelayAction(peer.id));
|
||||||
|
@ -529,85 +529,6 @@ class _CmControlPanel extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PaddingCard extends StatelessWidget {
|
|
||||||
PaddingCard({required this.child, this.title, this.titleIcon});
|
|
||||||
|
|
||||||
final String? title;
|
|
||||||
final IconData? titleIcon;
|
|
||||||
final Widget child;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final children = [child];
|
|
||||||
if (title != null) {
|
|
||||||
children.insert(
|
|
||||||
0,
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 5.0),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
titleIcon != null
|
|
||||||
? Padding(
|
|
||||||
padding: EdgeInsets.only(right: 10),
|
|
||||||
child: Icon(titleIcon,
|
|
||||||
color: MyTheme.accent80, size: 30))
|
|
||||||
: SizedBox.shrink(),
|
|
||||||
Text(
|
|
||||||
title!,
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily: 'WorkSans',
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 20,
|
|
||||||
color: MyTheme.accent80,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
return Container(
|
|
||||||
width: double.maxFinite,
|
|
||||||
child: Card(
|
|
||||||
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0),
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 15.0, horizontal: 30.0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: children,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget clientInfo(Client client) {
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 8),
|
|
||||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: -1,
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.only(right: 12),
|
|
||||||
child: CircleAvatar(
|
|
||||||
child: Text(client.name[0]),
|
|
||||||
backgroundColor: MyTheme.border))),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text(client.name,
|
|
||||||
style: TextStyle(color: MyTheme.idColor, fontSize: 18)),
|
|
||||||
SizedBox(width: 8),
|
|
||||||
Text(client.peerId,
|
|
||||||
style: TextStyle(color: MyTheme.idColor, fontSize: 10))
|
|
||||||
]))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
]));
|
|
||||||
}
|
|
||||||
|
|
||||||
void checkClickTime(int id, Function() callback) async {
|
void checkClickTime(int id, Function() callback) async {
|
||||||
var clickCallbackTime = DateTime.now().millisecondsSinceEpoch;
|
var clickCallbackTime = DateTime.now().millisecondsSinceEpoch;
|
||||||
await bind.cmCheckClickTime(connId: id);
|
await bind.cmCheckClickTime(connId: id);
|
||||||
|
@ -314,7 +314,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
icon: Icon(Icons.tv),
|
icon: Icon(Icons.tv),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() => _showEdit = false);
|
setState(() => _showEdit = false);
|
||||||
showOptions(widget.id, gFFI.dialogManager);
|
showOptions(context, widget.id, gFFI.dialogManager);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
] +
|
] +
|
||||||
@ -446,8 +446,9 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
gFFI.cursorModel.move(d.localPosition.dx, d.localPosition.dy);
|
gFFI.cursorModel.move(d.localPosition.dx, d.localPosition.dy);
|
||||||
inputModel.sendMouse('down', MouseButtons.left);
|
inputModel.sendMouse('down', MouseButtons.left);
|
||||||
} else {
|
} else {
|
||||||
final cursorX = gFFI.cursorModel.x;
|
final offset = gFFI.cursorModel.offset;
|
||||||
final cursorY = gFFI.cursorModel.y;
|
final cursorX = offset.dx;
|
||||||
|
final cursorY = offset.dy;
|
||||||
final visible =
|
final visible =
|
||||||
gFFI.cursorModel.getVisibleRect().inflate(1); // extend edges
|
gFFI.cursorModel.getVisibleRect().inflate(1); // extend edges
|
||||||
final size = MediaQueryData.fromWindow(ui.window).size;
|
final size = MediaQueryData.fromWindow(ui.window).size;
|
||||||
@ -873,7 +874,8 @@ class ImagePainter extends CustomPainter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void showOptions(String id, OverlayDialogManager dialogManager) async {
|
void showOptions(
|
||||||
|
BuildContext context, String id, OverlayDialogManager dialogManager) async {
|
||||||
String quality = await bind.sessionGetImageQuality(id: id) ?? 'balanced';
|
String quality = await bind.sessionGetImageQuality(id: id) ?? 'balanced';
|
||||||
if (quality == '') quality = 'balanced';
|
if (quality == '') quality = 'balanced';
|
||||||
String codec =
|
String codec =
|
||||||
@ -902,12 +904,16 @@ void showOptions(String id, OverlayDialogManager dialogManager) async {
|
|||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: Colors.black87),
|
border: Border.all(color: Theme.of(context).hintColor),
|
||||||
color: i == cur ? Colors.black87 : Colors.white),
|
borderRadius: BorderRadius.circular(2),
|
||||||
|
color: i == cur
|
||||||
|
? Theme.of(context).toggleableActiveColor.withOpacity(0.6)
|
||||||
|
: null),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text((i + 1).toString(),
|
child: Text((i + 1).toString(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: i == cur ? Colors.white : Colors.black87))))));
|
color: i == cur ? Colors.white : Colors.black87,
|
||||||
|
fontWeight: FontWeight.bold))))));
|
||||||
}
|
}
|
||||||
displays.add(Padding(
|
displays.add(Padding(
|
||||||
padding: const EdgeInsets.only(top: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
|
@ -333,14 +333,8 @@ class PermissionRow extends StatelessWidget {
|
|||||||
child: FittedBox(
|
child: FittedBox(
|
||||||
fit: BoxFit.scaleDown,
|
fit: BoxFit.scaleDown,
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(name,
|
child:
|
||||||
style: TextStyle(
|
Text(name, style: Theme.of(context).textTheme.labelLarge))),
|
||||||
fontSize: 16.0,
|
|
||||||
fontWeight:
|
|
||||||
Theme.of(context).brightness == Brightness.dark
|
|
||||||
? FontWeight.bold
|
|
||||||
: null,
|
|
||||||
color: MyTheme.accent80)))),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: FittedBox(
|
child: FittedBox(
|
||||||
@ -387,7 +381,7 @@ class ConnectionManager extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: clientInfo(client)),
|
Expanded(child: ClientInfo(client)),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: -1,
|
flex: -1,
|
||||||
child: client.isFileTransfer || !client.authorized
|
child: client.isFileTransfer || !client.authorized
|
||||||
@ -499,7 +493,12 @@ class PaddingCard extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget clientInfo(Client client) {
|
class ClientInfo extends StatelessWidget {
|
||||||
|
final Client client;
|
||||||
|
ClientInfo(this.client);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
@ -510,7 +509,8 @@ Widget clientInfo(Client client) {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(right: 12),
|
padding: const EdgeInsets.only(right: 12),
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
backgroundColor: MyTheme.border,
|
backgroundColor:
|
||||||
|
str2color(client.name).withOpacity(0.7),
|
||||||
child: Text(client.name[0])))),
|
child: Text(client.name[0])))),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -522,13 +522,14 @@ Widget clientInfo(Client client) {
|
|||||||
color: MyTheme.idColor, fontSize: 18)),
|
color: MyTheme.idColor, fontSize: 18)),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Text(client.peerId,
|
Text(client.peerId,
|
||||||
style:
|
style: const TextStyle(
|
||||||
const TextStyle(color: MyTheme.idColor, fontSize: 10))
|
color: MyTheme.idColor, fontSize: 10))
|
||||||
]))
|
]))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void androidChannelInit() {
|
void androidChannelInit() {
|
||||||
gFFI.setMethodCallHandler((method, arguments) {
|
gFFI.setMethodCallHandler((method, arguments) {
|
||||||
|
@ -36,6 +36,9 @@ var _ignoreBatteryOpt = false;
|
|||||||
var _enableAbr = false;
|
var _enableAbr = false;
|
||||||
var _denyLANDiscovery = false;
|
var _denyLANDiscovery = false;
|
||||||
var _onlyWhiteList = false;
|
var _onlyWhiteList = false;
|
||||||
|
var _enableDirectIPAccess = false;
|
||||||
|
var _localIP = "";
|
||||||
|
var _directAccessPort = "";
|
||||||
|
|
||||||
class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
||||||
String? username;
|
String? username;
|
||||||
@ -77,6 +80,26 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
_onlyWhiteList = onlyWhiteList;
|
_onlyWhiteList = onlyWhiteList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final enableDirectIPAccess = option2bool(
|
||||||
|
'direct-server', await bind.mainGetOption(key: 'direct-server'));
|
||||||
|
if (enableDirectIPAccess != _enableDirectIPAccess) {
|
||||||
|
update = true;
|
||||||
|
_enableDirectIPAccess = enableDirectIPAccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
final localIP = await bind.mainGetOption(key: 'local-ip-addr');
|
||||||
|
if (localIP != _localIP) {
|
||||||
|
update = true;
|
||||||
|
_localIP = localIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
final directAccessPort =
|
||||||
|
await bind.mainGetOption(key: 'direct-access-port');
|
||||||
|
if (directAccessPort != _directAccessPort) {
|
||||||
|
update = true;
|
||||||
|
_directAccessPort = directAccessPort;
|
||||||
|
}
|
||||||
|
|
||||||
if (update) {
|
if (update) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
@ -113,20 +136,8 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Provider.of<FfiModel>(context);
|
Provider.of<FfiModel>(context);
|
||||||
final enhancementsTiles = [
|
final List<AbstractSettingsTile> enhancementsTiles = [];
|
||||||
SettingsTile.switchTile(
|
final List<AbstractSettingsTile> shareScreenTiles = [
|
||||||
title: Text('${translate('Adaptive Bitrate')} (beta)'),
|
|
||||||
initialValue: _enableAbr,
|
|
||||||
onToggle: (v) async {
|
|
||||||
await bind.mainSetOption(key: "enable-abr", value: v ? "" : "N");
|
|
||||||
final newValue = await bind.mainGetOption(key: "enable-abr") != "N";
|
|
||||||
setState(() {
|
|
||||||
_enableAbr = newValue;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
)
|
|
||||||
];
|
|
||||||
final shareScreenTiles = [
|
|
||||||
SettingsTile.switchTile(
|
SettingsTile.switchTile(
|
||||||
title: Text(translate('Deny LAN Discovery')),
|
title: Text(translate('Deny LAN Discovery')),
|
||||||
initialValue: _denyLANDiscovery,
|
initialValue: _denyLANDiscovery,
|
||||||
@ -143,7 +154,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
),
|
),
|
||||||
SettingsTile.switchTile(
|
SettingsTile.switchTile(
|
||||||
title: Row(children: [
|
title: Row(children: [
|
||||||
Text(translate('Use IP Whitelisting')),
|
Expanded(child: Text(translate('Use IP Whitelisting'))),
|
||||||
Offstage(
|
Offstage(
|
||||||
offstage: !_onlyWhiteList,
|
offstage: !_onlyWhiteList,
|
||||||
child: const Icon(Icons.warning_amber_rounded,
|
child: const Icon(Icons.warning_amber_rounded,
|
||||||
@ -164,6 +175,58 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
|
|
||||||
changeWhiteList(callback: update);
|
changeWhiteList(callback: update);
|
||||||
},
|
},
|
||||||
|
),
|
||||||
|
SettingsTile.switchTile(
|
||||||
|
title: Text('${translate('Adaptive Bitrate')} (beta)'),
|
||||||
|
initialValue: _enableAbr,
|
||||||
|
onToggle: (v) async {
|
||||||
|
await bind.mainSetOption(key: "enable-abr", value: v ? "" : "N");
|
||||||
|
final newValue = await bind.mainGetOption(key: "enable-abr") != "N";
|
||||||
|
setState(() {
|
||||||
|
_enableAbr = newValue;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SettingsTile.switchTile(
|
||||||
|
title: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(translate("Direct IP Access")),
|
||||||
|
Offstage(
|
||||||
|
offstage: !_enableDirectIPAccess,
|
||||||
|
child: Text(
|
||||||
|
'${translate("Local Address")}: $_localIP${_directAccessPort.isEmpty ? "" : ":$_directAccessPort"}',
|
||||||
|
style: Theme.of(context).textTheme.bodySmall,
|
||||||
|
)),
|
||||||
|
])),
|
||||||
|
Offstage(
|
||||||
|
offstage: !_enableDirectIPAccess,
|
||||||
|
child: IconButton(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
icon: Icon(
|
||||||
|
Icons.edit,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
final port = await changeDirectAccessPort(
|
||||||
|
_localIP, _directAccessPort);
|
||||||
|
setState(() {
|
||||||
|
_directAccessPort = port;
|
||||||
|
});
|
||||||
|
}))
|
||||||
|
]),
|
||||||
|
initialValue: _enableDirectIPAccess,
|
||||||
|
onToggle: (_) async {
|
||||||
|
_enableDirectIPAccess = !_enableDirectIPAccess;
|
||||||
|
String value = bool2option('direct-server', _enableDirectIPAccess);
|
||||||
|
await bind.mainSetOption(key: 'direct-server', value: value);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
if (_hasIgnoreBattery) {
|
if (_hasIgnoreBattery) {
|
||||||
@ -171,9 +234,13 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
0,
|
0,
|
||||||
SettingsTile.switchTile(
|
SettingsTile.switchTile(
|
||||||
initialValue: _ignoreBatteryOpt,
|
initialValue: _ignoreBatteryOpt,
|
||||||
title: Text(translate('Keep RustDesk background service')),
|
title: Column(
|
||||||
description:
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Text('* ${translate('Ignore Battery Optimizations')}'),
|
children: [
|
||||||
|
Text(translate('Keep RustDesk background service')),
|
||||||
|
Text('* ${translate('Ignore Battery Optimizations')}',
|
||||||
|
style: Theme.of(context).textTheme.bodySmall),
|
||||||
|
]),
|
||||||
onToggle: (v) async {
|
onToggle: (v) async {
|
||||||
if (v) {
|
if (v) {
|
||||||
PermissionManager.request("ignore_battery_optimizations");
|
PermissionManager.request("ignore_battery_optimizations");
|
||||||
|
@ -570,6 +570,8 @@ class FileModel extends ChangeNotifier {
|
|||||||
Text(title)
|
Text(title)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
contentBoxConstraints:
|
||||||
|
BoxConstraints(minHeight: 100, minWidth: 400, maxWidth: 400),
|
||||||
content: Column(
|
content: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@ -627,6 +629,8 @@ class FileModel extends ChangeNotifier {
|
|||||||
Text(title)
|
Text(title)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
contentBoxConstraints:
|
||||||
|
BoxConstraints(minHeight: 100, minWidth: 400, maxWidth: 400),
|
||||||
content: Column(
|
content: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
@ -357,9 +357,6 @@ class InputModel {
|
|||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
}
|
}
|
||||||
// fix mouse out of bounds
|
|
||||||
x = min(max(0.0, x), d.width.toDouble());
|
|
||||||
y = min(max(0.0, y), d.height.toDouble());
|
|
||||||
evt['x'] = '${x.round()}';
|
evt['x'] = '${x.round()}';
|
||||||
evt['y'] = '${y.round()}';
|
evt['y'] = '${y.round()}';
|
||||||
var buttons = '';
|
var buttons = '';
|
||||||
|
@ -118,7 +118,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
} else {
|
} else {
|
||||||
final icon =
|
final icon =
|
||||||
'${secure == true ? 'secure' : 'insecure'}${direct == true ? '' : '_relay'}';
|
'${secure == true ? 'secure' : 'insecure'}${direct == true ? '' : '_relay'}';
|
||||||
return SvgPicture.asset('assets/$icon.png', width: 48, height: 48);
|
return SvgPicture.asset('assets/$icon.svg', width: 48, height: 48);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,9 +268,12 @@ class FfiModel with ChangeNotifier {
|
|||||||
if (isPeerAndroid) {
|
if (isPeerAndroid) {
|
||||||
_touchMode = true;
|
_touchMode = true;
|
||||||
if (parent.target != null &&
|
if (parent.target != null &&
|
||||||
|
parent.target!.connType == ConnType.defaultConn &&
|
||||||
parent.target!.ffiModel.permissions['keyboard'] != false) {
|
parent.target!.ffiModel.permissions['keyboard'] != false) {
|
||||||
Timer(const Duration(milliseconds: 100),
|
Timer(
|
||||||
parent.target!.dialogManager.showMobileActionsOverlay);
|
const Duration(milliseconds: 100),
|
||||||
|
() => parent.target!.dialogManager
|
||||||
|
.showMobileActionsOverlay(ffi: parent.target!));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_touchMode =
|
_touchMode =
|
||||||
|
@ -13,7 +13,7 @@ import '../desktop/widgets/tabbar_widget.dart';
|
|||||||
import '../mobile/pages/server_page.dart';
|
import '../mobile/pages/server_page.dart';
|
||||||
import 'model.dart';
|
import 'model.dart';
|
||||||
|
|
||||||
const KLoginDialogTag = "LOGIN";
|
const kLoginDialogTag = "LOGIN";
|
||||||
|
|
||||||
const kUseTemporaryPassword = "use-temporary-password";
|
const kUseTemporaryPassword = "use-temporary-password";
|
||||||
const kUsePermanentPassword = "use-permanent-password";
|
const kUsePermanentPassword = "use-permanent-password";
|
||||||
@ -433,7 +433,7 @@ class ServerModel with ChangeNotifier {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(translate("Do you accept?")),
|
Text(translate("Do you accept?")),
|
||||||
clientInfo(client),
|
ClientInfo(client),
|
||||||
Text(
|
Text(
|
||||||
translate("android_new_connection_tip"),
|
translate("android_new_connection_tip"),
|
||||||
style: Theme.of(globalKey.currentContext!).textTheme.bodyMedium,
|
style: Theme.of(globalKey.currentContext!).textTheme.bodyMedium,
|
||||||
@ -578,7 +578,7 @@ class Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String getLoginDialogTag(int id) {
|
String getLoginDialogTag(int id) {
|
||||||
return KLoginDialogTag + id.toString();
|
return kLoginDialogTag + id.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
showInputWarnAlert(FFI ffi) {
|
showInputWarnAlert(FFI ffi) {
|
||||||
|
@ -1319,7 +1319,7 @@ impl LoginConfigHandler {
|
|||||||
self.conn_id = pi.conn_id;
|
self.conn_id = pi.conn_id;
|
||||||
// no matter if change, for update file time
|
// no matter if change, for update file time
|
||||||
self.save_config(config);
|
self.save_config(config);
|
||||||
#[cfg(feature = "hwcodec")]
|
#[cfg(any(feature = "hwcodec", feature = "mediacodec"))]
|
||||||
{
|
{
|
||||||
self.supported_encoding = Some((pi.encoding.h264, pi.encoding.h265));
|
self.supported_encoding = Some((pi.encoding.h264, pi.encoding.h265));
|
||||||
}
|
}
|
||||||
|
@ -317,6 +317,7 @@ async fn test_nat_type_() -> ResultType<bool> {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Config::set_option("local-ip-addr".to_owned(), addr.ip().to_string());
|
||||||
let ok = port1 > 0 && port2 > 0;
|
let ok = port1 > 0 && port2 > 0;
|
||||||
if ok {
|
if ok {
|
||||||
let t = if port1 == port2 {
|
let t = if port1 == port2 {
|
||||||
|
@ -32,16 +32,15 @@ fn initialize(app_dir: &str) {
|
|||||||
);
|
);
|
||||||
#[cfg(feature = "mediacodec")]
|
#[cfg(feature = "mediacodec")]
|
||||||
scrap::mediacodec::check_mediacodec();
|
scrap::mediacodec::check_mediacodec();
|
||||||
|
crate::common::test_rendezvous_server();
|
||||||
|
crate::common::test_nat_type();
|
||||||
|
crate::common::check_software_update();
|
||||||
}
|
}
|
||||||
#[cfg(target_os = "ios")]
|
#[cfg(target_os = "ios")]
|
||||||
{
|
{
|
||||||
use hbb_common::env_logger::*;
|
use hbb_common::env_logger::*;
|
||||||
init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "debug"));
|
init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "debug"));
|
||||||
}
|
}
|
||||||
#[cfg(target_os = "android")]
|
|
||||||
{
|
|
||||||
crate::common::check_software_update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// FFI for rustdesk core's main entry.
|
/// FFI for rustdesk core's main entry.
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "动作"),
|
("Action", "动作"),
|
||||||
("Add", "添加"),
|
("Add", "添加"),
|
||||||
("Local Port", "本地端口"),
|
("Local Port", "本地端口"),
|
||||||
|
("Local Address", "当前地址"),
|
||||||
|
("Change Local Port", "修改本地端口"),
|
||||||
("setup_server_tip", "如果需要更快连接速度,你可以选择自建服务器"),
|
("setup_server_tip", "如果需要更快连接速度,你可以选择自建服务器"),
|
||||||
("Too short, at least 6 characters.", "太短了,至少6个字符"),
|
("Too short, at least 6 characters.", "太短了,至少6个字符"),
|
||||||
("The confirmation is not identical.", "两次输入不匹配"),
|
("The confirmation is not identical.", "两次输入不匹配"),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Akce"),
|
("Action", "Akce"),
|
||||||
("Add", "Přidat"),
|
("Add", "Přidat"),
|
||||||
("Local Port", "Místní port"),
|
("Local Port", "Místní port"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Rychlejší připojení získáte vytvořením si svého vlastního serveru"),
|
("setup_server_tip", "Rychlejší připojení získáte vytvořením si svého vlastního serveru"),
|
||||||
("Too short, at least 6 characters.", "Příliš krátké – alespoň 6 znaků."),
|
("Too short, at least 6 characters.", "Příliš krátké – alespoň 6 znaků."),
|
||||||
("The confirmation is not identical.", "Kontrolní zadání se neshoduje."),
|
("The confirmation is not identical.", "Kontrolní zadání se neshoduje."),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Рandling"),
|
("Action", "Рandling"),
|
||||||
("Add", "Tilføj"),
|
("Add", "Tilføj"),
|
||||||
("Local Port", "Lokal Port"),
|
("Local Port", "Lokal Port"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "For en hurtigere forbindelse skal du indstille din egen forbindelsesserver"),
|
("setup_server_tip", "For en hurtigere forbindelse skal du indstille din egen forbindelsesserver"),
|
||||||
("Too short, at least 6 characters.", "For kort, mindst 6 tegn."),
|
("Too short, at least 6 characters.", "For kort, mindst 6 tegn."),
|
||||||
("The confirmation is not identical.", "Bekræftelsen er ikke identisk."),
|
("The confirmation is not identical.", "Bekræftelsen er ikke identisk."),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Aktion"),
|
("Action", "Aktion"),
|
||||||
("Add", "Hinzufügen"),
|
("Add", "Hinzufügen"),
|
||||||
("Local Port", "Lokaler Port"),
|
("Local Port", "Lokaler Port"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Für eine schnellere Verbindung richten Sie bitte Ihren eigenen Verbindungsserver ein"),
|
("setup_server_tip", "Für eine schnellere Verbindung richten Sie bitte Ihren eigenen Verbindungsserver ein"),
|
||||||
("Too short, at least 6 characters.", "Zu kurz, mindestens 6 Zeichen."),
|
("Too short, at least 6 characters.", "Zu kurz, mindestens 6 Zeichen."),
|
||||||
("The confirmation is not identical.", "Die Passwörter sind nicht identisch."),
|
("The confirmation is not identical.", "Die Passwörter sind nicht identisch."),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Ago"),
|
("Action", "Ago"),
|
||||||
("Add", "Aldoni"),
|
("Add", "Aldoni"),
|
||||||
("Local Port", "Loka pordo"),
|
("Local Port", "Loka pordo"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Se vi bezonas pli rapida konekcio, vi povas krei vian propran servilon"),
|
("setup_server_tip", "Se vi bezonas pli rapida konekcio, vi povas krei vian propran servilon"),
|
||||||
("Too short, at least 6 characters.", "Tro mallonga, almenaŭ 6 signoj."),
|
("Too short, at least 6 characters.", "Tro mallonga, almenaŭ 6 signoj."),
|
||||||
("The confirmation is not identical.", "Ambaŭ enigoj ne kongruas"),
|
("The confirmation is not identical.", "Ambaŭ enigoj ne kongruas"),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Acción"),
|
("Action", "Acción"),
|
||||||
("Add", "Agregar"),
|
("Add", "Agregar"),
|
||||||
("Local Port", "Puerto local"),
|
("Local Port", "Puerto local"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Para una conexión más rápida, configure su propio servidor"),
|
("setup_server_tip", "Para una conexión más rápida, configure su propio servidor"),
|
||||||
("Too short, at least 6 characters.", "Demasiado corto, al menos 6 caracteres."),
|
("Too short, at least 6 characters.", "Demasiado corto, al menos 6 caracteres."),
|
||||||
("The confirmation is not identical.", "La confirmación no es idéntica."),
|
("The confirmation is not identical.", "La confirmación no es idéntica."),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Action"),
|
("Action", "Action"),
|
||||||
("Add", "Ajouter"),
|
("Add", "Ajouter"),
|
||||||
("Local Port", "Port local"),
|
("Local Port", "Port local"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Si vous avez besoin d'une vitesse de connexion plus rapide, vous pouvez choisir de créer votre propre serveur"),
|
("setup_server_tip", "Si vous avez besoin d'une vitesse de connexion plus rapide, vous pouvez choisir de créer votre propre serveur"),
|
||||||
("Too short, at least 6 characters.", "Trop court, au moins 6 caractères."),
|
("Too short, at least 6 characters.", "Trop court, au moins 6 caractères."),
|
||||||
("The confirmation is not identical.", "Les deux entrées ne correspondent pas"),
|
("The confirmation is not identical.", "Les deux entrées ne correspondent pas"),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Akció"),
|
("Action", "Akció"),
|
||||||
("Add", "Add"),
|
("Add", "Add"),
|
||||||
("Local Port", "Lokális Port"),
|
("Local Port", "Lokális Port"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Egy gyorsabb kapcsolatért, kérlek hostolj egy saját szervert"),
|
("setup_server_tip", "Egy gyorsabb kapcsolatért, kérlek hostolj egy saját szervert"),
|
||||||
("Too short, at least 6 characters.", "Túl rövid, legalább 6 karakter"),
|
("Too short, at least 6 characters.", "Túl rövid, legalább 6 karakter"),
|
||||||
("The confirmation is not identical.", "A megerősítés nem volt azonos"),
|
("The confirmation is not identical.", "A megerősítés nem volt azonos"),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Aksi"),
|
("Action", "Aksi"),
|
||||||
("Add", "Tambah"),
|
("Add", "Tambah"),
|
||||||
("Local Port", "Port Lokal"),
|
("Local Port", "Port Lokal"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Untuk koneksi yang lebih cepat, silakan atur server Anda sendiri"),
|
("setup_server_tip", "Untuk koneksi yang lebih cepat, silakan atur server Anda sendiri"),
|
||||||
("Too short, at least 6 characters.", "Terlalu pendek, setidaknya 6 karekter."),
|
("Too short, at least 6 characters.", "Terlalu pendek, setidaknya 6 karekter."),
|
||||||
("The confirmation is not identical.", "Konfirmasi tidak identik."),
|
("The confirmation is not identical.", "Konfirmasi tidak identik."),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Azione"),
|
("Action", "Azione"),
|
||||||
("Add", "Aggiungi"),
|
("Add", "Aggiungi"),
|
||||||
("Local Port", "Porta locale"),
|
("Local Port", "Porta locale"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Per una connessione più veloce, configura un tuo server"),
|
("setup_server_tip", "Per una connessione più veloce, configura un tuo server"),
|
||||||
("Too short, at least 6 characters.", "Troppo breve, almeno 6 caratteri"),
|
("Too short, at least 6 characters.", "Troppo breve, almeno 6 caratteri"),
|
||||||
("The confirmation is not identical.", "La conferma non corrisponde"),
|
("The confirmation is not identical.", "La conferma non corrisponde"),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "操作"),
|
("Action", "操作"),
|
||||||
("Add", "追加"),
|
("Add", "追加"),
|
||||||
("Local Port", "ローカルのポート"),
|
("Local Port", "ローカルのポート"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "接続をより速くするには、自分のサーバーをセットアップしてください"),
|
("setup_server_tip", "接続をより速くするには、自分のサーバーをセットアップしてください"),
|
||||||
("Too short, at least 6 characters.", "短すぎます。最低6文字です。"),
|
("Too short, at least 6 characters.", "短すぎます。最低6文字です。"),
|
||||||
("The confirmation is not identical.", "確認用と一致しません。"),
|
("The confirmation is not identical.", "確認用と一致しません。"),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "액션"),
|
("Action", "액션"),
|
||||||
("Add", "추가"),
|
("Add", "추가"),
|
||||||
("Local Port", "로컬 포트"),
|
("Local Port", "로컬 포트"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "빠른 접속을 위해, 당신의 서버를 설정하세요"),
|
("setup_server_tip", "빠른 접속을 위해, 당신의 서버를 설정하세요"),
|
||||||
("Too short, at least 6 characters.", "너무 짧습니다, 최소 6글자 이상 입력해주세요."),
|
("Too short, at least 6 characters.", "너무 짧습니다, 최소 6글자 이상 입력해주세요."),
|
||||||
("The confirmation is not identical.", "확인용 입력이 일치하지 않습니다."),
|
("The confirmation is not identical.", "확인용 입력이 일치하지 않습니다."),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Әрекет"),
|
("Action", "Әрекет"),
|
||||||
("Add", "Қосу"),
|
("Add", "Қосу"),
|
||||||
("Local Port", "Лақал Порт"),
|
("Local Port", "Лақал Порт"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Тез қосылым үшін өз серберіңізді орнатуды өтінеміз"),
|
("setup_server_tip", "Тез қосылым үшін өз серберіңізді орнатуды өтінеміз"),
|
||||||
("Too short, at least 6 characters.", "Тым қысқа, кемінде 6 таңба."),
|
("Too short, at least 6 characters.", "Тым қысқа, кемінде 6 таңба."),
|
||||||
("The confirmation is not identical.", "Растау сәйкес келмейді."),
|
("The confirmation is not identical.", "Растау сәйкес келмейді."),
|
||||||
@ -290,6 +292,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Ignore Battery Optimizations", "Бәтері Оңтайландыруларын Елемеу"),
|
("Ignore Battery Optimizations", "Бәтері Оңтайландыруларын Елемеу"),
|
||||||
("android_open_battery_optimizations_tip", "Егер де бұл ерекшелікті өшіруді қаласаңыз, келесі RustDesk апылқат орнатпалары бетіне барып, [Бәтері]'ні тауып кіріңіз де [Шектеусіз]'ден құсбелгіні алып тастауды өтінеміз"),
|
("android_open_battery_optimizations_tip", "Егер де бұл ерекшелікті өшіруді қаласаңыз, келесі RustDesk апылқат орнатпалары бетіне барып, [Бәтері]'ні тауып кіріңіз де [Шектеусіз]'ден құсбелгіні алып тастауды өтінеміз"),
|
||||||
("Connection not allowed", "Қосылу рұқсат етілмеген"),
|
("Connection not allowed", "Қосылу рұқсат етілмеген"),
|
||||||
|
("Legacy mode", ""),
|
||||||
|
("Map mode", ""),
|
||||||
|
("Translate mode", ""),
|
||||||
("Use temporary password", "Уақытша құпия сөзді қолдану"),
|
("Use temporary password", "Уақытша құпия сөзді қолдану"),
|
||||||
("Use permanent password", "Тұрақты құпия сөзді қолдану"),
|
("Use permanent password", "Тұрақты құпия сөзді қолдану"),
|
||||||
("Use both passwords", "Қос құпия сөзді қолдану"),
|
("Use both passwords", "Қос құпия сөзді қолдану"),
|
||||||
@ -319,16 +324,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Insecure Connection", "Қатерлі Қосылым"),
|
("Insecure Connection", "Қатерлі Қосылым"),
|
||||||
("Scale original", "Scale original"),
|
("Scale original", "Scale original"),
|
||||||
("Scale adaptive", "Scale adaptive"),
|
("Scale adaptive", "Scale adaptive"),
|
||||||
("Pin menubar", "Мәзір жолағын бекіту"),
|
|
||||||
("Unpin menubar", "Мәзір жолағын босату"),
|
|
||||||
("Recording", ""),
|
|
||||||
("Directory", ""),
|
|
||||||
("Automatically record incoming sessions", ""),
|
|
||||||
("Change", ""),
|
|
||||||
("Start session recording", ""),
|
|
||||||
("Stop session recording", ""),
|
|
||||||
("Enable Recording Session", ""),
|
|
||||||
("Allow recording session", ""),
|
|
||||||
("General", ""),
|
("General", ""),
|
||||||
("Security", ""),
|
("Security", ""),
|
||||||
("Account", "Есепкі"),
|
("Account", "Есепкі"),
|
||||||
@ -356,6 +351,14 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Enable RDP", ""),
|
("Enable RDP", ""),
|
||||||
("Pin menubar", "Мәзір жолағын бекіту"),
|
("Pin menubar", "Мәзір жолағын бекіту"),
|
||||||
("Unpin menubar", "Мәзір жолағын босату"),
|
("Unpin menubar", "Мәзір жолағын босату"),
|
||||||
|
("Recording", ""),
|
||||||
|
("Directory", ""),
|
||||||
|
("Automatically record incoming sessions", ""),
|
||||||
|
("Change", ""),
|
||||||
|
("Start session recording", ""),
|
||||||
|
("Stop session recording", ""),
|
||||||
|
("Enable Recording Session", ""),
|
||||||
|
("Allow recording session", ""),
|
||||||
("Enable LAN Discovery", ""),
|
("Enable LAN Discovery", ""),
|
||||||
("Deny LAN Discovery", ""),
|
("Deny LAN Discovery", ""),
|
||||||
("Write a message", ""),
|
("Write a message", ""),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Akcja"),
|
("Action", "Akcja"),
|
||||||
("Add", "Dodaj"),
|
("Add", "Dodaj"),
|
||||||
("Local Port", "Lokalny port"),
|
("Local Port", "Lokalny port"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Podpowiedź do ustawień serwera"),
|
("setup_server_tip", "Podpowiedź do ustawień serwera"),
|
||||||
("Too short, at least 6 characters.", "Za krótkie, min. 6 znaków"),
|
("Too short, at least 6 characters.", "Za krótkie, min. 6 znaków"),
|
||||||
("The confirmation is not identical.", "Potwierdzenie nie jest identyczne."),
|
("The confirmation is not identical.", "Potwierdzenie nie jest identyczne."),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Acção"),
|
("Action", "Acção"),
|
||||||
("Add", "Adicionar"),
|
("Add", "Adicionar"),
|
||||||
("Local Port", "Porta Local"),
|
("Local Port", "Porta Local"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Para uma ligação mais rápida, por favor configure seu próprio servidor"),
|
("setup_server_tip", "Para uma ligação mais rápida, por favor configure seu próprio servidor"),
|
||||||
("Too short, at least 6 characters.", "Muito curto, pelo menos 6 caracteres."),
|
("Too short, at least 6 characters.", "Muito curto, pelo menos 6 caracteres."),
|
||||||
("The confirmation is not identical.", "A confirmação não é idêntica."),
|
("The confirmation is not identical.", "A confirmação não é idêntica."),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Ação"),
|
("Action", "Ação"),
|
||||||
("Add", "Adicionar"),
|
("Add", "Adicionar"),
|
||||||
("Local Port", "Porta Local"),
|
("Local Port", "Porta Local"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Para uma conexão mais rápida, por favor configure seu próprio servidor"),
|
("setup_server_tip", "Para uma conexão mais rápida, por favor configure seu próprio servidor"),
|
||||||
("Too short, at least 6 characters.", "Muito curto, pelo menos 6 caracteres."),
|
("Too short, at least 6 characters.", "Muito curto, pelo menos 6 caracteres."),
|
||||||
("The confirmation is not identical.", "A confirmação não é idêntica."),
|
("The confirmation is not identical.", "A confirmação não é idêntica."),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Действие"),
|
("Action", "Действие"),
|
||||||
("Add", "Добавить"),
|
("Add", "Добавить"),
|
||||||
("Local Port", "Локальный порт"),
|
("Local Port", "Локальный порт"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Для более быстрого подключения настройте свой собственный сервер подключения"),
|
("setup_server_tip", "Для более быстрого подключения настройте свой собственный сервер подключения"),
|
||||||
("Too short, at least 6 characters.", "Слишком коротко, минимум 6 символов"),
|
("Too short, at least 6 characters.", "Слишком коротко, минимум 6 символов"),
|
||||||
("The confirmation is not identical.", "Подтверждение не совпадает"),
|
("The confirmation is not identical.", "Подтверждение не совпадает"),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Akcia"),
|
("Action", "Akcia"),
|
||||||
("Add", "Pridať"),
|
("Add", "Pridať"),
|
||||||
("Local Port", "Lokálny port"),
|
("Local Port", "Lokálny port"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Pre zrýchlenie pripojenia si nainštalujte svoj vlastný server"),
|
("setup_server_tip", "Pre zrýchlenie pripojenia si nainštalujte svoj vlastný server"),
|
||||||
("Too short, at least 6 characters.", "Príliš krátke, vyžaduje sa aspoň 6 znakov."),
|
("Too short, at least 6 characters.", "Príliš krátke, vyžaduje sa aspoň 6 znakov."),
|
||||||
("The confirmation is not identical.", "Potvrdenie nie je zhodné."),
|
("The confirmation is not identical.", "Potvrdenie nie je zhodné."),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", ""),
|
("Action", ""),
|
||||||
("Add", ""),
|
("Add", ""),
|
||||||
("Local Port", ""),
|
("Local Port", ""),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", ""),
|
("setup_server_tip", ""),
|
||||||
("Too short, at least 6 characters.", ""),
|
("Too short, at least 6 characters.", ""),
|
||||||
("The confirmation is not identical.", ""),
|
("The confirmation is not identical.", ""),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Eylem"),
|
("Action", "Eylem"),
|
||||||
("Add", "Ekle"),
|
("Add", "Ekle"),
|
||||||
("Local Port", "Yerel Port"),
|
("Local Port", "Yerel Port"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Daha hızlı bağlantı için kendi sunucunuzu kurun"),
|
("setup_server_tip", "Daha hızlı bağlantı için kendi sunucunuzu kurun"),
|
||||||
("Too short, at least 6 characters.", "Çok kısa en az 6 karakter gerekli."),
|
("Too short, at least 6 characters.", "Çok kısa en az 6 karakter gerekli."),
|
||||||
("The confirmation is not identical.", "Doğrulama yapılamadı."),
|
("The confirmation is not identical.", "Doğrulama yapılamadı."),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "操作"),
|
("Action", "操作"),
|
||||||
("Add", "新增"),
|
("Add", "新增"),
|
||||||
("Local Port", "本機連接埠"),
|
("Local Port", "本機連接埠"),
|
||||||
|
("Local Address", "本機地址"),
|
||||||
|
("Change Local Port", "修改本機連接埠"),
|
||||||
("setup_server_tip", "若您需要更快的連接速度,可以選擇自行建立伺服器"),
|
("setup_server_tip", "若您需要更快的連接速度,可以選擇自行建立伺服器"),
|
||||||
("Too short, at least 6 characters.", "過短,至少需 6 個字元。"),
|
("Too short, at least 6 characters.", "過短,至少需 6 個字元。"),
|
||||||
("The confirmation is not identical.", "兩次輸入不相符"),
|
("The confirmation is not identical.", "兩次輸入不相符"),
|
||||||
|
@ -153,6 +153,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Action", "Hành động"),
|
("Action", "Hành động"),
|
||||||
("Add", "Thêm"),
|
("Add", "Thêm"),
|
||||||
("Local Port", "Cổng nội bộ"),
|
("Local Port", "Cổng nội bộ"),
|
||||||
|
("Local Address", ""),
|
||||||
|
("Change Local Port", ""),
|
||||||
("setup_server_tip", "Để kết nối nhanh hơn, hãy tự tạo máy chủ riêng"),
|
("setup_server_tip", "Để kết nối nhanh hơn, hãy tự tạo máy chủ riêng"),
|
||||||
("Too short, at least 6 characters.", "Quá ngắn, độ dài phải ít nhất là 6."),
|
("Too short, at least 6 characters.", "Quá ngắn, độ dài phải ít nhất là 6."),
|
||||||
("The confirmation is not identical.", "Xác minh không khớp"),
|
("The confirmation is not identical.", "Xác minh không khớp"),
|
||||||
|
@ -765,7 +765,9 @@ pub fn is_release() -> bool {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_root() -> bool {
|
pub fn is_root() -> bool {
|
||||||
crate::platform::is_root()
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
|
return crate::platform::is_root();
|
||||||
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -146,10 +146,9 @@ impl<T: InvokeUiSession> Session<T> {
|
|||||||
let decoder = scrap::codec::Decoder::video_codec_state(&self.id);
|
let decoder = scrap::codec::Decoder::video_codec_state(&self.id);
|
||||||
let mut h264 = decoder.score_h264 > 0;
|
let mut h264 = decoder.score_h264 > 0;
|
||||||
let mut h265 = decoder.score_h265 > 0;
|
let mut h265 = decoder.score_h265 > 0;
|
||||||
if let Some((encoding_264, encoding_265)) = self.lc.read().unwrap().supported_encoding {
|
let (encoding_264, encoding_265) = self.lc.read().unwrap().supported_encoding.unwrap_or_default();
|
||||||
h264 = h264 && encoding_264;
|
h264 = h264 && encoding_264;
|
||||||
h265 = h265 && encoding_265;
|
h265 = h265 && encoding_265;
|
||||||
}
|
|
||||||
return (h264, h265);
|
return (h264, h265);
|
||||||
}
|
}
|
||||||
(false, false)
|
(false, false)
|
||||||
@ -1119,6 +1118,7 @@ impl<T: InvokeUiSession> Interface for Session<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn handle_peer_info(&mut self, mut pi: PeerInfo) {
|
fn handle_peer_info(&mut self, mut pi: PeerInfo) {
|
||||||
|
log::debug!("handle_peer_info :{:?}", pi);
|
||||||
pi.username = self.lc.read().unwrap().get_username(&pi);
|
pi.username = self.lc.read().unwrap().get_username(&pi);
|
||||||
if pi.current_display as usize >= pi.displays.len() {
|
if pi.current_display as usize >= pi.displays.len() {
|
||||||
pi.current_display = 0;
|
pi.current_display = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user