From eac10866e24e2c36d550569ccce8069ad1952abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sun, 11 Sep 2022 19:02:00 +0200 Subject: [PATCH] DriveSetup: select the actual partition type instead of defaulting to BeFS Change-Id: Id73ad3398e802eb10b1928317bb9987ddee30eb6 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5658 Reviewed-by: Adrien Destugues --- src/apps/drivesetup/ChangeParametersPanel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/apps/drivesetup/ChangeParametersPanel.cpp b/src/apps/drivesetup/ChangeParametersPanel.cpp index 4b0ab15ab4..3c11cc2336 100644 --- a/src/apps/drivesetup/ChangeParametersPanel.cpp +++ b/src/apps/drivesetup/ChangeParametersPanel.cpp @@ -125,6 +125,10 @@ ChangeParametersPanel::CreateChangeControls(BPartition* partition, fTypePopUpMenu = new BPopUpMenu("Partition Type"); + const char* type = NULL; + if (partition != NULL) + type = partition->Type(); + int32 cookie = 0; BString supportedType; if (parent != NULL) { @@ -135,8 +139,11 @@ ChangeParametersPanel::CreateChangeControls(BPartition* partition, BMenuItem* item = new BMenuItem(supportedType, message); fTypePopUpMenu->AddItem(item); - if (strcmp(supportedType, kPartitionTypeBFS) == 0) + if (type != NULL) { + item->SetMarked(strcmp(supportedType, type) == 0); + } else if (strcmp(supportedType, kPartitionTypeBFS) == 0) { item->SetMarked(true); + } } }