If no suitable partitions have been found, encourage the user to use the
Setup Partitions button... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30612 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -208,6 +208,7 @@ InstallerWindow::InstallerWindow()
|
|||||||
: BWindow(BRect(-2000, -2000, -1800, -1800), "Installer", B_TITLED_WINDOW,
|
: BWindow(BRect(-2000, -2000, -1800, -1800), "Installer", B_TITLED_WINDOW,
|
||||||
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
|
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
|
||||||
fNeedsToCenterOnScreen(true),
|
fNeedsToCenterOnScreen(true),
|
||||||
|
fEncouragedToSetupPartitions(false),
|
||||||
fDriveSetupLaunched(false),
|
fDriveSetupLaunched(false),
|
||||||
fInstallStatus(kReadyForInstall),
|
fInstallStatus(kReadyForInstall),
|
||||||
fWorkerThread(new WorkerThread(this)),
|
fWorkerThread(new WorkerThread(this)),
|
||||||
@@ -633,7 +634,9 @@ InstallerWindow::_UpdateControls()
|
|||||||
}
|
}
|
||||||
fSrcMenuField->MenuItem()->SetLabel(label.String());
|
fSrcMenuField->MenuItem()->SetLabel(label.String());
|
||||||
|
|
||||||
// Disable any unsuitable target items
|
// Disable any unsuitable target items, check if at least one partition
|
||||||
|
// is suitable.
|
||||||
|
bool foundOneSuitableTarget = false;
|
||||||
for (int32 i = fDestMenu->CountItems() - 1; i >= 0; i--) {
|
for (int32 i = fDestMenu->CountItems() - 1; i >= 0; i--) {
|
||||||
PartitionMenuItem* dstItem
|
PartitionMenuItem* dstItem
|
||||||
= (PartitionMenuItem*)fDestMenu->ItemAt(i);
|
= (PartitionMenuItem*)fDestMenu->ItemAt(i);
|
||||||
@@ -644,6 +647,9 @@ InstallerWindow::_UpdateControls()
|
|||||||
dstItem->SetMarked(false);
|
dstItem->SetMarked(false);
|
||||||
} else
|
} else
|
||||||
dstItem->SetEnabled(dstItem->IsValidTarget());
|
dstItem->SetEnabled(dstItem->IsValidTarget());
|
||||||
|
|
||||||
|
if (dstItem->IsEnabled())
|
||||||
|
foundOneSuitableTarget = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PartitionMenuItem* dstItem = (PartitionMenuItem*)fDestMenu->FindMarked();
|
PartitionMenuItem* dstItem = (PartitionMenuItem*)fDestMenu->FindMarked();
|
||||||
@@ -683,6 +689,15 @@ InstallerWindow::_UpdateControls()
|
|||||||
label << " to \'" <<dstItem->Name() << '\'';
|
label << " to \'" <<dstItem->Name() << '\'';
|
||||||
fMakeBootableButton->SetEnabled(dstItem);
|
fMakeBootableButton->SetEnabled(dstItem);
|
||||||
fMakeBootableButton->SetLabel(label.String());
|
fMakeBootableButton->SetLabel(label.String());
|
||||||
|
|
||||||
|
if (!fEncouragedToSetupPartitions && !foundOneSuitableTarget) {
|
||||||
|
// Focus the users attention on the DriveSetup button
|
||||||
|
fEncouragedToSetupPartitions = true;
|
||||||
|
(new BAlert("use drive setup", "No partitions have been found that "
|
||||||
|
"are suitable for installation. Please setup partitions and "
|
||||||
|
"initialize at least one partition with the Be File System." ,
|
||||||
|
"Ok"))->Go();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ private:
|
|||||||
BButton* fMakeBootableButton;
|
BButton* fMakeBootableButton;
|
||||||
|
|
||||||
bool fNeedsToCenterOnScreen;
|
bool fNeedsToCenterOnScreen;
|
||||||
|
bool fEncouragedToSetupPartitions;
|
||||||
|
|
||||||
bool fDriveSetupLaunched;
|
bool fDriveSetupLaunched;
|
||||||
InstallStatus fInstallStatus;
|
InstallStatus fInstallStatus;
|
||||||
|
|||||||
Reference in New Issue
Block a user