From ea4b7aebf37a45850637f66aa27cbde4cee90d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 8 Jan 2011 23:37:54 +0000 Subject: [PATCH] * Reselect the previously chosen disk, if any, otherwise, as before, the boot drive. * Do not change the wizard buttons after they have been updated already due to the selection when building the UI. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40173 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/bootmanager/DrivesPage.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/apps/bootmanager/DrivesPage.cpp b/src/apps/bootmanager/DrivesPage.cpp index 00cd2f448d..7b3db7378d 100644 --- a/src/apps/bootmanager/DrivesPage.cpp +++ b/src/apps/bootmanager/DrivesPage.cpp @@ -218,14 +218,15 @@ DrivesPage::DrivesPage(WizardView* wizardView, const BootMenuList& menus, .Add(description, 0.5) .Add(scrollView, 1); + fWizardView->SetPreviousButtonHidden(!any); if (any) { fWizardView->SetPreviousButtonLabel( B_TRANSLATE_COMMENT("Uninstall", "Button")); - fWizardView->SetPreviousButtonHidden(false); - fWizardView->SetPreviousButtonEnabled(false); - fWizardView->SetPreviousButtonEnabled(false); + if (fDrivesView->CurrentSelection() == -1) { + fWizardView->SetPreviousButtonEnabled(false); + fWizardView->SetNextButtonEnabled(false); + } } else { - fWizardView->SetPreviousButtonHidden(true); fWizardView->SetNextButtonLabel( B_TRANSLATE_COMMENT("Quit", "Button")); } @@ -278,6 +279,7 @@ DrivesPage::MessageReceived(BMessage* message) bool DrivesPage::_FillDrivesView(const BootMenuList& menus) { + const char* selected = fSettings->FindString("disk"); bool any = false; BDiskDeviceRoster roster; @@ -288,7 +290,9 @@ DrivesPage::_FillDrivesView(const BootMenuList& menus) if (item->CanBeInstalled()) any = true; fDrivesView->AddItem(item); - if (item->IsBootDrive()) { + + if ((selected == NULL && item->IsBootDrive()) + || (selected != NULL && !strcmp(item->Path(), selected))) { fDrivesView->Select(fDrivesView->CountItems() - 1); _UpdateWizardButtons(item); }