Minor cleanup, no functional change.
This commit is contained in:
@@ -18,14 +18,12 @@
|
|||||||
|
|
||||||
PrimaryPartitionEditor::PrimaryPartitionEditor()
|
PrimaryPartitionEditor::PrimaryPartitionEditor()
|
||||||
:
|
:
|
||||||
BPartitionParameterEditor(),
|
|
||||||
fView(NULL),
|
|
||||||
fActiveCB(NULL),
|
|
||||||
fParameters(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 = new BGroupView(B_VERTICAL);
|
||||||
fView->AddChild(fActiveCB);
|
fView->AddChild(fActiveCheckBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -44,12 +42,13 @@ PrimaryPartitionEditor::View()
|
|||||||
bool
|
bool
|
||||||
PrimaryPartitionEditor::FinishedEditing()
|
PrimaryPartitionEditor::FinishedEditing()
|
||||||
{
|
{
|
||||||
if (fActiveCB->IsEnabled()) {
|
if (fActiveCheckBox->IsEnabled()) {
|
||||||
if (fActiveCB->Value() == B_CONTROL_ON)
|
if (fActiveCheckBox->Value() == B_CONTROL_ON)
|
||||||
fParameters.SetTo("active true ;");
|
fParameters.SetTo("active true ;");
|
||||||
else
|
else
|
||||||
fParameters.SetTo("active false ;");
|
fParameters.SetTo("active false ;");
|
||||||
} else fParameters.SetTo("");
|
} else
|
||||||
|
fParameters.SetTo("");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -69,6 +68,6 @@ PrimaryPartitionEditor::GetParameters(BString* parameters)
|
|||||||
status_t
|
status_t
|
||||||
PrimaryPartitionEditor::PartitionTypeChanged(const char* type)
|
PrimaryPartitionEditor::PartitionTypeChanged(const char* type)
|
||||||
{
|
{
|
||||||
fActiveCB->SetEnabled(strcmp(type, kPartitionTypeIntelExtended) != 0);
|
fActiveCheckBox->SetEnabled(strcmp(type, kPartitionTypeIntelExtended) != 0);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
BView* fView;
|
BView* fView;
|
||||||
BCheckBox* fActiveCB;
|
BCheckBox* fActiveCheckBox;
|
||||||
BString fParameters;
|
BString fParameters;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -327,8 +327,10 @@ PartitionMapHandle::ValidateCreateChild(off_t* _offset, off_t* _size,
|
|||||||
if (!type.SetType(typeString) || type.IsEmpty())
|
if (!type.SetType(typeString) || type.IsEmpty())
|
||||||
return B_BAD_VALUE;
|
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;
|
return B_BAD_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
// check name
|
// check name
|
||||||
if (name)
|
if (name)
|
||||||
|
|||||||
Reference in New Issue
Block a user