[haiku-commits] r40173 - haiku/trunk/src/apps/bootmanager

Author: axeld
Date: 2011-01-09 00:37:54 +0100 (Sun, 09 Jan 2011)
New Revision: 40173
Changeset: http://dev.haiku-os.org/changeset/40173

Modified:
   haiku/trunk/src/apps/bootmanager/DrivesPage.cpp
Log:
* 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.


Modified: haiku/trunk/src/apps/bootmanager/DrivesPage.cpp
===================================================================
--- haiku/trunk/src/apps/bootmanager/DrivesPage.cpp     2011-01-08 23:17:18 UTC 
(rev 40172)
+++ haiku/trunk/src/apps/bootmanager/DrivesPage.cpp     2011-01-08 23:37:54 UTC 
(rev 40173)
@@ -218,14 +218,15 @@
                .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 @@
 bool
 DrivesPage::_FillDrivesView(const BootMenuList& menus)
 {
+       const char* selected = fSettings->FindString("disk");
        bool any = false;
 
        BDiskDeviceRoster roster;
@@ -288,7 +290,9 @@
                        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);
                        }


Other related posts:

  • » [haiku-commits] r40173 - haiku/trunk/src/apps/bootmanager - axeld