From ab451b90564cadd7240171034e39008fc1492280 Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 13 Jun 2024 18:30:29 +0800 Subject: [PATCH] android keep screen on option (#8344) * android keep screen on option Keep screen on option relays on floating window. Three options: Never, During controlled(default), During service is on Signed-off-by: 21pages * When rustdesk is in forground, be consistent with the settings Signed-off-by: 21pages --------- Signed-off-by: 21pages --- .../flutter_hbb/FloatingWindowService.kt | 60 +++++++++++++++-- flutter/lib/consts.dart | 2 + flutter/lib/mobile/pages/settings_page.dart | 65 ++++++++++++++++++- flutter/lib/models/server_model.dart | 29 ++++++++- libs/hbb_common/src/config.rs | 4 ++ src/lang/ar.rs | 4 ++ src/lang/bg.rs | 4 ++ src/lang/ca.rs | 4 ++ src/lang/cn.rs | 4 ++ src/lang/cs.rs | 4 ++ src/lang/da.rs | 4 ++ src/lang/de.rs | 4 ++ src/lang/el.rs | 4 ++ src/lang/eo.rs | 4 ++ src/lang/es.rs | 4 ++ src/lang/et.rs | 4 ++ src/lang/fa.rs | 4 ++ src/lang/fr.rs | 4 ++ src/lang/he.rs | 4 ++ src/lang/hr.rs | 4 ++ src/lang/hu.rs | 4 ++ src/lang/id.rs | 4 ++ src/lang/it.rs | 4 ++ src/lang/ja.rs | 4 ++ src/lang/ko.rs | 4 ++ src/lang/kz.rs | 4 ++ src/lang/lt.rs | 4 ++ src/lang/lv.rs | 4 ++ src/lang/nb.rs | 4 ++ src/lang/nl.rs | 4 ++ src/lang/pl.rs | 4 ++ src/lang/pt_PT.rs | 4 ++ src/lang/ptbr.rs | 4 ++ src/lang/ro.rs | 4 ++ src/lang/ru.rs | 4 ++ src/lang/sk.rs | 4 ++ src/lang/sl.rs | 4 ++ src/lang/sq.rs | 4 ++ src/lang/sr.rs | 4 ++ src/lang/sv.rs | 4 ++ src/lang/template.rs | 4 ++ src/lang/th.rs | 4 ++ src/lang/tr.rs | 4 ++ src/lang/tw.rs | 4 ++ src/lang/ua.rs | 4 ++ src/lang/vn.rs | 4 ++ 46 files changed, 315 insertions(+), 9 deletions(-) diff --git a/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/FloatingWindowService.kt b/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/FloatingWindowService.kt index a16e90e95..e117f5b9f 100644 --- a/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/FloatingWindowService.kt +++ b/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/FloatingWindowService.kt @@ -11,7 +11,9 @@ import android.graphics.PixelFormat import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable import android.os.Build +import android.os.Handler import android.os.IBinder +import android.os.Looper import android.util.Log import android.view.Gravity import android.view.MotionEvent @@ -20,6 +22,7 @@ import android.view.WindowManager import android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN import android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE import android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL +import android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON import android.widget.ImageView import android.widget.PopupMenu import com.caverock.androidsvg.SVG @@ -39,6 +42,7 @@ class FloatingWindowService : Service(), View.OnTouchListener { private var lastDownX = 0f private var lastDownY = 0f private var viewCreated = false; + private var keepScreenOn = KeepScreenOn.DURING_CONTROLLED companion object { private val logTag = "floatingService" @@ -69,12 +73,21 @@ class FloatingWindowService : Service(), View.OnTouchListener { } Log.d(logTag, "floating window size: $viewWidth x $viewHeight, transparency: $viewTransparency, lastLayoutX: $lastLayoutX, lastLayoutY: $lastLayoutY, customSvg: $customSvg") createView(windowManager) + handler.postDelayed(runnable, 1000) Log.d(logTag, "onCreate success") } catch (e: Exception) { Log.d(logTag, "onCreate failed: $e") } } + override fun onDestroy() { + super.onDestroy() + if (viewCreated) { + windowManager.removeView(floatingView) + } + handler.removeCallbacks(runnable) + } + @SuppressLint("ClickableViewAccessibility") private fun createView(windowManager: WindowManager) { floatingView = ImageView(this) @@ -151,6 +164,15 @@ class FloatingWindowService : Service(), View.OnTouchListener { layoutParams.x = lastLayoutX layoutParams.y = lastLayoutY + val keepScreenOnOption = FFI.getLocalOption("keep-screen-on").lowercase() + keepScreenOn = when (keepScreenOnOption) { + "never" -> KeepScreenOn.NEVER + "service-on" -> KeepScreenOn.SERVICE_ON + else -> KeepScreenOn.DURING_CONTROLLED + } + Log.d(logTag, "keepScreenOn option: $keepScreenOnOption, value: $keepScreenOn") + updateKeepScreenOnLayoutParams() + windowManager.addView(floatingView, layoutParams) moveToScreenSide() } @@ -200,12 +222,7 @@ class FloatingWindowService : Service(), View.OnTouchListener { lastOrientation = resources.configuration.orientation } - override fun onDestroy() { - super.onDestroy() - if (viewCreated) { - windowManager.removeView(floatingView) - } - } + private fun performClick() { showPopupMenu() @@ -326,5 +343,36 @@ class FloatingWindowService : Service(), View.OnTouchListener { private fun stopMainService() { MainActivity.flutterMethodChannel?.invokeMethod("stop_service", null) } + + enum class KeepScreenOn { + NEVER, + DURING_CONTROLLED, + SERVICE_ON, + } + + private val handler = Handler(Looper.getMainLooper()) + private val runnable = object : Runnable { + override fun run() { + if (updateKeepScreenOnLayoutParams()) { + windowManager.updateViewLayout(floatingView, layoutParams) + } + handler.postDelayed(this, 1000) // 1000 milliseconds = 1 second + } + } + + private fun updateKeepScreenOnLayoutParams(): Boolean { + val oldOn = layoutParams.flags and FLAG_KEEP_SCREEN_ON != 0 + val newOn = keepScreenOn == KeepScreenOn.SERVICE_ON || (keepScreenOn == KeepScreenOn.DURING_CONTROLLED && MainService.isStart) + if (oldOn != newOn) { + Log.d(logTag, "change keep screen on to $newOn") + if (newOn) { + layoutParams.flags = layoutParams.flags or FLAG_KEEP_SCREEN_ON + } else { + layoutParams.flags = layoutParams.flags and FLAG_KEEP_SCREEN_ON.inv() + } + return true + } + return false + } } diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index ae3aef0b9..9cbfd265e 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -139,6 +139,8 @@ const String kOptionToggleViewOnly = "view-only"; const String kOptionDisableFloatingWindow = "disable-floating-window"; +const String kOptionKeepScreenOn = "keep-screen-on"; + const String kUrlActionClose = "close"; const String kTabLabelHomePage = "Home"; diff --git a/flutter/lib/mobile/pages/settings_page.dart b/flutter/lib/mobile/pages/settings_page.dart index 1b402f6a1..5e3dcdee9 100644 --- a/flutter/lib/mobile/pages/settings_page.dart +++ b/flutter/lib/mobile/pages/settings_page.dart @@ -35,12 +35,41 @@ class SettingsPage extends StatefulWidget implements PageShape { const url = 'https://rustdesk.com/'; +enum KeepScreenOn { + never, + duringControlled, + serviceOn, +} + +String _keepScreenOnToOption(KeepScreenOn value) { + switch (value) { + case KeepScreenOn.never: + return 'never'; + case KeepScreenOn.duringControlled: + return 'during-controlled'; + case KeepScreenOn.serviceOn: + return 'service-on'; + } +} + +KeepScreenOn optionToKeepScreenOn(String value) { + switch (value) { + case 'never': + return KeepScreenOn.never; + case 'service-on': + return KeepScreenOn.serviceOn; + default: + return KeepScreenOn.duringControlled; + } +} + class _SettingsState extends State with WidgetsBindingObserver { final _hasIgnoreBattery = false; //androidVersion >= 26; // remove because not work on every device var _ignoreBatteryOpt = false; var _enableStartOnBoot = false; var _floatingWindowDisabled = false; + var _keepScreenOn = KeepScreenOn.duringControlled; // relay on floating window var _enableAbr = false; var _denyLANDiscovery = false; var _onlyWhiteList = false; @@ -96,6 +125,15 @@ class _SettingsState extends State with WidgetsBindingObserver { _floatingWindowDisabled = floatingWindowDisabled; } + final keepScreenOn = _floatingWindowDisabled + ? KeepScreenOn.never + : optionToKeepScreenOn( + bind.mainGetLocalOption(key: kOptionKeepScreenOn)); + if (keepScreenOn != _keepScreenOn) { + update = true; + _keepScreenOn = keepScreenOn; + } + final enableAbrRes = option2bool( kOptionEnableAbr, await bind.mainGetOption(key: kOptionEnableAbr)); if (enableAbrRes != _enableAbr) { @@ -524,6 +562,29 @@ class _SettingsState extends State with WidgetsBindingObserver { ? null : onFloatingWindowChanged)); + enhancementsTiles.add(_getPopupDialogRadioEntry( + title: 'Keep screen on', + list: [ + _RadioEntry('Never', _keepScreenOnToOption(KeepScreenOn.never)), + _RadioEntry('During controlled', + _keepScreenOnToOption(KeepScreenOn.duringControlled)), + _RadioEntry('During service is on', + _keepScreenOnToOption(KeepScreenOn.serviceOn)), + ], + getter: () => _keepScreenOnToOption(_floatingWindowDisabled + ? KeepScreenOn.never + : optionToKeepScreenOn( + bind.mainGetLocalOption(key: kOptionKeepScreenOn))), + asyncSetter: isOptionFixed(kOptionKeepScreenOn) || _floatingWindowDisabled + ? null + : (value) async { + await bind.mainSetLocalOption( + key: kOptionKeepScreenOn, value: value); + setState(() => _keepScreenOn = optionToKeepScreenOn(value)); + gFFI.serverModel.androidUpdatekeepScreenOn(); + }, + )); + final disabledSettings = bind.isDisableSettings(); final settings = SettingsList( sections: [ @@ -947,7 +1008,7 @@ class _RadioEntry { typedef _RadioEntryGetter = String Function(); typedef _RadioEntrySetter = Future Function(String); -_getPopupDialogRadioEntry({ +SettingsTile _getPopupDialogRadioEntry({ required String title, required List<_RadioEntry> list, required _RadioEntryGetter getter, @@ -1001,7 +1062,7 @@ _getPopupDialogRadioEntry({ return SettingsTile( title: Text(translate(title)), - onPressed: (context) => showDialog(), + onPressed: asyncSetter == null ? null : (context) => showDialog(), value: Padding( padding: EdgeInsets.symmetric(vertical: 8), child: Obx(() => Text(translate(valueText.value))), diff --git a/flutter/lib/models/server_model.dart b/flutter/lib/models/server_model.dart index 2aa961cec..fc169c963 100644 --- a/flutter/lib/models/server_model.dart +++ b/flutter/lib/models/server_model.dart @@ -4,6 +4,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_hbb/consts.dart'; import 'package:flutter_hbb/main.dart'; +import 'package:flutter_hbb/mobile/pages/settings_page.dart'; import 'package:flutter_hbb/models/chat_model.dart'; import 'package:flutter_hbb/models/platform_model.dart'; import 'package:get/get.dart'; @@ -421,7 +422,7 @@ class ServerModel with ChangeNotifier { await bind.mainStartService(); updateClientState(); if (isAndroid) { - WakelockPlus.enable(); + androidUpdatekeepScreenOn(); } } @@ -514,6 +515,7 @@ class ServerModel with ChangeNotifier { } if (_clients.length != oldClientLenght) { notifyListeners(); + if (isAndroid) androidUpdatekeepScreenOn(); } } @@ -548,6 +550,7 @@ class ServerModel with ChangeNotifier { scrollToBottom(); notifyListeners(); if (isAndroid && !client.authorized) showLoginDialog(client); + if (isAndroid) androidUpdatekeepScreenOn(); } catch (e) { debugPrint("Failed to call loginRequest,error:$e"); } @@ -668,6 +671,7 @@ class ServerModel with ChangeNotifier { final index = _clients.indexOf(client); tabController.remove(index); _clients.remove(client); + if (isAndroid) androidUpdatekeepScreenOn(); } } @@ -691,6 +695,7 @@ class ServerModel with ChangeNotifier { if (desktopType == DesktopType.cm && _clients.isEmpty) { hideCmWindow(); } + if (isAndroid) androidUpdatekeepScreenOn(); notifyListeners(); } catch (e) { debugPrint("onClientRemove failed,error:$e"); @@ -702,6 +707,7 @@ class ServerModel with ChangeNotifier { _clients.map((client) => bind.cmCloseConnection(connId: client.id))); _clients.clear(); tabController.state.value.tabs.clear(); + if (isAndroid) androidUpdatekeepScreenOn(); } void jumpTo(int id) { @@ -739,6 +745,27 @@ class ServerModel with ChangeNotifier { debugPrint("updateVoiceCallState failed: $e"); } } + + void androidUpdatekeepScreenOn() async { + if (!isAndroid) return; + var floatingWindowDisabled = + bind.mainGetLocalOption(key: kOptionDisableFloatingWindow) == "Y" || + !await AndroidPermissionManager.check(kSystemAlertWindow); + final keepScreenOn = floatingWindowDisabled + ? KeepScreenOn.never + : optionToKeepScreenOn( + bind.mainGetLocalOption(key: kOptionKeepScreenOn)); + final on = ((keepScreenOn == KeepScreenOn.serviceOn) && _isStart) || + (keepScreenOn == KeepScreenOn.duringControlled && + _clients.map((e) => !e.disconnected).isNotEmpty); + if (on != await WakelockPlus.enabled) { + if (on) { + WakelockPlus.enable(); + } else { + WakelockPlus.disable(); + } + } + } } enum ClientType { diff --git a/libs/hbb_common/src/config.rs b/libs/hbb_common/src/config.rs index b9533407a..bc7c96732 100644 --- a/libs/hbb_common/src/config.rs +++ b/libs/hbb_common/src/config.rs @@ -2100,6 +2100,9 @@ pub mod keys { pub const OPTION_FLOATING_WINDOW_TRANSPARENCY: &str = "floating-window-transparency"; pub const OPTION_FLOATING_WINDOW_SVG: &str = "floating-window-svg"; + // android keep screen on + pub const OPTION_KEEP_SCREEN_ON: &str = "keep-screen-on"; + pub const OPTION_DISABLE_GROUP_PANEL: &str = "disable-group-panel"; pub const OPTION_PRE_ELEVATE_SERVICE: &str = "pre-elevate-service"; @@ -2163,6 +2166,7 @@ pub mod keys { OPTION_FLOATING_WINDOW_UNTOUCHABLE, OPTION_FLOATING_WINDOW_TRANSPARENCY, OPTION_FLOATING_WINDOW_SVG, + OPTION_KEEP_SCREEN_ON, OPTION_DISABLE_GROUP_PANEL, OPTION_PRE_ELEVATE_SERVICE, ]; diff --git a/src/lang/ar.rs b/src/lang/ar.rs index 35ebdf332..034831410 100644 --- a/src/lang/ar.rs +++ b/src/lang/ar.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/bg.rs b/src/lang/bg.rs index 7fb752ca6..42da65078 100644 --- a/src/lang/bg.rs +++ b/src/lang/bg.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 24ac26296..0e86032d7 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 2763e53ce..11da24d72 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "使用纹理渲染"), ("Floating window", "悬浮窗"), ("floating_window_tip", "有助于保持RustDesk后台服务"), + ("Keep screen on", "保持屏幕开启"), + ("Never", "从不"), + ("During controlled", "被控期间"), + ("During service is on", "服务开启期间"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 12ab464d8..8edfb8c88 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "Použít vykreslování textur"), ("Floating window", "Plovoucí okno"), ("floating_window_tip", "Pomáhá udržovat službu RustDesk na pozadí"), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index 5c21fe99e..42f9c751c 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index 09237a313..05992da2b 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "Textur-Rendering verwenden"), ("Floating window", "Schwebendes Fenster"), ("floating_window_tip", "Es hilft dabei, RustDesk im Hintergrund auszuführen."), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index 1f9244bb4..35b2e7c35 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index df8fc4558..49ce149bc 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index fd691a087..a452f5478 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "Usar renderizado de texturas"), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/et.rs b/src/lang/et.rs index d81976a9b..e96eaa276 100644 --- a/src/lang/et.rs +++ b/src/lang/et.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index 4b9152a88..923aca2e2 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index d8580188e..54894c667 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "Utiliser le rendu de texture"), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/he.rs b/src/lang/he.rs index 7b41ac6e5..6ef587819 100644 --- a/src/lang/he.rs +++ b/src/lang/he.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hr.rs b/src/lang/hr.rs index 7df05e518..34ade8489 100644 --- a/src/lang/hr.rs +++ b/src/lang/hr.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index e505fb015..9ddeb3f9f 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index c7eab6322..5dbd233ec 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index 048ad34e0..3d3cfc7da 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "Usa rendering texture"), ("Floating window", "Finestra galleggiante"), ("floating_window_tip", "Aiuta a mantenere il servizio di RustDesk in background"), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 32272835c..0ee196941 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index a52c147ed..756a5a04c 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index f8f864e57..3d4793d67 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index 034388273..7fb256f33 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lv.rs b/src/lang/lv.rs index cfa463fb0..ef2a087ed 100644 --- a/src/lang/lv.rs +++ b/src/lang/lv.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "Izmantot tekstūras renderēšanu"), ("Floating window", "Peldošs logs"), ("floating_window_tip", "Tas palīdz uzturēt RustDesk fona servisu"), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nb.rs b/src/lang/nb.rs index 90d9666fc..098fa82ba 100644 --- a/src/lang/nb.rs +++ b/src/lang/nb.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index aaf6b1308..8ba24d862 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "Textuurrendering gebruiken"), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index d0cd3a7d9..0b9e1ba6e 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 11b974547..b77af7dc1 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 8a654340c..1e4ad748e 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index 4e2998dc8..e81f5ed32 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index f653cbe66..44d16987e 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "Визуализация текстур"), ("Floating window", "Плавающее окно"), ("floating_window_tip", "Помогает поддерживать фоновую службу RustDesk"), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index cb6d0517d..8d8fb2bf0 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "Použiť vykresľovanie textúr"), ("Floating window", "Plávajúce okno"), ("floating_window_tip", "Pomáha udržiavať službu RustDesk na pozadí"), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index 1401a2279..97554bb97 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 740579e7c..94d560c9e 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 079f5ec33..550f73e5c 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 7cbd89036..1ebac149b 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 757e94173..d15af13d8 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index 99caddf59..b2dfe9a25 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index 853719828..103c5c833 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index f85bbc72d..03702aaea 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "使用紋理渲染"), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 1ca769a07..8412a6959 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", "Використовувати візуалізацію текстур"), ("Floating window", "Рухоме вікно"), ("floating_window_tip", "Допомагає зберегти фонову службу Rustdesk"), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 3e4b887f8..46ee58c67 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -617,5 +617,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use texture rendering", ""), ("Floating window", ""), ("floating_window_tip", ""), + ("Keep screen on", ""), + ("Never", ""), + ("During controlled", ""), + ("During service is on", ""), ].iter().cloned().collect(); }