From 4d0c990ef1bd7ef1b3fb80d79f07e1d585e552f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 8 Jan 2011 16:15:54 +0000 Subject: [PATCH] * Forgot to change the data retrieval due to the layout changes; now works again, and will also drop into debugger if broken again. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40155 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/bootmanager/PartitionsPage.cpp | 44 ++++++++++--------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/src/apps/bootmanager/PartitionsPage.cpp b/src/apps/bootmanager/PartitionsPage.cpp index 49699965da..9df64d7430 100644 --- a/src/apps/bootmanager/PartitionsPage.cpp +++ b/src/apps/bootmanager/PartitionsPage.cpp @@ -52,37 +52,25 @@ PartitionsPage::~PartitionsPage() void PartitionsPage::PageCompleted() { - int32 i; - const int32 n = fPartitions->CountChildren(); - for (i = 0; i < n; i ++) { - BView* row = fPartitions->ChildAt(i); - int32 j; - const int32 m = row->CountChildren(); - for (j = 0; j < m; j ++) { - BView* child = row->ChildAt(j); - BControl* control = dynamic_cast(child); - if (control == NULL) - continue; + BGridLayout* layout = (BGridLayout*)fPartitions->GetLayout(); + int32 index = 0; - int32 index; - BMessage* message = control->Message(); - if (message == NULL || message->FindInt32("index", &index) != B_OK) - continue; + for (int32 row = 0; row < layout->CountRows(); row += 3, index++) { + BCheckBox* showBox + = dynamic_cast(layout->ItemAt(0, row)->View()); + BTextControl* nameControl + = dynamic_cast(layout->ItemAt(1, row)->View()); + if (nameControl == NULL || showBox == NULL) + debugger("partitions page is broken"); - BMessage partition; - if (fSettings->FindMessage("partition", index, &partition) != B_OK) - continue; + BMessage partition; + if (fSettings->FindMessage("partition", index, &partition) != B_OK) + continue; - if (kMessageShow == message->what) { - partition.ReplaceBool("show", control->Value() == 1); - } else if (kMessageName == message->what && - dynamic_cast(control) != NULL) { - partition.ReplaceString("name", - ((BTextControl*)control)->Text()); - } + partition.ReplaceBool("show", showBox->Value() != 0); + partition.ReplaceString("name", nameControl->Text()); - fSettings->ReplaceMessage("partition", index, &partition); - } + fSettings->ReplaceMessage("partition", index, &partition); } } @@ -154,6 +142,8 @@ PartitionsPage::_FillPartitionsView(BView* view) // name BTextControl* nameControl = new BTextControl("name", "", name.String(), _CreateControlMessage(kMessageName, i)); + nameControl->SetExplicitMinSize(BSize(StringWidth("WWWWWWWWWWWWWW"), + B_SIZE_UNSET)); // size BString sizeText;