RR: Some reworks in autopart

This commit is contained in:
Ward from fusion-voyager-3 2024-02-20 12:32:31 +03:00
parent 026712160c
commit 1f6e386175
6 changed files with 41 additions and 18 deletions

View File

@ -6,12 +6,12 @@ exec &> >(tee /tmp/pika-installer-gtk4-log)
if [[ -f /tmp/pika-installer-gtk4-target-manual.txt ]] if [[ -f /tmp/pika-installer-gtk4-target-manual.txt ]]
then then
sudo /usr/lib/pika/pika-installer-gtk4/scripts/manual-partition-install.sh || touch /tmp/pika-installer-gtk4-fail.txt sudo /usr/lib/pika/pika-installer-gtk4/scripts/manual-partition-install.sh || sudo touch /tmp/pika-installer-gtk4-fail.txt
else else
if [[ -f /tmp/pika-installer-gtk4-target-auto.txt ]] if [[ -f /tmp/pika-installer-gtk4-target-auto.txt ]]
then then
sudo /usr/lib/pika/pika-installer-gtk4/scripts/automatic-partition-install.sh || touch /tmp/pika-installer-gtk4-fail.txt sudo /usr/lib/pika/pika-installer-gtk4/scripts/automatic-partition-install.sh || sudo touch /tmp/pika-installer-gtk4-fail.txt
else else
echo "critical installer error" && touch /tmp/pika-installer-gtk4-fail.txt && exit 1 echo "critical installer error" && sudo touch /tmp/pika-installer-gtk4-fail.txt && exit 1
fi fi
fi fi

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
pika-installer-gtk4 (1.0.1-100pika1) pikauwu; urgency=low pika-installer-gtk4 (1.0.1-100pika2) pikauwu; urgency=low
* First release * First release

View File

@ -78,8 +78,7 @@ pub fn automatic_partitioning(
let devices_selection_expander_row_viewport = let devices_selection_expander_row_viewport =
gtk::ScrolledWindow::builder().height_request(200).build(); gtk::ScrolledWindow::builder().height_request(200).build();
let devices_selection_expander_row_viewport_box = gtk::ListBox::builder() let devices_selection_expander_row_viewport_box = gtk::ListBox::builder().build();
.build();
devices_selection_expander_row_viewport_box.add_css_class("boxed-list"); devices_selection_expander_row_viewport_box.add_css_class("boxed-list");
devices_selection_expander_row_viewport devices_selection_expander_row_viewport
@ -241,12 +240,15 @@ pub fn automatic_partitioning(
} }
if partition_method_automatic_luks_password_entry.text().to_string().is_empty() { if partition_method_automatic_luks_password_entry.text().to_string().is_empty() {
partition_method_automatic_luks_error_label.set_visible(true); partition_method_automatic_luks_error_label.set_visible(true);
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(false); bottom_next_button.set_sensitive(false);
} else { } else {
partition_method_automatic_luks_error_label.set_visible(false); partition_method_automatic_luks_error_label.set_visible(false);
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() { if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(true); bottom_next_button.set_sensitive(true);
} else { } else {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(false); bottom_next_button.set_sensitive(false);
} }
} }
@ -255,8 +257,10 @@ pub fn automatic_partitioning(
partition_method_automatic_luks_error_label.set_visible(false); partition_method_automatic_luks_error_label.set_visible(false);
partition_method_automatic_luks_error2_label.set_visible(false); partition_method_automatic_luks_error2_label.set_visible(false);
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() { if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(true); bottom_next_button.set_sensitive(true);
} else { } else {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(false); bottom_next_button.set_sensitive(false);
} }
} }
@ -272,12 +276,15 @@ pub fn automatic_partitioning(
} }
if partition_method_automatic_luks_password_entry.text().to_string().is_empty() { if partition_method_automatic_luks_password_entry.text().to_string().is_empty() {
partition_method_automatic_luks_error_label.set_visible(true); partition_method_automatic_luks_error_label.set_visible(true);
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(false); bottom_next_button.set_sensitive(false);
} else { } else {
partition_method_automatic_luks_error_label.set_visible(false); partition_method_automatic_luks_error_label.set_visible(false);
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() { if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(true); bottom_next_button.set_sensitive(true);
} else { } else {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(false); bottom_next_button.set_sensitive(false);
} }
} }
@ -286,8 +293,10 @@ pub fn automatic_partitioning(
partition_method_automatic_luks_error_label.set_visible(false); partition_method_automatic_luks_error_label.set_visible(false);
partition_method_automatic_luks_error2_label.set_visible(false); partition_method_automatic_luks_error2_label.set_visible(false);
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() { if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(true); bottom_next_button.set_sensitive(true);
} else { } else {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(false); bottom_next_button.set_sensitive(false);
} }
} }
@ -303,12 +312,15 @@ pub fn automatic_partitioning(
} }
if partition_method_automatic_luks_password_entry.text().to_string().is_empty() { if partition_method_automatic_luks_password_entry.text().to_string().is_empty() {
partition_method_automatic_luks_error_label.set_visible(true); partition_method_automatic_luks_error_label.set_visible(true);
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(false); bottom_next_button.set_sensitive(false);
} else { } else {
partition_method_automatic_luks_error_label.set_visible(false); partition_method_automatic_luks_error_label.set_visible(false);
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() { if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(true); bottom_next_button.set_sensitive(true);
} else { } else {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(false); bottom_next_button.set_sensitive(false);
} }
} }
@ -317,8 +329,10 @@ pub fn automatic_partitioning(
partition_method_automatic_luks_error_label.set_visible(false); partition_method_automatic_luks_error_label.set_visible(false);
partition_method_automatic_luks_error2_label.set_visible(false); partition_method_automatic_luks_error2_label.set_visible(false);
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() { if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(true); bottom_next_button.set_sensitive(true);
} else { } else {
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
bottom_next_button.set_sensitive(false); bottom_next_button.set_sensitive(false);
} }
} }

