Merge pull request #3152 from 21pages/fix
flutter option enable share rdp
This commit is contained in:
commit
7129429226
@ -701,6 +701,7 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
|||||||
child: _OptionCheckBox(context, 'Enable RDP', 'enable-rdp',
|
child: _OptionCheckBox(context, 'Enable RDP', 'enable-rdp',
|
||||||
enabled: enabled),
|
enabled: enabled),
|
||||||
),
|
),
|
||||||
|
shareRdp(context, enabled),
|
||||||
_OptionCheckBox(context, 'Deny LAN Discovery', 'enable-lan-discovery',
|
_OptionCheckBox(context, 'Deny LAN Discovery', 'enable-lan-discovery',
|
||||||
reverse: true, enabled: enabled),
|
reverse: true, enabled: enabled),
|
||||||
...directIp(context),
|
...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) {
|
List<Widget> directIp(BuildContext context) {
|
||||||
TextEditingController controller = TextEditingController();
|
TextEditingController controller = TextEditingController();
|
||||||
update() => setState(() {});
|
update() => setState(() {});
|
||||||
|
@ -1203,6 +1203,10 @@ pub fn main_is_rdp_service_open() -> SyncReturn<bool> {
|
|||||||
SyncReturn(is_rdp_service_open())
|
SyncReturn(is_rdp_service_open())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn main_set_share_rdp(enable: bool) {
|
||||||
|
set_share_rdp(enable)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn main_goto_install() -> SyncReturn<bool> {
|
pub fn main_goto_install() -> SyncReturn<bool> {
|
||||||
goto_install();
|
goto_install();
|
||||||
SyncReturn(true)
|
SyncReturn(true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user