* 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
This commit is contained in:
Axel Dörfler
2011-01-08 16:15:54 +00:00
parent 24a77ea0be
commit 4d0c990ef1
+13 -23
View File
@@ -52,38 +52,26 @@ PartitionsPage::~PartitionsPage()
void void
PartitionsPage::PageCompleted() PartitionsPage::PageCompleted()
{ {
int32 i; BGridLayout* layout = (BGridLayout*)fPartitions->GetLayout();
const int32 n = fPartitions->CountChildren(); int32 index = 0;
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<BControl*>(child);
if (control == NULL)
continue;
int32 index; for (int32 row = 0; row < layout->CountRows(); row += 3, index++) {
BMessage* message = control->Message(); BCheckBox* showBox
if (message == NULL || message->FindInt32("index", &index) != B_OK) = dynamic_cast<BCheckBox*>(layout->ItemAt(0, row)->View());
continue; BTextControl* nameControl
= dynamic_cast<BTextControl*>(layout->ItemAt(1, row)->View());
if (nameControl == NULL || showBox == NULL)
debugger("partitions page is broken");
BMessage partition; BMessage partition;
if (fSettings->FindMessage("partition", index, &partition) != B_OK) if (fSettings->FindMessage("partition", index, &partition) != B_OK)
continue; continue;
if (kMessageShow == message->what) { partition.ReplaceBool("show", showBox->Value() != 0);
partition.ReplaceBool("show", control->Value() == 1); partition.ReplaceString("name", nameControl->Text());
} else if (kMessageName == message->what &&
dynamic_cast<BTextControl*>(control) != NULL) {
partition.ReplaceString("name",
((BTextControl*)control)->Text());
}
fSettings->ReplaceMessage("partition", index, &partition); fSettings->ReplaceMessage("partition", index, &partition);
} }
}
} }
@@ -154,6 +142,8 @@ PartitionsPage::_FillPartitionsView(BView* view)
// name // name
BTextControl* nameControl = new BTextControl("name", "", BTextControl* nameControl = new BTextControl("name", "",
name.String(), _CreateControlMessage(kMessageName, i)); name.String(), _CreateControlMessage(kMessageName, i));
nameControl->SetExplicitMinSize(BSize(StringWidth("WWWWWWWWWWWWWW"),
B_SIZE_UNSET));
// size // size
BString sizeText; BString sizeText;