From 510138aadfbb5c1f74cc3da933394426022087d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dancs=C3=B3=20R=C3=B3bert?= Date: Tue, 9 Apr 2019 18:25:09 +0200 Subject: [PATCH] DriveSetup: automatically select single disk When there is only one disk, automatically select it. Otherwise, do not select anything to make sure the user does not accidentally do things to the wrong disk. Change-Id: I834415bda6bc43692697bdfa9030f35ffc94048f Reviewed-on: https://review.haiku-os.org/c/1397 Reviewed-by: waddlesplash --- src/apps/drivesetup/DiskView.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/apps/drivesetup/DiskView.cpp b/src/apps/drivesetup/DiskView.cpp index e560e5beb3..6c72090f3a 100644 --- a/src/apps/drivesetup/DiskView.cpp +++ b/src/apps/drivesetup/DiskView.cpp @@ -439,6 +439,11 @@ void DiskView::SetDiskCount(int32 count) { fDiskCount = count; + if (count == 1) { + BMessage message(MSG_SELECTED_PARTITION_ID); + message.AddInt32("partition_id", 0); + Window()->PostMessage(&message); + } }