some changes : alert if free space isn't enough, set status when mouse is over packages (doesn't work for some reason ...)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16192 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2006-02-01 17:45:20 +00:00
parent d6b6f8bfe1
commit a5fa64b505
6 changed files with 45 additions and 5 deletions
+17 -3
View File
@@ -53,7 +53,8 @@ private:
CopyEngine::CopyEngine(InstallerWindow *window)
: BLooper("copy_engine"),
fWindow(window),
fPackages(NULL)
fPackages(NULL),
fSpaceRequired(0)
{
fControl = new InstallerCopyLoopControl(window);
Run();
@@ -119,22 +120,35 @@ CopyEngine::Start(BMenu *srcMenu, BMenu *targetMenu)
fprintf(stderr, "bad menu items\n");
return;
}
// check if target is initialized
// ask if init or mount as is
BPath targetDirectory;
BDiskDevice device;
BPartition *partition;
BVolume targetVolume;
if (fDDRoster.GetPartitionWithID(targetItem->ID(), &device, &partition) == B_OK) {
if (partition->GetVolume(&targetVolume)!=B_OK)
return;
if (partition->GetMountPoint(&targetDirectory)!=B_OK)
return;
} else if (fDDRoster.GetDeviceWithID(targetItem->ID(), &device) == B_OK) {
if (device.GetVolume(&targetVolume)!=B_OK)
return;
if (device.GetMountPoint(&targetDirectory)!=B_OK)
return;
} else
return; // shouldn't happen
// check if target is initialized
// ask if init or mount as is
// check if target has enough space
if ((fSpaceRequired > 0 && targetVolume.FreeBytes() < fSpaceRequired)
&& ((new BAlert("", "The destination disk may not have enough space. Try choosing a different disk or \
choose to not install optional items.", "Try installing anyway", "Cancel", 0,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0)) {
return;
}
BPath srcDirectory;
if (fDDRoster.GetPartitionWithID(srcItem->ID(), &device, &partition) == B_OK) {