Minor cleanup, no functional change.

This commit is contained in:
Axel Dörfler 2012-06-17 19:56:56 +02:00
parent 21c0a9529b
commit 2ffea8e8a3
3 changed files with 12 additions and 11 deletions

View File

@ -18,14 +18,12 @@
PrimaryPartitionEditor::PrimaryPartitionEditor()
:
BPartitionParameterEditor(),
fView(NULL),
fActiveCB(NULL),
fParameters(NULL)
{
fActiveCB = new BCheckBox("active", B_TRANSLATE("Active partition"), NULL);
fActiveCheckBox = new BCheckBox("active", B_TRANSLATE("Active partition"),
NULL);
fView = new BGroupView(B_VERTICAL);
fView->AddChild(fActiveCB);
fView->AddChild(fActiveCheckBox);
}
@ -44,12 +42,13 @@ PrimaryPartitionEditor::View()
bool
PrimaryPartitionEditor::FinishedEditing()
{
if (fActiveCB->IsEnabled()) {
if (fActiveCB->Value() == B_CONTROL_ON)
if (fActiveCheckBox->IsEnabled()) {
if (fActiveCheckBox->Value() == B_CONTROL_ON)
fParameters.SetTo("active true ;");
else
fParameters.SetTo("active false ;");
} else fParameters.SetTo("");
} else
fParameters.SetTo("");
return true;
}
@ -69,6 +68,6 @@ PrimaryPartitionEditor::GetParameters(BString* parameters)
status_t
PrimaryPartitionEditor::PartitionTypeChanged(const char* type)
{
fActiveCB->SetEnabled(strcmp(type, kPartitionTypeIntelExtended) != 0);
fActiveCheckBox->SetEnabled(strcmp(type, kPartitionTypeIntelExtended) != 0);
return B_OK;
}

View File

@ -26,7 +26,7 @@ public:
private:
BView* fView;
BCheckBox* fActiveCB;
BCheckBox* fActiveCheckBox;
BString fParameters;
};

View File

@ -327,8 +327,10 @@ PartitionMapHandle::ValidateCreateChild(off_t* _offset, off_t* _size,
if (!type.SetType(typeString) || type.IsEmpty())
return B_BAD_VALUE;
if (type.IsExtended() && fPartitionMap.ExtendedPartitionIndex() >= 0)
if (type.IsExtended() && fPartitionMap.ExtendedPartitionIndex() >= 0) {
// There can only be a single extended partition
return B_BAD_VALUE;
}
// check name
if (name)