Files
haiku-beta6/src/add-ons/disk_systems/intel/CreationParameterEditor.cpp
T
Ingo Weinhold 7f96148cac Patch by Bryce Groff with changes by myself:
* Added missing name parameter to the partitioning system module child creation
  and child creation validation hooks. Pass the name to them.
* Added BPartitionParameterEditor interface, which is/will be used for editing
  disk system specific parameters.
* Implemented partition parameter editors for BFS initialization and Intel
  partition map child creation.
* Fixed the incorrect supported child partition type iteration in the Intel
  partition map add-on. It does now return actual types.
* Handle the "active" flag parameter in the Intel partitioning system module.
* DriveSetup:
  - Replaced the "Create" submenu by a simple menu item. The type can now by
    chosen in the dialog.
  - Make use of initialization and child creation parameter editors. Some
    non-generic code has been moved to the respective editor implementations
    (BFS, intel partitioning system).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31658 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-20 20:29:16 +00:00

72 lines
1.2 KiB
C++

/*
* Copyright 2009, Bryce Groff, [email protected].
* Distributed under the terms of the MIT License.
*/
#include "CreationParameterEditor.h"
#include <DiskDeviceTypes.h>
#include <GroupLayoutBuilder.h>
#include <PartitionParameterEditor.h>
#include <View.h>
PrimaryPartitionEditor::PrimaryPartitionEditor()
:
BPartitionParameterEditor(),
fView(NULL),
fActiveCB(NULL),
fParameters(NULL)
{
fActiveCB = new BCheckBox("active", "Active Partition", NULL);
fView = BGroupLayoutBuilder(B_VERTICAL, 4)
.Add(fActiveCB)
;
}
PrimaryPartitionEditor::~PrimaryPartitionEditor()
{
}
BView*
PrimaryPartitionEditor::View()
{
return fView;
}
bool
PrimaryPartitionEditor::FinishedEditing()
{
if (fActiveCB->IsEnabled()) {
if (fActiveCB->Value() == B_CONTROL_ON)
fParameters.SetTo("active true ;");
else
fParameters.SetTo("active false ;");
} else fParameters.SetTo("");
return true;
}
status_t
PrimaryPartitionEditor::GetParameters(BString* parameters)
{
if (fParameters == NULL)
return B_BAD_VALUE;
*parameters = fParameters;
return B_OK;
}
status_t
PrimaryPartitionEditor::PartitionTypeChanged(const char* type)
{
fActiveCB->SetEnabled(strcmp(type, kPartitionTypeIntelExtended) != 0);
return B_OK;
}