begin install sum page
This commit is contained in:
parent
c256d2e456
commit
1b7c826714
@ -73,6 +73,8 @@
|
||||
"advanced_home_seperation_selection_checkbutton_subvol_label": "Yes, via a Subvolume",
|
||||
"advanced_home_seperation_selection_checkbutton_partition_label": "Yes, via a Partition",
|
||||
"advanced_home_seperation_selection_checkbutton_none_label": "No",
|
||||
"advanced_home_part_ratio_label_root_label": "Root Partition Size",
|
||||
"advanced_home_part_ratio_label_home_label": "Home Partition Size",
|
||||
"fs_unknown": "Unknown",
|
||||
"drive_mount_add_button_label": "Add A Custom Filesystem Entry",
|
||||
"open_disk_utility_button_label": "Open Disk Partitioning Utility",
|
||||
@ -96,9 +98,14 @@
|
||||
"partition_method_manual_valid_label_label": "Filesystem Table is Valid!",
|
||||
"installation_summary_page_title": "Installation Summary",
|
||||
"installation_summary_page_subtitle": "Please Double Check and Confirm That This Configuration is Satisfactory",
|
||||
"language_detail": "Language:",
|
||||
"timezone_detail": "Timezone:",
|
||||
"keyboard_detail": "Keyboard layout:",
|
||||
"install_confirm_detail_language_title": "Language/Locale",
|
||||
"install_confirm_detail_keymap_title": "Keymap/Keyboard Layout",
|
||||
"install_confirm_detail_timezone_title": "Time Zone",
|
||||
"install_confirm_detail_partition_method_type_title": "Partitioning Method",
|
||||
"install_confirm_detail_partition_method_type_subtitle_automatic_luks": "Automatic w/ LUKS",
|
||||
"install_confirm_detail_partition_method_type_subtitle_automatic": "Automatic",
|
||||
"install_confirm_detail_partition_method_type_subtitle_manual_luks": "Manual w/ LUKS",
|
||||
"install_confirm_detail_partition_method_type_subtitle_manual": "Manual",
|
||||
"mounted_on_detail": " mounted on ",
|
||||
"install_target_detail": "Install Target:",
|
||||
"install_confirm_button_label": "Confirm & Install PikaOS"
|
||||
|
@ -20,6 +20,7 @@ pub fn automatic_partitioning_page(
|
||||
partition_method_automatic_ratio_refcell: &Rc<RefCell<f64>>,
|
||||
partition_method_automatic_seperation_refcell: &Rc<RefCell<String>>,
|
||||
language_changed_action: &gio::SimpleAction,
|
||||
page_done_action: &gio::SimpleAction,
|
||||
) {
|
||||
let automatic_partitioning_page = installer_stack_page::InstallerStackPage::new();
|
||||
automatic_partitioning_page.set_page_icon("builder");
|
||||
@ -601,6 +602,8 @@ pub fn automatic_partitioning_page(
|
||||
#[strong]
|
||||
partition_method_type_refcell,
|
||||
#[strong]
|
||||
page_done_action,
|
||||
#[strong]
|
||||
partition_method_automatic_target_refcell,
|
||||
#[strong]
|
||||
partition_method_automatic_target_fs_refcell,
|
||||
@ -614,6 +617,10 @@ pub fn automatic_partitioning_page(
|
||||
partition_method_automatic_seperation_refcell,
|
||||
move |_automatic_partitioning_page: installer_stack_page::InstallerStackPage| {
|
||||
*partition_method_type_refcell.borrow_mut() = String::from("automatic");
|
||||
page_done_action.activate(Some(&glib::variant::Variant::from_data_with_type(
|
||||
"partitioning_done",
|
||||
glib::VariantTy::STRING,
|
||||
)));
|
||||
main_carousel.scroll_to(&main_carousel.nth_page(6), true)
|
||||
}
|
||||
),
|
||||
|
@ -132,6 +132,7 @@ pub fn build_ui(app: &adw::Application) {
|
||||
Rc::new(RefCell::new(Vec::new()));
|
||||
|
||||
let language_changed_action = gio::SimpleAction::new("lang-changed", None);
|
||||
let page_done_action = gio::SimpleAction::new("lang-changed", Some(glib::VariantTy::STRING));
|
||||
|
||||
language_page::language_page(
|
||||
&carousel,
|
||||
@ -167,9 +168,10 @@ pub fn build_ui(app: &adw::Application) {
|
||||
&partition_method_manual_luks_enabled_refcell,
|
||||
&partition_method_manual_crypttab_entry_array_refcell,
|
||||
&language_changed_action,
|
||||
&page_done_action,
|
||||
);
|
||||
|
||||
installation_summary_page::installation_summary_page(&carousel, &language_changed_action, &language_selection_text_refcell, &keymap_selection_text_refcell, &timezone_selection_text_refcell, &partition_method_type_refcell, &partition_method_automatic_target_refcell, &partition_method_automatic_target_fs_refcell, &partition_method_automatic_luks_enabled_refcell, &partition_method_automatic_luks_refcell, &partition_method_automatic_ratio_refcell, &partition_method_automatic_seperation_refcell, &partition_method_manual_fstab_entry_array_refcell, &partition_method_manual_luks_enabled_refcell, &partition_method_manual_crypttab_entry_array_refcell);
|
||||
installation_summary_page::installation_summary_page(&carousel, &language_changed_action, &page_done_action,&language_selection_text_refcell, &keymap_selection_text_refcell, &timezone_selection_text_refcell, &partition_method_type_refcell, &partition_method_automatic_target_refcell, &partition_method_automatic_target_fs_refcell, &partition_method_automatic_luks_enabled_refcell, &partition_method_automatic_luks_refcell, &partition_method_automatic_ratio_refcell, &partition_method_automatic_seperation_refcell, &partition_method_manual_fstab_entry_array_refcell, &partition_method_manual_luks_enabled_refcell, &partition_method_manual_crypttab_entry_array_refcell);
|
||||
|
||||
window.present()
|
||||
}
|
||||
|
@ -2,12 +2,13 @@ use crate::{build_ui::{PikaLocale, PikaKeymap, FstabEntry, CrypttabEntry}, insta
|
||||
use adw::prelude::*;
|
||||
use glib::{clone, closure_local};
|
||||
use gtk::{gio, glib};
|
||||
use std::{cell::RefCell, fs, path::Path, process::Command, rc::Rc};
|
||||
use std::{cell::RefCell, fs, ops::Deref, path::Path, process::Command, rc::Rc};
|
||||
|
||||
pub fn installation_summary_page(
|
||||
main_carousel: &adw::Carousel,
|
||||
language_changed_action: &gio::SimpleAction,
|
||||
installation_summary_text_refcell: &Rc<RefCell<PikaLocale>>,
|
||||
page_done_action: &gio::SimpleAction,
|
||||
language_summary_text_refcell: &Rc<RefCell<PikaLocale>>,
|
||||
keymap_selection_text_refcell: &Rc<RefCell<PikaKeymap>>,
|
||||
timezone_selection_text_refcell: &Rc<RefCell<String>>,
|
||||
partition_method_type_refcell: &Rc<RefCell<String>>,
|
||||
@ -56,15 +57,92 @@ pub fn installation_summary_page(
|
||||
.valign(gtk::Align::Center)
|
||||
.build();
|
||||
install_confirm_button.add_css_class("destructive-action");
|
||||
install_confirm_button.add_css_class("circular");
|
||||
install_confirm_button.add_css_class("rounded-all-25-with-padding");
|
||||
|
||||
// / content_box appends
|
||||
//// add text and and entry to installation_summary page selections
|
||||
content_box.append(&installation_summary_row_viewport_listbox);
|
||||
content_box.append(&installation_summary_row_viewport);
|
||||
content_box.append(&install_confirm_button);
|
||||
|
||||
installation_summary_page.set_child_widget(&content_box);
|
||||
|
||||
//
|
||||
|
||||
page_done_action.connect_activate(clone!(
|
||||
#[strong]
|
||||
installation_summary_row_viewport_listbox,
|
||||
#[strong]
|
||||
language_summary_text_refcell,
|
||||
#[strong]
|
||||
keymap_selection_text_refcell,
|
||||
#[strong]
|
||||
timezone_selection_text_refcell,
|
||||
#[strong]
|
||||
partition_method_type_refcell,
|
||||
#[strong]
|
||||
partition_method_automatic_luks_enabled_refcell,
|
||||
#[strong]
|
||||
partition_method_manual_luks_enabled_refcell,
|
||||
move|_, action_arg|
|
||||
{
|
||||
let action_arg = String::from_utf8_lossy(action_arg.unwrap().data());
|
||||
if action_arg == "partitioning_done" {
|
||||
while let Some(row) = installation_summary_row_viewport_listbox.last_child() {
|
||||
installation_summary_row_viewport_listbox.remove(&row);
|
||||
}
|
||||
//
|
||||
let partition_method_automatic_luks_enabled = partition_method_automatic_luks_enabled_refcell.borrow();
|
||||
let partition_method_manual_luks_enabled = partition_method_manual_luks_enabled_refcell.borrow();
|
||||
//
|
||||
let install_confirm_detail_language = adw::ActionRow::builder()
|
||||
.title(t!("install_confirm_detail_language_title"))
|
||||
.subtitle(&language_summary_text_refcell.borrow().pretty_name)
|
||||
.build();
|
||||
install_confirm_detail_language.add_css_class("property");
|
||||
installation_summary_row_viewport_listbox.append(&install_confirm_detail_language);
|
||||
//
|
||||
let install_confirm_detail_keymap = adw::ActionRow::builder()
|
||||
.title(t!("install_confirm_detail_keymap_title"))
|
||||
.subtitle(&keymap_selection_text_refcell.borrow().pretty_name)
|
||||
.build();
|
||||
install_confirm_detail_keymap.add_css_class("property");
|
||||
installation_summary_row_viewport_listbox.append(&install_confirm_detail_keymap);
|
||||
//
|
||||
let install_confirm_detail_timezone = adw::ActionRow::builder()
|
||||
.title(t!("install_confirm_detail_timezone_title"))
|
||||
.subtitle(&timezone_selection_text_refcell.borrow().to_string())
|
||||
.build();
|
||||
install_confirm_detail_timezone.add_css_class("property");
|
||||
installation_summary_row_viewport_listbox.append(&install_confirm_detail_timezone);
|
||||
//
|
||||
let install_confirm_detail_partition_method_type_subtitle = match &*partition_method_type_refcell.borrow().as_str() {
|
||||
"automatic" => {
|
||||
if *partition_method_automatic_luks_enabled {
|
||||
t!("install_confirm_detail_partition_method_type_subtitle_automatic_luks").to_string()
|
||||
} else {
|
||||
t!("install_confirm_detail_partition_method_type_subtitle_automatic").to_string()
|
||||
}
|
||||
}
|
||||
"manual" => {
|
||||
if *partition_method_manual_luks_enabled {
|
||||
t!("install_confirm_detail_partition_method_type_subtitle_manual_luks").to_string()
|
||||
} else {
|
||||
t!("install_confirm_detail_partition_method_type_subtitle_manual").to_string()
|
||||
}
|
||||
}
|
||||
_ => panic!()
|
||||
};
|
||||
let install_confirm_detail_partition_method_type = adw::ActionRow::builder()
|
||||
.title(t!("install_confirm_detail_partition_method_type_title"))
|
||||
.subtitle(&install_confirm_detail_partition_method_type_subtitle)
|
||||
.build();
|
||||
install_confirm_detail_partition_method_type.add_css_class("property");
|
||||
installation_summary_row_viewport_listbox.append(&install_confirm_detail_partition_method_type);
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
//
|
||||
language_changed_action.connect_activate(clone!(
|
||||
#[weak]
|
||||
|
@ -19,6 +19,7 @@ pub fn manual_partitioning_page(
|
||||
partition_method_manual_luks_enabled_refcell: &Rc<RefCell<bool>>,
|
||||
partition_method_manual_crypttab_entry_array_refcell: &Rc<RefCell<Vec<CrypttabEntry>>>,
|
||||
language_changed_action: &gio::SimpleAction,
|
||||
page_done_action: &gio::SimpleAction,
|
||||
) {
|
||||
let manual_partitioning_page = installer_stack_page::InstallerStackPage::new();
|
||||
manual_partitioning_page.set_page_icon("emblem-system-symbolic");
|
||||
@ -363,6 +364,8 @@ pub fn manual_partitioning_page(
|
||||
#[strong]
|
||||
partition_method_type_refcell,
|
||||
#[strong]
|
||||
page_done_action,
|
||||
#[strong]
|
||||
partition_method_manual_fstab_entry_array_refcell,
|
||||
#[strong]
|
||||
partition_method_manual_luks_enabled_refcell,
|
||||
@ -370,6 +373,10 @@ pub fn manual_partitioning_page(
|
||||
partition_method_manual_crypttab_entry_array_refcell,
|
||||
move |_automatic_partitioning_page: installer_stack_page::InstallerStackPage| {
|
||||
*partition_method_type_refcell.borrow_mut() = String::from("manual");
|
||||
page_done_action.activate(Some(&glib::variant::Variant::from_data_with_type(
|
||||
"partitioning_done",
|
||||
glib::VariantTy::STRING,
|
||||
)));
|
||||
main_carousel.scroll_to(&main_carousel.nth_page(6), true)
|
||||
}
|
||||
),
|
||||
|
@ -18,6 +18,7 @@ pub fn partitioning_page(
|
||||
partition_method_manual_luks_enabled_refcell: &Rc<RefCell<bool>>,
|
||||
partition_method_manual_crypttab_entry_array_refcell: &Rc<RefCell<Vec<CrypttabEntry>>>,
|
||||
language_changed_action: &gio::SimpleAction,
|
||||
page_done_action: &gio::SimpleAction,
|
||||
) {
|
||||
let partitioning_page = installer_stack_page::InstallerStackPage::new();
|
||||
partitioning_page.set_page_icon("media-floppy-symbolic");
|
||||
@ -143,6 +144,7 @@ pub fn partitioning_page(
|
||||
&partition_method_automatic_ratio_refcell,
|
||||
&partition_method_automatic_seperation_refcell,
|
||||
&language_changed_action,
|
||||
&page_done_action,
|
||||
);
|
||||
manual_partitioning_page::manual_partitioning_page(
|
||||
&main_carousel,
|
||||
@ -153,6 +155,7 @@ pub fn partitioning_page(
|
||||
&partition_method_manual_luks_enabled_refcell,
|
||||
&partition_method_manual_crypttab_entry_array_refcell,
|
||||
&language_changed_action,
|
||||
page_done_action,
|
||||
);
|
||||
|
||||
partitioning_page.connect_closure(
|
||||
|
Loading…
Reference in New Issue
Block a user