|
|
|
@ -2,7 +2,7 @@ use crate::install_flags::{self, InstallFlags};
|
|
|
|
use crate::installer;
|
|
|
|
use crate::installer;
|
|
|
|
use clean_flash_common::{uninstaller, redirection, update_checker, ProgressCallback};
|
|
|
|
use clean_flash_common::{uninstaller, redirection, update_checker, ProgressCallback};
|
|
|
|
use clean_flash_ui::font::FontManager;
|
|
|
|
use clean_flash_ui::font::FontManager;
|
|
|
|
use clean_flash_ui::renderer::{Renderer, RgbaImage};
|
|
|
|
use clean_flash_ui::renderer::Renderer;
|
|
|
|
use clean_flash_ui::widgets::button::GradientButton;
|
|
|
|
use clean_flash_ui::widgets::button::GradientButton;
|
|
|
|
use clean_flash_ui::widgets::checkbox::ImageCheckBox;
|
|
|
|
use clean_flash_ui::widgets::checkbox::ImageCheckBox;
|
|
|
|
use clean_flash_ui::widgets::label::Label;
|
|
|
|
use clean_flash_ui::widgets::label::Label;
|
|
|
|
@ -59,10 +59,7 @@ pub struct InstallForm {
|
|
|
|
// Header
|
|
|
|
// Header
|
|
|
|
pub title_text: String,
|
|
|
|
pub title_text: String,
|
|
|
|
pub subtitle_text: String,
|
|
|
|
pub subtitle_text: String,
|
|
|
|
pub flash_logo: RgbaImage,
|
|
|
|
flash_logo_cache: clean_flash_ui::flash_logo::FlashLogoCache,
|
|
|
|
// Checkbox images
|
|
|
|
|
|
|
|
pub checkbox_on: RgbaImage,
|
|
|
|
|
|
|
|
pub checkbox_off: RgbaImage,
|
|
|
|
|
|
|
|
// Navigation buttons
|
|
|
|
// Navigation buttons
|
|
|
|
pub prev_button: GradientButton,
|
|
|
|
pub prev_button: GradientButton,
|
|
|
|
pub next_button: GradientButton,
|
|
|
|
pub next_button: GradientButton,
|
|
|
|
@ -132,12 +129,6 @@ impl InstallForm {
|
|
|
|
let title_text = "Clean Flash Player".to_string();
|
|
|
|
let title_text = "Clean Flash Player".to_string();
|
|
|
|
let subtitle_text = format!("built from version {} (China)", version);
|
|
|
|
let subtitle_text = format!("built from version {} (China)", version);
|
|
|
|
|
|
|
|
|
|
|
|
// Load images from the common resources folder.
|
|
|
|
|
|
|
|
// These are loaded from the C# project's assets alongside the binary.
|
|
|
|
|
|
|
|
let flash_logo = load_resource_image("flashLogo.png");
|
|
|
|
|
|
|
|
let checkbox_on = load_resource_image("checkboxOn.png");
|
|
|
|
|
|
|
|
let checkbox_off = load_resource_image("checkboxOff.png");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let fonts = FontManager::new();
|
|
|
|
let fonts = FontManager::new();
|
|
|
|
|
|
|
|
|
|
|
|
Self {
|
|
|
|
Self {
|
|
|
|
@ -145,9 +136,7 @@ impl InstallForm {
|
|
|
|
panel: Panel::Disclaimer,
|
|
|
|
panel: Panel::Disclaimer,
|
|
|
|
title_text,
|
|
|
|
title_text,
|
|
|
|
subtitle_text,
|
|
|
|
subtitle_text,
|
|
|
|
flash_logo,
|
|
|
|
flash_logo_cache: clean_flash_ui::flash_logo::FlashLogoCache::new(),
|
|
|
|
checkbox_on,
|
|
|
|
|
|
|
|
checkbox_off,
|
|
|
|
|
|
|
|
prev_button: btn(90, 286, 138, 31, "QUIT"),
|
|
|
|
prev_button: btn(90, 286, 138, 31, "QUIT"),
|
|
|
|
next_button: btn(497, 286, 138, 31, "AGREE"),
|
|
|
|
next_button: btn(497, 286, 138, 31, "AGREE"),
|
|
|
|
// Disclaimer panel
|
|
|
|
// Disclaimer panel
|
|
|
|
@ -240,10 +229,10 @@ The following details could be useful. Press the Retry button to try again.",
|
|
|
|
// ----- Draw -----
|
|
|
|
// ----- Draw -----
|
|
|
|
renderer.clear(BG_COLOR);
|
|
|
|
renderer.clear(BG_COLOR);
|
|
|
|
|
|
|
|
|
|
|
|
// Header: flash logo.
|
|
|
|
// Header: flash logo (cached software render).
|
|
|
|
let lw = (self.flash_logo.width as f32 * self.scale) as i32;
|
|
|
|
self.flash_logo_cache.draw(
|
|
|
|
let lh = (self.flash_logo.height as f32 * self.scale) as i32;
|
|
|
|
renderer, self.s(90), self.s(36), self.s(109), self.s(107),
|
|
|
|
renderer.draw_image_scaled(self.s(90), self.s(36), lw, lh, &self.flash_logo);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
// Title.
|
|
|
|
// Title.
|
|
|
|
self.fonts.draw_text(
|
|
|
|
self.fonts.draw_text(
|
|
|
|
@ -561,34 +550,27 @@ including Clean Flash Player and older versions of Adobe Flash Player."
|
|
|
|
// ---- Drawing helpers ----
|
|
|
|
// ---- Drawing helpers ----
|
|
|
|
|
|
|
|
|
|
|
|
fn draw_disclaimer(&self, r: &mut Renderer) {
|
|
|
|
fn draw_disclaimer(&self, r: &mut Renderer) {
|
|
|
|
self.disclaimer_box
|
|
|
|
self.disclaimer_box.draw(r);
|
|
|
|
.draw(r, &self.checkbox_on, &self.checkbox_off);
|
|
|
|
|
|
|
|
self.disclaimer_label.draw(r, &self.fonts);
|
|
|
|
self.disclaimer_label.draw(r, &self.fonts);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn draw_choice(&self, r: &mut Renderer) {
|
|
|
|
fn draw_choice(&self, r: &mut Renderer) {
|
|
|
|
self.browser_ask_label.draw(r, &self.fonts);
|
|
|
|
self.browser_ask_label.draw(r, &self.fonts);
|
|
|
|
self.pepper_box
|
|
|
|
self.pepper_box.draw(r);
|
|
|
|
.draw(r, &self.checkbox_on, &self.checkbox_off);
|
|
|
|
|
|
|
|
self.pepper_label.draw(r, &self.fonts);
|
|
|
|
self.pepper_label.draw(r, &self.fonts);
|
|
|
|
self.netscape_box
|
|
|
|
self.netscape_box.draw(r);
|
|
|
|
.draw(r, &self.checkbox_on, &self.checkbox_off);
|
|
|
|
|
|
|
|
self.netscape_label.draw(r, &self.fonts);
|
|
|
|
self.netscape_label.draw(r, &self.fonts);
|
|
|
|
self.activex_box
|
|
|
|
self.activex_box.draw(r);
|
|
|
|
.draw(r, &self.checkbox_on, &self.checkbox_off);
|
|
|
|
|
|
|
|
self.activex_label.draw(r, &self.fonts);
|
|
|
|
self.activex_label.draw(r, &self.fonts);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn draw_player_choice(&self, r: &mut Renderer) {
|
|
|
|
fn draw_player_choice(&self, r: &mut Renderer) {
|
|
|
|
self.player_ask_label.draw(r, &self.fonts);
|
|
|
|
self.player_ask_label.draw(r, &self.fonts);
|
|
|
|
self.player_box
|
|
|
|
self.player_box.draw(r);
|
|
|
|
.draw(r, &self.checkbox_on, &self.checkbox_off);
|
|
|
|
|
|
|
|
self.player_label.draw(r, &self.fonts);
|
|
|
|
self.player_label.draw(r, &self.fonts);
|
|
|
|
self.player_desktop_box
|
|
|
|
self.player_desktop_box.draw(r);
|
|
|
|
.draw(r, &self.checkbox_on, &self.checkbox_off);
|
|
|
|
|
|
|
|
self.player_desktop_label.draw(r, &self.fonts);
|
|
|
|
self.player_desktop_label.draw(r, &self.fonts);
|
|
|
|
self.player_start_menu_box
|
|
|
|
self.player_start_menu_box.draw(r);
|
|
|
|
.draw(r, &self.checkbox_on, &self.checkbox_off);
|
|
|
|
|
|
|
|
self.player_start_menu_label.draw(r, &self.fonts);
|
|
|
|
self.player_start_menu_label.draw(r, &self.fonts);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -664,13 +646,3 @@ fn join_with_and(items: &[&str]) -> String {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Try to load a resource image from the original C# project's asset folder.
|
|
|
|
|
|
|
|
fn load_resource_image(name: &str) -> RgbaImage {
|
|
|
|
|
|
|
|
let bytes: &[u8] = match name {
|
|
|
|
|
|
|
|
"flashLogo.png" => include_bytes!("../../../resources/flashLogo.png"),
|
|
|
|
|
|
|
|
"checkboxOn.png" => include_bytes!("../../../resources/checkboxOn.png"),
|
|
|
|
|
|
|
|
"checkboxOff.png" => include_bytes!("../../../resources/checkboxOff.png"),
|
|
|
|
|
|
|
|
_ => return RgbaImage::empty(),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
RgbaImage::from_png_bytes(bytes)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|