2 * Copyright 2009, Stephan Aßmus <superstippi@gmx.de>.
3 * Copyright 2005, Jérôme DUVAL.
4 * All rights reserved. Distributed under the terms of the MIT License.
6 #ifndef WORKER_THREAD_H
7 #define WORKER_THREAD_H
9 #include <DiskDevice.h>
10 #include <DiskDeviceRoster.h>
12 #include <Messenger.h>
13 #include <Partition.h>
18 class ProgressReporter
;
20 class WorkerThread
: public BLooper
{
22 WorkerThread(const BMessenger
& owner
);
24 virtual void MessageReceived(BMessage
* message
);
26 void ScanDisksPartitions(BMenu
* srcMenu
,
29 void SetPackagesList(BList
* list
);
30 void SetSpaceRequired(off_t bytes
)
31 { fSpaceRequired
= bytes
; };
34 void SetLock(sem_id cancelSemaphore
)
35 { fCancelSemaphore
= cancelSemaphore
; }
37 void StartInstall(partition_id sourcePartitionID
,
38 partition_id targetPartitionID
);
39 void WriteBootSector(BMenu
* dstMenu
);
42 void _LaunchInitScript(BPath
& path
);
43 void _LaunchFinishScript(BPath
& path
);
45 status_t
_PerformInstall(partition_id sourcePartitionID
,
46 partition_id targetPartitionID
);
47 status_t
_InstallationError(status_t error
);
48 status_t
_MirrorIndices(const BPath
& srcDirectory
,
49 const BPath
& targetDirectory
) const;
50 status_t
_CreateDefaultIndices(
51 const BPath
& targetDirectory
) const;
52 status_t
_ProcessZipPackages(const char* sourcePath
,
53 const char* targetPath
,
54 ProgressReporter
* reporter
,
57 void _SetStatusMessage(const char* status
);
64 BDiskDeviceRoster fDDRoster
;
67 sem_id fCancelSemaphore
;
70 #endif // WORKER_THREAD_H