Intel partition: activate the first created partition.
The default MBR relies on at least one partition being active. The first one sounds like a good choice. Fixes #7930.
This commit is contained in:
parent
a62c3f918c
commit
d0a662e20a
|
@ -301,7 +301,9 @@ PartitionMapHandle::GetParameterEditor(B_PARAMETER_EDITOR_TYPE type,
|
|||
if (type == B_CREATE_PARAMETER_EDITOR
|
||||
|| type == B_PROPERTIES_PARAMETER_EDITOR) {
|
||||
try {
|
||||
*editor = new PrimaryPartitionEditor();
|
||||
BMutablePartition* partition = Partition();
|
||||
int32 count = partition->CountChildren();
|
||||
*editor = new PrimaryPartitionEditor(count == 0);
|
||||
} catch (std::bad_alloc) {
|
||||
return B_NO_MEMORY;
|
||||
}
|
||||
|
|
|
@ -19,12 +19,15 @@
|
|||
#define B_TRANSLATION_CONTEXT "PrimaryPartitionEditor"
|
||||
|
||||
|
||||
PrimaryPartitionEditor::PrimaryPartitionEditor()
|
||||
PrimaryPartitionEditor::PrimaryPartitionEditor(bool first)
|
||||
{
|
||||
fActiveCheckBox = new BCheckBox("active", B_TRANSLATE("Active partition"),
|
||||
NULL);
|
||||
fView = new BGroupView(B_VERTICAL);
|
||||
fView->AddChild(fActiveCheckBox);
|
||||
|
||||
// The first partition is active by default. Others are not.
|
||||
fActiveCheckBox->SetValue(first);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
class PrimaryPartitionEditor : public BPartitionParameterEditor {
|
||||
public:
|
||||
PrimaryPartitionEditor();
|
||||
PrimaryPartitionEditor(bool first);
|
||||
virtual ~PrimaryPartitionEditor();
|
||||
|
||||
virtual BView* View();
|
||||
|
|
Loading…
Reference in New Issue