Add some buttons to manual parting

This commit is contained in:
Ward from fusion-voyager-3 2024-08-19 10:28:09 +03:00
parent 0684a19ab2
commit 03a0f8ec74
2 changed files with 39 additions and 8 deletions

View File

@ -14,14 +14,9 @@
"manual_method_button_label": "Manually Partition The Drive",
"automatic_method_button_label": "Automatically Partition\nThe Drive",
"manual_partitioning_page_title": "Manual Disk Partitioning",
"manual_partitioning_page_subtitle": "Use This Page to Create a Custom Filesystem Table for PikaOS to install into.\nNotes:\n - This installer doesn't erase any data automatically, format your drives manually via gparted.\n - To Add a linux-swap partition set mountpoint to [SWAP]",
"open_gparted": "Open GPARTED",
"manual_part_note": " - Press the plus button below to begin adding filesystem entries.",
"refresh_part_table": "Refresh Partition Table",
"validate_fs_table": "Validate Filesystem Table",
"manual_partitioning_page_subtitle": "Use This Page to Create a Custom Filesystem Table for PikaOS to install into.\nNotes:\n - This Installer Doesn't Erase Any Data Automatically, Format Your Drives MANUALLY Via The Disk Utility.\n - To Add a linux-swap Partition Set Mountpoint to [SWAP]",
"fstab_status_valid": "Filesystem Table Status: All entries are valid!",
"partition_row_subtitle_needs_mapper": "This partition needs a mapper!",
"fstab_subvol_warn": "Filesystem Table Warning: Partition reuse check will be skipped due to subvol usage.",
"fstab_multiple_part_mountpoint_err": "Filesystem Table Error: Multiple partitions are configured to the same mountpoint!",
"fstab_no_mountpoint_err": "Filesystem Table Error: One or more partitions don't have a mountpoint configured!",
"fstab_no_partition_err": "Filesystem Table Error: One or more entries don't have a partition configured!",
@ -103,5 +98,8 @@
"advanced_home_seperation_selection_checkbutton_partition_label": "Yes, via a Partition",
"advanced_home_seperation_selection_checkbutton_none_label": "No",
"fs_unknown": "Unknown",
"drive_mount_add_button_label": "Add A Custom FIlesystem Entry"
"drive_mount_add_button_label": "Add A Custom FIlesystem Entry",
"open_disk_utility_button_label": "Open Disk Partitioning Utility",
"filesystem_table_refresh_button_label": "Refresh Filesystem Table",
"filesystem_table_validate_button_label": "Validate Filesystem Table"
}

View File

@ -4,7 +4,7 @@ use crate::partitioning_page::{get_partitions, CrypttabEntry, FstabEntry, Partit
use adw::gio;
use adw::prelude::*;
use glib::{clone, closure_local, ffi::gboolean};
use gtk::{glib, prelude::*};
use gtk::{glib, prelude::*, Orientation};
use std::{cell::RefCell, rc::Rc};
mod func;
@ -69,7 +69,40 @@ pub fn manual_partitioning_page(
&subvol_partition_array_refcell,
);
let open_disk_utility_button = gtk::Button::builder()
.label(t!("open_disk_utility_button_label"))
.margin_top(10)
.margin_end(5)
.halign(gtk::Align::Start)
.build();
let filesystem_table_refresh_button = gtk::Button::builder()
.label(t!("filesystem_table_refresh_button_label"))
.margin_top(10)
.margin_end(5)
.halign(gtk::Align::Start)
.build();
filesystem_table_refresh_button.add_css_class("destructive-action");
let filesystem_table_validate_button = gtk::Button::builder()
.label(t!("filesystem_table_validate_button_label"))
.margin_top(10)
.hexpand(true)
.halign(gtk::Align::End)
.build();
filesystem_table_validate_button.add_css_class("suggested-action");
let utility_buttons_box = gtk::Box::builder()
.orientation(Orientation::Horizontal)
.hexpand(true)
.build();
utility_buttons_box.append(&open_disk_utility_button);
utility_buttons_box.append(&filesystem_table_refresh_button);
utility_buttons_box.append(&filesystem_table_validate_button);
content_box.append(&drive_mounts_viewport);
content_box.append(&utility_buttons_box);
//
manual_partitioning_page.connect_closure(