diff --git a/archinstall/lib/disk/disk_menu.py b/archinstall/lib/disk/disk_menu.py index 28400b2b47..703f408678 100644 --- a/archinstall/lib/disk/disk_menu.py +++ b/archinstall/lib/disk/disk_menu.py @@ -257,7 +257,7 @@ def _prev_disk_encryption(self, item: MenuItem) -> str | None: if enc_config: enc_type = enc_config.encryption_type - output = tr('Encryption type') + f': {EncryptionType.type_to_text(enc_type)}\n' + output = tr('Encryption type') + f': {enc_type.type_to_text()}\n' if enc_config.encryption_password: output += tr('Password') + f': {enc_config.encryption_password.hidden()}\n' diff --git a/archinstall/lib/disk/encryption_menu.py b/archinstall/lib/disk/encryption_menu.py index eeeb897065..e5f75f9ec1 100644 --- a/archinstall/lib/disk/encryption_menu.py +++ b/archinstall/lib/disk/encryption_menu.py @@ -184,7 +184,7 @@ def _prev_type(self) -> str | None: enc_type = self._item_group.find_by_key('encryption_type').value if enc_type: - enc_text = EncryptionType.type_to_text(enc_type) + enc_text = enc_type.type_to_text() return f'{tr("Encryption type")}: {enc_text}' return None @@ -252,9 +252,9 @@ def select_encryption_type( if not preset: preset = options[0] - preset_value = EncryptionType.type_to_text(preset) + preset_value = preset.type_to_text() - items = [MenuItem(EncryptionType.type_to_text(o), value=o) for o in options] + items = [MenuItem(o.type_to_text(), value=o) for o in options] group = MenuItemGroup(items) group.set_focus_by_value(preset_value) diff --git a/archinstall/lib/global_menu.py b/archinstall/lib/global_menu.py index dbf728a2cb..9c1cceffc9 100644 --- a/archinstall/lib/global_menu.py +++ b/archinstall/lib/global_menu.py @@ -5,7 +5,7 @@ from archinstall.lib.disk.disk_menu import DiskLayoutConfigurationMenu from archinstall.lib.models.application import ApplicationConfiguration, ZramConfiguration from archinstall.lib.models.authentication import AuthenticationConfiguration -from archinstall.lib.models.device import DiskLayoutConfiguration, DiskLayoutType, EncryptionType, FilesystemType, PartitionModification +from archinstall.lib.models.device import DiskLayoutConfiguration, DiskLayoutType, FilesystemType, PartitionModification from archinstall.lib.packages import list_available_packages from archinstall.tui.menu_item import MenuItem, MenuItemGroup @@ -375,7 +375,7 @@ def _prev_disk_config(self, item: MenuItem) -> str | None: output += '{}: {}'.format(tr('LVM configuration type'), disk_layout_conf.lvm_config.config_type.display_msg()) + '\n' if disk_layout_conf.disk_encryption: - output += tr('Disk encryption') + ': ' + EncryptionType.type_to_text(disk_layout_conf.disk_encryption.encryption_type) + '\n' + output += tr('Disk encryption') + ': ' + disk_layout_conf.disk_encryption.encryption_type.type_to_text() + '\n' if disk_layout_conf.btrfs_options: btrfs_options = disk_layout_conf.btrfs_options diff --git a/archinstall/lib/models/device.py b/archinstall/lib/models/device.py index 09a0945d8d..f069afc338 100644 --- a/archinstall/lib/models/device.py +++ b/archinstall/lib/models/device.py @@ -1444,11 +1444,10 @@ def text_to_type(cls, text: str) -> 'EncryptionType': mapping = cls._encryption_type_mapper() return mapping[text] - @classmethod - def type_to_text(cls, type_: 'EncryptionType') -> str: - mapping = cls._encryption_type_mapper() - type_to_text = {type_: text for text, type_ in mapping.items()} - return type_to_text[type_] + def type_to_text(self) -> str: + mapping = self._encryption_type_mapper() + type_to_text = {enctype: text for text, enctype in mapping.items()} + return type_to_text[self] class _DiskEncryptionSerialization(TypedDict):