mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-05 15:01:28 +03:00
telegram bot ui settings and code sending
This commit is contained in:
@@ -340,7 +340,7 @@ class _ConnectionPageState extends State<ConnectionPage>
|
||||
?.merge(TextStyle(height: 1)),
|
||||
).marginOnly(right: 4),
|
||||
Tooltip(
|
||||
waitDuration: Duration(milliseconds: 0),
|
||||
waitDuration: Duration(milliseconds: 300),
|
||||
message: translate("id_input_tip"),
|
||||
child: Icon(
|
||||
Icons.help_outline_outlined,
|
||||
|
||||
@@ -679,6 +679,7 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
// Simple temp wrapper for PR check
|
||||
tmpWrapper() {
|
||||
RxBool has2fa = bind.mainHasValid2FaSync().obs;
|
||||
RxBool hasBot = bind.mainHasValidBotSync().obs;
|
||||
update() async {
|
||||
has2fa.value = bind.mainHasValid2FaSync();
|
||||
}
|
||||
@@ -687,7 +688,7 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
change2fa(callback: update);
|
||||
}
|
||||
|
||||
return GestureDetector(
|
||||
final tfa = GestureDetector(
|
||||
child: InkWell(
|
||||
child: Obx(() => Row(
|
||||
children: [
|
||||
@@ -708,6 +709,44 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
onChanged(!has2fa.value);
|
||||
},
|
||||
).marginOnly(left: _kCheckBoxLeftMargin);
|
||||
if (!has2fa.value) {
|
||||
return tfa;
|
||||
}
|
||||
updateBot() async {
|
||||
hasBot.value = bind.mainHasValidBotSync();
|
||||
}
|
||||
|
||||
onChangedBot(bool? checked) async {
|
||||
changeBot(callback: updateBot);
|
||||
}
|
||||
|
||||
final bot = GestureDetector(
|
||||
child: Tooltip(
|
||||
waitDuration: Duration(milliseconds: 300),
|
||||
message: translate("enable-bot-tip"),
|
||||
child: InkWell(
|
||||
child: Obx(() => Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: hasBot.value,
|
||||
onChanged: enabled ? onChangedBot : null)
|
||||
.marginOnly(right: 5),
|
||||
Expanded(
|
||||
child: Text(
|
||||
translate('Telegram bot'),
|
||||
style: TextStyle(
|
||||
color: disabledTextColor(context, enabled)),
|
||||
))
|
||||
],
|
||||
))),
|
||||
),
|
||||
onTap: () {
|
||||
onChangedBot(!hasBot.value);
|
||||
},
|
||||
).marginOnly(left: _kCheckBoxLeftMargin + 30);
|
||||
return Column(
|
||||
children: [tfa, bot],
|
||||
);
|
||||
}
|
||||
|
||||
return tmpWrapper();
|
||||
|
||||
Reference in New Issue
Block a user