hrev45226 adds 4 changesets to branch 'master' old head: b7733e0655c1bb70a465f1255373494de3609365 new head: 4ec2ca4e1645f59237d611942f08f442370c5cfe overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=4ec2ca4+%5Eb7733e0 ---------------------------------------------------------------------------- a206dee: DriveSetup: improved default window size. * The default width will no longer make the parameters and partition type columns visible. * Fixed default size of those two columns -- I did not notice that the column state was being restored before, and thought it would just be another oddity of BColumnListView :-) * Since MainWindow maintains its size pretty much itself, the constructor no longer gets a BRect. * The window will now also be resized vertically to make space for all the partitions (only affects first launch without settings file). * Also made the window a bit higher by default. 4435225: 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. 9deef7d: DriveSetup: show content type if there is no type. 4ec2ca4: DriveSetup: renamed some files, fixed catalog. * Already renamed the classes within those files earlier. * The AbstractParametersPanel class was missing from the catalog. [ Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> ] ---------------------------------------------------------------------------- 28 files changed, 868 insertions(+), 848 deletions(-) .../private/storage/PartitionParameterEditor.h | 29 +- src/add-ons/disk_systems/bfs/BFSAddOn.rdef | 6 +- .../bfs/InitializeParameterEditor.cpp | 93 +++--- .../disk_systems/bfs/InitializeParameterEditor.h | 21 +- .../intel/CreationParameterEditor.cpp | 44 ++- .../disk_systems/intel/CreationParameterEditor.h | 11 +- src/add-ons/disk_systems/intel/Jamfile | 2 +- .../ntfs/InitializeParameterEditor.cpp | 58 ++-- .../ntfs/InitializeParameterEditor.h | 15 +- src/add-ons/disk_systems/ntfs/Jamfile | 6 + src/add-ons/disk_systems/ntfs/NTFSAddOn.rdef | 14 +- src/apps/drivesetup/AbstractParametersPanel.cpp | 248 ++++++++++++++ src/apps/drivesetup/AbstractParametersPanel.h | 58 ++++ src/apps/drivesetup/CreateParametersPanel.cpp | 187 +++++++++++ ...eateParamsPanel.h => CreateParametersPanel.h} | 35 +- src/apps/drivesetup/CreateParamsPanel.cpp | 326 ------------------- src/apps/drivesetup/DriveSetup.cpp | 4 +- src/apps/drivesetup/InitParametersPanel.cpp | 56 ++++ src/apps/drivesetup/InitParametersPanel.h | 27 ++ src/apps/drivesetup/InitParamsPanel.cpp | 254 --------------- src/apps/drivesetup/InitParamsPanel.h | 45 --- src/apps/drivesetup/Jamfile | 10 +- src/apps/drivesetup/MainWindow.cpp | 52 +-- src/apps/drivesetup/MainWindow.h | 2 +- src/apps/drivesetup/PartitionList.cpp | 17 +- src/apps/drivesetup/PartitionList.h | 2 + src/apps/drivesetup/Support.h | 5 - .../disk_device/PartitionParameterEditor.cpp | 89 +++-- ############################################################################ Commit: a206dee38ea6adfa82f4cfeae22fe748deaf0477 URL: http://cgit.haiku-os.org/haiku/commit/?id=a206dee Author: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> Date: Fri Feb 1 23:53:30 2013 UTC DriveSetup: improved default window size. * The default width will no longer make the parameters and partition type columns visible. * Fixed default size of those two columns -- I did not notice that the column state was being restored before, and thought it would just be another oddity of BColumnListView :-) * Since MainWindow maintains its size pretty much itself, the constructor no longer gets a BRect. * The window will now also be resized vertically to make space for all the partitions (only affects first launch without settings file). * Also made the window a bit higher by default. ---------------------------------------------------------------------------- diff --git a/src/apps/drivesetup/DriveSetup.cpp b/src/apps/drivesetup/DriveSetup.cpp index bff334f..e3220c1 100644 --- a/src/apps/drivesetup/DriveSetup.cpp +++ b/src/apps/drivesetup/DriveSetup.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 Haiku Inc. All rights reserved. + * Copyright 2002-2013 Haiku Inc. All rights reserved. * Distributed under the terms of the MIT license. * * Authors: @@ -36,7 +36,7 @@ DriveSetup::~DriveSetup() void DriveSetup::ReadyToRun() { - fWindow = new MainWindow(BRect(50, 50, 600, 450)); + fWindow = new MainWindow(); if (_RestoreSettings() != B_OK) fWindow->ApplyDefaultSettings(); fWindow->Show(); diff --git a/src/apps/drivesetup/MainWindow.cpp b/src/apps/drivesetup/MainWindow.cpp index 2cd67d7..6660cd5 100644 --- a/src/apps/drivesetup/MainWindow.cpp +++ b/src/apps/drivesetup/MainWindow.cpp @@ -3,11 +3,11 @@ * Distributed under the terms of the MIT license. * * Authors: - * Erik Jaesler <ejakowatz@xxxxxxxxxxxxxxxxxxxxx> * Ithamar R. Adema <ithamar@xxxxxxx> - * Ingo Weinhold <ingo_weinhold@xxxxxx> * Stephan Aßmus <superstippi@xxxxxx> * Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. + * Erik Jaesler <ejakowatz@xxxxxxxxxxxxxxxxxxxxx> + * Ingo Weinhold <ingo_weinhold@xxxxxx> */ @@ -193,10 +193,10 @@ enum { // #pragma mark - -MainWindow::MainWindow(BRect frame) +MainWindow::MainWindow() : - BWindow(frame, B_TRANSLATE_SYSTEM_NAME("DriveSetup"), B_DOCUMENT_WINDOW, - B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE), + BWindow(BRect(50, 50, 600, 500), B_TRANSLATE_SYSTEM_NAME("DriveSetup"), + B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE), fCurrentDisk(NULL), fCurrentPartitionID(-1), fSpaceIDMap() @@ -440,17 +440,26 @@ MainWindow::ApplyDefaultSettings() fListView->ResizeAllColumnsToPreferred(); // Adjust window size for convenience - float enlargeBy = fListView->PreferredSize().width + BScreen screen(this); + float windowWidth = Frame().Width(); + float windowHeight = Frame().Height(); + + float enlargeWidthBy = fListView->PreferredSize().width - fListView->Bounds().Width(); - if (enlargeBy > 0.0f) { - BScreen screen(this); - float windowWidth = Frame().Width() + enlargeBy; - if (windowWidth > screen.Frame().Width() - 20.0f) - windowWidth = screen.Frame().Width() - 20.0f; + float enlargeHeightBy = fListView->PreferredSize().height + - fListView->Bounds().Height(); - ResizeTo(windowWidth, Frame().Height()); - } + if (enlargeWidthBy > 0.0f) + windowWidth += enlargeWidthBy; + if (enlargeHeightBy > 0.0f) + windowHeight += enlargeHeightBy; + + if (windowWidth > screen.Frame().Width() - 20.0f) + windowWidth = screen.Frame().Width() - 20.0f; + if (windowHeight > screen.Frame().Height() - 20.0f) + windowHeight = screen.Frame().Height() - 20.0f; + ResizeTo(windowWidth, windowHeight); CenterOnScreen(); Unlock(); diff --git a/src/apps/drivesetup/MainWindow.h b/src/apps/drivesetup/MainWindow.h index 048ac27..26c7df4 100644 --- a/src/apps/drivesetup/MainWindow.h +++ b/src/apps/drivesetup/MainWindow.h @@ -31,7 +31,7 @@ enum { class MainWindow : public BWindow { public: - MainWindow(BRect frame); + MainWindow(); virtual ~MainWindow(); // BWindow interface diff --git a/src/apps/drivesetup/PartitionList.cpp b/src/apps/drivesetup/PartitionList.cpp index 378e289..098b2d3 100644 --- a/src/apps/drivesetup/PartitionList.cpp +++ b/src/apps/drivesetup/PartitionList.cpp @@ -341,9 +341,9 @@ PartitionListView::PartitionListView(const BRect& frame, uint32 resizeMode) B_TRUNCATE_MIDDLE), kMountedAtColumn); AddColumn(new PartitionColumn(B_TRANSLATE("Size"), 100, 50, 500, B_TRUNCATE_END, B_ALIGN_RIGHT), kSizeColumn); - AddColumn(new PartitionColumn(B_TRANSLATE("Parameters"), 200, 50, 500, + AddColumn(new PartitionColumn(B_TRANSLATE("Parameters"), 100, 50, 500, B_TRUNCATE_END), kParametersColumn); - AddColumn(new PartitionColumn(B_TRANSLATE("Partition type"), 100, 50, 500, + AddColumn(new PartitionColumn(B_TRANSLATE("Partition type"), 200, 50, 500, B_TRUNCATE_END), kPartitionTypeColumn); SetSortingEnabled(false); @@ -466,6 +466,17 @@ PartitionListView::AddSpace(partition_id parentID, partition_id id, } +BSize +PartitionListView::PreferredSize() +{ + // Remove default size for parameters + partition type column + BSize size = BColumnListView::PreferredSize(); + size.width -= ColumnAt(kParametersColumn)->Width() + + ColumnAt(kPartitionTypeColumn)->Width(); + return size; +} + + int32 PartitionListView::_InsertIndexForOffset(PartitionListRow* parent, off_t offset) const diff --git a/src/apps/drivesetup/PartitionList.h b/src/apps/drivesetup/PartitionList.h index 8ed7952..acc0374 100644 --- a/src/apps/drivesetup/PartitionList.h +++ b/src/apps/drivesetup/PartitionList.h @@ -104,6 +104,8 @@ public: PartitionListRow* AddSpace(partition_id parent, partition_id id, off_t offset, off_t size); + virtual BSize PreferredSize(); + private: int32 _InsertIndexForOffset(PartitionListRow* parent, off_t offset) const; ############################################################################ Commit: 443522551e70c8a595525700b2b7b445db37865d URL: http://cgit.haiku-os.org/haiku/commit/?id=4435225 Author: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> Date: Fri Feb 1 23:59:55 2013 UTC 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. ---------------------------------------------------------------------------- diff --git a/headers/private/storage/PartitionParameterEditor.h b/headers/private/storage/PartitionParameterEditor.h index 701d84e..757d6d1 100644 --- a/headers/private/storage/PartitionParameterEditor.h +++ b/headers/private/storage/PartitionParameterEditor.h @@ -1,4 +1,5 @@ /* + * Copyright 2013, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. * Copyright 2009, Bryce Groff, brycegroff@xxxxxxxxx. * 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); + + 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); +private: + BMessage* fModificationMessage; }; -#endif //_PARTITION_PARAMETER_EDITOR_H +#endif // _PARTITION_PARAMETER_EDITOR_H diff --git a/src/add-ons/disk_systems/bfs/BFSAddOn.rdef b/src/add-ons/disk_systems/bfs/BFSAddOn.rdef index 862d9db..3c2589d 100644 --- a/src/add-ons/disk_systems/bfs/BFSAddOn.rdef +++ b/src/add-ons/disk_systems/bfs/BFSAddOn.rdef @@ -1,7 +1,3 @@ -/* - * BFSAddOn.rdef - */ - resource app_signature "application/x-vnd.Haiku-BFSAddOn"; resource app_version { @@ -11,5 +7,5 @@ resource app_version { variety = 0, internal = 0, short_info = "1.0.0", - long_info = "Haiku BFS disk add-on." + long_info = "BFS disk add-on." }; diff --git a/src/add-ons/disk_systems/bfs/InitializeParameterEditor.cpp b/src/add-ons/disk_systems/bfs/InitializeParameterEditor.cpp index 50e1253..99ac652 100644 --- a/src/add-ons/disk_systems/bfs/InitializeParameterEditor.cpp +++ b/src/add-ons/disk_systems/bfs/InitializeParameterEditor.cpp @@ -1,4 +1,5 @@ /* + * Copyright 2013, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. * Copyright 2009-2010, Stephan Aßmus <superstippi@xxxxxx> * Copyright 2009, Bryce Groff, brycegroff@xxxxxxxxx. * Distributed under the terms of the MIT License. @@ -16,10 +17,11 @@ #include <GridLayoutBuilder.h> #include <MenuField.h> #include <MenuItem.h> -#include <PartitionParameterEditor.h> +#include <Partition.h> #include <PopUpMenu.h> #include <SpaceLayoutItem.h> #include <TextControl.h> +#include <Variant.h> #include <View.h> #include <Window.h> @@ -36,10 +38,9 @@ InitializeBFSEditor::InitializeBFSEditor() : BPartitionParameterEditor(), fView(NULL), - fNameTC(NULL), - fBlockSizeMF(NULL), - fUseIndicesCB(NULL), - fParameters(NULL) + fNameControl(NULL), + fBlockSizeMenuField(NULL), + fUseIndicesCheckBox(NULL) { _CreateViewControls(); } @@ -50,6 +51,15 @@ InitializeBFSEditor::~InitializeBFSEditor() } +void +InitializeBFSEditor::SetTo(BPartition* partition) +{ + BString name = partition->ContentName(); + if (!name.IsEmpty()) + fNameControl->SetText(name.String()); +} + + BView* InitializeBFSEditor::View() { @@ -58,41 +68,39 @@ InitializeBFSEditor::View() bool -InitializeBFSEditor::FinishedEditing() +InitializeBFSEditor::ValidateParameters() const { - fParameters = ""; - if (BMenuItem* item = fBlockSizeMF->Menu()->FindMarked()) { - const char* size; - BMessage* message = item->Message(); - if (!message || message->FindString("size", &size) < B_OK) - size = "2048"; - // TODO: use libroot driver settings API - fParameters << "block_size " << size << ";\n"; - } - if (fUseIndicesCB->Value() == B_CONTROL_OFF) - fParameters << "noindex;\n"; - - fParameters << "name \"" << fNameTC->Text() << "\";\n"; - - return true; + // The name must be set + return fNameControl->TextView()->TextLength() > 0; } status_t -InitializeBFSEditor::GetParameters(BString* parameters) +InitializeBFSEditor::ParameterChanged(const char* name, const BVariant& variant) { - if (parameters == NULL) - return B_BAD_VALUE; - - *parameters = fParameters; + if (!strcmp(name, "name")) + fNameControl->SetText(variant.ToString()); return B_OK; } status_t -InitializeBFSEditor::PartitionNameChanged(const char* name) +InitializeBFSEditor::GetParameters(BString& parameters) { - fNameTC->SetText(name); + parameters = ""; + + if (BMenuItem* item = fBlockSizeMenuField->Menu()->FindMarked()) { + const char* size; + BMessage* message = item->Message(); + if (!message || message->FindString("size", &size) < B_OK) + size = "2048"; + // TODO: use libroot driver settings API + parameters << "block_size " << size << ";\n"; + } + if (fUseIndicesCheckBox->Value() == B_CONTROL_OFF) + parameters << "noindex;\n"; + + parameters << "name \"" << fNameControl->Text() << "\";\n"; return B_OK; } @@ -100,10 +108,9 @@ InitializeBFSEditor::PartitionNameChanged(const char* name) void InitializeBFSEditor::_CreateViewControls() { - fNameTC = new BTextControl(B_TRANSLATE("Name:"), "Haiku", NULL); - fNameTC->SetModificationMessage(new BMessage(MSG_NAME_CHANGED)); - // TODO find out what is the max length for this specific FS partition name - fNameTC->TextView()->SetMaxBytes(31); + fNameControl = new BTextControl(B_TRANSLATE("Name:"), "Haiku", NULL); + fNameControl->SetModificationMessage(new BMessage(MSG_NAME_CHANGED)); + fNameControl->TextView()->SetMaxBytes(31); BPopUpMenu* blocksizeMenu = new BPopUpMenu("blocksize"); BMessage* message = new BMessage(MSG_BLOCK_SIZE); @@ -123,13 +130,15 @@ InitializeBFSEditor::_CreateViewControls() blocksizeMenu->AddItem(new BMenuItem( B_TRANSLATE("8192 (Mostly large files)"), message)); - fBlockSizeMF = new BMenuField(B_TRANSLATE("Blocksize:"), blocksizeMenu); + fBlockSizeMenuField = new BMenuField(B_TRANSLATE("Blocksize:"), + blocksizeMenu); defaultItem->SetMarked(true); - fUseIndicesCB = new BCheckBox(B_TRANSLATE("Enable query support"), NULL); - fUseIndicesCB->SetValue(true); - fUseIndicesCB->SetToolTip(B_TRANSLATE("Disabling query support may speed " - "up certain file system operations, but should only be used " + fUseIndicesCheckBox = new BCheckBox(B_TRANSLATE("Enable query support"), + NULL); + fUseIndicesCheckBox->SetValue(true); + fUseIndicesCheckBox->SetToolTip(B_TRANSLATE("Disabling query support may " + "speed up certain file system operations, but should only be used " "if one is absolutely certain that one will not need queries.\n" "Any volume that is intended for booting Haiku must have query " "support enabled.")); @@ -138,14 +147,14 @@ InitializeBFSEditor::_CreateViewControls() fView = BGridLayoutBuilder(spacing, spacing) // row 1 - .Add(fNameTC->CreateLabelLayoutItem(), 0, 0) - .Add(fNameTC->CreateTextViewLayoutItem(), 1, 0) + .Add(fNameControl->CreateLabelLayoutItem(), 0, 0) + .Add(fNameControl->CreateTextViewLayoutItem(), 1, 0) // row 2 - .Add(fBlockSizeMF->CreateLabelLayoutItem(), 0, 1) - .Add(fBlockSizeMF->CreateMenuBarLayoutItem(), 1, 1) + .Add(fBlockSizeMenuField->CreateLabelLayoutItem(), 0, 1) + .Add(fBlockSizeMenuField->CreateMenuBarLayoutItem(), 1, 1) // row 3 - .Add(fUseIndicesCB, 0, 2, 2).View() + .Add(fUseIndicesCheckBox, 0, 2, 2).View() ; } diff --git a/src/add-ons/disk_systems/bfs/InitializeParameterEditor.h b/src/add-ons/disk_systems/bfs/InitializeParameterEditor.h index 339cea0..9f7abc3 100644 --- a/src/add-ons/disk_systems/bfs/InitializeParameterEditor.h +++ b/src/add-ons/disk_systems/bfs/InitializeParameterEditor.h @@ -1,4 +1,5 @@ /* + * Copyright 2013, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. * Copyright 2009-2010, Stephan Aßmus <superstippi@xxxxxx> * Copyright 2009, Bryce Groff, brycegroff@xxxxxxxxx. * Distributed under the terms of the MIT License. @@ -10,6 +11,7 @@ #include <PartitionParameterEditor.h> #include <String.h> + class BCheckBox; class BMenuField; class BTextControl; @@ -21,21 +23,24 @@ public: InitializeBFSEditor(); virtual ~InitializeBFSEditor(); - virtual bool FinishedEditing(); + virtual void SetTo(BPartition* partition); + + virtual bool ValidateParameters() const; + virtual status_t ParameterChanged(const char* name, + const BVariant& variant); + virtual BView* View(); - virtual status_t GetParameters(BString* parameters); - virtual status_t PartitionNameChanged(const char* name); + virtual status_t GetParameters(BString& parameters); private: void _CreateViewControls(); +private: BView* fView; - BTextControl* fNameTC; - BMenuField* fBlockSizeMF; - BCheckBox* fUseIndicesCB; - - BString fParameters; + BTextControl* fNameControl; + BMenuField* fBlockSizeMenuField; + BCheckBox* fUseIndicesCheckBox; }; diff --git a/src/add-ons/disk_systems/intel/CreationParameterEditor.cpp b/src/add-ons/disk_systems/intel/CreationParameterEditor.cpp index 881a6e0..75c3819 100644 --- a/src/add-ons/disk_systems/intel/CreationParameterEditor.cpp +++ b/src/add-ons/disk_systems/intel/CreationParameterEditor.cpp @@ -1,4 +1,5 @@ /* + * Copyright 2013, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. * Copyright 2009, Bryce Groff, brycegroff@xxxxxxxxx. * Distributed under the terms of the MIT License. */ @@ -10,15 +11,15 @@ #include <DiskDeviceTypes.h> #include <GroupView.h> #include <PartitionParameterEditor.h> +#include <Variant.h> #include <View.h> + #undef B_TRANSLATION_CONTEXT -#define B_TRANSLATION_CONTEXT "BFS_Creation_Parameter" +#define B_TRANSLATION_CONTEXT "PrimaryPartitionEditor" PrimaryPartitionEditor::PrimaryPartitionEditor() - : - fParameters(NULL) { fActiveCheckBox = new BCheckBox("active", B_TRANSLATE("Active partition"), NULL); @@ -39,35 +40,28 @@ PrimaryPartitionEditor::View() } -bool -PrimaryPartitionEditor::FinishedEditing() -{ - if (fActiveCheckBox->IsEnabled()) { - if (fActiveCheckBox->Value() == B_CONTROL_ON) - fParameters.SetTo("active true ;"); - else - fParameters.SetTo("active false ;"); - } else - fParameters.SetTo(""); - - return true; -} - - status_t -PrimaryPartitionEditor::GetParameters(BString* parameters) +PrimaryPartitionEditor::ParameterChanged(const char* name, + const BVariant& variant) { - if (fParameters == NULL) - return B_BAD_VALUE; - - *parameters = fParameters; + if (!strcmp(name, "type")) { + fActiveCheckBox->SetEnabled(strcmp(variant.ToString(), + kPartitionTypeIntelExtended) != 0); + } return B_OK; } status_t -PrimaryPartitionEditor::PartitionTypeChanged(const char* type) +PrimaryPartitionEditor::GetParameters(BString& parameters) { - fActiveCheckBox->SetEnabled(strcmp(type, kPartitionTypeIntelExtended) != 0); + if (fActiveCheckBox->IsEnabled()) { + if (fActiveCheckBox->Value() == B_CONTROL_ON) + parameters.SetTo("active true ;"); + else + parameters.SetTo("active false ;"); + } else + parameters.SetTo(""); + return B_OK; } diff --git a/src/add-ons/disk_systems/intel/CreationParameterEditor.h b/src/add-ons/disk_systems/intel/CreationParameterEditor.h index ff2374d..e165560 100644 --- a/src/add-ons/disk_systems/intel/CreationParameterEditor.h +++ b/src/add-ons/disk_systems/intel/CreationParameterEditor.h @@ -1,4 +1,5 @@ /* + * Copyright 2013, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. * Copyright 2009, Bryce Groff, brycegroff@xxxxxxxxx. * Distributed under the terms of the MIT License. */ @@ -18,17 +19,17 @@ public: PrimaryPartitionEditor(); virtual ~PrimaryPartitionEditor(); - virtual bool FinishedEditing(); virtual BView* View(); - virtual status_t GetParameters(BString* parameters); - virtual status_t PartitionTypeChanged(const char* type); + virtual status_t ParameterChanged(const char* name, + const BVariant& variant); + + virtual status_t GetParameters(BString& parameters); private: BView* fView; BCheckBox* fActiveCheckBox; - BString fParameters; }; -#endif //_CREATION_PARAMETER_EDITOR +#endif // _CREATION_PARAMETER_EDITOR diff --git a/src/add-ons/disk_systems/intel/Jamfile b/src/add-ons/disk_systems/intel/Jamfile index fac4f5d..db47924 100644 --- a/src/add-ons/disk_systems/intel/Jamfile +++ b/src/add-ons/disk_systems/intel/Jamfile @@ -23,7 +23,7 @@ Addon <disk_system>intel : # kernel sources PartitionMap.cpp - : be $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++) + : be libshared.a $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++) ; DoCatalogs <disk_system>intel : diff --git a/src/add-ons/disk_systems/ntfs/InitializeParameterEditor.cpp b/src/add-ons/disk_systems/ntfs/InitializeParameterEditor.cpp index ba14586..a5c9a13 100644 --- a/src/add-ons/disk_systems/ntfs/InitializeParameterEditor.cpp +++ b/src/add-ons/disk_systems/ntfs/InitializeParameterEditor.cpp @@ -1,4 +1,5 @@ /* + * Copyright 2013, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. * Copyright 2009-2010, Stephan Aßmus <superstippi@xxxxxx> * Copyright 2009, Bryce Groff, brycegroff@xxxxxxxxx. * Distributed under the terms of the MIT License. @@ -11,19 +12,20 @@ #include <Button.h> #include <Catalog.h> -#include <CheckBox.h> #include <ControlLook.h> #include <GridLayoutBuilder.h> -#include <MenuField.h> -#include <MenuItem.h> -#include <PartitionParameterEditor.h> -#include <PopUpMenu.h> +#include <Partition.h> #include <SpaceLayoutItem.h> #include <TextControl.h> +#include <Variant.h> #include <View.h> #include <Window.h> +#undef B_TRANSLATION_CONTEXT +#define B_TRANSLATION_CONTEXT "NTFS_Initialize_Parameter" + + static uint32 MSG_NAME_CHANGED = 'nmch'; @@ -31,7 +33,7 @@ InitializeNTFSEditor::InitializeNTFSEditor() : BPartitionParameterEditor(), fView(NULL), - fNameTC(NULL), + fNameControl(NULL), fParameters(NULL) { _CreateViewControls(); @@ -43,6 +45,15 @@ InitializeNTFSEditor::~InitializeNTFSEditor() } +void +InitializeNTFSEditor::SetTo(BPartition* partition) +{ + BString name = partition->ContentName(); + if (!name.IsEmpty()) + fNameControl->SetText(name.String()); +} + + BView* InitializeNTFSEditor::View() { @@ -51,30 +62,28 @@ InitializeNTFSEditor::View() bool -InitializeNTFSEditor::FinishedEditing() +InitializeNTFSEditor::ValidateParameters() const { - fParameters = ""; - fParameters << "name \"" << fNameTC->Text() << "\";\n"; - - return true; + // The name must be set + return fNameControl->TextView()->TextLength() > 0; } status_t -InitializeNTFSEditor::GetParameters(BString* parameters) +InitializeNTFSEditor::ParameterChanged(const char* name, + const BVariant& variant) { - if (parameters == NULL) - return B_BAD_VALUE; - - *parameters = fParameters; + if (!strcmp(name, "name")) + fNameControl->SetText(variant.ToString()); return B_OK; } status_t -InitializeNTFSEditor::PartitionNameChanged(const char* name) +InitializeNTFSEditor::GetParameters(BString& parameters) { - fNameTC->SetText(name); + parameters = "name \""; + parameters << fNameControl->Text() << "\";\n"; return B_OK; } @@ -82,16 +91,15 @@ InitializeNTFSEditor::PartitionNameChanged(const char* name) void InitializeNTFSEditor::_CreateViewControls() { - fNameTC = new BTextControl("Name:", "New NTFS Volume", NULL); - fNameTC->SetModificationMessage(new BMessage(MSG_NAME_CHANGED)); - // TODO find out what is the max length for this specific FS partition name - fNameTC->TextView()->SetMaxBytes(31); + fNameControl = new BTextControl(B_TRANSLATE("Name:"), "New NTFS Volume", + NULL); + fNameControl->SetModificationMessage(new BMessage(MSG_NAME_CHANGED)); + fNameControl->TextView()->SetMaxBytes(127); float spacing = be_control_look->DefaultItemSpacing(); fView = BGridLayoutBuilder(spacing, spacing) - // row 1 - .Add(fNameTC->CreateLabelLayoutItem(), 0, 0) - .Add(fNameTC->CreateTextViewLayoutItem(), 1, 0).View() + .Add(fNameControl->CreateLabelLayoutItem(), 0, 0) + .Add(fNameControl->CreateTextViewLayoutItem(), 1, 0).View() ; } diff --git a/src/add-ons/disk_systems/ntfs/InitializeParameterEditor.h b/src/add-ons/disk_systems/ntfs/InitializeParameterEditor.h index bdb6647..5a4ce7d 100644 --- a/src/add-ons/disk_systems/ntfs/InitializeParameterEditor.h +++ b/src/add-ons/disk_systems/ntfs/InitializeParameterEditor.h @@ -1,4 +1,5 @@ /* + * Copyright 2013, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. * Copyright 2009-2010, Stephan Aßmus <superstippi@xxxxxx> * Copyright 2009, Bryce Groff, brycegroff@xxxxxxxxx. * Distributed under the terms of the MIT License. @@ -10,6 +11,7 @@ #include <PartitionParameterEditor.h> #include <String.h> + class BCheckBox; class BMenuField; class BTextControl; @@ -21,17 +23,22 @@ public: InitializeNTFSEditor(); virtual ~InitializeNTFSEditor(); - virtual bool FinishedEditing(); + virtual void SetTo(BPartition* partition); + + virtual bool ValidateParameters() const; + virtual status_t ParameterChanged(const char* name, + const BVariant& variant); + virtual BView* View(); - virtual status_t GetParameters(BString* parameters); - virtual status_t PartitionNameChanged(const char* name); + virtual status_t GetParameters(BString& parameters); private: void _CreateViewControls(); +private: BView* fView; - BTextControl* fNameTC; + BTextControl* fNameControl; BString fParameters; }; diff --git a/src/add-ons/disk_systems/ntfs/Jamfile b/src/add-ons/disk_systems/ntfs/Jamfile index 342108b..4abdcfb 100644 --- a/src/add-ons/disk_systems/ntfs/Jamfile +++ b/src/add-ons/disk_systems/ntfs/Jamfile @@ -13,3 +13,9 @@ Addon <disk_system>ntfs : : be $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++) libshared.a ; + +DoCatalogs <disk_system>ntfs : + x-vnd.Haiku-NTFSDiskAddOn + : + InitializeParameterEditor.cpp +; diff --git a/src/add-ons/disk_systems/ntfs/NTFSAddOn.rdef b/src/add-ons/disk_systems/ntfs/NTFSAddOn.rdef index 44435fe..7cb9cd5 100644 --- a/src/add-ons/disk_systems/ntfs/NTFSAddOn.rdef +++ b/src/add-ons/disk_systems/ntfs/NTFSAddOn.rdef @@ -1,15 +1,11 @@ -/* - * NTFSAddOn.rdef - */ - -resource app_signature "application/x-vnd.Haiku-NTFSAddOn"; +resource app_signature "application/x-vnd.Haiku-NTFSDiskAddOn"; resource app_version { - major = 0, + major = 1, middle = 0, - minor = 1, + minor = 0, variety = 0, internal = 0, - short_info = "0.0.1", - long_info = "Haiku NTFS disk add-on." + short_info = "1.0.0", + long_info = "NTFS disk add-on." }; diff --git a/src/apps/drivesetup/AbstractParametersPanel.cpp b/src/apps/drivesetup/AbstractParametersPanel.cpp new file mode 100644 index 0000000..1c38f64 --- /dev/null +++ b/src/apps/drivesetup/AbstractParametersPanel.cpp @@ -0,0 +1,248 @@ +/* + * Copyright 2008-2013 Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT license. + * + * Authors: + * Stephan Aßmus <superstippi@xxxxxx> + * Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. + * Karsten Heimrich. <host.haiku@xxxxxx> + */ + + +#include "AbstractParametersPanel.h" + +#include <driver_settings.h> +#include <stdio.h> + +#include <Button.h> +#include <Catalog.h> +#include <DiskSystemAddOn.h> +#include <DiskSystemAddOnManager.h> +#include <GroupLayout.h> +#include <MessageFilter.h> +#include <String.h> + + +#undef B_TRANSLATION_CONTEXT +#define B_TRANSLATION_CONTEXT "AbstractParametersPanel" + + +static const uint32 kMsgOk = 'okok'; +static const uint32 kParameterChanged = 'pmch'; + + +class AbstractParametersPanel::EscapeFilter : public BMessageFilter { +public: + EscapeFilter(AbstractParametersPanel* target) + : + BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE), + fPanel(target) + { + } + + virtual ~EscapeFilter() + { + } + + virtual filter_result Filter(BMessage* message, BHandler** target) + { + filter_result result = B_DISPATCH_MESSAGE; + switch (message->what) { + case B_KEY_DOWN: + case B_UNMAPPED_KEY_DOWN: { + uint32 key; + if (message->FindInt32("raw_char", (int32*)&key) >= B_OK) { + if (key == B_ESCAPE) { + result = B_SKIP_MESSAGE; + fPanel->Cancel(); + } + } + break; + } + default: + break; + } + return result; + } + +private: + AbstractParametersPanel* fPanel; +}; + + +// #pragma mark - + + +AbstractParametersPanel::AbstractParametersPanel(BWindow* window) + : + BWindow(BRect(300.0, 200.0, 600.0, 300.0), 0, B_MODAL_WINDOW_LOOK, + B_MODAL_SUBSET_WINDOW_FEEL, + B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS), + fOkButton(new BButton(B_TRANSLATE("OK"), new BMessage(kMsgOk))), + fReturnStatus(B_CANCELED), + fEditor(NULL), + fEscapeFilter(new EscapeFilter(this)), + fExitSemaphore(create_sem(0, "AbstractParametersPanel exit")), + fWindow(window) +{ + AddCommonFilter(fEscapeFilter); + AddToSubset(fWindow); +} + + +AbstractParametersPanel::~AbstractParametersPanel() +{ + RemoveCommonFilter(fEscapeFilter); + delete fEscapeFilter; + + delete_sem(fExitSemaphore); + + if (fEditor == NULL) + delete fOkButton; +} + + +bool +AbstractParametersPanel::QuitRequested() +{ + release_sem(fExitSemaphore); + return false; +} + + +void +AbstractParametersPanel::MessageReceived(BMessage* message) +{ + switch (message->what) { + case B_CANCEL: + Cancel(); + break; + + case kMsgOk: + fReturnStatus = B_OK; + release_sem(fExitSemaphore); + break; + + case kParameterChanged: + fOkButton->SetEnabled(fEditor->ValidateParameters()); + break; + + default: + BWindow::MessageReceived(message); + } +} + + +status_t +AbstractParametersPanel::Go(BString& parameters) +{ + // Without an editor, we cannot change anything, anyway + if (fEditor == NULL) { + parameters = ""; + if (fReturnStatus == B_CANCELED) + fReturnStatus = B_OK; + + if (!Lock()) + return B_ERROR; + } else { + // run the window thread, to get an initial layout of the controls + Hide(); + Show(); + if (!Lock()) + return B_CANCELED; + + // center the panel above the parent window + CenterIn(fWindow->Frame()); + + Show(); + Unlock(); + + // block this thread now, but keep the window repainting + while (true) { + status_t status = acquire_sem_etc(fExitSemaphore, 1, + B_CAN_INTERRUPT | B_RELATIVE_TIMEOUT, 50000); + if (status != B_TIMED_OUT && status != B_INTERRUPTED) + break; + fWindow->UpdateIfNeeded(); + } + + if (!Lock()) + return B_CANCELED; + + if (fReturnStatus == B_OK) { + if (fEditor->ValidateParameters()) { + status_t err = fEditor->GetParameters(parameters); + if (err != B_OK) + fReturnStatus = err; + } + } + } + + status_t status = fReturnStatus; + + Quit(); + // NOTE: this object is toast now! + + return status; +} + + +void +AbstractParametersPanel::Cancel() +{ + fReturnStatus = B_CANCELED; + release_sem(fExitSemaphore); +} + + +void +AbstractParametersPanel::Init(B_PARAMETER_EDITOR_TYPE type, + const BString& diskSystem, BPartition* partition) +{ + // Create partition parameter editor + + status_t status = B_ERROR; + if (diskSystem.IsEmpty()) { + status = partition->GetParameterEditor(type, &fEditor); + } else { + DiskSystemAddOnManager* manager = DiskSystemAddOnManager::Default(); + BDiskSystemAddOn* addOn = manager->GetAddOn(diskSystem); + if (addOn != NULL) { + // put the add-on + manager->PutAddOn(addOn); + + status = addOn->GetParameterEditor(type, &fEditor); + } + } + if (status != B_OK && status != B_NOT_SUPPORTED) + fReturnStatus = status; + + if (fEditor == NULL) + return; + + // Create controls + + BLayoutBuilder::Group<> builder = BLayoutBuilder::Group<>(this, + B_VERTICAL); + AddControls(builder, fEditor->View()); + + builder.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING) + .AddGlue() + .Add(new BButton(B_TRANSLATE("Cancel"), new BMessage(B_CANCEL))) + .Add(fOkButton) + .End() + .SetInsets(B_USE_DEFAULT_SPACING); + + SetDefaultButton(fOkButton); + + fEditor->SetTo(partition); + fEditor->SetModificationMessage(new BMessage(kParameterChanged)); +} + + +void +AbstractParametersPanel::AddControls(BLayoutBuilder::Group<>& builder, + BView* editorView) +{ + builder.Add(editorView); +} diff --git a/src/apps/drivesetup/AbstractParametersPanel.h b/src/apps/drivesetup/AbstractParametersPanel.h new file mode 100644 index 0000000..123e957 --- /dev/null +++ b/src/apps/drivesetup/AbstractParametersPanel.h @@ -0,0 +1,58 @@ +/* + * Copyright 2008-2013 Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT license. + * + * Authors: + * Stephan Aßmus <superstippi@xxxxxx> + * Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. + */ +#ifndef ABSTRACT_PARAMETERS_PANEL_H +#define ABSTRACT_PARAMETERS_PANEL_H + + +#include <LayoutBuilder.h> +#include <Partition.h> +#include <PartitionParameterEditor.h> +#include <Window.h> + +#include "Support.h" + + +class BMenuField; +class BTextControl; + + +class AbstractParametersPanel : public BWindow { +public: + AbstractParametersPanel(BWindow* window); + virtual ~AbstractParametersPanel(); + + virtual bool QuitRequested(); + virtual void MessageReceived(BMessage* message); + + status_t Go(BString& parameters); + void Cancel(); + +protected: + void Init(B_PARAMETER_EDITOR_TYPE type, + const BString& diskSystem, + BPartition* partition); + + virtual void AddControls(BLayoutBuilder::Group<>& builder, + BView* editorView); + +protected: + BButton* fOkButton; + status_t fReturnStatus; + + BPartitionParameterEditor* fEditor; + +private: + class EscapeFilter; + EscapeFilter* fEscapeFilter; + sem_id fExitSemaphore; + BWindow* fWindow; +}; + + +#endif // ABSTRACT_PARAMETERS_PANEL_H diff --git a/src/apps/drivesetup/CreateParamsPanel.cpp b/src/apps/drivesetup/CreateParamsPanel.cpp index deeee12..42abf27 100644 --- a/src/apps/drivesetup/CreateParamsPanel.cpp +++ b/src/apps/drivesetup/CreateParamsPanel.cpp @@ -1,9 +1,10 @@ /* - * Copyright 2008-2012 Haiku Inc. All rights reserved. + * Copyright 2008-2013 Haiku Inc. All rights reserved. * Distributed under the terms of the MIT license. * * Authors: * Stephan Aßmus <superstippi@xxxxxx> + * Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. * Bryce Groff <bgroff@xxxxxxxxxx> * Karsten Heimrich <host.haiku@xxxxxx> */ @@ -15,89 +16,34 @@ #include <Catalog.h> #include <ControlLook.h> #include <DiskDeviceTypes.h> -#include <GridLayoutBuilder.h> -#include <GroupLayout.h> -#include <GroupLayoutBuilder.h> -#include <Locale.h> #include <MenuField.h> #include <MenuItem.h> -#include <Message.h> #include <MessageFilter.h> #include <PopUpMenu.h> -#include <PartitionParameterEditor.h> -#include <Partition.h> #include <String.h> +#include <TextControl.h> +#include <Variant.h> #include "Support.h" #undef B_TRANSLATION_CONTEXT -#define B_TRANSLATION_CONTEXT "CreateParamsPanel" - - -class CreateParamsPanel::EscapeFilter : public BMessageFilter { -public: - EscapeFilter(CreateParamsPanel* target) - : - BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE), - fPanel(target) - { - } - - virtual ~EscapeFilter() - { - } - - virtual filter_result Filter(BMessage* message, BHandler** target) - { - filter_result result = B_DISPATCH_MESSAGE; - switch (message->what) { - case B_KEY_DOWN: - case B_UNMAPPED_KEY_DOWN: { - uint32 key; - if (message->FindInt32("raw_char", (int32*)&key) >= B_OK) { - if (key == B_ESCAPE) { - result = B_SKIP_MESSAGE; - fPanel->Cancel(); - } - } - break; - } - default: - break; - } - return result; - } - -private: - CreateParamsPanel* fPanel; -}; - - -// #pragma mark - +#define B_TRANSLATION_CONTEXT "CreateParametersPanel" enum { - MSG_OK = 'okok', - MSG_CANCEL = 'cncl', MSG_PARTITION_TYPE = 'type', MSG_SIZE_SLIDER = 'ssld', MSG_SIZE_TEXTCONTROL = 'stct' }; -CreateParamsPanel::CreateParamsPanel(BWindow* window, BPartition* partition, - off_t offset, off_t size) +CreateParametersPanel::CreateParametersPanel(BWindow* window, + BPartition* partition, off_t offset, off_t size) : - BWindow(BRect(300.0, 200.0, 600.0, 300.0), 0, B_MODAL_WINDOW_LOOK, - B_MODAL_SUBSET_WINDOW_FEEL, - B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS), - fEscapeFilter(new EscapeFilter(this)), - fExitSemaphore(create_sem(0, "CreateParamsPanel exit")), - fWindow(window), - fReturnValue(GO_CANCELED) + AbstractParametersPanel(window) { - AddCommonFilter(fEscapeFilter); + Init(B_CREATE_PARAMETER_EDITOR, "", partition); // Scale offset, and size from bytes to megabytes (2^20) // so that we do not run over a signed int32. @@ -107,138 +53,56 @@ CreateParamsPanel::CreateParamsPanel(BWindow* window, BPartition* partition, } -CreateParamsPanel::~CreateParamsPanel() +CreateParametersPanel::~CreateParametersPanel() { - RemoveCommonFilter(fEscapeFilter); - delete fEscapeFilter; - - delete_sem(fExitSemaphore); -} - - -bool -CreateParamsPanel::QuitRequested() -{ - release_sem(fExitSemaphore); - return false; -} - - -void -CreateParamsPanel::MessageReceived(BMessage* message) -{ - switch (message->what) { - case MSG_CANCEL: - Cancel(); - break; - - case MSG_OK: - fReturnValue = GO_SUCCESS; - release_sem(fExitSemaphore); - break; - - case MSG_PARTITION_TYPE: - if (fEditor != NULL) { - const char* type; - message->FindString("type", &type); - fEditor->PartitionTypeChanged(type); - } - break; - - case MSG_SIZE_SLIDER: - _UpdateSizeTextControl(); - break; - - case MSG_SIZE_TEXTCONTROL: - { - int32 size = atoi(fSizeTextControl->Text()); - if (size >= 0 && size <= fSizeSlider->MaxPartitionSize()) - fSizeSlider->SetValue(size + fSizeSlider->Offset()); - else - _UpdateSizeTextControl(); - break; - } - - default: - BWindow::MessageReceived(message); - } } -int32 -CreateParamsPanel::Go(off_t& offset, off_t& size, BString& name, +status_t +CreateParametersPanel::Go(off_t& offset, off_t& size, BString& name, BString& type, BString& parameters) { - // run the window thread, to get an initial layout of the controls - Hide(); - Show(); - if (!Lock()) - return GO_CANCELED; - - // center the panel above the parent window - CenterIn(fWindow->Frame()); - - Show(); - Unlock(); - - // block this thread now, but keep the window repainting - while (true) { - status_t err = acquire_sem_etc(fExitSemaphore, 1, - B_CAN_INTERRUPT | B_RELATIVE_TIMEOUT, 50000); - if (err != B_TIMED_OUT && err != B_INTERRUPTED) - break; - fWindow->UpdateIfNeeded(); + // The object will be deleted in Go(), so we need to get the values before + + // Return the value back as bytes. + size = (off_t)fSizeSlider->Size() * kMegaByte; + offset = (off_t)fSizeSlider->Offset() * kMegaByte; + + // get name + name.SetTo(fNameTextControl->Text()); + + // get type + if (BMenuItem* item = fTypeMenuField->Menu()->FindMarked()) { + const char* _type; + BMessage* message = item->Message(); + if (!message || message->FindString("type", &_type) < B_OK) + _type = kPartitionTypeBFS; + type << _type; } - if (!Lock()) - return GO_CANCELED; - - if (fReturnValue == GO_SUCCESS) { - // Return the value back as bytes. - size = (off_t)fSizeSlider->Size() * kMegaByte; - offset = (off_t)fSizeSlider->Offset() * kMegaByte; - - // get name - name.SetTo(fNameTextControl->Text()); - - // get type - if (BMenuItem* item = fTypeMenuField->Menu()->FindMarked()) { - const char* _type; - BMessage* message = item->Message(); - if (!message || message->FindString("type", &_type) < B_OK) - _type = kPartitionTypeBFS; - type << _type; - } - - // get editors parameters - if (fEditor != NULL) { - if (fEditor->FinishedEditing()) { - status_t status = fEditor->GetParameters(¶meters); - if (status != B_OK) - fReturnValue = status; - } - } - } - - int32 value = fReturnValue; - - Quit(); - // NOTE: this object is toast now! - - return value; + return AbstractParametersPanel::Go(parameters); } void -CreateParamsPanel::Cancel() +CreateParametersPanel::AddControls(BLayoutBuilder::Group<>& builder, + BView* editorView) { - fReturnValue = GO_CANCELED; - release_sem(fExitSemaphore); + builder + .Add(fSizeSlider) + .Add(fSizeTextControl) + .AddGrid(0.0, 5.0) + .Add(fNameTextControl->CreateLabelLayoutItem(), 0, 0) + .Add(fNameTextControl->CreateTextViewLayoutItem(), 1, 0) + .Add(fTypeMenuField->CreateLabelLayoutItem(), 0, 1) + .Add(fTypeMenuField->CreateMenuBarLayoutItem(), 1, 1) + .End() + .Add(editorView); } void -CreateParamsPanel::_CreateViewControls(BPartition* parent, off_t offset, +CreateParametersPanel::_CreateViewControls(BPartition* parent, off_t offset, off_t size) { // Setup the controls @@ -265,8 +129,7 @@ CreateParamsPanel::_CreateViewControls(BPartition* parent, off_t offset, int32 cookie = 0; BString supportedType; - while (parent->GetNextSupportedChildType(&cookie, &supportedType) - == B_OK) { + while (parent->GetNextSupportedChildType(&cookie, &supportedType) == B_OK) { BMessage* message = new BMessage(MSG_PARTITION_TYPE); message->AddString("type", supportedType); BMenuItem* item = new BMenuItem(supportedType, message); @@ -279,46 +142,44 @@ CreateParamsPanel::_CreateViewControls(BPartition* parent, off_t offset, fTypeMenuField = new BMenuField(B_TRANSLATE("Partition type:"), fTypePopUpMenu); - const float spacing = be_control_look->DefaultItemSpacing(); - BGroupLayout* layout = new BGroupLayout(B_VERTICAL, spacing); - layout->SetInsets(spacing, spacing, spacing, spacing); + fOkButton->SetLabel(B_TRANSLATE("Create")); +} - SetLayout(layout); - AddChild(BGroupLayoutBuilder(B_VERTICAL, spacing) - .Add(fSizeSlider) - .Add(fSizeTextControl) - .Add(BGridLayoutBuilder(0.0, 5.0) - .Add(fNameTextControl->CreateLabelLayoutItem(), 0, 0) - .Add(fNameTextControl->CreateTextViewLayoutItem(), 1, 0) - .Add(fTypeMenuField->CreateLabelLayoutItem(), 0, 1) - .Add(fTypeMenuField->CreateMenuBarLayoutItem(), 1, 1) - ) - ); - - status_t err = parent->GetParameterEditor(B_CREATE_PARAMETER_EDITOR, - &fEditor); - if (err == B_OK && fEditor != NULL) - AddChild(fEditor->View()); - else - fEditor = NULL; - - BButton* okButton = new BButton(B_TRANSLATE("Create"), - new BMessage(MSG_OK)); - AddChild(BGroupLayoutBuilder(B_HORIZONTAL, spacing) - .AddGlue() - .Add(new BButton(B_TRANSLATE("Cancel"), new BMessage(MSG_CANCEL))) - .Add(okButton) - ); - SetDefaultButton(okButton); - - AddToSubset(fWindow); - layout->View()->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); +void +CreateParametersPanel::MessageReceived(BMessage* message) +{ + switch (message->what) { + case MSG_PARTITION_TYPE: + if (fEditor != NULL) { + const char* type; + if (message->FindString("type", &type) == B_OK) + fEditor->ParameterChanged("type", BVariant(type)); + } + break; + + case MSG_SIZE_SLIDER: + _UpdateSizeTextControl(); + break; + + case MSG_SIZE_TEXTCONTROL: + { + int32 size = atoi(fSizeTextControl->Text()); + if (size >= 0 && size <= fSizeSlider->MaxPartitionSize()) + fSizeSlider->SetValue(size + fSizeSlider->Offset()); + else + _UpdateSizeTextControl(); + break; + } + + default: + AbstractParametersPanel::MessageReceived(message); + } } void -CreateParamsPanel::_UpdateSizeTextControl() +CreateParametersPanel::_UpdateSizeTextControl() { BString sizeString; sizeString << fSizeSlider->Value() - fSizeSlider->Offset(); diff --git a/src/apps/drivesetup/CreateParamsPanel.h b/src/apps/drivesetup/CreateParamsPanel.h index eef3cc2..4746397 100644 --- a/src/apps/drivesetup/CreateParamsPanel.h +++ b/src/apps/drivesetup/CreateParamsPanel.h @@ -1,40 +1,40 @@ /* - * Copyright 2008-2012 Haiku Inc. All rights reserved. + * Copyright 2008-2013 Haiku Inc. All rights reserved. * Distributed under the terms of the MIT license. * * Authors: * Stephan Aßmus <superstippi@xxxxxx> + * Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. * Bryce Groff <bgroff@xxxxxxxxxx> */ #ifndef CREATE_PARAMS_PANEL_H #define CREATE_PARAMS_PANEL_H -#include <Window.h> -#include <InterfaceKit.h> -#include <PartitionParameterEditor.h> -#include <Partition.h> +#include "AbstractParametersPanel.h" class BMenuField; +class BPopUpMenu; class BTextControl; class SizeSlider; -class CreateParamsPanel : public BWindow { +class CreateParametersPanel : public AbstractParametersPanel { public: - CreateParamsPanel(BWindow* window, + CreateParametersPanel(BWindow* window, BPartition* parent, off_t offset, off_t size); - virtual ~CreateParamsPanel(); + virtual ~CreateParametersPanel(); - virtual bool QuitRequested(); - virtual void MessageReceived(BMessage* message); - - int32 Go(off_t& offset, off_t& size, BString& name, + status_t Go(off_t& offset, off_t& size, BString& name, BString& type, BString& parameters); - void Cancel(); + virtual void MessageReceived(BMessage* message); + +protected: + virtual void AddControls(BLayoutBuilder::Group<>& builder, + BView* editorView); private: void _CreateViewControls(BPartition* parent, @@ -43,15 +43,6 @@ private: void _UpdateSizeTextControl(); private: - class EscapeFilter; - - EscapeFilter* fEscapeFilter; - sem_id fExitSemaphore; - BWindow* fWindow; - int32 fReturnValue; - - BPartitionParameterEditor* fEditor; - BPopUpMenu* fTypePopUpMenu; BMenuField* fTypeMenuField; BTextControl* fNameTextControl; diff --git a/src/apps/drivesetup/InitParamsPanel.cpp b/src/apps/drivesetup/InitParamsPanel.cpp index 6d03f83..9c8ae56 100644 --- a/src/apps/drivesetup/InitParamsPanel.cpp +++ b/src/apps/drivesetup/InitParamsPanel.cpp @@ -4,6 +4,7 @@ * * Authors: * Stephan Aßmus <superstippi@xxxxxx> + * Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. * Karsten Heimrich. <host.haiku@xxxxxx> */ @@ -15,240 +16,41 @@ #include <Button.h> #include <Catalog.h> -#include <ControlLook.h> -#include <DiskSystemAddOn.h> -#include <DiskSystemAddOnManager.h> -#include <GroupLayout.h> -#include <GroupLayoutBuilder.h> -#include <Locale.h> -#include <Message.h> -#include <MessageFilter.h> -#include <String.h> -#include <TextControl.h> #undef B_TRANSLATION_CONTEXT -#define B_TRANSLATION_CONTEXT "InitParamsPanel" +#define B_TRANSLATION_CONTEXT "InitializeParametersPanel" -class InitParamsPanel::EscapeFilter : public BMessageFilter { -public: - EscapeFilter(InitParamsPanel* target) - : - BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE), - fPanel(target) - { - } - - virtual ~EscapeFilter() - { - } - - virtual filter_result Filter(BMessage* message, BHandler** target) - { - filter_result result = B_DISPATCH_MESSAGE; - switch (message->what) { - case B_KEY_DOWN: - case B_UNMAPPED_KEY_DOWN: { - uint32 key; - if (message->FindInt32("raw_char", (int32*)&key) >= B_OK) { - if (key == B_ESCAPE) { - result = B_SKIP_MESSAGE; - fPanel->Cancel(); - } - } - break; - } - default: - break; - } - return result; - } - -private: - InitParamsPanel* fPanel; -}; - - -// #pragma mark - - - -// TODO: MSG_NAME_CHANGED is shared with the disk system add-ons, so it should -// be in some private shared header. -// TODO: there is already B_CANCEL, why not use that one? -enum { - MSG_OK = 'okok', - MSG_CANCEL = 'cncl', - MSG_NAME_CHANGED = 'nmch' -}; - - -InitParamsPanel::InitParamsPanel(BWindow* window, const BString& diskSystem, - BPartition* partition) +InitParametersPanel::InitParametersPanel(BWindow* window, + const BString& diskSystem, BPartition* partition) : - BWindow(BRect(300.0, 200.0, 600.0, 300.0), 0, B_MODAL_WINDOW_LOOK, - B_MODAL_SUBSET_WINDOW_FEEL, - B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS), - fEscapeFilter(new EscapeFilter(this)), - fExitSemaphore(create_sem(0, "InitParamsPanel exit")), - fWindow(window), - fReturnValue(GO_CANCELED) + AbstractParametersPanel(window) { - AddCommonFilter(fEscapeFilter); - - fOkButton = new BButton(B_TRANSLATE("Initialize"), new BMessage(MSG_OK)); - - DiskSystemAddOnManager* manager = DiskSystemAddOnManager::Default(); - BDiskSystemAddOn* addOn = manager->GetAddOn(diskSystem); - if (addOn) { - // put the add-on - manager->PutAddOn(addOn); - - status_t err = addOn->GetParameterEditor(B_INITIALIZE_PARAMETER_EDITOR, - &fEditor); - if (err != B_OK) - fEditor = NULL; - } else { - fEditor = NULL; - } - if (fEditor == NULL) - return; - - SetLayout(new BGroupLayout(B_HORIZONTAL)); - const float spacing = be_control_look->DefaultItemSpacing(); - AddChild(BGroupLayoutBuilder(B_VERTICAL, spacing) - .Add(fEditor->View()) - .AddGroup(B_HORIZONTAL, spacing) - .AddGlue() - .Add(new BButton(B_TRANSLATE("Cancel"), new BMessage(MSG_CANCEL))) - .Add(fOkButton) - .End() - .SetInsets(spacing, spacing, spacing, spacing) - ); + Init(B_INITIALIZE_PARAMETER_EDITOR, diskSystem, partition); - SetDefaultButton(fOkButton); - - // If the partition had a previous name, set to that name. - BString name = partition->ContentName(); - if (name.Length() > 0) - fEditor->PartitionNameChanged(name.String()); - - AddToSubset(fWindow); + fOkButton->SetLabel(B_TRANSLATE("Initialize")); } -InitParamsPanel::~InitParamsPanel() +InitParametersPanel::~InitParametersPanel() { - RemoveCommonFilter(fEscapeFilter); - delete fEscapeFilter; - - delete_sem(fExitSemaphore); } -bool -InitParamsPanel::QuitRequested() +status_t +InitParametersPanel::Go(BString& name, BString& parameters) { - release_sem(fExitSemaphore); - return false; -} - - -void -InitParamsPanel::MessageReceived(BMessage* message) -{ - switch (message->what) { - case MSG_CANCEL: - Cancel(); - break; - - case MSG_OK: - fReturnValue = GO_SUCCESS; - release_sem(fExitSemaphore); - break; - - case MSG_NAME_CHANGED: - // message comes from fEditor's BTextControl - BTextControl* control; - if (message->FindPointer("source", (void**)&control) != B_OK) - break; - if (control->TextView()->TextLength() == 0 - && fOkButton->IsEnabled()) - fOkButton->SetEnabled(false); - else if (control->TextView()->TextLength() > 0 - && !fOkButton->IsEnabled()) - fOkButton->SetEnabled(true); - break; - - default: - BWindow::MessageReceived(message); - } -} - - -int32 -InitParamsPanel::Go(BString& name, BString& parameters) -{ - // Without an editor, we cannot change anything, anyway - if (fEditor == NULL) - return GO_SUCCESS; - - // run the window thread, to get an initial layout of the controls - Hide(); - Show(); - if (!Lock()) - return GO_CANCELED; - - // center the panel above the parent window - CenterIn(fWindow->Frame()); - - Show(); - Unlock(); - - // block this thread now, but keep the window repainting - while (true) { - status_t err = acquire_sem_etc(fExitSemaphore, 1, - B_CAN_INTERRUPT | B_RELATIVE_TIMEOUT, 50000); - if (err != B_TIMED_OUT && err != B_INTERRUPTED) - break; - fWindow->UpdateIfNeeded(); - } - - if (!Lock()) - return GO_CANCELED; - - if (fEditor == NULL) - fReturnValue = B_BAD_VALUE; - - if (fReturnValue == GO_SUCCESS) { - if (fEditor->FinishedEditing()) { - status_t err = fEditor->GetParameters(¶meters); - if (err == B_OK) { - void* handle = parse_driver_settings_string( - parameters.String()); - if (handle != NULL) { - const char* string = get_driver_parameter(handle, "name", - NULL, NULL); - name.SetTo(string); - delete_driver_settings(handle); - } - } else - fReturnValue = err; + status_t status = AbstractParametersPanel::Go(parameters); + if (status == B_OK) { + void* handle = parse_driver_settings_string(parameters.String()); + if (handle != NULL) { + const char* string = get_driver_parameter(handle, "name", + NULL, NULL); + name.SetTo(string); + delete_driver_settings(handle); } } - int32 value = fReturnValue; - - Quit(); - // NOTE: this object is toast now! - - return value; -} - - -void -InitParamsPanel::Cancel() -{ - fReturnValue = GO_CANCELED; - release_sem(fExitSemaphore); + return status; } diff --git a/src/apps/drivesetup/InitParamsPanel.h b/src/apps/drivesetup/InitParamsPanel.h index 98b1022..338eac9 100644 --- a/src/apps/drivesetup/InitParamsPanel.h +++ b/src/apps/drivesetup/InitParamsPanel.h @@ -1,45 +1,27 @@ /* - * Copyright 2008 Haiku Inc. All rights reserved. + * Copyright 2008-2013 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT license. * * Authors: * Stephan Aßmus <superstippi@xxxxxx> + * Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. */ -#ifndef INIT_PARAMS_PANEL_H -#define INIT_PARAMS_PANEL_H +#ifndef INIT_PARAMETERS_PANEL_H +#define INIT_PARAMETERS_PANEL_H -#include "Support.h" -#include <Partition.h> -#include <PartitionParameterEditor.h> -#include <Window.h> +#include "AbstractParametersPanel.h" -class BMenuField; -class BTextControl; - -class InitParamsPanel : public BWindow { +class InitParametersPanel : public AbstractParametersPanel { public: - InitParamsPanel(BWindow* window, + InitParametersPanel(BWindow* window, const BString& diskSystem, BPartition* partition); - virtual ~InitParamsPanel(); - - virtual bool QuitRequested(); - virtual void MessageReceived(BMessage* message); - - int32 Go(BString& name, BString& parameters); - void Cancel(); + virtual ~InitParametersPanel(); -private: - class EscapeFilter; - EscapeFilter* fEscapeFilter; - sem_id fExitSemaphore; - BWindow* fWindow; - BButton* fOkButton; - int32 fReturnValue; - - BPartitionParameterEditor* fEditor; + status_t Go(BString& name, BString& parameters); }; -#endif // INIT_PARAMS_PANEL_H + +#endif // INIT_PARAMETERS_PANEL_H diff --git a/src/apps/drivesetup/Jamfile b/src/apps/drivesetup/Jamfile index 1e9b483..44a4a68 100644 --- a/src/apps/drivesetup/Jamfile +++ b/src/apps/drivesetup/Jamfile @@ -5,6 +5,7 @@ AddSubDirSupportedPlatforms libbe_test ; UsePrivateHeaders interface shared storage tracker ; Preference DriveSetup : + AbstractParametersPanel.cpp CreateParamsPanel.cpp DiskView.cpp DriveSetup.cpp diff --git a/src/apps/drivesetup/MainWindow.cpp b/src/apps/drivesetup/MainWindow.cpp index 6660cd5..2816b06 100644 --- a/src/apps/drivesetup/MainWindow.cpp +++ b/src/apps/drivesetup/MainWindow.cpp @@ -882,9 +882,9 @@ MainWindow::_Initialize(BDiskDevice* disk, partition_id selectedPartition, BString name; BString parameters; - InitParamsPanel* panel = new InitParamsPanel(this, diskSystemName, + InitParametersPanel* panel = new InitParametersPanel(this, diskSystemName, partition); - if (panel->Go(name, parameters) == GO_CANCELED) + if (panel->Go(name, parameters) != B_OK) return; bool supportsName = diskSystem.SupportsContentName(); @@ -1037,9 +1037,9 @@ MainWindow::_Create(BDiskDevice* disk, partition_id selectedPartition) off_t offset = currentSelection->Offset(); off_t size = currentSelection->Size(); - CreateParamsPanel* panel = new CreateParamsPanel(this, parent, offset, - size); - if (panel->Go(offset, size, name, type, parameters) == GO_CANCELED) + CreateParametersPanel* panel = new CreateParametersPanel(this, parent, + offset, size); + if (panel->Go(offset, size, name, type, parameters) != B_OK) return; ret = parent->ValidateCreateChild(&offset, &size, type.String(), diff --git a/src/apps/drivesetup/Support.h b/src/apps/drivesetup/Support.h index 9314446..b7540c6 100644 --- a/src/apps/drivesetup/Support.h +++ b/src/apps/drivesetup/Support.h @@ -21,11 +21,6 @@ void dump_partition_info(const BPartition* partition); bool is_valid_partitionable_space(size_t size); -enum { - GO_CANCELED = 0, - GO_SUCCESS -}; - static const uint32 kMegaByte = 0x100000; diff --git a/src/kits/storage/disk_device/PartitionParameterEditor.cpp b/src/kits/storage/disk_device/PartitionParameterEditor.cpp index 6c6a806..f1dfde6 100644 --- a/src/kits/storage/disk_device/PartitionParameterEditor.cpp +++ b/src/kits/storage/disk_device/PartitionParameterEditor.cpp @@ -1,4 +1,5 @@ /* + * Copyright 2013, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. * Copyright 2009, Bryce Groff, brycegroff@xxxxxxxxx. * Distributed under the terms of the MIT License. */ @@ -10,12 +11,52 @@ BPartitionParameterEditor::BPartitionParameterEditor() + : + fModificationMessage(NULL) { } BPartitionParameterEditor::~BPartitionParameterEditor() { + delete fModificationMessage; +} + + +/*! \brief Sets the controls of the editor to match the parameters + of the given \a partition. + + For \c B_CREATE_PARAMETER_EDITOR editors, this will be the parent + partition. +*/ +void +BPartitionParameterEditor::SetTo(BPartition* partition) +{ +} + + +/*! \brief Sets the modification message. + + This message needs to be sent whenever an internal parameter changed. + This call takes over ownership of the provided message. + + The message may contain a string field "parameter" with the value set + to the name of the changed parameter. +*/ +void +BPartitionParameterEditor::SetModificationMessage(BMessage* message) +{ + delete fModificationMessage; + fModificationMessage = message; +} + + +/*! \brief The currently set modification message, if any. +*/ +BMessage* +BPartitionParameterEditor::ModificationMessage() const +{ + return fModificationMessage; } @@ -40,7 +81,6 @@ BPartitionParameterEditor::View() } -// FinishedEditing /*! \brief Called when the user finishes editing the parameters. To be overridden by derived classes. @@ -52,59 +92,46 @@ BPartitionParameterEditor::View() \return \c true, if the current parameters are valid, \c false otherwise. */ bool -BPartitionParameterEditor::FinishedEditing() +BPartitionParameterEditor::ValidateParameters() const { - return false; + return true; } -/*! \brief Returns the edited parameters. - - To be overridden by derived classes. - The base class version returns an empty string. - - \param parameters A BString to be set to the edited parameters. +/*! \brief Called when a parameter has changed. - \return \c B_OK, if everything went fine, another error code otherwise. -*/ -status_t -BPartitionParameterEditor::GetParameters(BString* parameters) -{ - status_t error = (parameters ? B_OK : B_BAD_VALUE); - if (error == B_OK) - parameters->SetTo(""); - return error; -} - - -/*! \brief Called when type information has changed. + Each editor type comes with a number of predefined parameters that + may be changed from the outside while the editor is open. You can + either accept the changes, and update your controls correspondingly, + or else reject the change by returning an appropriate error code. To be overridden by derived classes. The base class version returns B_OK. - \param type A string that is the new type. - + \param name The name of the changed parameter. + \param variant The new value of the parameter. \return \c B_OK, if everything went fine, another error code otherwise. */ status_t -BPartitionParameterEditor::PartitionTypeChanged(const char* type) +BPartitionParameterEditor::ParameterChanged(const char* name, + const BVariant& variant) { return B_NOT_SUPPORTED; } -/*! \brief Called when name information has changed. +/*! \brief Returns the edited parameters. To be overridden by derived classes. - The base class version returns B_OK. + The base class version returns an empty string. - \param name A string that is the new name. + \param parameters A BString to be set to the edited parameters. \return \c B_OK, if everything went fine, another error code otherwise. */ status_t -BPartitionParameterEditor::PartitionNameChanged(const char* name) +BPartitionParameterEditor::GetParameters(BString& parameters) { - return B_NOT_SUPPORTED; + parameters.SetTo(""); + return B_OK; } - ############################################################################ Commit: 9deef7d466e88fd5030a5e03165c7b6894b12728 URL: http://cgit.haiku-os.org/haiku/commit/?id=9deef7d Author: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> Date: Sat Feb 2 00:07:49 2013 UTC DriveSetup: show content type if there is no type. ---------------------------------------------------------------------------- diff --git a/src/apps/drivesetup/PartitionList.cpp b/src/apps/drivesetup/PartitionList.cpp index 098b2d3..04246ed 100644 --- a/src/apps/drivesetup/PartitionList.cpp +++ b/src/apps/drivesetup/PartitionList.cpp @@ -285,6 +285,8 @@ PartitionListRow::PartitionListRow(BPartition* partition) // Partition type + if (partitionType.IsEmpty()) + partitionType = partition->ContentType(); SetField(new BStringField(partitionType), kPartitionTypeColumn); } ############################################################################ Revision: hrev45226 Commit: 4ec2ca4e1645f59237d611942f08f442370c5cfe URL: http://cgit.haiku-os.org/haiku/commit/?id=4ec2ca4 Author: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> Date: Sat Feb 2 00:11:27 2013 UTC DriveSetup: renamed some files, fixed catalog. * Already renamed the classes within those files earlier. * The AbstractParametersPanel class was missing from the catalog. ---------------------------------------------------------------------------- diff --git a/src/apps/drivesetup/CreateParamsPanel.cpp b/src/apps/drivesetup/CreateParametersPanel.cpp similarity index 99% rename from src/apps/drivesetup/CreateParamsPanel.cpp rename to src/apps/drivesetup/CreateParametersPanel.cpp index 42abf27..f85713d 100644 --- a/src/apps/drivesetup/CreateParamsPanel.cpp +++ b/src/apps/drivesetup/CreateParametersPanel.cpp @@ -10,7 +10,7 @@ */ -#include "CreateParamsPanel.h" +#include "CreateParametersPanel.h" #include <Button.h> #include <Catalog.h> diff --git a/src/apps/drivesetup/CreateParamsPanel.h b/src/apps/drivesetup/CreateParametersPanel.h similarity index 100% rename from src/apps/drivesetup/CreateParamsPanel.h rename to src/apps/drivesetup/CreateParametersPanel.h diff --git a/src/apps/drivesetup/InitParamsPanel.cpp b/src/apps/drivesetup/InitParametersPanel.cpp similarity index 97% rename from src/apps/drivesetup/InitParamsPanel.cpp rename to src/apps/drivesetup/InitParametersPanel.cpp index 9c8ae56..c047bb2 100644 --- a/src/apps/drivesetup/InitParamsPanel.cpp +++ b/src/apps/drivesetup/InitParametersPanel.cpp @@ -9,7 +9,7 @@ */ -#include "InitParamsPanel.h" +#include "InitParametersPanel.h" #include <driver_settings.h> #include <stdio.h> diff --git a/src/apps/drivesetup/InitParamsPanel.h b/src/apps/drivesetup/InitParametersPanel.h similarity index 100% rename from src/apps/drivesetup/InitParamsPanel.h rename to src/apps/drivesetup/InitParametersPanel.h diff --git a/src/apps/drivesetup/Jamfile b/src/apps/drivesetup/Jamfile index 44a4a68..b2884801 100644 --- a/src/apps/drivesetup/Jamfile +++ b/src/apps/drivesetup/Jamfile @@ -6,10 +6,10 @@ UsePrivateHeaders interface shared storage tracker ; Preference DriveSetup : AbstractParametersPanel.cpp - CreateParamsPanel.cpp + CreateParametersPanel.cpp DiskView.cpp DriveSetup.cpp - InitParamsPanel.cpp + InitParametersPanel.cpp MainWindow.cpp PartitionList.cpp Support.cpp @@ -22,9 +22,10 @@ Preference DriveSetup : DoCatalogs DriveSetup : x-vnd.Haiku-DriveSetup : - CreateParamsPanel.cpp + AbstractParametersPanel.cpp + CreateParametersPanel.cpp DiskView.cpp - InitParamsPanel.cpp + InitParametersPanel.cpp MainWindow.cpp PartitionList.cpp Support.cpp diff --git a/src/apps/drivesetup/MainWindow.cpp b/src/apps/drivesetup/MainWindow.cpp index 2816b06..6376e88 100644 --- a/src/apps/drivesetup/MainWindow.cpp +++ b/src/apps/drivesetup/MainWindow.cpp @@ -38,12 +38,13 @@ #include <Volume.h> #include <VolumeRoster.h> -#include "CreateParamsPanel.h" +#include <tracker_private.h> + +#include "CreateParametersPanel.h" #include "DiskView.h" -#include "InitParamsPanel.h" +#include "InitParametersPanel.h" #include "PartitionList.h" #include "Support.h" -#include "tracker_private.h" #undef B_TRANSLATION_CONTEXT