diff --git a/install_station/data.py b/install_station/data.py index 6e03150..cef1094 100644 --- a/install_station/data.py +++ b/install_station/data.py @@ -1,7 +1,6 @@ """ Contains the data class and some commonly use variables """ -import os import gettext be_name: str = "default" @@ -46,8 +45,8 @@ class InstallationData: ufs_config_data: list = [] # Installation type and mode - install_mode: str = "" # "install" or "try" - filesystem_type: str = "" # "zfs", "ufs", or "custom" + what_to_do: str = "" # "install" or "try" + install_type: str = "" # "zfs", "ufs", or "custom" # Language and localization language: str = "" @@ -79,8 +78,8 @@ class InstallationData: cls.boot = "" cls.zfs_config_data = [] cls.ufs_config_data = [] - cls.install_mode = "" - cls.filesystem_type = "" + cls.what_to_do = "" + cls.install_type = "" cls.language = "" cls.language_code = "" cls.keyboard_layout = "" diff --git a/install_station/install_type.py b/install_station/install_type.py index 410f2d2..384ed33 100644 --- a/install_station/install_type.py +++ b/install_station/install_type.py @@ -48,7 +48,7 @@ class InstallTypes: # Only respond to activation, not deactivation if widget.get_active(): cls.ne = val - InstallationData.filesystem_type = val + InstallationData.install_type = val print(f"Filesystem type selected: {val}") @classmethod @@ -58,7 +58,7 @@ class InstallTypes: Returns: str: Current filesystem type ('zfs' or 'custom') """ - return InstallationData.filesystem_type or cls.ne + return InstallationData.install_type or cls.ne @classmethod def get_model(cls) -> Gtk.Box: @@ -88,7 +88,7 @@ class InstallTypes: cls.vbox1.show() vbox2 = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, homogeneous=False, spacing=0) hbox1 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, homogeneous=False, spacing=0) - InstallationData.filesystem_type = cls.ne + InstallationData.install_type = cls.ne cls.vbox1.pack_start(hbox1, True, False, 0) hbox1.set_halign(Gtk.Align.CENTER) label = Gtk.Label(label=get_text("How do you want to install GhostBSD?")) diff --git a/install_station/interface_controller.py b/install_station/interface_controller.py index 17c01ef..1c08a7b 100644 --- a/install_station/interface_controller.py +++ b/install_station/interface_controller.py @@ -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.""" diff --git a/install_station/try_install.py b/install_station/try_install.py index 48aaa9e..d1325a0 100644 --- a/install_station/try_install.py +++ b/install_station/try_install.py @@ -48,7 +48,7 @@ class TryOrInstall: # Only respond to activation, not deactivation if widget.get_active(): cls.what = val - InstallationData.install_mode = val + InstallationData.what_to_do = val print(f"Mode selected: {val}") @classmethod @@ -62,7 +62,7 @@ class TryOrInstall: Returns: str: Current installation mode ('install' or 'try') """ - return InstallationData.install_mode or cls.what + return InstallationData.what_to_do or cls.what @classmethod def initialize(cls) -> None: @@ -78,7 +78,7 @@ class TryOrInstall: This method is called automatically by get_model() when the interface is first accessed. """ cls.what = 'install' # Default to install mode - InstallationData.install_mode = cls.what + InstallationData.what_to_do = cls.what cls.vbox1 = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, homogeneous=False, spacing=0) cls.vbox1.show()