Minor cleanup, no functional change.
This commit is contained in:
parent
21c0a9529b
commit
2ffea8e8a3
@ -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;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
|
||||
private:
|
||||
BView* fView;
|
||||
BCheckBox* fActiveCB;
|
||||
BCheckBox* fActiveCheckBox;
|
||||
BString fParameters;
|
||||
};
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user