View File

@ -129,8 +129,7 @@ pub fn keyboard_page(content_stack: &gtk::Stack) {
let keyboard_selection_expander_row_viewport = let keyboard_selection_expander_row_viewport =
gtk::ScrolledWindow::builder().height_request(355).build(); gtk::ScrolledWindow::builder().height_request(355).build();
let keyboard_selection_expander_row_viewport_box = gtk::ListBox::builder() let keyboard_selection_expander_row_viewport_box = gtk::ListBox::builder().build();
.build();
keyboard_selection_expander_row_viewport_box.add_css_class("boxed-list"); keyboard_selection_expander_row_viewport_box.add_css_class("boxed-list");
let keyboard_selection_expander_row_viewport_listbox = gtk::ListBox::builder() let keyboard_selection_expander_row_viewport_listbox = gtk::ListBox::builder()
@ -204,7 +203,13 @@ pub fn keyboard_page(content_stack: &gtk::Stack) {
.build(); .build();
let keyboard_layout_row = adw::ActionRow::builder() let keyboard_layout_row = adw::ActionRow::builder()
.activatable_widget(&keyboard_layout_checkbutton) .activatable_widget(&keyboard_layout_checkbutton)
.title(gnome_desktop::XkbInfo::new().layout_info(&keyboard_layout).unwrap().0.unwrap()) .title(
gnome_desktop::XkbInfo::new()
.layout_info(&keyboard_layout)
.unwrap()
.0
.unwrap(),
)
.subtitle(keyboard_layout.clone()) .subtitle(keyboard_layout.clone())
.build(); .build();
keyboard_layout_row.add_prefix(&keyboard_layout_checkbutton); keyboard_layout_row.add_prefix(&keyboard_layout_checkbutton);

View File

@ -127,8 +127,7 @@ pub fn language_page(content_stack: &gtk::Stack) {
let language_selection_expander_row_viewport = let language_selection_expander_row_viewport =
gtk::ScrolledWindow::builder().height_request(420).build(); gtk::ScrolledWindow::builder().height_request(420).build();
let language_selection_expander_row_viewport_box = gtk::ListBox::builder() let language_selection_expander_row_viewport_box = gtk::ListBox::builder().build();
.build();
language_selection_expander_row_viewport_box.add_css_class("boxed-list"); language_selection_expander_row_viewport_box.add_css_class("boxed-list");
language_selection_expander_row_viewport language_selection_expander_row_viewport
@ -187,10 +186,11 @@ pub fn language_page(content_stack: &gtk::Stack) {
for locale in locale_reader.lines() { for locale in locale_reader.lines() {
let locale = locale.unwrap(); let locale = locale.unwrap();
let locale_name_cli = Command::new("/usr/lib/pika/pika-installer-gtk4/scripts/locale-name.py") let locale_name_cli =
.arg(locale.clone()) Command::new("/usr/lib/pika/pika-installer-gtk4/scripts/locale-name.py")
.output() .arg(locale.clone())
.expect("failed to execute process"); .output()
.expect("failed to execute process");
let locale_name = String::from_utf8(locale_name_cli.stdout).unwrap(); let locale_name = String::from_utf8(locale_name_cli.stdout).unwrap();
let locale_clone = locale.clone(); let locale_clone = locale.clone();
let locale_checkbutton = gtk::CheckButton::builder() let locale_checkbutton = gtk::CheckButton::builder()
@ -212,7 +212,12 @@ pub fn language_page(content_stack: &gtk::Stack) {
lang_data_buffer.set_text(&locale); lang_data_buffer.set_text(&locale);
} }
})); }));
if current_locale.contains(&(locale_clone)) && current_locale != "C.UTF-8" && current_locale != "C" && current_locale != "C.utf8" && current_locale != "POSIX" { if current_locale.contains(&(locale_clone))
&& current_locale != "C.UTF-8"
&& current_locale != "C"
&& current_locale != "C.utf8"
&& current_locale != "POSIX"
{
locale_checkbutton.set_active(true); locale_checkbutton.set_active(true);
} }
} }

View File

@ -127,8 +127,7 @@ pub fn timezone_page(content_stack: &gtk::Stack) {
let timezone_selection_expander_row_viewport = let timezone_selection_expander_row_viewport =
gtk::ScrolledWindow::builder().height_request(420).build(); gtk::ScrolledWindow::builder().height_request(420).build();
let timezone_selection_expander_row_viewport_box = gtk::ListBox::builder() let timezone_selection_expander_row_viewport_box = gtk::ListBox::builder().build();
.build();
timezone_selection_expander_row_viewport_box.add_css_class("boxed-list"); timezone_selection_expander_row_viewport_box.add_css_class("boxed-list");
let timezone_selection_expander_row_viewport_listbox = gtk::ListBox::builder() let timezone_selection_expander_row_viewport_listbox = gtk::ListBox::builder()