desktop: Made upgrade_to_https Option
This commit is contained in:
parent
1771e09e5e
commit
f748dd747d
|
@ -9,7 +9,6 @@ spoof-swf-url = Spoof SWF URL
|
||||||
proxy = Proxy
|
proxy = Proxy
|
||||||
|
|
||||||
upgrade-http = Upgrade HTTP to HTTPS
|
upgrade-http = Upgrade HTTP to HTTPS
|
||||||
upgrade-http-check = Upgrade
|
|
||||||
|
|
||||||
tcp-connections = TCP Connections
|
tcp-connections = TCP Connections
|
||||||
tcp-connections-allow = Allow
|
tcp-connections-allow = Allow
|
||||||
|
@ -73,4 +72,3 @@ custom-framerate = Custom Framerate
|
||||||
custom-framerate-suffix = {" "} fps
|
custom-framerate-suffix = {" "} fps
|
||||||
|
|
||||||
dummy-external-interface = Dummy External Interface
|
dummy-external-interface = Dummy External Interface
|
||||||
dummy-external-interface-enable = Enable
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ pub struct OpenDialog {
|
||||||
player_version: OptionalField<NumberField<u8>>,
|
player_version: OptionalField<NumberField<u8>>,
|
||||||
player_runtime: OptionalField<EnumDropdownField<PlayerRuntime>>,
|
player_runtime: OptionalField<EnumDropdownField<PlayerRuntime>>,
|
||||||
dummy_external_interface: OptionalField<BooleanDropdownField>,
|
dummy_external_interface: OptionalField<BooleanDropdownField>,
|
||||||
|
upgrade_to_https: OptionalField<BooleanDropdownField>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl OpenDialog {
|
impl OpenDialog {
|
||||||
|
@ -223,6 +224,16 @@ impl OpenDialog {
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
let upgrade_to_https = OptionalField::new(
|
||||||
|
defaults.upgrade_to_https,
|
||||||
|
BooleanDropdownField::new(
|
||||||
|
false,
|
||||||
|
Box::new(|value, locale| match value {
|
||||||
|
true => text(locale, "enable"),
|
||||||
|
false => text(locale, "disable"),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
options: defaults,
|
options: defaults,
|
||||||
|
@ -243,6 +254,7 @@ impl OpenDialog {
|
||||||
player_version,
|
player_version,
|
||||||
player_runtime,
|
player_runtime,
|
||||||
dummy_external_interface,
|
dummy_external_interface,
|
||||||
|
upgrade_to_https,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,10 +359,8 @@ impl OpenDialog {
|
||||||
ui.end_row();
|
ui.end_row();
|
||||||
|
|
||||||
ui.label(text(locale, "upgrade-http"));
|
ui.label(text(locale, "upgrade-http"));
|
||||||
ui.checkbox(
|
self.upgrade_to_https
|
||||||
&mut self.options.upgrade_to_https,
|
.ui(ui, &mut self.options.upgrade_to_https, locale);
|
||||||
text(locale, "upgrade-http-check"),
|
|
||||||
);
|
|
||||||
ui.end_row();
|
ui.end_row();
|
||||||
|
|
||||||
ui.label(text(locale, "tcp-connections"));
|
ui.label(text(locale, "tcp-connections"));
|
||||||
|
|
|
@ -48,7 +48,7 @@ pub struct LaunchOptions {
|
||||||
pub proxy: Option<Url>,
|
pub proxy: Option<Url>,
|
||||||
pub socket_allowed: HashSet<String>,
|
pub socket_allowed: HashSet<String>,
|
||||||
pub tcp_connections: Option<SocketMode>,
|
pub tcp_connections: Option<SocketMode>,
|
||||||
pub upgrade_to_https: bool,
|
pub upgrade_to_https: Option<bool>,
|
||||||
pub fullscreen: bool,
|
pub fullscreen: bool,
|
||||||
pub load_behavior: Option<LoadBehavior>,
|
pub load_behavior: Option<LoadBehavior>,
|
||||||
pub save_directory: PathBuf,
|
pub save_directory: PathBuf,
|
||||||
|
@ -83,7 +83,11 @@ impl From<&GlobalPreferences> for LaunchOptions {
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
proxy: value.cli.proxy.clone(),
|
proxy: value.cli.proxy.clone(),
|
||||||
upgrade_to_https: value.cli.upgrade_to_https,
|
upgrade_to_https: if value.cli.upgrade_to_https {
|
||||||
|
Some(true)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
},
|
||||||
fullscreen: value.cli.fullscreen,
|
fullscreen: value.cli.fullscreen,
|
||||||
load_behavior: value.cli.load_behavior,
|
load_behavior: value.cli.load_behavior,
|
||||||
save_directory: value.cli.save_directory.clone(),
|
save_directory: value.cli.save_directory.clone(),
|
||||||
|
@ -182,7 +186,7 @@ impl ActivePlayer {
|
||||||
opt.base.to_owned().unwrap_or_else(|| movie_url.clone()),
|
opt.base.to_owned().unwrap_or_else(|| movie_url.clone()),
|
||||||
future_spawner,
|
future_spawner,
|
||||||
opt.proxy.clone(),
|
opt.proxy.clone(),
|
||||||
opt.upgrade_to_https,
|
opt.upgrade_to_https.unwrap_or_default(),
|
||||||
opt.open_url_mode,
|
opt.open_url_mode,
|
||||||
opt.socket_allowed.clone(),
|
opt.socket_allowed.clone(),
|
||||||
opt.tcp_connections.unwrap_or(SocketMode::Ask),
|
opt.tcp_connections.unwrap_or(SocketMode::Ask),
|
||||||
|
|
Loading…
Reference in New Issue