refact, linux headless option, ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
55972bfac5
commit
19c8ba719a
@ -312,20 +312,26 @@ class _GeneralState extends State<_General> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget other() {
|
Widget other() {
|
||||||
return _Card(title: 'Other', children: [
|
final children = [
|
||||||
_OptionCheckBox(context, 'Confirm before closing multiple tabs',
|
_OptionCheckBox(context, 'Confirm before closing multiple tabs',
|
||||||
'enable-confirm-closing-tabs'),
|
'enable-confirm-closing-tabs'),
|
||||||
_OptionCheckBox(context, 'Adaptive Bitrate', 'enable-abr'),
|
_OptionCheckBox(context, 'Adaptive Bitrate', 'enable-abr')
|
||||||
if (Platform.isLinux)
|
];
|
||||||
Tooltip(
|
if (Platform.isLinux) {
|
||||||
message: translate('software_render_tip'),
|
children.add(Tooltip(
|
||||||
child: _OptionCheckBox(
|
message: translate('software_render_tip'),
|
||||||
context,
|
child: _OptionCheckBox(
|
||||||
"Always use software rendering",
|
context,
|
||||||
'allow-always-software-render',
|
"Always use software rendering",
|
||||||
),
|
'allow-always-software-render',
|
||||||
)
|
),
|
||||||
]);
|
));
|
||||||
|
}
|
||||||
|
if (bind.mainShowOption(key: 'allow-linux-headless')) {
|
||||||
|
children.add(_OptionCheckBox(
|
||||||
|
context, 'Allow linux headless', 'allow-linux-headless'));
|
||||||
|
}
|
||||||
|
return _Card(title: 'Other', children: children);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget hwcodec() {
|
Widget hwcodec() {
|
||||||
|
@ -33,7 +33,7 @@ const SERIAL: i32 = 3;
|
|||||||
const PASSWORD_ENC_VERSION: &str = "00";
|
const PASSWORD_ENC_VERSION: &str = "00";
|
||||||
|
|
||||||
// config2 options
|
// config2 options
|
||||||
#[cfg(all(target_os = "linux"))]
|
#[cfg(target_os = "linux")]
|
||||||
pub const CONFIG_OPTION_ALLOW_LINUX_HEADLESS: &str = "allow-linux-headless";
|
pub const CONFIG_OPTION_ALLOW_LINUX_HEADLESS: &str = "allow-linux-headless";
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
@ -614,6 +614,15 @@ pub fn main_get_error() -> String {
|
|||||||
get_error()
|
get_error()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn main_show_option(key: String) -> SyncReturn<bool> {
|
||||||
|
if key.eq(config::CONFIG_OPTION_ALLOW_LINUX_HEADLESS) {
|
||||||
|
#[cfg(all(target_os = "linux", feature = "linux_headless"))]
|
||||||
|
#[cfg(not(any(feature = "flatpak", feature = "appimage")))]
|
||||||
|
return SyncReturn(true)
|
||||||
|
}
|
||||||
|
SyncReturn(false)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn main_set_option(key: String, value: String) {
|
pub fn main_set_option(key: String, value: String) {
|
||||||
if key.eq("custom-rendezvous-server") {
|
if key.eq("custom-rendezvous-server") {
|
||||||
set_option(key, value);
|
set_option(key, value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user