Fixed design issues in BPartitionParameterEditor.
* The user of an editor needed knowledge about the editor in order to make use of it. * Furthermore, the BPartitionParameterEditor exposed type specific functionality that it shouldn't know anything about, either. * We may now define a number of known parameters per editor type; right now there is only "type" as it's needed by DriveSetup. * Adapted all disk systems, and DriveSetup to the new API. * Renamed CreateParamsPanel, and InitializeParamsPanel to *ParametersPanel in DriveSetup. * They now share a common base class AbstractParametersPanel.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013, Axel Dörfler, [email protected].
|
||||
* Copyright 2009, Bryce Groff, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
@@ -9,26 +10,32 @@
|
||||
#include <View.h>
|
||||
|
||||
|
||||
// BPartitionParameterEditor
|
||||
class BMessage;
|
||||
class BPartition;
|
||||
class BVariant;
|
||||
|
||||
|
||||
class BPartitionParameterEditor {
|
||||
public:
|
||||
BPartitionParameterEditor();
|
||||
virtual ~BPartitionParameterEditor();
|
||||
|
||||
virtual bool FinishedEditing();
|
||||
virtual void SetTo(BPartition* partition);
|
||||
|
||||
void SetModificationMessage(BMessage* message);
|
||||
BMessage* ModificationMessage() const;
|
||||
|
||||
virtual BView* View();
|
||||
|
||||
virtual status_t GetParameters(BString* parameters);
|
||||
virtual bool ValidateParameters() const;
|
||||
virtual status_t ParameterChanged(const char* name,
|
||||
const BVariant& variant);
|
||||
|
||||
// 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);
|
||||
virtual status_t GetParameters(BString& parameters);
|
||||
|
||||
private:
|
||||
BMessage* fModificationMessage;
|
||||
};
|
||||
|
||||
|
||||
#endif //_PARTITION_PARAMETER_EDITOR_H
|
||||
#endif // _PARTITION_PARAMETER_EDITOR_H
|
||||
|
||||
Reference in New Issue
Block a user