mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-24 12:29:04 +08:00
flutter option enable share rdp
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
9d88a06cdf
commit
5b36555faa
@ -701,6 +701,7 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
child: _OptionCheckBox(context, 'Enable RDP', 'enable-rdp',
|
||||
enabled: enabled),
|
||||
),
|
||||
shareRdp(context, enabled),
|
||||
_OptionCheckBox(context, 'Deny LAN Discovery', 'enable-lan-discovery',
|
||||
reverse: true, enabled: enabled),
|
||||
...directIp(context),
|
||||
@ -708,6 +709,33 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
]);
|
||||
}
|
||||
|
||||
shareRdp(BuildContext context, bool enabled) {
|
||||
onChanged(bool b) async {
|
||||
await bind.mainSetShareRdp(enable: b);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
bool value = bind.mainIsShareRdp();
|
||||
return Offstage(
|
||||
offstage: !(Platform.isWindows && bind.mainIsRdpServiceOpen()),
|
||||
child: GestureDetector(
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: value,
|
||||
onChanged: enabled ? (_) => onChanged(!value) : null)
|
||||
.marginOnly(right: 5),
|
||||
Expanded(
|
||||
child: Text(translate('Enable RDP session sharing'),
|
||||
style:
|
||||
TextStyle(color: _disabledTextColor(context, enabled))),
|
||||
)
|
||||
],
|
||||
).marginOnly(left: _kCheckBoxLeftMargin),
|
||||
onTap: enabled ? () => onChanged(!value) : null),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> directIp(BuildContext context) {
|
||||
TextEditingController controller = TextEditingController();
|
||||
update() => setState(() {});
|
||||
|
@ -1210,6 +1210,10 @@ pub fn main_is_rdp_service_open() -> SyncReturn<bool> {
|
||||
SyncReturn(is_rdp_service_open())
|
||||
}
|
||||
|
||||
pub fn main_set_share_rdp(enable: bool) {
|
||||
set_share_rdp(enable)
|
||||
}
|
||||
|
||||
pub fn main_goto_install() -> SyncReturn<bool> {
|
||||
goto_install();
|
||||
SyncReturn(true)
|
||||
|
Loading…
Reference in New Issue
Block a user