* Don't continue with initializing a partition if the user cancelled the

parameter panel... Doh!
* Force update the disk view when rescanning the disks (a newly initialized
  partition will now also show the correct name in the DiskView).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26465 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-07-17 01:00:49 +00:00
parent d63b9e14a0
commit 441ad0b87e
3 changed files with 9 additions and 8 deletions

View File

@ -420,18 +420,15 @@ DiskView::SetDisk(BDiskDevice* disk, partition_id selectedPartition)
{
if (fDisk != disk) {
fDisk = disk;
_UpdateLayout();
ForceUpdate();
}
fPartitionLayout->SetSelectedPartition(selectedPartition);
}
// #pragma mark -
void
DiskView::_UpdateLayout()
DiskView::ForceUpdate()
{
while (BView* view = ChildAt(0)) {
view->RemoveSelf();

View File

@ -26,9 +26,9 @@ public:
void SetDiskCount(int32 count);
void SetDisk(BDiskDevice* disk,
partition_id selectedPartition);
private:
void _UpdateLayout();
void ForceUpdate();
private:
int32 fDiskCount;
BDiskDevice* fDisk;
SpaceIDMap& fSpaceIDMap;

View File

@ -376,6 +376,7 @@ MainWindow::_ScanDrives()
fListView->AddToSelection(previousSelection);
_EnabledDisableMenuItems(fCurrentDisk, fCurrentPartitionID,
previousSelection->ParentID());
fDiskView->ForceUpdate();
} else {
_EnabledDisableMenuItems(NULL, -1, -1);
}
@ -650,6 +651,7 @@ MainWindow::_MountAll()
// #pragma mark -
class ModificationPreparer {
public:
ModificationPreparer(BDiskDevice* disk)
@ -679,6 +681,7 @@ private:
status_t fModificationStatus;
};
void
MainWindow::_Initialize(BDiskDevice* disk, partition_id selectedPartition,
const BString& diskSystemName)
@ -760,7 +763,8 @@ MainWindow::_Initialize(BDiskDevice* disk, partition_id selectedPartition,
BString name = "Haiku";
BString parameters;
InitParamsPanel* panel = new InitParamsPanel(this);
panel->Go(name, parameters);
if (panel->Go(name, parameters) == GO_CANCELED)
return;
bool supportsName = diskSystem.SupportsContentName();
BString validatedName(name);