Skip to content

Commit

Permalink
Merge branch 'main' into danirabbit/navigation-view
Browse files Browse the repository at this point in the history
  • Loading branch information
zeebok authored Sep 17, 2024
2 parents 1bbac23 + e31dbcf commit 73c8149
Show file tree
Hide file tree
Showing 24 changed files with 271 additions and 151 deletions.
62 changes: 55 additions & 7 deletions common/DBusStructures.vala
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,58 @@ public struct InstallerDaemon.Disk {
Partition[] partitions;
}

public enum InstallerDaemon.FileSystem {
NONE,
BTRFS,
EXT2,
EXT3,
EXT4,
F2FS,
FAT16,
FAT32,
NTFS,
SWAP,
XFS,
LVM,
LUKS;

public unowned string to_string () {
switch (this) {
case BTRFS:
return "btrfs";
case EXT2:
return "ext2";
case EXT3:
return "ext3";
case EXT4:
return "ext4";
case F2FS:
return "f2fs";
case FAT16:
return "fat16";
case FAT32:
return "fat32";
case NTFS:
return "ntfs";
case SWAP:
return "swap";
case XFS:
return "xfs";
case LVM:
return "lvm";
case LUKS:
return "luks";
case NONE:
default:
return "none";
}
}
}

public struct InstallerDaemon.Partition {
string device_path;

Distinst.FileSystem filesystem;
FileSystem filesystem;

uint64 start_sector;
uint64 end_sector;
Expand Down Expand Up @@ -62,18 +110,18 @@ public struct InstallerDaemon.Mount {
string parent_disk;
string mount_point;
uint64 sectors;
Distinst.FileSystem filesystem;
FileSystem filesystem;
MountFlags flags;

public bool is_valid_boot_mount () {
return filesystem == Distinst.FileSystem.FAT16
|| filesystem == Distinst.FileSystem.FAT32;
return filesystem == FileSystem.FAT16
|| filesystem == FileSystem.FAT32;
}

public bool is_valid_root_mount () {
return filesystem != Distinst.FileSystem.FAT16
&& filesystem != Distinst.FileSystem.FAT32
&& filesystem != Distinst.FileSystem.NTFS;
return filesystem != FileSystem.FAT16
&& filesystem != FileSystem.FAT32
&& filesystem != FileSystem.NTFS;
}

public bool is_lvm () {
Expand Down
82 changes: 74 additions & 8 deletions daemon/Daemon.vala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class InstallerDaemon.Daemon : GLib.Object {

partitions += Partition () {
device_path = string_from_utf8 (part.get_device_path ()),
filesystem = part.get_file_system (),
filesystem = to_common_fs (part.get_file_system ()),
start_sector = part.get_start_sector (),
end_sector = part.get_end_sector (),
sectors_used = part.sectors_used (disk.get_sector_size ()),
Expand Down Expand Up @@ -103,7 +103,7 @@ public class InstallerDaemon.Daemon : GLib.Object {

partitions += Partition () {
device_path = string_from_utf8 (part.get_device_path ()),
filesystem = part.get_file_system (),
filesystem = to_common_fs (part.get_file_system ()),
start_sector = part.get_start_sector (),
end_sector = part.get_end_sector (),
sectors_used = part.sectors_used (disk.get_sector_size ()),
Expand Down Expand Up @@ -149,7 +149,7 @@ public class InstallerDaemon.Daemon : GLib.Object {

partitions += Partition () {
device_path = string_from_utf8 (part.get_device_path ()),
filesystem = part.get_file_system (),
filesystem = to_common_fs (part.get_file_system ()),
start_sector = part.get_start_sector (),
end_sector = part.get_end_sector (),
sectors_used = part.sectors_used (disk.get_sector_size ()),
Expand Down Expand Up @@ -451,7 +451,7 @@ public class InstallerDaemon.Daemon : GLib.Object {
if (m.mount_point == "/boot/efi") {
if (m.is_valid_boot_mount ()) {
if (m.should_format ()) {
partition.format_with (m.filesystem);
partition.format_with (to_distinst_fs (m.filesystem));
}

partition.set_mount (m.mount_point);
Expand All @@ -460,7 +460,7 @@ public class InstallerDaemon.Daemon : GLib.Object {
throw new GLib.IOError.FAILED ("Unreachable code path -- EFI partition is invalid");
}
} else {
if (m.filesystem != Distinst.FileSystem.SWAP) {
if (m.filesystem != SWAP) {
partition.set_mount (m.mount_point);
}

Expand All @@ -469,7 +469,7 @@ public class InstallerDaemon.Daemon : GLib.Object {
}

if (m.should_format ()) {
partition.format_with (m.filesystem);
partition.format_with (to_distinst_fs (m.filesystem));
}
}
}
Expand Down Expand Up @@ -498,12 +498,12 @@ public class InstallerDaemon.Daemon : GLib.Object {
throw new GLib.IOError.FAILED ("could not find %s", m.partition_path);
}

if (m.filesystem != Distinst.FileSystem.SWAP) {
if (m.filesystem != SWAP) {
partition.set_mount (m.mount_point);
}

if (m.should_format ()) {
partition.format_and_keep_name (m.filesystem);
partition.format_and_keep_name (to_distinst_fs (m.filesystem));
}
}
}
Expand All @@ -513,6 +513,72 @@ public class InstallerDaemon.Daemon : GLib.Object {
builder.append_len ((string) input, input.length);
return (owned) builder.str;
}

private InstallerDaemon.FileSystem to_common_fs (Distinst.FileSystem fs) {
switch (fs) {
case BTRFS:
return InstallerDaemon.FileSystem.BTRFS;
case EXT2:
return InstallerDaemon.FileSystem.EXT2;
case EXT3:
return InstallerDaemon.FileSystem.EXT3;
case EXT4:
return InstallerDaemon.FileSystem.EXT4;
case F2FS:
return InstallerDaemon.FileSystem.F2FS;
case FAT16:
return InstallerDaemon.FileSystem.FAT16;
case FAT32:
return InstallerDaemon.FileSystem.FAT32;
case NONE:
return InstallerDaemon.FileSystem.NONE;
case NTFS:
return InstallerDaemon.FileSystem.NTFS;
case SWAP:
return InstallerDaemon.FileSystem.SWAP;
case XFS:
return InstallerDaemon.FileSystem.XFS;
case LVM:
return InstallerDaemon.FileSystem.LVM;
case LUKS:
return InstallerDaemon.FileSystem.LUKS;
default:
return InstallerDaemon.FileSystem.NONE;
}
}

private Distinst.FileSystem to_distinst_fs (InstallerDaemon.FileSystem fs) {
switch (fs) {
case BTRFS:
return Distinst.FileSystem.BTRFS;
case EXT2:
return Distinst.FileSystem.EXT2;
case EXT3:
return Distinst.FileSystem.EXT3;
case EXT4:
return Distinst.FileSystem.EXT4;
case F2FS:
return Distinst.FileSystem.F2FS;
case FAT16:
return Distinst.FileSystem.FAT16;
case FAT32:
return Distinst.FileSystem.FAT32;
case NONE:
return Distinst.FileSystem.NONE;
case NTFS:
return Distinst.FileSystem.NTFS;
case SWAP:
return Distinst.FileSystem.SWAP;
case XFS:
return Distinst.FileSystem.XFS;
case LVM:
return Distinst.FileSystem.LVM;
case LUKS:
return Distinst.FileSystem.LUKS;
default:
return Distinst.FileSystem.NONE;
}
}
}

private void on_bus_acquired (GLib.DBusConnection connection, string name) {
Expand Down
2 changes: 2 additions & 0 deletions data/io.elementary.installer.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
<gresource prefix="/io/elementary/installer/icons">
<file alias="io.elementary.installer.caution.svg" compressed="true" preprocess="xml-stripblanks">caution.svg</file>
<file alias="io.elementary.installer.emblem-downloads.svg" compressed="true" preprocess="xml-stripblanks">emblem-downloads.svg</file>
<file alias="24x24/categories/io.elementary.settings-symbolic.svg" compressed="true" preprocess="xml-stripblanks">io.elementary.settings.svg</file>
<file alias="24x24@2/categories/io.elementary.settings-symbolic.svg" compressed="true" preprocess="xml-stripblanks">io.elementary.settings.svg</file>
</gresource>
</gresources>
56 changes: 56 additions & 0 deletions data/io.elementary.settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 4 additions & 8 deletions po/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-11 22:12+0000\n"
"PO-Revision-Date: 2024-08-08 10:16+0000\n"
"PO-Revision-Date: 2024-09-12 22:16+0000\n"
"Last-Translator: David M <[email protected]>\n"
"Language-Team: Catalan <https://l10n.elementary.io/projects/installer/"
"installer/ca/>\n"
Expand Down Expand Up @@ -171,17 +171,13 @@ msgstr ""
"NVIDIA®."

#: src/Views/DriversView.vala:50
#, fuzzy
#| msgid ""
#| "Proprietary drivers can be installed later through AppCenter, but an "
#| "Internet connection will be required for all drivers."
msgid ""
"Proprietary drivers can be installed later through System Settings → System, "
"but an Internet connection will be required for all drivers."
msgstr ""
"Els controladors de propietat es poden instal·lar més tard mitjançant el "
"Centre d'aplicacions, però caldrà una connexió a Internet per a tots els "
"controladors."
"Els controladors de propietat es poden instal·lar més tard mitjançant "
"l'apartat de Sistema dels Paràmetres del sistema, però caldrà una connexió a "
"Internet per a tots els controladors."

#: src/Views/DriversView.vala:55
msgid ""
Expand Down
11 changes: 4 additions & 7 deletions po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: pantheon-calculator\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-11 22:12+0000\n"
"PO-Revision-Date: 2024-08-17 20:21+0000\n"
"PO-Revision-Date: 2024-09-16 17:16+0000\n"
"Last-Translator: Uwe S <[email protected]>\n"
"Language-Team: German <https://l10n.elementary.io/projects/installer/"
"installer/de/>\n"
Expand Down Expand Up @@ -177,16 +177,13 @@ msgstr ""
"Zur Installation der NVIDIA®-Treiber wird eine Internet-Verbindung benötigt."

#: src/Views/DriversView.vala:50
#, fuzzy
#| msgid ""
#| "Proprietary drivers can be installed later through AppCenter, but an "
#| "Internet connection will be required for all drivers."
msgid ""
"Proprietary drivers can be installed later through System Settings → System, "
"but an Internet connection will be required for all drivers."
msgstr ""
"Proprietäre Treiber können später im AppCenter installiert werden, "
"allerdings wird für alle Treiber eine Internet-Verbindung benötigt."
"Proprietäre Treiber können später über Systemeinstellungen → System "
"installiert werden, allerdings wird für alle Treiber eine Internet-"
"Verbindung benötigt."

#: src/Views/DriversView.vala:55
msgid ""
Expand Down
12 changes: 4 additions & 8 deletions po/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-11 22:12+0000\n"
"PO-Revision-Date: 2024-08-09 22:16+0000\n"
"PO-Revision-Date: 2024-09-12 22:16+0000\n"
"Last-Translator: Italo Felipe Capasso Ballesteros <[email protected]>\n"
"Language-Team: Spanish <https://l10n.elementary.io/projects/installer/"
"installer/es/>\n"
Expand Down Expand Up @@ -171,17 +171,13 @@ msgstr ""
"los procesadores gráficos de NVIDIA®."

#: src/Views/DriversView.vala:50
#, fuzzy
#| msgid ""
#| "Proprietary drivers can be installed later through AppCenter, but an "
#| "Internet connection will be required for all drivers."
msgid ""
"Proprietary drivers can be installed later through System Settings → System, "
"but an Internet connection will be required for all drivers."
msgstr ""
"Los controladores de propietarios se pueden instalar después a través del "
"Centro de Aplicaciones, pero se requiere de una conexión a Internet para "
"todos los controladores."
"Los controladores de propietarios se pueden instalar después a través de "
"Configuración del Sistema → Sistema, pero se requiere de una conexión a "
"Internet para todos los controladores."

#: src/Views/DriversView.vala:55
msgid ""
Expand Down
Loading

0 comments on commit 73c8149

Please sign in to comment.