* 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
This commit is contained in:
Axel Dörfler 2011-01-08 23:37:54 +00:00
parent 2004d8c100
commit ea4b7aebf3

View File

@ -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);
}