[haiku-commits] haiku: hrev46994 - src/apps/drivesetup

  • From: julian.harnath@xxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 8 Mar 2014 23:27:46 +0100 (CET)

hrev46994 adds 1 changeset to branch 'master'
old head: 5d98ee1e4de58d0228a387ba1962e0bf9bd0f749
new head: 119bf0013c1085a8d0aaa4e1fb32af8cbd286146
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=119bf00+%5E5d98ee1

----------------------------------------------------------------------------

119bf00: Fix empty parameter dialog in DriveSetup
  
  * When the add-on provides no parameter editor, still add the set of
    of default controls instead of just bailing out of the Init()
    method.
  
  * Before, DriveSetup never added the default controls in such cases
    and simply showed an empty window. This happened when e.g. trying
    to create a new partition inside an extended partition (because
    ExtendedPartitionAddOn provides no parameter editor).
  
  * Fixes #10569

                          [ Julian Harnath <julian.harnath@xxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev46994
Commit:      119bf0013c1085a8d0aaa4e1fb32af8cbd286146
URL:         http://cgit.haiku-os.org/haiku/commit/?id=119bf00
Author:      Julian Harnath <julian.harnath@xxxxxxxxxxxxxx>
Date:        Sat Mar  8 22:18:27 2014 UTC

Ticket:      https://dev.haiku-os.org/ticket/10569

----------------------------------------------------------------------------

1 file changed, 10 insertions(+), 7 deletions(-)
src/apps/drivesetup/AbstractParametersPanel.cpp | 17 ++++++++++-------

----------------------------------------------------------------------------

diff --git a/src/apps/drivesetup/AbstractParametersPanel.cpp 
b/src/apps/drivesetup/AbstractParametersPanel.cpp
index c86b5d3..28b4ee7 100644
--- a/src/apps/drivesetup/AbstractParametersPanel.cpp
+++ b/src/apps/drivesetup/AbstractParametersPanel.cpp
@@ -97,7 +97,7 @@ AbstractParametersPanel::~AbstractParametersPanel()
 
        delete_sem(fExitSemaphore);
 
-       if (fEditor == NULL)
+       if (fOkButton->Window() == NULL)
                delete fOkButton;
 }
 
@@ -171,14 +171,15 @@ AbstractParametersPanel::Init(B_PARAMETER_EDITOR_TYPE 
type,
        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());
+
+       if (fEditor == NULL)
+               AddControls(builder, NULL);
+       else
+               AddControls(builder, fEditor->View());
 
        builder.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
                        .AddGlue()
@@ -189,8 +190,10 @@ AbstractParametersPanel::Init(B_PARAMETER_EDITOR_TYPE type,
 
        SetDefaultButton(fOkButton);
 
-       fEditor->SetTo(partition);
-       fEditor->SetModificationMessage(new BMessage(kParameterChanged));
+       if (fEditor != NULL) {
+               fEditor->SetTo(partition);
+               fEditor->SetModificationMessage(new 
BMessage(kParameterChanged));
+       }
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev46994 - src/apps/drivesetup - julian . harnath