Add missing logic for .xinitrc updates in "Try Live" mode

- Renamed `install_mode` to `what_to_do` and `filesystem_type` to `install_type` across modules for clarity and consistency
- Implemented `.xinitrc` configuration updates in "Try Live" mode
- Added logic to save ZFS configuration during installation process
- Improved button handling and code readability in the interface controller
This commit is contained in:
ericbsd
2025-12-09 19:43:45 -04:00
parent f8afc8002a
commit 1507a5a456
4 changed files with 22 additions and 38 deletions
+12 -27
View File
@@ -208,12 +208,14 @@ class Interface:
InstallationData.keyboard_variant,
InstallationData.keyboard_model_code
)
# Continue to network setup for live session
cls.next_setup_page()
with open('/usr/home/ghostbsd/.xinitrc', 'w') as xinitrc:
xinitrc.writelines('gsettings set org.mate.SettingsDaemon.plugins.housekeeping active true &\n')
xinitrc.writelines('gsettings set org.mate.screensaver lock-enabled false &\n')
xinitrc.writelines('exec ck-launch-session mate-session\n')
Gtk.main_quit()
elif page == 4:
Button.show_back()
if InstallationData.filesystem_type == "custom":
if InstallationData.install_type == "custom":
custom_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, homogeneous=False, spacing=0)
custom_box.show()
get_part = cls.custom_partition.get_model()
@@ -223,7 +225,7 @@ class Interface:
cls.page.next_page()
cls.page.show_all()
Button.next_button.set_sensitive(False)
elif InstallationData.filesystem_type == "zfs":
elif InstallationData.install_type == "zfs":
zfs_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, homogeneous=False, spacing=0)
zfs_box.show()
get_zfs = cls.full_zfs.get_model()
@@ -234,6 +236,11 @@ class Interface:
cls.page.show_all()
Button.next_button.set_sensitive(False)
elif page == 5:
# Save ZFS configuration before proceeding
if InstallationData.install_type == "zfs":
cls.full_zfs.save_selection()
# For custom partitioning, data is already saved in InstallationData
boot_manager_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, homogeneous=False, spacing=0)
boot_manager_box.show()
get_root = cls.boot_manager.get_model()
@@ -265,28 +272,6 @@ class Interface:
title_text = cls.page.get_tab_label_text(current_page_widget)
Window.set_title(title_text)
@classmethod
def next_setup_page(cls) -> None:
page = cls.page.get_current_page()
if page == 0:
Button.next_button.show()
Button.next_button.set_sensitive(False)
Window.set_title(get_text("Network Setup"))
net_setup_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, homogeneous=False, spacing=0)
net_setup_box.show()
model = cls.network_setup.get_model()
net_setup_box.pack_start(model, True, True, 0)
label = Gtk.Label(label=get_text("Network Setup"))
cls.page.insert_page(net_setup_box, label, 1)
cls.page.next_page()
cls.page.show_all()
if page == 1:
with open('/usr/home/ghostbsd/.xinitrc', 'w') as xinitrc:
xinitrc.writelines('gsettings set org.mate.SettingsDaemon.plugins.housekeeping active true &\n')
xinitrc.writelines('gsettings set org.mate.screensaver lock-enabled false &\n')
xinitrc.writelines('exec ck-launch-session mate-session\n')
Gtk.main_quit()
@classmethod
def back_page(cls, _widget: Gtk.Button) -> None:
"""Go back to the previous window."""