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
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
class BDiskDeviceParameterEditor;
|
||||
class BPartitionParameterEditor;
|
||||
class BList;
|
||||
class BMutablePartition;
|
||||
class BPartitionHandle;
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
const BMutablePartition* partition);
|
||||
virtual status_t GetInitializationParameterEditor(
|
||||
const BMutablePartition* partition,
|
||||
BDiskDeviceParameterEditor** editor);
|
||||
BPartitionParameterEditor** editor);
|
||||
virtual status_t ValidateInitialize(
|
||||
const BMutablePartition* partition,
|
||||
BString* name, const char* parameters);
|
||||
@@ -107,10 +107,10 @@ public:
|
||||
const char* type);
|
||||
|
||||
virtual status_t GetContentParameterEditor(
|
||||
BDiskDeviceParameterEditor** editor);
|
||||
BPartitionParameterEditor** editor);
|
||||
virtual status_t GetParameterEditor(
|
||||
const BMutablePartition* child,
|
||||
BDiskDeviceParameterEditor** editor);
|
||||
BPartitionParameterEditor** editor);
|
||||
virtual status_t ValidateSetContentParameters(
|
||||
const char* parameters);
|
||||
virtual status_t ValidateSetParameters(
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
|
||||
virtual status_t GetChildCreationParameterEditor(
|
||||
const char* type,
|
||||
BDiskDeviceParameterEditor** editor);
|
||||
BPartitionParameterEditor** editor);
|
||||
virtual status_t ValidateCreateChild(off_t* offset,
|
||||
off_t* size, const char* type,
|
||||
BString* name, const char* parameters);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef _PARTITION_H
|
||||
#define _PARTITION_H
|
||||
|
||||
|
||||
#include <DiskDeviceDefs.h>
|
||||
#include <Messenger.h>
|
||||
#include <Mime.h>
|
||||
@@ -14,7 +15,7 @@
|
||||
|
||||
class BBitmap;
|
||||
class BDiskDevice;
|
||||
class BDiskDeviceParameterEditor;
|
||||
class BPartitionParameterEditor;
|
||||
class BDiskDeviceVisitor;
|
||||
class BDiskSystem;
|
||||
class BMutablePartition;
|
||||
@@ -128,13 +129,13 @@ public:
|
||||
|
||||
bool CanEditParameters() const;
|
||||
status_t GetParameterEditor(
|
||||
BDiskDeviceParameterEditor** editor);
|
||||
BPartitionParameterEditor** editor);
|
||||
status_t SetParameters(const char* parameters);
|
||||
|
||||
bool CanEditContentParameters(
|
||||
bool* whileMounted = NULL) const;
|
||||
status_t GetContentParameterEditor(
|
||||
BDiskDeviceParameterEditor** editor);
|
||||
BPartitionParameterEditor** editor);
|
||||
status_t SetContentParameters(const char* parameters);
|
||||
|
||||
status_t GetNextSupportedType(int32 *cookie,
|
||||
@@ -152,7 +153,7 @@ public:
|
||||
bool CanInitialize(const char* diskSystem) const;
|
||||
status_t GetInitializationParameterEditor(
|
||||
const char* system,
|
||||
BDiskDeviceParameterEditor** editor) const;
|
||||
BPartitionParameterEditor** editor) const;
|
||||
status_t ValidateInitialize(const char* diskSystem,
|
||||
BString* name, const char* parameters);
|
||||
status_t Initialize(const char* diskSystem,
|
||||
@@ -164,7 +165,7 @@ public:
|
||||
bool CanCreateChild() const;
|
||||
status_t GetChildCreationParameterEditor(
|
||||
const char* type,
|
||||
BDiskDeviceParameterEditor** editor) const;
|
||||
BPartitionParameterEditor** editor) const;
|
||||
status_t ValidateCreateChild(off_t* start, off_t* size,
|
||||
const char* type, BString* name,
|
||||
const char* parameters) const;
|
||||
@@ -176,6 +177,8 @@ public:
|
||||
bool CanDeleteChild(int32 index) const;
|
||||
status_t DeleteChild(int32 index);
|
||||
|
||||
bool SupportsChildName() const;
|
||||
|
||||
private:
|
||||
class Delegate;
|
||||
|
||||
@@ -230,4 +233,5 @@ private:
|
||||
Delegate* fDelegate;
|
||||
};
|
||||
|
||||
|
||||
#endif // _PARTITION_H
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2009, Bryce Groff, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PARTITION_PARAMETER_EDITOR_H
|
||||
#define _PARTITION_PARAMETER_EDITOR_H
|
||||
|
||||
|
||||
#include <View.h>
|
||||
|
||||
|
||||
// BPartitionParameterEditor
|
||||
class BPartitionParameterEditor {
|
||||
public:
|
||||
BPartitionParameterEditor();
|
||||
virtual ~BPartitionParameterEditor();
|
||||
|
||||
virtual bool FinishedEditing();
|
||||
|
||||
virtual BView* View();
|
||||
|
||||
virtual status_t GetParameters(BString* parameters);
|
||||
|
||||
// TODO: Those are child creation specific and shouldn't be in a generic
|
||||
// interface. Something like a
|
||||
// GenericPartitionParameterChanged(partition_parameter_type,
|
||||
// const BVariant&)
|
||||
// would be better.
|
||||
virtual status_t PartitionTypeChanged(const char* type);
|
||||
virtual status_t PartitionNameChanged(const char* name);
|
||||
};
|
||||
|
||||
|
||||
#endif //_PARTITION_PARAMETER_EDITOR_H
|
||||
Reference in New Issue
Block a user