mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-13 19:47:17 +00:00
Fix/custom client advanced settings (#8066)
* fix: custom client, advanced settings Signed-off-by: fufesou <shuanglongchen@yeah.net> * refact: custom client, default options Signed-off-by: fufesou <shuanglongchen@yeah.net> * fix: cargo test Signed-off-by: fufesou <shuanglongchen@yeah.net> * refact: remove prefix $ and unify option keys Signed-off-by: fufesou <shuanglongchen@yeah.net> * refact: custom client, advanced options Signed-off-by: fufesou <shuanglongchen@yeah.net> * debug custom client, advanced settings Signed-off-by: fufesou <shuanglongchen@yeah.net> * custom client, advanced settings. Add filter-transfer to display settings Signed-off-by: fufesou <shuanglongchen@yeah.net> * custom client, advanced settings Signed-off-by: fufesou <shuanglongchen@yeah.net> * fix: custom client, advanced settings, codec Signed-off-by: fufesou <shuanglongchen@yeah.net> * fix: custom client, advanced settings, whitelist Signed-off-by: fufesou <shuanglongchen@yeah.net> --------- Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -10,8 +10,8 @@ import 'package:get/get.dart';
|
||||
customImageQualityWidget(
|
||||
{required double initQuality,
|
||||
required double initFps,
|
||||
required Function(double) setQuality,
|
||||
required Function(double) setFps,
|
||||
required Function(double)? setQuality,
|
||||
required Function(double)? setFps,
|
||||
required bool showFps,
|
||||
required bool showMoreQuality}) {
|
||||
if (initQuality < kMinQuality ||
|
||||
@@ -27,16 +27,12 @@ customImageQualityWidget(
|
||||
final RxBool moreQualityChecked = RxBool(qualityValue.value > kMaxQuality);
|
||||
final debouncerQuality = Debouncer<double>(
|
||||
Duration(milliseconds: 1000),
|
||||
onChanged: (double v) {
|
||||
setQuality(v);
|
||||
},
|
||||
onChanged: setQuality,
|
||||
initialValue: qualityValue.value,
|
||||
);
|
||||
final debouncerFps = Debouncer<double>(
|
||||
Duration(milliseconds: 1000),
|
||||
onChanged: (double v) {
|
||||
setFps(v);
|
||||
},
|
||||
onChanged: setFps,
|
||||
initialValue: fpsValue.value,
|
||||
);
|
||||
|
||||
@@ -62,10 +58,12 @@ customImageQualityWidget(
|
||||
divisions: moreQualityChecked.value
|
||||
? ((kMaxMoreQuality - kMinQuality) / 10).round()
|
||||
: ((kMaxQuality - kMinQuality) / 5).round(),
|
||||
onChanged: (double value) async {
|
||||
qualityValue.value = value;
|
||||
debouncerQuality.value = value;
|
||||
},
|
||||
onChanged: setQuality == null
|
||||
? null
|
||||
: (double value) async {
|
||||
qualityValue.value = value;
|
||||
debouncerQuality.value = value;
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -124,10 +122,12 @@ customImageQualityWidget(
|
||||
min: kMinFps,
|
||||
max: kMaxFps,
|
||||
divisions: ((kMaxFps - kMinFps) / 5).round(),
|
||||
onChanged: (double value) async {
|
||||
fpsValue.value = value;
|
||||
debouncerFps.value = value;
|
||||
},
|
||||
onChanged: setFps == null
|
||||
? null
|
||||
: (double value) async {
|
||||
fpsValue.value = value;
|
||||
debouncerFps.value = value;
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -152,21 +152,29 @@ customImageQualitySetting() {
|
||||
final qualityKey = 'custom_image_quality';
|
||||
final fpsKey = 'custom-fps';
|
||||
|
||||
var initQuality =
|
||||
final initQuality =
|
||||
(double.tryParse(bind.mainGetUserDefaultOption(key: qualityKey)) ??
|
||||
kDefaultQuality);
|
||||
var initFps = (double.tryParse(bind.mainGetUserDefaultOption(key: fpsKey)) ??
|
||||
kDefaultFps);
|
||||
final isQuanlityFixed = isOptionFixed(qualityKey);
|
||||
final initFps =
|
||||
(double.tryParse(bind.mainGetUserDefaultOption(key: fpsKey)) ??
|
||||
kDefaultFps);
|
||||
final isFpsFixed = isOptionFixed(fpsKey);
|
||||
|
||||
return customImageQualityWidget(
|
||||
initQuality: initQuality,
|
||||
initFps: initFps,
|
||||
setQuality: (v) {
|
||||
bind.mainSetUserDefaultOption(key: qualityKey, value: v.toString());
|
||||
},
|
||||
setFps: (v) {
|
||||
bind.mainSetUserDefaultOption(key: fpsKey, value: v.toString());
|
||||
},
|
||||
setQuality: isQuanlityFixed
|
||||
? null
|
||||
: (v) {
|
||||
bind.mainSetUserDefaultOption(
|
||||
key: qualityKey, value: v.toString());
|
||||
},
|
||||
setFps: isFpsFixed
|
||||
? null
|
||||
: (v) {
|
||||
bind.mainSetUserDefaultOption(key: fpsKey, value: v.toString());
|
||||
},
|
||||
showFps: true,
|
||||
showMoreQuality: true);
|
||||
}
|
||||
@@ -208,23 +216,25 @@ List<Widget> ServerConfigImportExportWidgets(
|
||||
|
||||
List<(String, String)> otherDefaultSettings() {
|
||||
List<(String, String)> v = [
|
||||
('View Mode', 'view_only'),
|
||||
if ((isDesktop || isWebDesktop)) ('show_monitors_tip', kKeyShowMonitorsToolbar),
|
||||
if ((isDesktop || isWebDesktop)) ('Collapse toolbar', 'collapse_toolbar'),
|
||||
('Show remote cursor', 'show_remote_cursor'),
|
||||
('Follow remote cursor', 'follow_remote_cursor'),
|
||||
('Follow remote window focus', 'follow_remote_window'),
|
||||
if ((isDesktop || isWebDesktop)) ('Zoom cursor', 'zoom-cursor'),
|
||||
('Show quality monitor', 'show_quality_monitor'),
|
||||
('Mute', 'disable_audio'),
|
||||
if (isDesktop) ('Enable file copy and paste', 'enable_file_transfer'),
|
||||
('Disable clipboard', 'disable_clipboard'),
|
||||
('Lock after session end', 'lock_after_session_end'),
|
||||
('Privacy mode', 'privacy_mode'),
|
||||
if (isMobile) ('Touch mode', 'touch-mode'),
|
||||
('True color (4:4:4)', 'i444'),
|
||||
('View Mode', kOptionViewOnly),
|
||||
if ((isDesktop || isWebDesktop))
|
||||
('show_monitors_tip', kKeyShowMonitorsToolbar),
|
||||
if ((isDesktop || isWebDesktop))
|
||||
('Collapse toolbar', kOptionCollapseToolbar),
|
||||
('Show remote cursor', kOptionShowRemoteCursor),
|
||||
('Follow remote cursor', kOptionFollowRemoteCursor),
|
||||
('Follow remote window focus', kOptionFollowRemoteWindow),
|
||||
if ((isDesktop || isWebDesktop)) ('Zoom cursor', kOptionZoomCursor),
|
||||
('Show quality monitor', kOptionShowQualityMonitor),
|
||||
('Mute', kOptionDisableAudio),
|
||||
if (isDesktop) ('Enable file copy and paste', kOptionEnableFileTransfer),
|
||||
('Disable clipboard', kOptionDisableClipboard),
|
||||
('Lock after session end', kOptionLockAfterSessionEnd),
|
||||
('Privacy mode', kOptionPrivacyMode),
|
||||
if (isMobile) ('Touch mode', kOptionTouchMode),
|
||||
('True color (4:4:4)', kOptionI444),
|
||||
('Reverse mouse wheel', kKeyReverseMouseWheel),
|
||||
('swap-left-right-mouse', 'swap-left-right-mouse'),
|
||||
('swap-left-right-mouse', kOptionSwapLeftRightMouse),
|
||||
if (isDesktop && useTextureRender)
|
||||
(
|
||||
'Show displays as individual windows',
|
||||
|
||||
Reference in New Issue
Block a user