* Removed auto mounter code from Tracker.
* Tracker forwards auto mounter related messages to the mount_server. * Rewrote AutoMounterSettings to not know AutoMounter and use the layout-management. * Moved the "Eject When Unmounting" setting into the Mount Settings. * Launch the mount_server during boot, but delay the script until all previously mounted volumes have been mounted. This solves some annoying timing bugs during boot. For example when you have desktop backgrounds on other volumes and some servers don't deal well with the situation of links to add-ons on other volumes becoming valid with a delay... * src/kits/tracker/Commands.h includes the private headers/private/ mount/MountServer.h header, which made adjustments to the DiskUsage Jamfile necessary. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33555 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -114,10 +114,17 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
if [ -e /etc/users ]; then
|
if [ -e /etc/users ]; then
|
||||||
|
# TODO: system/Login needs to be fixed to launch the mount_server!
|
||||||
launch system/Login
|
launch system/Login
|
||||||
# nothing more
|
# nothing more
|
||||||
else
|
else
|
||||||
cd /boot/home
|
cd /boot/home
|
||||||
|
|
||||||
|
launch $SERVERS/mount_server
|
||||||
|
waitfor -m application/x-vnd.Haiku-mount_server
|
||||||
|
# delay the boot script until all previous volumes have been mounted
|
||||||
|
hey -s mount_server DO InitialScan
|
||||||
|
|
||||||
launch system/Tracker
|
launch system/Tracker
|
||||||
launch system/Deskbar
|
launch system/Deskbar
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
SubDir HAIKU_TOP src apps diskusage ;
|
SubDir HAIKU_TOP src apps diskusage ;
|
||||||
|
|
||||||
UsePrivateHeaders shared ;
|
UsePrivateHeaders mount shared tracker ;
|
||||||
UsePrivateHeaders tracker ;
|
|
||||||
SubDirHdrs $(HAIKU_TOP) src kits tracker ;
|
SubDirHdrs $(HAIKU_TOP) src kits tracker ;
|
||||||
|
|
||||||
Application DiskUsage :
|
Application DiskUsage :
|
||||||
|
|||||||
@@ -1,779 +0,0 @@
|
|||||||
/*
|
|
||||||
Open Tracker License
|
|
||||||
|
|
||||||
Terms and Conditions
|
|
||||||
|
|
||||||
Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
||||||
of the Software, and to permit persons to whom the Software is furnished to do
|
|
||||||
so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice applies to all licensees
|
|
||||||
and shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
||||||
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
||||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
Except as contained in this notice, the name of Be Incorporated shall not be
|
|
||||||
used in advertising or otherwise to promote the sale, use or other dealings in
|
|
||||||
this Software without prior written authorization from Be Incorporated.
|
|
||||||
|
|
||||||
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
|
|
||||||
of Be Incorporated in the United States and other countries. Other brand product
|
|
||||||
names are registered trademarks or trademarks of their respective holders.
|
|
||||||
All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "AutoMounter.h"
|
|
||||||
|
|
||||||
#include <Debug.h>
|
|
||||||
|
|
||||||
#include "AutoLock.h"
|
|
||||||
#include "AutoMounterSettings.h"
|
|
||||||
#include "Commands.h"
|
|
||||||
#include "FSUtils.h"
|
|
||||||
#include "Tracker.h"
|
|
||||||
#include "TrackerSettings.h"
|
|
||||||
|
|
||||||
#include <DiskDeviceRoster.h>
|
|
||||||
#include <DiskDevice.h>
|
|
||||||
#include <DiskDeviceList.h>
|
|
||||||
#include <DiskDeviceTypes.h>
|
|
||||||
#include <DiskSystem.h>
|
|
||||||
#include <fs_volume.h>
|
|
||||||
|
|
||||||
#include <Alert.h>
|
|
||||||
#include <fs_info.h>
|
|
||||||
#include <Message.h>
|
|
||||||
#include <Node.h>
|
|
||||||
#include <NodeMonitor.h>
|
|
||||||
#include <String.h>
|
|
||||||
#include <VolumeRoster.h>
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
|
|
||||||
static const char *kAutoMounterSettings = "automounter_settings";
|
|
||||||
static const uint32 kMsgInitialScan = 'insc';
|
|
||||||
static const char* kMountFlagsKeyExtension = " mount flags";
|
|
||||||
|
|
||||||
|
|
||||||
AutoMounter::AutoMounter()
|
|
||||||
: BLooper("AutoMounter", B_LOW_PRIORITY),
|
|
||||||
fNormalMode(kRestorePreviousVolumes),
|
|
||||||
fRemovableMode(kAllVolumes)
|
|
||||||
{
|
|
||||||
if (!BootedInSafeMode()) {
|
|
||||||
_ReadSettings();
|
|
||||||
} else {
|
|
||||||
// defeat automounter in safe mode, don't even care about the settings
|
|
||||||
fNormalMode = kNoVolumes;
|
|
||||||
fRemovableMode = kNoVolumes;
|
|
||||||
}
|
|
||||||
|
|
||||||
BDiskDeviceRoster().StartWatching(this,
|
|
||||||
B_DEVICE_REQUEST_DEVICE | B_DEVICE_REQUEST_DEVICE_LIST);
|
|
||||||
PostMessage(kMsgInitialScan);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AutoMounter::~AutoMounter()
|
|
||||||
{
|
|
||||||
BDiskDeviceRoster().StopWatching(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static bool
|
|
||||||
suggest_mount_flags(const BPartition* partition, uint32* _flags)
|
|
||||||
{
|
|
||||||
uint32 mountFlags = 0;
|
|
||||||
|
|
||||||
bool askReadOnly = true;
|
|
||||||
bool isBFS = false;
|
|
||||||
|
|
||||||
if (partition->ContentType() != NULL
|
|
||||||
&& strcmp(partition->ContentType(), kPartitionTypeBFS) == 0) {
|
|
||||||
#if 0
|
|
||||||
askReadOnly = false;
|
|
||||||
#endif
|
|
||||||
isBFS = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
BDiskSystem diskSystem;
|
|
||||||
status_t status = partition->GetDiskSystem(&diskSystem);
|
|
||||||
if (status == B_OK && !diskSystem.SupportsWriting())
|
|
||||||
askReadOnly = false;
|
|
||||||
|
|
||||||
if (partition->IsReadOnly())
|
|
||||||
askReadOnly = false;
|
|
||||||
|
|
||||||
if (askReadOnly) {
|
|
||||||
// Suggest to the user to mount read-only until Haiku is more mature.
|
|
||||||
BString string;
|
|
||||||
string << "Mounting volume ";
|
|
||||||
if (partition->ContentName() != NULL)
|
|
||||||
string << "'" << partition->ContentName() << "'\n\n";
|
|
||||||
else
|
|
||||||
string << "<unnamed volume>\n\n";
|
|
||||||
// TODO: Use distro name instead of "Haiku"...
|
|
||||||
if (!isBFS) {
|
|
||||||
string << "The file system on this volume is not the Haiku file "
|
|
||||||
"system. It is strongly suggested to mount it in read-only "
|
|
||||||
"mode. ";
|
|
||||||
} else {
|
|
||||||
string << "It is suggested to mount all additional Haiku volumes "
|
|
||||||
"in read-only mode. ";
|
|
||||||
}
|
|
||||||
string << "This will prevent unintentional data loss because of "
|
|
||||||
"errors in Haiku.";
|
|
||||||
BAlert* alert = new BAlert("Mount Warning", string.String(),
|
|
||||||
"Mount Read/Write", "Cancel", "Mount Read-only",
|
|
||||||
B_WIDTH_FROM_WIDEST, B_WARNING_ALERT);
|
|
||||||
alert->SetShortcut(1, B_ESCAPE);
|
|
||||||
int32 choice = alert->Go();
|
|
||||||
switch (choice) {
|
|
||||||
case 0:
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
return false;
|
|
||||||
case 2:
|
|
||||||
mountFlags |= B_MOUNT_READ_ONLY;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*_flags = mountFlags;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutoMounter::_MountVolumes(mount_mode normal, mount_mode removable,
|
|
||||||
bool initialRescan, partition_id deviceID)
|
|
||||||
{
|
|
||||||
if (normal == kNoVolumes && removable == kNoVolumes)
|
|
||||||
return;
|
|
||||||
|
|
||||||
class InitialMountVisitor : public BDiskDeviceVisitor {
|
|
||||||
public:
|
|
||||||
InitialMountVisitor(mount_mode normalMode, mount_mode removableMode,
|
|
||||||
bool initialRescan, BMessage& previous,
|
|
||||||
partition_id deviceID)
|
|
||||||
:
|
|
||||||
fNormalMode(normalMode),
|
|
||||||
fRemovableMode(removableMode),
|
|
||||||
fInitialRescan(initialRescan),
|
|
||||||
fPrevious(previous),
|
|
||||||
fOnlyOnDeviceID(deviceID)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual
|
|
||||||
~InitialMountVisitor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
Visit(BDiskDevice* device)
|
|
||||||
{
|
|
||||||
return Visit(device, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
Visit(BPartition* partition, int32 level)
|
|
||||||
{
|
|
||||||
if (fOnlyOnDeviceID >= 0) {
|
|
||||||
// only mount partitions on the given device id
|
|
||||||
// or if the partition ID is already matched
|
|
||||||
BPartition* device = partition;
|
|
||||||
while (device->Parent() != NULL) {
|
|
||||||
if (device->ID() == fOnlyOnDeviceID) {
|
|
||||||
// we are happy
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
device = device->Parent();
|
|
||||||
}
|
|
||||||
if (device->ID() != fOnlyOnDeviceID)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
mount_mode mode = !fInitialRescan
|
|
||||||
&& partition->Device()->IsRemovableMedia()
|
|
||||||
? fRemovableMode : fNormalMode;
|
|
||||||
if (mode == kNoVolumes
|
|
||||||
|| partition->IsMounted()
|
|
||||||
|| !partition->ContainsFileSystem())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
BPath path;
|
|
||||||
if (partition->GetPath(&path) != B_OK)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (mode == kRestorePreviousVolumes) {
|
|
||||||
// mount all volumes that were stored in the settings file
|
|
||||||
const char *volumeName = NULL;
|
|
||||||
if (partition->ContentName() == NULL
|
|
||||||
|| fPrevious.FindString(path.Path(), &volumeName)
|
|
||||||
!= B_OK
|
|
||||||
|| strcmp(volumeName, partition->ContentName()))
|
|
||||||
return false;
|
|
||||||
} else if (mode == kOnlyBFSVolumes) {
|
|
||||||
if (partition->ContentType() == NULL
|
|
||||||
|| strcmp(partition->ContentType(), kPartitionTypeBFS))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 mountFlags;
|
|
||||||
if (!fInitialRescan) {
|
|
||||||
// Ask the user about mount flags if this is not the
|
|
||||||
// initial scan.
|
|
||||||
if (!suggest_mount_flags(partition, &mountFlags))
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
BString mountFlagsKey(path.Path());
|
|
||||||
mountFlagsKey << kMountFlagsKeyExtension;
|
|
||||||
if (fPrevious.FindInt32(mountFlagsKey.String(),
|
|
||||||
(int32*)&mountFlags) < B_OK) {
|
|
||||||
mountFlags = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (partition->Mount(NULL, mountFlags) == B_OK
|
|
||||||
&& partition->GetMountPoint(&path) == B_OK) {
|
|
||||||
// notify Tracker that a new volume has been started
|
|
||||||
BMessage note(kVolumeMounted);
|
|
||||||
note.AddString("path", path.Path());
|
|
||||||
note.AddBool("initial rescan", fInitialRescan);
|
|
||||||
be_app->PostMessage(¬e);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
mount_mode fNormalMode;
|
|
||||||
mount_mode fRemovableMode;
|
|
||||||
bool fInitialRescan;
|
|
||||||
BMessage& fPrevious;
|
|
||||||
partition_id fOnlyOnDeviceID;
|
|
||||||
} visitor(normal, removable, initialRescan, fSettings, deviceID);
|
|
||||||
|
|
||||||
BDiskDeviceList devices;
|
|
||||||
status_t status = devices.Fetch();
|
|
||||||
if (status == B_OK)
|
|
||||||
devices.VisitEachPartition(&visitor);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutoMounter::_MountVolume(const BMessage* message)
|
|
||||||
{
|
|
||||||
int32 id;
|
|
||||||
if (message->FindInt32("id", &id) != B_OK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
BDiskDeviceRoster roster;
|
|
||||||
BPartition *partition;
|
|
||||||
BDiskDevice device;
|
|
||||||
if (roster.GetPartitionWithID(id, &device, &partition) != B_OK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
uint32 mountFlags;
|
|
||||||
if (!suggest_mount_flags(partition, &mountFlags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
status_t status = partition->Mount(NULL, mountFlags);
|
|
||||||
if (status < B_OK) {
|
|
||||||
BString string;
|
|
||||||
string << "Error mounting volume. (" << strerror(status) << ")";
|
|
||||||
(new BAlert("", string.String(), "Ok"))->Go(NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
AutoMounter::_SuggestForceUnmount(const char* name, status_t error)
|
|
||||||
{
|
|
||||||
BString text;
|
|
||||||
text << "Could not unmount disk \"" << name << "\":\n\t" << strerror(error);
|
|
||||||
text << "\n\nShould unmounting be forced?\n\n"
|
|
||||||
"Note: if an application is currently writing to the volume, unmounting"
|
|
||||||
" it now might result in loss of data.\n";
|
|
||||||
|
|
||||||
BAlert* alert = new BAlert("", text.String(), "Cancel", "Force Unmount",
|
|
||||||
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
|
||||||
int32 choice = alert->Go();
|
|
||||||
|
|
||||||
return choice == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutoMounter::_ReportUnmountError(const char* name, status_t error)
|
|
||||||
{
|
|
||||||
BString text;
|
|
||||||
text << "Could not unmount disk \"" << name << "\":\n\t" << strerror(error);
|
|
||||||
|
|
||||||
(new BAlert("", text.String(), "OK", NULL, NULL, B_WIDTH_AS_USUAL,
|
|
||||||
B_WARNING_ALERT))->Go(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutoMounter::_UnmountAndEjectVolume(BPartition* partition, BPath& mountPoint,
|
|
||||||
const char* name)
|
|
||||||
{
|
|
||||||
BDiskDevice device;
|
|
||||||
if (partition == NULL) {
|
|
||||||
// Try to retrieve partition
|
|
||||||
BDiskDeviceRoster().FindPartitionByMountPoint(mountPoint.Path(),
|
|
||||||
&device, &partition);
|
|
||||||
}
|
|
||||||
|
|
||||||
status_t status;
|
|
||||||
if (partition != NULL)
|
|
||||||
status = partition->Unmount();
|
|
||||||
else
|
|
||||||
status = fs_unmount_volume(mountPoint.Path(), 0);
|
|
||||||
|
|
||||||
if (status < B_OK) {
|
|
||||||
if (!_SuggestForceUnmount(name, status))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (partition != NULL)
|
|
||||||
status = partition->Unmount(B_FORCE_UNMOUNT);
|
|
||||||
else
|
|
||||||
status = fs_unmount_volume(mountPoint.Path(), B_FORCE_UNMOUNT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status < B_OK) {
|
|
||||||
_ReportUnmountError(partition->ContentName(), status);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TrackerSettings().EjectWhenUnmounting() && partition != NULL) {
|
|
||||||
// eject device if it doesn't have any mounted partitions left
|
|
||||||
class IsMountedVisitor : public BDiskDeviceVisitor {
|
|
||||||
public:
|
|
||||||
IsMountedVisitor()
|
|
||||||
:
|
|
||||||
fHasMounted(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool Visit(BDiskDevice* device)
|
|
||||||
{
|
|
||||||
return Visit(device, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool Visit(BPartition* partition, int32 level)
|
|
||||||
{
|
|
||||||
if (partition->IsMounted()) {
|
|
||||||
fHasMounted = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HasMountedPartitions() const
|
|
||||||
{
|
|
||||||
return fHasMounted;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool fHasMounted;
|
|
||||||
} visitor;
|
|
||||||
|
|
||||||
partition->Device()->VisitEachDescendant(&visitor);
|
|
||||||
|
|
||||||
if (!visitor.HasMountedPartitions())
|
|
||||||
partition->Device()->Eject();
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove the directory if it's a directory in rootfs
|
|
||||||
if (dev_for_path(mountPoint.Path()) == dev_for_path("/"))
|
|
||||||
rmdir(mountPoint.Path());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutoMounter::_UnmountAndEjectVolume(BMessage* message)
|
|
||||||
{
|
|
||||||
int32 id;
|
|
||||||
if (message->FindInt32("id", &id) == B_OK) {
|
|
||||||
BDiskDeviceRoster roster;
|
|
||||||
BPartition *partition;
|
|
||||||
BDiskDevice device;
|
|
||||||
if (roster.GetPartitionWithID(id, &device, &partition) != B_OK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
BPath path;
|
|
||||||
if (partition->GetMountPoint(&path) == B_OK)
|
|
||||||
_UnmountAndEjectVolume(partition, path, partition->ContentName());
|
|
||||||
} else {
|
|
||||||
// see if we got a dev_t
|
|
||||||
|
|
||||||
dev_t device;
|
|
||||||
if (message->FindInt32("device_id", &device) != B_OK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
BVolume volume(device);
|
|
||||||
status_t status = volume.InitCheck();
|
|
||||||
|
|
||||||
char name[B_FILE_NAME_LENGTH];
|
|
||||||
if (status == B_OK)
|
|
||||||
status = volume.GetName(name);
|
|
||||||
if (status < B_OK)
|
|
||||||
snprintf(name, sizeof(name), "device:%ld", device);
|
|
||||||
|
|
||||||
BPath path;
|
|
||||||
if (status == B_OK) {
|
|
||||||
BDirectory mountPoint;
|
|
||||||
status = volume.GetRootDirectory(&mountPoint);
|
|
||||||
if (status == B_OK)
|
|
||||||
status = path.SetTo(&mountPoint, ".");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status == B_OK)
|
|
||||||
_UnmountAndEjectVolume(NULL, path, name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutoMounter::_FromMode(mount_mode mode, bool& all, bool& bfs, bool& restore)
|
|
||||||
{
|
|
||||||
all = bfs = restore = false;
|
|
||||||
|
|
||||||
switch (mode) {
|
|
||||||
case kAllVolumes:
|
|
||||||
all = true;
|
|
||||||
break;
|
|
||||||
case kOnlyBFSVolumes:
|
|
||||||
bfs = true;
|
|
||||||
break;
|
|
||||||
case kRestorePreviousVolumes:
|
|
||||||
restore = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AutoMounter::mount_mode
|
|
||||||
AutoMounter::_ToMode(bool all, bool bfs, bool restore)
|
|
||||||
{
|
|
||||||
if (all)
|
|
||||||
return kAllVolumes;
|
|
||||||
if (bfs)
|
|
||||||
return kOnlyBFSVolumes;
|
|
||||||
if (restore)
|
|
||||||
return kRestorePreviousVolumes;
|
|
||||||
|
|
||||||
return kNoVolumes;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutoMounter::_ReadSettings()
|
|
||||||
{
|
|
||||||
BPath directoryPath;
|
|
||||||
if (FSFindTrackerSettingsDir(&directoryPath) != B_OK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
BPath path(directoryPath);
|
|
||||||
path.Append(kAutoMounterSettings);
|
|
||||||
fPrefsFile.SetTo(path.Path(), O_RDWR);
|
|
||||||
|
|
||||||
if (fPrefsFile.InitCheck() != B_OK) {
|
|
||||||
// no prefs file yet, create a new one
|
|
||||||
|
|
||||||
BDirectory dir(directoryPath.Path());
|
|
||||||
dir.CreateFile(kAutoMounterSettings, &fPrefsFile);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ssize_t settingsSize = (ssize_t)fPrefsFile.Seek(0, SEEK_END);
|
|
||||||
if (settingsSize == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ASSERT(settingsSize != 0);
|
|
||||||
char *buffer = new char[settingsSize];
|
|
||||||
|
|
||||||
fPrefsFile.Seek(0, 0);
|
|
||||||
if (fPrefsFile.Read(buffer, (size_t)settingsSize) != settingsSize) {
|
|
||||||
PRINT(("error reading automounter settings\n"));
|
|
||||||
delete [] buffer;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BMessage message('stng');
|
|
||||||
status_t result = message.Unflatten(buffer);
|
|
||||||
if (result != B_OK) {
|
|
||||||
PRINT(("error %s unflattening settings, size %d\n", strerror(result),
|
|
||||||
settingsSize));
|
|
||||||
delete [] buffer;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete [] buffer;
|
|
||||||
|
|
||||||
// update flags and modes from the message
|
|
||||||
_UpdateSettingsFromMessage(&message);
|
|
||||||
// copy the previously mounted partitions
|
|
||||||
fSettings = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutoMounter::_WriteSettings()
|
|
||||||
{
|
|
||||||
if (fPrefsFile.InitCheck() != B_OK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
BMessage message('stng');
|
|
||||||
GetSettings(&message);
|
|
||||||
|
|
||||||
ssize_t settingsSize = message.FlattenedSize();
|
|
||||||
|
|
||||||
char *buffer = new char[settingsSize];
|
|
||||||
status_t result = message.Flatten(buffer, settingsSize);
|
|
||||||
|
|
||||||
fPrefsFile.Seek(0, 0);
|
|
||||||
result = fPrefsFile.Write(buffer, (size_t)settingsSize);
|
|
||||||
if (result != settingsSize)
|
|
||||||
PRINT(("error writing settings, %s\n", strerror(result)));
|
|
||||||
|
|
||||||
delete [] buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutoMounter::_UpdateSettingsFromMessage(BMessage* message)
|
|
||||||
{
|
|
||||||
// auto mounter settings
|
|
||||||
|
|
||||||
bool all, bfs, restore;
|
|
||||||
if (message->FindBool("autoMountAll", &all) != B_OK)
|
|
||||||
all = true;
|
|
||||||
if (message->FindBool("autoMountAllBFS", &bfs) != B_OK)
|
|
||||||
bfs = false;
|
|
||||||
|
|
||||||
fRemovableMode = _ToMode(all, bfs, false);
|
|
||||||
|
|
||||||
// initial mount settings
|
|
||||||
|
|
||||||
if (message->FindBool("initialMountAll", &all) != B_OK)
|
|
||||||
all = false;
|
|
||||||
if (message->FindBool("initialMountAllBFS", &bfs) != B_OK)
|
|
||||||
bfs = false;
|
|
||||||
if (message->FindBool("initialMountRestore", &restore) != B_OK)
|
|
||||||
restore = true;
|
|
||||||
|
|
||||||
fNormalMode = _ToMode(all, bfs, restore);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutoMounter::GetSettings(BMessage *message)
|
|
||||||
{
|
|
||||||
message->MakeEmpty();
|
|
||||||
|
|
||||||
bool all, bfs, restore;
|
|
||||||
|
|
||||||
_FromMode(fNormalMode, all, bfs, restore);
|
|
||||||
message->AddBool("initialMountAll", all);
|
|
||||||
message->AddBool("initialMountAllBFS", bfs);
|
|
||||||
message->AddBool("initialMountRestore", restore);
|
|
||||||
|
|
||||||
_FromMode(fRemovableMode, all, bfs, restore);
|
|
||||||
message->AddBool("autoMountAll", all);
|
|
||||||
message->AddBool("autoMountAllBFS", bfs);
|
|
||||||
|
|
||||||
// Save mounted volumes so we can optionally mount them on next
|
|
||||||
// startup
|
|
||||||
BVolumeRoster volumeRoster;
|
|
||||||
BVolume volume;
|
|
||||||
while (volumeRoster.GetNextVolume(&volume) == B_OK) {
|
|
||||||
fs_info info;
|
|
||||||
if (fs_stat_dev(volume.Device(), &info) == 0
|
|
||||||
&& (info.flags & (B_FS_IS_REMOVABLE | B_FS_IS_PERSISTENT)) != 0) {
|
|
||||||
message->AddString(info.device_name, info.volume_name);
|
|
||||||
|
|
||||||
BString mountFlagsKey(info.device_name);
|
|
||||||
mountFlagsKey << kMountFlagsKeyExtension;
|
|
||||||
uint32 mountFlags = 0;
|
|
||||||
if (volume.IsReadOnly())
|
|
||||||
mountFlags |= B_MOUNT_READ_ONLY;
|
|
||||||
message->AddInt32(mountFlagsKey.String(), mountFlags);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutoMounter::MessageReceived(BMessage* message)
|
|
||||||
{
|
|
||||||
switch (message->what) {
|
|
||||||
case kMsgInitialScan:
|
|
||||||
_MountVolumes(fNormalMode, fRemovableMode, true);
|
|
||||||
be_app->PostMessage(kOpenPreviouslyOpenWindows);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kMountVolume:
|
|
||||||
_MountVolume(message);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kUnmountVolume:
|
|
||||||
_UnmountAndEjectVolume(message);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kSetAutomounterParams:
|
|
||||||
{
|
|
||||||
bool rescanNow = false;
|
|
||||||
message->FindBool("rescanNow", &rescanNow);
|
|
||||||
|
|
||||||
_UpdateSettingsFromMessage(message);
|
|
||||||
GetSettings(&fSettings);
|
|
||||||
_WriteSettings();
|
|
||||||
|
|
||||||
if (rescanNow)
|
|
||||||
_MountVolumes(fNormalMode, fRemovableMode);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case kMountAllNow:
|
|
||||||
_MountVolumes(kAllVolumes, kAllVolumes);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case B_DEVICE_UPDATE:
|
|
||||||
int32 event;
|
|
||||||
if (message->FindInt32("event", &event) != B_OK
|
|
||||||
|| (event != B_DEVICE_MEDIA_CHANGED
|
|
||||||
&& event != B_DEVICE_ADDED))
|
|
||||||
break;
|
|
||||||
|
|
||||||
partition_id deviceID;
|
|
||||||
if (message->FindInt32("id", &deviceID) != B_OK)
|
|
||||||
break;
|
|
||||||
|
|
||||||
_MountVolumes(kNoVolumes, fRemovableMode, false, deviceID);
|
|
||||||
break;
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
case B_NODE_MONITOR:
|
|
||||||
{
|
|
||||||
int32 opcode;
|
|
||||||
if (message->FindInt32("opcode", &opcode) != B_OK)
|
|
||||||
break;
|
|
||||||
|
|
||||||
switch (opcode) {
|
|
||||||
// The name of a mount point has changed
|
|
||||||
case B_ENTRY_MOVED: {
|
|
||||||
WRITELOG(("*** Received Mount Point Renamed Notification"));
|
|
||||||
|
|
||||||
const char *newName;
|
|
||||||
if (message->FindString("name", &newName) != B_OK) {
|
|
||||||
WRITELOG(("ERROR: Couldn't find name field in update message"));
|
|
||||||
PRINT_OBJECT(*message);
|
|
||||||
break ;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// When the node monitor reports a move, it gives the
|
|
||||||
// parent device and inode that moved. The problem is
|
|
||||||
// that the inode is the inode of root *in* the filesystem,
|
|
||||||
// which is generally always the same number for every
|
|
||||||
// filesystem of a type.
|
|
||||||
//
|
|
||||||
// What we'd really like is the device that the moved
|
|
||||||
// volume is mounted on. Find this by using the
|
|
||||||
// *new* name and directory, and then stat()ing that to
|
|
||||||
// find the device.
|
|
||||||
//
|
|
||||||
dev_t parentDevice;
|
|
||||||
if (message->FindInt32("device", &parentDevice) != B_OK) {
|
|
||||||
WRITELOG(("ERROR: Couldn't find 'device' field in update"
|
|
||||||
" message"));
|
|
||||||
PRINT_OBJECT(*message);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ino_t toDirectory;
|
|
||||||
if (message->FindInt64("to directory", &toDirectory)!=B_OK){
|
|
||||||
WRITELOG(("ERROR: Couldn't find 'to directory' field in update"
|
|
||||||
"message"));
|
|
||||||
PRINT_OBJECT(*message);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
entry_ref root_entry(parentDevice, toDirectory, newName);
|
|
||||||
|
|
||||||
BNode entryNode(&root_entry);
|
|
||||||
if (entryNode.InitCheck() != B_OK) {
|
|
||||||
WRITELOG(("ERROR: Couldn't create mount point entry node: %s/n",
|
|
||||||
strerror(entryNode.InitCheck())));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
node_ref mountPointNode;
|
|
||||||
if (entryNode.GetNodeRef(&mountPointNode) != B_OK) {
|
|
||||||
WRITELOG(("ERROR: Couldn't get node ref for new mount point"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
WRITELOG(("Attempt to rename device %li to %s", mountPointNode.device,
|
|
||||||
newName));
|
|
||||||
|
|
||||||
Partition *partition = FindPartition(mountPointNode.device);
|
|
||||||
if (partition != NULL) {
|
|
||||||
WRITELOG(("Found device, changing name."));
|
|
||||||
|
|
||||||
BVolume mountVolume(partition->VolumeDeviceID());
|
|
||||||
BDirectory mountDir;
|
|
||||||
mountVolume.GetRootDirectory(&mountDir);
|
|
||||||
BPath dirPath(&mountDir, 0);
|
|
||||||
|
|
||||||
partition->SetMountedAt(dirPath.Path());
|
|
||||||
partition->SetVolumeName(newName);
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
WRITELOG(("ERROR: Device %li does not appear to be present",
|
|
||||||
mountPointNode.device));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
|
||||||
BLooper::MessageReceived(message);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
AutoMounter::QuitRequested()
|
|
||||||
{
|
|
||||||
if (!BootedInSafeMode()) {
|
|
||||||
// don't write out settings in safe mode - this would overwrite the
|
|
||||||
// normal, non-safe mode settings
|
|
||||||
_WriteSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,108 +0,0 @@
|
|||||||
/*
|
|
||||||
Open Tracker License
|
|
||||||
|
|
||||||
Terms and Conditions
|
|
||||||
|
|
||||||
Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
||||||
of the Software, and to permit persons to whom the Software is furnished to do
|
|
||||||
so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice applies to all licensees
|
|
||||||
and shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
||||||
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
||||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
Except as contained in this notice, the name of Be Incorporated shall not be
|
|
||||||
used in advertising or otherwise to promote the sale, use or other dealings in
|
|
||||||
this Software without prior written authorization from Be Incorporated.
|
|
||||||
|
|
||||||
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
|
|
||||||
of Be Incorporated in the United States and other countries. Other brand product
|
|
||||||
names are registered trademarks or trademarks of their respective holders.
|
|
||||||
All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _AUTO_MOUNTER_H
|
|
||||||
#define _AUTO_MOUNTER_H
|
|
||||||
|
|
||||||
#include <DiskDeviceDefs.h>
|
|
||||||
#include <File.h>
|
|
||||||
#include <Looper.h>
|
|
||||||
#include <Message.h>
|
|
||||||
|
|
||||||
class BPartition;
|
|
||||||
class BPath;
|
|
||||||
|
|
||||||
namespace BPrivate {
|
|
||||||
|
|
||||||
const uint32 kMountVolume = 'mntv';
|
|
||||||
const uint32 kMountAllNow = 'mntn';
|
|
||||||
const uint32 kSetAutomounterParams = 'pmst';
|
|
||||||
const uint32 kVolumeMounted = 'vmtd';
|
|
||||||
|
|
||||||
|
|
||||||
class AutoMounter : public BLooper {
|
|
||||||
public:
|
|
||||||
AutoMounter();
|
|
||||||
virtual ~AutoMounter();
|
|
||||||
|
|
||||||
virtual bool QuitRequested();
|
|
||||||
|
|
||||||
void GetSettings(BMessage* message);
|
|
||||||
|
|
||||||
private:
|
|
||||||
enum mount_mode {
|
|
||||||
kNoVolumes,
|
|
||||||
kOnlyBFSVolumes,
|
|
||||||
kAllVolumes,
|
|
||||||
kRestorePreviousVolumes
|
|
||||||
};
|
|
||||||
|
|
||||||
void _MountVolumes(mount_mode normal,
|
|
||||||
mount_mode removable,
|
|
||||||
bool initialRescan = false,
|
|
||||||
partition_id deviceID = -1);
|
|
||||||
void _MountVolume(const BMessage* message);
|
|
||||||
bool _SuggestForceUnmount(const char* name,
|
|
||||||
status_t error);
|
|
||||||
void _ReportUnmountError(const char* name,
|
|
||||||
status_t error);
|
|
||||||
void _UnmountAndEjectVolume(BPartition* partition,
|
|
||||||
BPath& mountPoint, const char* name);
|
|
||||||
void _UnmountAndEjectVolume(BMessage* message);
|
|
||||||
|
|
||||||
void _FromMode(mount_mode mode, bool& all,
|
|
||||||
bool& bfs, bool& restore);
|
|
||||||
mount_mode _ToMode(bool all, bool bfs,
|
|
||||||
bool restore = false);
|
|
||||||
|
|
||||||
void _UpdateSettingsFromMessage(BMessage* message);
|
|
||||||
void _ReadSettings();
|
|
||||||
void _WriteSettings();
|
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage* message);
|
|
||||||
|
|
||||||
private:
|
|
||||||
mount_mode fNormalMode;
|
|
||||||
mount_mode fRemovableMode;
|
|
||||||
|
|
||||||
BFile fPrefsFile;
|
|
||||||
BMessage fSettings;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace BPrivate
|
|
||||||
|
|
||||||
using namespace BPrivate;
|
|
||||||
|
|
||||||
#endif // _AUTO_MOUNTER_H
|
|
||||||
|
|||||||
@@ -32,39 +32,41 @@ names are registered trademarks or trademarks of their respective holders.
|
|||||||
All rights reserved.
|
All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "AutoMounter.h"
|
|
||||||
#include "AutoMounterSettings.h"
|
#include "AutoMounterSettings.h"
|
||||||
|
|
||||||
|
#include <Alert.h>
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <CheckBox.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
|
#include <GridLayoutBuilder.h>
|
||||||
|
#include <GroupLayoutBuilder.h>
|
||||||
|
#include <SpaceLayoutItem.h>
|
||||||
|
#include <SeparatorView.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <RadioButton.h>
|
#include <RadioButton.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
|
#include <MountServer.h>
|
||||||
|
|
||||||
|
|
||||||
const uint32 kAutomountSettingsChanged = 'achg';
|
const uint32 kAutomountSettingsChanged = 'achg';
|
||||||
const uint32 kBootMountSettingsChanged = 'bchg';
|
const uint32 kBootMountSettingsChanged = 'bchg';
|
||||||
const uint32 kAutoAll = 'aall';
|
const uint32 kEjectWhenUnmountingChanged = 'ejct';
|
||||||
const uint32 kAutoBFS = 'abfs';
|
|
||||||
const uint32 kAutoHFS = 'ahfs';
|
|
||||||
const uint32 kInitAll = 'iall';
|
|
||||||
const uint32 kInitBFS = 'ibfs';
|
|
||||||
const uint32 kInitHFS = 'ihfs';
|
|
||||||
|
|
||||||
class AutomountSettingsPanel : public BBox {
|
class AutomountSettingsPanel : public BBox {
|
||||||
public:
|
public:
|
||||||
AutomountSettingsPanel(BRect, BMessage *, AutoMounter *);
|
AutomountSettingsPanel(BMessage* settings,
|
||||||
|
const BMessenger& target);
|
||||||
virtual ~AutomountSettingsPanel();
|
virtual ~AutomountSettingsPanel();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void MessageReceived(BMessage *);
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
virtual void GetPreferredSize(float* _width, float* _height);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SendSettings(bool rescan);
|
void _SendSettings(bool rescan);
|
||||||
|
|
||||||
BRadioButton* fInitialDontMountCheck;
|
BRadioButton* fInitialDontMountCheck;
|
||||||
BRadioButton* fInitialMountAllBFSCheck;
|
BRadioButton* fInitialMountAllBFSCheck;
|
||||||
@@ -75,134 +77,137 @@ class AutomountSettingsPanel : public BBox {
|
|||||||
BRadioButton* fAutoMountAllBFSCheck;
|
BRadioButton* fAutoMountAllBFSCheck;
|
||||||
BRadioButton* fAutoMountAllCheck;
|
BRadioButton* fAutoMountAllCheck;
|
||||||
|
|
||||||
|
BCheckBox* fEjectWhenUnmountingCheckBox;
|
||||||
|
|
||||||
BButton* fDone;
|
BButton* fDone;
|
||||||
BButton* fMountAllNow;
|
BButton* fMountAllNow;
|
||||||
|
|
||||||
AutoMounter *fTarget;
|
BMessenger fTarget;
|
||||||
|
|
||||||
typedef BBox _inherited;
|
typedef BBox _inherited;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
AutomountSettingsDialog* AutomountSettingsDialog::sOneCopyOnly = NULL;
|
AutomountSettingsDialog* AutomountSettingsDialog::sOneCopyOnly = NULL;
|
||||||
|
|
||||||
|
|
||||||
AutomountSettingsPanel::AutomountSettingsPanel(BRect frame,
|
AutomountSettingsPanel::AutomountSettingsPanel(BMessage* settings,
|
||||||
BMessage *settings, AutoMounter *target)
|
const BMessenger& target)
|
||||||
: BBox(frame, "", B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS
|
:
|
||||||
| B_NAVIGABLE_JUMP, B_NO_BORDER),
|
BBox("", B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP, B_NO_BORDER),
|
||||||
fTarget(target)
|
fTarget(target)
|
||||||
{
|
{
|
||||||
|
const float spacing = 8;
|
||||||
|
|
||||||
// "Automatic Disk Mounting" group
|
// "Automatic Disk Mounting" group
|
||||||
|
|
||||||
BRect boxRect(Bounds());
|
BBox* autoMountBox = new BBox("autoMountBox", B_WILL_DRAW | B_FRAME_EVENTS
|
||||||
boxRect.InsetBy(8.0f, 8.0f);
|
| B_PULSE_NEEDED | B_NAVIGABLE_JUMP);
|
||||||
boxRect.bottom = boxRect.top + 85;
|
autoMountBox->SetLabel("Automatic Disk Mounting");
|
||||||
BBox *box = new BBox(boxRect, "autoMountBox", B_FOLLOW_LEFT_RIGHT,
|
BGroupLayout* autoMountLayout = new BGroupLayout(B_VERTICAL, spacing);
|
||||||
B_WILL_DRAW | B_FRAME_EVENTS | B_PULSE_NEEDED | B_NAVIGABLE_JUMP);
|
autoMountBox->SetLayout(autoMountLayout);
|
||||||
box->SetLabel("Automatic Disk Mounting");
|
autoMountLayout->SetInsets(spacing,
|
||||||
AddChild(box);
|
autoMountBox->InnerFrame().top + spacing, spacing, spacing);
|
||||||
|
|
||||||
font_height fontHeight;
|
fScanningDisabledCheck = new BRadioButton("scanningOff", "Don't Automount",
|
||||||
box->GetFontHeight(&fontHeight);
|
new BMessage(kAutomountSettingsChanged));
|
||||||
|
|
||||||
BRect checkBoxRect(box->Bounds());
|
fAutoMountAllBFSCheck = new BRadioButton("autoBFS", "All BeOS Disks",
|
||||||
checkBoxRect.InsetBy(8.0f, 8.0f);
|
new BMessage(kAutomountSettingsChanged));
|
||||||
checkBoxRect.top += fontHeight.ascent + fontHeight.descent;
|
|
||||||
|
|
||||||
fScanningDisabledCheck = new BRadioButton(checkBoxRect, "scanningOff",
|
fAutoMountAllCheck = new BRadioButton("autoAll", "All Disks",
|
||||||
"Don't Automount", new BMessage(kAutomountSettingsChanged));
|
new BMessage(kAutomountSettingsChanged));
|
||||||
fScanningDisabledCheck->ResizeToPreferred();
|
|
||||||
box->AddChild(fScanningDisabledCheck);
|
|
||||||
|
|
||||||
checkBoxRect.OffsetBy(0, fScanningDisabledCheck->Bounds().Height());
|
|
||||||
fAutoMountAllBFSCheck = new BRadioButton(checkBoxRect, "autoBFS",
|
|
||||||
"All BeOS Disks", new BMessage(kAutomountSettingsChanged));
|
|
||||||
fAutoMountAllBFSCheck->ResizeToPreferred();
|
|
||||||
box->AddChild(fAutoMountAllBFSCheck);
|
|
||||||
|
|
||||||
checkBoxRect.OffsetBy(0, fScanningDisabledCheck->Bounds().Height());
|
|
||||||
fAutoMountAllCheck = new BRadioButton(checkBoxRect, "autoAll",
|
|
||||||
"All Disks", new BMessage(kAutomountSettingsChanged));
|
|
||||||
fAutoMountAllCheck->ResizeToPreferred();
|
|
||||||
box->AddChild(fAutoMountAllCheck);
|
|
||||||
|
|
||||||
box->ResizeTo(box->Bounds().Width(), fAutoMountAllCheck->Frame().bottom + 8.0f);
|
|
||||||
|
|
||||||
// "Disk Mounting During Boot" group
|
// "Disk Mounting During Boot" group
|
||||||
|
|
||||||
boxRect.top = box->Frame().bottom + 8.0f;
|
BBox* bootMountBox = new BBox("", B_WILL_DRAW | B_FRAME_EVENTS
|
||||||
boxRect.bottom = boxRect.top + 105;
|
|
||||||
box = new BBox(boxRect, "", B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW | B_FRAME_EVENTS
|
|
||||||
| B_PULSE_NEEDED | B_NAVIGABLE_JUMP);
|
| B_PULSE_NEEDED | B_NAVIGABLE_JUMP);
|
||||||
box->SetLabel("Disk Mounting During Boot");
|
bootMountBox->SetLabel("Disk Mounting During Boot");
|
||||||
AddChild(box);
|
BGroupLayout* bootMountLayout = new BGroupLayout(B_VERTICAL, spacing);
|
||||||
|
bootMountBox->SetLayout(bootMountLayout);
|
||||||
|
bootMountLayout->SetInsets(spacing,
|
||||||
|
bootMountBox->InnerFrame().top + spacing, spacing, spacing);
|
||||||
|
|
||||||
checkBoxRect = box->Bounds();
|
fInitialDontMountCheck = new BRadioButton("initialNone",
|
||||||
checkBoxRect.InsetBy(8.0f, 8.0f);
|
|
||||||
checkBoxRect.top += fontHeight.ascent + fontHeight.descent;
|
|
||||||
|
|
||||||
checkBoxRect.bottom = checkBoxRect.top + 20;
|
|
||||||
fInitialDontMountCheck = new BRadioButton(checkBoxRect, "initialNone",
|
|
||||||
"Only The Boot Disk", new BMessage(kBootMountSettingsChanged));
|
"Only The Boot Disk", new BMessage(kBootMountSettingsChanged));
|
||||||
fInitialDontMountCheck->ResizeToPreferred();
|
|
||||||
box->AddChild(fInitialDontMountCheck);
|
|
||||||
|
|
||||||
checkBoxRect.OffsetBy(0, fInitialDontMountCheck->Bounds().Height());
|
fInitialMountRestoreCheck = new BRadioButton("initialRestore",
|
||||||
fInitialMountRestoreCheck = new BRadioButton(checkBoxRect, "initialRestore",
|
|
||||||
"Previously Mounted Disks", new BMessage(kBootMountSettingsChanged));
|
"Previously Mounted Disks", new BMessage(kBootMountSettingsChanged));
|
||||||
fInitialMountRestoreCheck->ResizeToPreferred();
|
|
||||||
box->AddChild(fInitialMountRestoreCheck);
|
|
||||||
|
|
||||||
checkBoxRect.OffsetBy(0, fInitialDontMountCheck->Bounds().Height());
|
fInitialMountAllBFSCheck = new BRadioButton("initialBFS",
|
||||||
fInitialMountAllBFSCheck = new BRadioButton(checkBoxRect, "initialBFS",
|
|
||||||
"All BeOS Disks", new BMessage(kBootMountSettingsChanged));
|
"All BeOS Disks", new BMessage(kBootMountSettingsChanged));
|
||||||
fInitialMountAllBFSCheck->ResizeToPreferred();
|
|
||||||
box->AddChild(fInitialMountAllBFSCheck);
|
|
||||||
|
|
||||||
checkBoxRect.OffsetBy(0, fInitialDontMountCheck->Bounds().Height());
|
fInitialMountAllCheck = new BRadioButton("initialAll",
|
||||||
fInitialMountAllCheck = new BRadioButton(checkBoxRect, "initialAll",
|
|
||||||
"All Disks", new BMessage(kBootMountSettingsChanged));
|
"All Disks", new BMessage(kBootMountSettingsChanged));
|
||||||
fInitialMountAllCheck->ResizeToPreferred();
|
|
||||||
box->AddChild(fInitialMountAllCheck);
|
|
||||||
|
|
||||||
box->ResizeTo(box->Bounds().Width(), fInitialMountAllCheck->Frame().bottom + 8.0f);
|
fEjectWhenUnmountingCheckBox = new BCheckBox("ejectWhenUnmounting",
|
||||||
|
"Eject When Unmounting", new BMessage(kEjectWhenUnmountingChanged));
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
|
|
||||||
fDone = new BButton(Bounds(), "done", "Done", new BMessage(B_QUIT_REQUESTED),
|
fDone = new BButton("Done", new BMessage(B_QUIT_REQUESTED));
|
||||||
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
|
||||||
fDone->ResizeToPreferred();
|
|
||||||
fDone->MoveTo(Bounds().Width() - fDone->Bounds().Width() - 8.0f,
|
|
||||||
Bounds().bottom - fDone->Bounds().Height() - 8.0f);
|
|
||||||
AddChild(fDone);
|
|
||||||
|
|
||||||
fMountAllNow = new BButton(fDone->Frame(), "mountAll", "Mount all disks now",
|
fMountAllNow = new BButton("mountAll", "Mount all disks now",
|
||||||
new BMessage(kMountAllNow), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
new BMessage(kMountAllNow));
|
||||||
fMountAllNow->ResizeToPreferred();
|
|
||||||
fMountAllNow->MoveBy(-fMountAllNow->Bounds().Width() - 10.0f, 0.0f);
|
|
||||||
AddChild(fMountAllNow);
|
|
||||||
|
|
||||||
fDone->MakeDefault(true);
|
fDone->MakeDefault(true);
|
||||||
|
|
||||||
|
// Layout the controls
|
||||||
|
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
|
||||||
|
.Add(BGroupLayoutBuilder(B_VERTICAL, spacing)
|
||||||
|
.Add(BGroupLayoutBuilder(autoMountLayout)
|
||||||
|
.Add(fScanningDisabledCheck)
|
||||||
|
.Add(fAutoMountAllBFSCheck)
|
||||||
|
.Add(fAutoMountAllCheck)
|
||||||
|
)
|
||||||
|
.Add(BGroupLayoutBuilder(bootMountLayout)
|
||||||
|
.Add(fInitialDontMountCheck)
|
||||||
|
.Add(fInitialMountRestoreCheck)
|
||||||
|
.Add(fInitialMountAllBFSCheck)
|
||||||
|
.Add(fInitialMountAllCheck)
|
||||||
|
)
|
||||||
|
.Add(BGroupLayoutBuilder(B_HORIZONTAL)
|
||||||
|
.Add(BSpaceLayoutItem::CreateHorizontalStrut(spacing - 1))
|
||||||
|
.Add(fEjectWhenUnmountingCheckBox)
|
||||||
|
)
|
||||||
|
.SetInsets(spacing, spacing, spacing, spacing)
|
||||||
|
)
|
||||||
|
.Add(new BSeparatorView(B_HORIZONTAL/*, B_FANCY_BORDER*/))
|
||||||
|
.Add(BGroupLayoutBuilder(B_HORIZONTAL, spacing)
|
||||||
|
.AddGlue()
|
||||||
|
.Add(fMountAllNow)
|
||||||
|
.Add(fDone)
|
||||||
|
.SetInsets(spacing, spacing, spacing, spacing)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Apply the settings
|
||||||
|
|
||||||
bool result;
|
bool result;
|
||||||
if (settings->FindBool("autoMountAll", &result) == B_OK && result)
|
if (settings->FindBool("autoMountAll", &result) == B_OK && result)
|
||||||
fAutoMountAllCheck->SetValue(1);
|
fAutoMountAllCheck->SetValue(B_CONTROL_ON);
|
||||||
else if (settings->FindBool("autoMountAllBFS", &result) == B_OK && result)
|
else if (settings->FindBool("autoMountAllBFS", &result) == B_OK && result)
|
||||||
fAutoMountAllBFSCheck->SetValue(1);
|
fAutoMountAllBFSCheck->SetValue(B_CONTROL_ON);
|
||||||
else
|
else
|
||||||
fScanningDisabledCheck->SetValue(1);
|
fScanningDisabledCheck->SetValue(B_CONTROL_ON);
|
||||||
|
|
||||||
if (settings->FindBool("suspended", &result) == B_OK && result)
|
if (settings->FindBool("suspended", &result) == B_OK && result)
|
||||||
fScanningDisabledCheck->SetValue(1);
|
fScanningDisabledCheck->SetValue(B_CONTROL_ON);
|
||||||
|
|
||||||
if (settings->FindBool("initialMountAll", &result) == B_OK && result)
|
if (settings->FindBool("initialMountAll", &result) == B_OK && result)
|
||||||
fInitialMountAllCheck->SetValue(1);
|
fInitialMountAllCheck->SetValue(B_CONTROL_ON);
|
||||||
else if (settings->FindBool("initialMountRestore", &result) == B_OK && result)
|
else if (settings->FindBool("initialMountRestore", &result) == B_OK
|
||||||
fInitialMountRestoreCheck->SetValue(1);
|
&& result) {
|
||||||
else if (settings->FindBool("initialMountAllBFS", &result) == B_OK && result)
|
fInitialMountRestoreCheck->SetValue(B_CONTROL_ON);
|
||||||
fInitialMountAllBFSCheck->SetValue(1);
|
} else if (settings->FindBool("initialMountAllBFS", &result) == B_OK
|
||||||
else
|
&& result) {
|
||||||
fInitialDontMountCheck->SetValue(1);
|
fInitialMountAllBFSCheck->SetValue(B_CONTROL_ON);
|
||||||
|
} else
|
||||||
|
fInitialDontMountCheck->SetValue(B_CONTROL_ON);
|
||||||
|
|
||||||
|
if (settings->FindBool("ejectWhenUnmounting", &result) == B_OK && result)
|
||||||
|
fEjectWhenUnmountingCheckBox->SetValue(B_CONTROL_ON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -211,50 +216,6 @@ AutomountSettingsPanel::~AutomountSettingsPanel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutomountSettingsPanel::SendSettings(bool rescan)
|
|
||||||
{
|
|
||||||
BMessage message(kSetAutomounterParams);
|
|
||||||
|
|
||||||
message.AddBool("autoMountAll", (bool)fAutoMountAllCheck->Value());
|
|
||||||
message.AddBool("autoMountAllBFS", (bool)fAutoMountAllBFSCheck->Value());
|
|
||||||
if (fAutoMountAllBFSCheck->Value())
|
|
||||||
message.AddBool("autoMountAllHFS", false);
|
|
||||||
|
|
||||||
message.AddBool("suspended", (bool)fScanningDisabledCheck->Value());
|
|
||||||
message.AddBool("rescanNow", rescan);
|
|
||||||
|
|
||||||
message.AddBool("initialMountAll", (bool)fInitialMountAllCheck->Value());
|
|
||||||
message.AddBool("initialMountAllBFS", (bool)fInitialMountAllBFSCheck->Value());
|
|
||||||
message.AddBool("initialMountRestore", (bool)fInitialMountRestoreCheck->Value());
|
|
||||||
if (fInitialDontMountCheck->Value())
|
|
||||||
message.AddBool("initialMountAllHFS", false);
|
|
||||||
|
|
||||||
fTarget->PostMessage(&message, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AutomountSettingsPanel::GetPreferredSize(float* _width, float* _height)
|
|
||||||
{
|
|
||||||
BBox* box = dynamic_cast<BBox*>(fInitialMountRestoreCheck->Parent());
|
|
||||||
|
|
||||||
if (_width) {
|
|
||||||
float a = fInitialMountRestoreCheck->Bounds().Width() + 32.0f;
|
|
||||||
float b = box != NULL ? box->StringWidth(box->Label()) + 24.0f : 0.0f;
|
|
||||||
float c = fMountAllNow->Bounds().Width() + fDone->Bounds().Width() + 26.0f;
|
|
||||||
|
|
||||||
a = max_c(a, b);
|
|
||||||
*_width = max_c(a, c);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_height) {
|
|
||||||
*_height = (box != NULL ? box->Frame().bottom : 0.0f) + 16.0f
|
|
||||||
+ fMountAllNow->Bounds().Height();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AutomountSettingsPanel::AttachedToWindow()
|
AutomountSettingsPanel::AttachedToWindow()
|
||||||
{
|
{
|
||||||
@@ -266,6 +227,7 @@ AutomountSettingsPanel::AttachedToWindow()
|
|||||||
fAutoMountAllCheck->SetTarget(this);
|
fAutoMountAllCheck->SetTarget(this);
|
||||||
fAutoMountAllBFSCheck->SetTarget(this);
|
fAutoMountAllBFSCheck->SetTarget(this);
|
||||||
fScanningDisabledCheck->SetTarget(this);
|
fScanningDisabledCheck->SetTarget(this);
|
||||||
|
fEjectWhenUnmountingCheckBox->SetTarget(this);
|
||||||
|
|
||||||
fDone->SetTarget(this);
|
fDone->SetTarget(this);
|
||||||
fMountAllNow->SetTarget(fTarget);
|
fMountAllNow->SetTarget(fTarget);
|
||||||
@@ -281,11 +243,12 @@ AutomountSettingsPanel::MessageReceived(BMessage *message)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case kAutomountSettingsChanged:
|
case kAutomountSettingsChanged:
|
||||||
SendSettings(true);
|
_SendSettings(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kBootMountSettingsChanged:
|
case kBootMountSettingsChanged:
|
||||||
SendSettings(false);
|
case kEjectWhenUnmountingChanged:
|
||||||
|
_SendSettings(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -295,21 +258,48 @@ AutomountSettingsPanel::MessageReceived(BMessage *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
AutomountSettingsPanel::_SendSettings(bool rescan)
|
||||||
|
{
|
||||||
|
BMessage message(kSetAutomounterParams);
|
||||||
|
|
||||||
|
message.AddBool("autoMountAll", (bool)fAutoMountAllCheck->Value());
|
||||||
|
message.AddBool("autoMountAllBFS", (bool)fAutoMountAllBFSCheck->Value());
|
||||||
|
if (fAutoMountAllBFSCheck->Value())
|
||||||
|
message.AddBool("autoMountAllHFS", false);
|
||||||
|
|
||||||
|
message.AddBool("suspended", (bool)fScanningDisabledCheck->Value());
|
||||||
|
message.AddBool("rescanNow", rescan);
|
||||||
|
|
||||||
|
message.AddBool("initialMountAll", (bool)fInitialMountAllCheck->Value());
|
||||||
|
message.AddBool("initialMountAllBFS",
|
||||||
|
(bool)fInitialMountAllBFSCheck->Value());
|
||||||
|
message.AddBool("initialMountRestore",
|
||||||
|
(bool)fInitialMountRestoreCheck->Value());
|
||||||
|
if (fInitialDontMountCheck->Value())
|
||||||
|
message.AddBool("initialMountAllHFS", false);
|
||||||
|
|
||||||
|
message.AddBool("ejectWhenUnmounting",
|
||||||
|
(bool)fEjectWhenUnmountingCheckBox->Value());
|
||||||
|
|
||||||
|
fTarget.SendMessage(&message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
AutomountSettingsDialog::AutomountSettingsDialog(BMessage* settings,
|
AutomountSettingsDialog::AutomountSettingsDialog(BMessage* settings,
|
||||||
AutoMounter *target)
|
const BMessenger& target)
|
||||||
: BWindow(BRect(100, 100, 320, 370), "Disk Mount Settings",
|
:
|
||||||
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
|
BWindow(BRect(100, 100, 320, 370), "Disk Mount Settings",
|
||||||
|
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
|
||||||
|
| B_AUTO_UPDATE_SIZE_LIMITS)
|
||||||
{
|
{
|
||||||
BView* view = new AutomountSettingsPanel(Bounds(), settings, target);
|
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||||
|
BView* view = new AutomountSettingsPanel(settings, target);
|
||||||
AddChild(view);
|
AddChild(view);
|
||||||
|
|
||||||
float width, height;
|
|
||||||
view->GetPreferredSize(&width, &height);
|
|
||||||
ResizeTo(width, height);
|
|
||||||
|
|
||||||
ASSERT(!sOneCopyOnly);
|
ASSERT(!sOneCopyOnly);
|
||||||
sOneCopyOnly = this;
|
sOneCopyOnly = this;
|
||||||
}
|
}
|
||||||
@@ -323,7 +313,7 @@ AutomountSettingsDialog::~AutomountSettingsDialog()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AutomountSettingsDialog::RunAutomountSettings(AutoMounter *target)
|
AutomountSettingsDialog::RunAutomountSettings(const BMessenger& target)
|
||||||
{
|
{
|
||||||
// either activate an existing mount settings dialog or create a new one
|
// either activate an existing mount settings dialog or create a new one
|
||||||
if (sOneCopyOnly) {
|
if (sOneCopyOnly) {
|
||||||
@@ -331,8 +321,16 @@ AutomountSettingsDialog::RunAutomountSettings(AutoMounter *target)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BMessage message;
|
BMessage message(kGetAutomounterParams);
|
||||||
target->GetSettings(&message);
|
BMessage reply;
|
||||||
(new AutomountSettingsDialog(&message, target))->Show();
|
status_t ret = target.SendMessage(&message, &reply, 2500000);
|
||||||
|
if (ret != B_OK) {
|
||||||
|
(new BAlert("Mount Server Error", "The mount server could not be "
|
||||||
|
"contacted.", "Ok", NULL, NULL, B_WIDTH_AS_USUAL,
|
||||||
|
B_STOP_ALERT))->Go();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
(new AutomountSettingsDialog(&reply, target))->Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,14 +41,12 @@ All rights reserved.
|
|||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
class AutoMounter;
|
|
||||||
|
|
||||||
class AutomountSettingsDialog : public BWindow {
|
class AutomountSettingsDialog : public BWindow {
|
||||||
public:
|
public:
|
||||||
AutomountSettingsDialog(BMessage *settings, AutoMounter *);
|
AutomountSettingsDialog(BMessage *settings, const BMessenger &target);
|
||||||
virtual ~AutomountSettingsDialog();
|
virtual ~AutomountSettingsDialog();
|
||||||
|
|
||||||
static void RunAutomountSettings(AutoMounter *);
|
static void RunAutomountSettings(const BMessenger &target);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static AutomountSettingsDialog *sOneCopyOnly;
|
static AutomountSettingsDialog *sOneCopyOnly;
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ All rights reserved.
|
|||||||
|
|
||||||
#include "PublicCommands.h"
|
#include "PublicCommands.h"
|
||||||
|
|
||||||
|
#include <MountServer.h>
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
// external app messages
|
// external app messages
|
||||||
@@ -77,7 +79,6 @@ const uint32 kEmptyTrash = 'Tetr';
|
|||||||
const uint32 kAddPrinter = 'Tadp';
|
const uint32 kAddPrinter = 'Tadp';
|
||||||
const uint32 kMakeActivePrinter = 'Tmap';
|
const uint32 kMakeActivePrinter = 'Tmap';
|
||||||
|
|
||||||
const uint32 kUnmountVolume = 'Tunm';
|
|
||||||
const uint32 kRunAutomounterSettings = 'Tram';
|
const uint32 kRunAutomounterSettings = 'Tram';
|
||||||
|
|
||||||
const uint32 kOpenParentDir = 'Topt';
|
const uint32 kOpenParentDir = 'Topt';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ SubDir HAIKU_TOP src kits tracker ;
|
|||||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||||
AddSubDirSupportedPlatforms libbe_test ;
|
AddSubDirSupportedPlatforms libbe_test ;
|
||||||
|
|
||||||
UsePrivateHeaders interface shared storage tracker ;
|
UsePrivateHeaders interface mount shared storage tracker ;
|
||||||
|
|
||||||
UseLibraryHeaders icon ;
|
UseLibraryHeaders icon ;
|
||||||
|
|
||||||
@@ -24,7 +24,6 @@ if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) && $(TARGET_PLATFORM) != libbe_test {
|
|||||||
|
|
||||||
SharedLibrary libtracker.so :
|
SharedLibrary libtracker.so :
|
||||||
AttributeStream.cpp
|
AttributeStream.cpp
|
||||||
AutoMounter.cpp
|
|
||||||
AutoMounterSettings.cpp
|
AutoMounterSettings.cpp
|
||||||
BackgroundImage.cpp
|
BackgroundImage.cpp
|
||||||
Bitmaps.cpp
|
Bitmaps.cpp
|
||||||
|
|||||||
@@ -42,27 +42,18 @@ All rights reserved.
|
|||||||
#include <Volume.h>
|
#include <Volume.h>
|
||||||
#include <fs_info.h>
|
#include <fs_info.h>
|
||||||
|
|
||||||
#include "AutoMounter.h"
|
|
||||||
#include "Commands.h"
|
#include "Commands.h"
|
||||||
#include "MountMenu.h"
|
#include "MountMenu.h"
|
||||||
#include "IconMenuItem.h"
|
#include "IconMenuItem.h"
|
||||||
#include "Tracker.h"
|
#include "Tracker.h"
|
||||||
#include "Bitmaps.h"
|
#include "Bitmaps.h"
|
||||||
|
|
||||||
#ifdef __HAIKU__
|
|
||||||
#include <DiskDevice.h>
|
#include <DiskDevice.h>
|
||||||
#include <DiskDeviceList.h>
|
#include <DiskDeviceList.h>
|
||||||
#else
|
|
||||||
# include "DeviceMap.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SHOW_NETWORK_VOLUMES
|
#define SHOW_NETWORK_VOLUMES
|
||||||
|
|
||||||
|
|
||||||
#ifdef __HAIKU__
|
|
||||||
// #pragma mark - Haiku Disk Device API
|
|
||||||
|
|
||||||
|
|
||||||
class AddMenuItemVisitor : public BDiskDeviceVisitor {
|
class AddMenuItemVisitor : public BDiskDeviceVisitor {
|
||||||
public:
|
public:
|
||||||
AddMenuItemVisitor(BMenu* menu);
|
AddMenuItemVisitor(BMenu* menu);
|
||||||
@@ -159,74 +150,6 @@ AddMenuItemVisitor::Visit(BPartition *partition, int32 level)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // !__HAIKU__
|
|
||||||
// #pragma mark - R5 DeviceMap API
|
|
||||||
|
|
||||||
|
|
||||||
struct AddOneAsMenuItemParams {
|
|
||||||
BMenu *mountMenu;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static Partition *
|
|
||||||
AddOnePartitionAsMenuItem(Partition *partition, void *castToParams)
|
|
||||||
{
|
|
||||||
if (partition->Hidden())
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
AddOneAsMenuItemParams *params = (AddOneAsMenuItemParams *)castToParams;
|
|
||||||
BBitmap *icon = new BBitmap(BRect(0, 0, B_MINI_ICON - 1, B_MINI_ICON - 1),
|
|
||||||
B_CMAP8);
|
|
||||||
get_device_icon(partition->GetDevice()->Name(), icon->Bits(), B_MINI_ICON);
|
|
||||||
|
|
||||||
|
|
||||||
const char *name = partition->GetDevice()->DisplayName();
|
|
||||||
|
|
||||||
if (!partition->GetDevice()->IsFloppy() ||
|
|
||||||
partition->Mounted() == kMounted) {
|
|
||||||
if (*partition->VolumeName())
|
|
||||||
name = partition->VolumeName();
|
|
||||||
else if (*partition->Type())
|
|
||||||
name = partition->Type();
|
|
||||||
}
|
|
||||||
|
|
||||||
BMessage *message = new BMessage;
|
|
||||||
|
|
||||||
if (partition->Mounted() == kMounted) {
|
|
||||||
message->what = kUnmountVolume;
|
|
||||||
message->AddInt32("device_id", partition->VolumeDeviceID());
|
|
||||||
} else {
|
|
||||||
message->what = kMountVolume;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Floppies have an ID of -1, because they don't have
|
|
||||||
// partition (and hence no parititon ID).
|
|
||||||
//
|
|
||||||
if (partition->GetDevice()->IsFloppy())
|
|
||||||
message->AddInt32("id", kFloppyID);
|
|
||||||
else
|
|
||||||
message->AddInt32("id", partition->UniqueID());
|
|
||||||
}
|
|
||||||
|
|
||||||
BMenuItem *item = new IconMenuItem(name, message, icon);
|
|
||||||
if (partition->Mounted() == kMounted)
|
|
||||||
item->SetMarked(true);
|
|
||||||
|
|
||||||
if (partition->Mounted() == kMounted) {
|
|
||||||
BVolume partVolume(partition->VolumeDeviceID());
|
|
||||||
|
|
||||||
BVolume bootVolume;
|
|
||||||
BVolumeRoster().GetBootVolume(&bootVolume);
|
|
||||||
if (partVolume == bootVolume)
|
|
||||||
item->SetEnabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
params->mountMenu->AddItem(item);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#endif // !__HAIKU__
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
@@ -249,23 +172,12 @@ MountMenu::AddDynamicItem(add_state)
|
|||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __HAIKU__
|
|
||||||
BDiskDeviceList devices;
|
BDiskDeviceList devices;
|
||||||
status_t status = devices.Fetch();
|
status_t status = devices.Fetch();
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
AddMenuItemVisitor visitor(this);
|
AddMenuItemVisitor visitor(this);
|
||||||
devices.VisitEachPartition(&visitor);
|
devices.VisitEachPartition(&visitor);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
AddOneAsMenuItemParams params;
|
|
||||||
params.mountMenu = this;
|
|
||||||
|
|
||||||
AutoMounter *autoMounter = dynamic_cast<TTracker *>(be_app)->
|
|
||||||
AutoMounterLoop();
|
|
||||||
|
|
||||||
autoMounter->CheckVolumesNow();
|
|
||||||
autoMounter->EachPartition(&AddOnePartitionAsMenuItem, ¶ms);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SHOW_NETWORK_VOLUMES
|
#ifdef SHOW_NETWORK_VOLUMES
|
||||||
// iterate the volume roster and look for volumes with the
|
// iterate the volume roster and look for volumes with the
|
||||||
@@ -302,16 +214,8 @@ MountMenu::AddDynamicItem(add_state)
|
|||||||
|
|
||||||
AddSeparatorItem();
|
AddSeparatorItem();
|
||||||
|
|
||||||
#ifndef __HAIKU__
|
BMenuItem *mountAll = new BMenuItem("Mount All",
|
||||||
// add an option to rescan the scsii bus, etc.
|
new BMessage(kMountAllNow));
|
||||||
BMenuItem *rescanItem = NULL;
|
|
||||||
if (modifiers() & B_SHIFT_KEY) {
|
|
||||||
rescanItem = new BMenuItem("Rescan Devices", new BMessage(kAutomounterRescan));
|
|
||||||
AddItem(rescanItem);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BMenuItem *mountAll = new BMenuItem("Mount All", new BMessage(kMountAllNow));
|
|
||||||
AddItem(mountAll);
|
AddItem(mountAll);
|
||||||
BMenuItem *mountSettings = new BMenuItem("Settings" B_UTF8_ELLIPSIS,
|
BMenuItem *mountSettings = new BMenuItem("Settings" B_UTF8_ELLIPSIS,
|
||||||
new BMessage(kRunAutomounterSettings));
|
new BMessage(kRunAutomounterSettings));
|
||||||
@@ -319,10 +223,5 @@ MountMenu::AddDynamicItem(add_state)
|
|||||||
|
|
||||||
SetTargetForItems(be_app);
|
SetTargetForItems(be_app);
|
||||||
|
|
||||||
#ifndef __HAIKU__
|
|
||||||
if (rescanItem)
|
|
||||||
rescanItem->SetTarget(autoMounter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,11 +186,6 @@ DesktopSettingsView::DesktopSettingsView(BRect rect)
|
|||||||
|
|
||||||
rect.OffsetBy(-20, itemSpacing);
|
rect.OffsetBy(-20, itemSpacing);
|
||||||
|
|
||||||
fEjectWhenUnmountingCheckBox = new BCheckBox(rect, "", "Eject When Unmounting",
|
|
||||||
new BMessage(kEjectWhenUnmountingChanged));
|
|
||||||
AddChild(fEjectWhenUnmountingCheckBox);
|
|
||||||
fEjectWhenUnmountingCheckBox->ResizeToPreferred();
|
|
||||||
|
|
||||||
rect = Bounds();
|
rect = Bounds();
|
||||||
rect.top = rect.bottom;
|
rect.top = rect.bottom;
|
||||||
fMountButton = new BButton(rect, "", "Mount Settings" B_UTF8_ELLIPSIS,
|
fMountButton = new BButton(rect, "", "Mount Settings" B_UTF8_ELLIPSIS,
|
||||||
@@ -211,7 +206,7 @@ DesktopSettingsView::GetPreferredSize(float *_width, float *_height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_height != NULL) {
|
if (_height != NULL) {
|
||||||
*_height = fEjectWhenUnmountingCheckBox->Frame().bottom + 8
|
*_height = fMountSharedVolumesOntoDesktopCheckBox->Frame().bottom + 8
|
||||||
+ fMountButton->Bounds().Height();
|
+ fMountButton->Bounds().Height();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -223,7 +218,6 @@ DesktopSettingsView::AttachedToWindow()
|
|||||||
fShowDisksIconRadioButton->SetTarget(this);
|
fShowDisksIconRadioButton->SetTarget(this);
|
||||||
fMountVolumesOntoDesktopRadioButton->SetTarget(this);
|
fMountVolumesOntoDesktopRadioButton->SetTarget(this);
|
||||||
fMountSharedVolumesOntoDesktopCheckBox->SetTarget(this);
|
fMountSharedVolumesOntoDesktopCheckBox->SetTarget(this);
|
||||||
fEjectWhenUnmountingCheckBox->SetTarget(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -301,20 +295,6 @@ DesktopSettingsView::MessageReceived(BMessage *message)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case kEjectWhenUnmountingChanged:
|
|
||||||
{
|
|
||||||
settings.SetEjectWhenUnmounting(
|
|
||||||
fEjectWhenUnmountingCheckBox->Value() == 1);
|
|
||||||
|
|
||||||
// Send the notification message
|
|
||||||
send_bool_notices(kEjectWhenUnmountingChanged,
|
|
||||||
"EjectWhenUnmounting", fEjectWhenUnmountingCheckBox->Value() == 1);
|
|
||||||
|
|
||||||
// Tell the settings window the contents have changed
|
|
||||||
Window()->PostMessage(kSettingsContentsModified);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
_inherited::MessageReceived(message);
|
_inherited::MessageReceived(message);
|
||||||
}
|
}
|
||||||
@@ -382,8 +362,6 @@ DesktopSettingsView::_SendNotices()
|
|||||||
fMountVolumesOntoDesktopRadioButton->Value() == 1);
|
fMountVolumesOntoDesktopRadioButton->Value() == 1);
|
||||||
notificationMessage.AddBool("MountSharedVolumesOntoDesktop",
|
notificationMessage.AddBool("MountSharedVolumesOntoDesktop",
|
||||||
fMountSharedVolumesOntoDesktopCheckBox->Value() == 1);
|
fMountSharedVolumesOntoDesktopCheckBox->Value() == 1);
|
||||||
notificationMessage.AddBool("EjectWhenUnmounting",
|
|
||||||
fEjectWhenUnmountingCheckBox->Value() == 1);
|
|
||||||
|
|
||||||
// Send notices to the tracker about the change:
|
// Send notices to the tracker about the change:
|
||||||
tracker->SendNotices(kVolumesOnDesktopChanged, ¬ificationMessage);
|
tracker->SendNotices(kVolumesOnDesktopChanged, ¬ificationMessage);
|
||||||
@@ -401,8 +379,6 @@ DesktopSettingsView::ShowCurrentSettings()
|
|||||||
|
|
||||||
fMountSharedVolumesOntoDesktopCheckBox->SetValue(settings.MountSharedVolumesOntoDesktop());
|
fMountSharedVolumesOntoDesktopCheckBox->SetValue(settings.MountSharedVolumesOntoDesktop());
|
||||||
fMountSharedVolumesOntoDesktopCheckBox->SetEnabled(settings.MountVolumesOntoDesktop());
|
fMountSharedVolumesOntoDesktopCheckBox->SetEnabled(settings.MountVolumesOntoDesktop());
|
||||||
|
|
||||||
fEjectWhenUnmountingCheckBox->SetValue(settings.EjectWhenUnmounting());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -426,9 +402,7 @@ DesktopSettingsView::IsRevertable() const
|
|||||||
|| fMountVolumesOntoDesktop !=
|
|| fMountVolumesOntoDesktop !=
|
||||||
(fMountVolumesOntoDesktopRadioButton->Value() > 0)
|
(fMountVolumesOntoDesktopRadioButton->Value() > 0)
|
||||||
|| fMountSharedVolumesOntoDesktop !=
|
|| fMountSharedVolumesOntoDesktop !=
|
||||||
(fMountSharedVolumesOntoDesktopCheckBox->Value() > 0)
|
(fMountSharedVolumesOntoDesktopCheckBox->Value() > 0);
|
||||||
|| fEjectWhenUnmounting !=
|
|
||||||
(fEjectWhenUnmountingCheckBox->Value() > 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ class DesktopSettingsView : public SettingsView {
|
|||||||
BRadioButton *fMountVolumesOntoDesktopRadioButton;
|
BRadioButton *fMountVolumesOntoDesktopRadioButton;
|
||||||
BCheckBox *fMountSharedVolumesOntoDesktopCheckBox;
|
BCheckBox *fMountSharedVolumesOntoDesktopCheckBox;
|
||||||
BCheckBox *fIntegrateNonBootBeOSDesktopsCheckBox;
|
BCheckBox *fIntegrateNonBootBeOSDesktopsCheckBox;
|
||||||
BCheckBox *fEjectWhenUnmountingCheckBox;
|
|
||||||
BButton *fMountButton;
|
BButton *fMountButton;
|
||||||
|
|
||||||
bool fShowDisksIcon;
|
bool fShowDisksIcon;
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ All rights reserved.
|
|||||||
|
|
||||||
#include "Attributes.h"
|
#include "Attributes.h"
|
||||||
#include "AutoLock.h"
|
#include "AutoLock.h"
|
||||||
#include "AutoMounter.h"
|
|
||||||
#include "AutoMounterSettings.h"
|
#include "AutoMounterSettings.h"
|
||||||
#include "BackgroundImage.h"
|
#include "BackgroundImage.h"
|
||||||
#include "Bitmaps.h"
|
#include "Bitmaps.h"
|
||||||
@@ -349,10 +348,6 @@ TTracker::Quit()
|
|||||||
{
|
{
|
||||||
TrackerSettings().SaveSettings(false);
|
TrackerSettings().SaveSettings(false);
|
||||||
|
|
||||||
fAutoMounter->Lock();
|
|
||||||
fAutoMounter->QuitRequested(); // automounter does some stuff in QuitRequested
|
|
||||||
fAutoMounter->Quit(); // but we really don't care if it is cooperating or not
|
|
||||||
|
|
||||||
fClipboardRefsWatcher->Lock();
|
fClipboardRefsWatcher->Lock();
|
||||||
fClipboardRefsWatcher->Quit();
|
fClipboardRefsWatcher->Quit();
|
||||||
|
|
||||||
@@ -376,11 +371,6 @@ TTracker::MessageReceived(BMessage *message)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case kOpenPreviouslyOpenWindows:
|
|
||||||
if (!BootedInSafeMode())
|
|
||||||
_OpenPreviouslyOpenedWindows();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kGetInfo:
|
case kGetInfo:
|
||||||
OpenInfoWindows(message);
|
OpenInfoWindows(message);
|
||||||
break;
|
break;
|
||||||
@@ -415,35 +405,6 @@ TTracker::MessageReceived(BMessage *message)
|
|||||||
EditQueries(message);
|
EditQueries(message);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kUnmountVolume:
|
|
||||||
// When the user attempts to unmount a volume from the mount
|
|
||||||
// context menu, this is where the message gets received.
|
|
||||||
// Save pose locations and forward this to the automounter
|
|
||||||
SaveAllPoseLocations();
|
|
||||||
fAutoMounter->PostMessage(message);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kRunAutomounterSettings:
|
|
||||||
AutomountSettingsDialog::RunAutomountSettings(fAutoMounter);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kVolumeMounted:
|
|
||||||
{
|
|
||||||
// This is sent to us by the AutoMounter whenever it mounts
|
|
||||||
// a new volume - we use it to restore the previously opened
|
|
||||||
// windows from that volume in case it has been mounted
|
|
||||||
// during the AutoMounter's initial rescan
|
|
||||||
const char* path;
|
|
||||||
bool initial;
|
|
||||||
if (message->FindBool("initial rescan", &initial) != B_OK
|
|
||||||
|| message->FindString("path", &path) != B_OK
|
|
||||||
|| !initial)
|
|
||||||
break;
|
|
||||||
|
|
||||||
_OpenPreviouslyOpenedWindows(path);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case kShowSplash:
|
case kShowSplash:
|
||||||
run_be_about();
|
run_be_about();
|
||||||
break;
|
break;
|
||||||
@@ -473,19 +434,28 @@ TTracker::MessageReceived(BMessage *message)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
case kUnmountVolume:
|
||||||
|
// When the user attempts to unmount a volume from the mount
|
||||||
|
// context menu, this is where the message gets received.
|
||||||
|
// Save pose locations and forward this to the automounter
|
||||||
|
SaveAllPoseLocations();
|
||||||
|
// Fall through...
|
||||||
case kMountVolume:
|
case kMountVolume:
|
||||||
case kMountAllNow:
|
case kMountAllNow:
|
||||||
AutoMounterLoop()->PostMessage(message);
|
MountServer().SendMessage(message);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case kRunAutomounterSettings:
|
||||||
|
AutomountSettingsDialog::RunAutomountSettings(MountServer());
|
||||||
|
break;
|
||||||
|
|
||||||
case kRestoreBackgroundImage:
|
case kRestoreBackgroundImage:
|
||||||
{
|
{
|
||||||
BDeskWindow *desktop = GetDeskWindow();
|
BDeskWindow *desktop = GetDeskWindow();
|
||||||
AutoLock<BWindow> lock(desktop);
|
AutoLock<BWindow> lock(desktop);
|
||||||
desktop->UpdateDesktopBackgroundImages();
|
desktop->UpdateDesktopBackgroundImages();
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case kShowSettingsWindow:
|
case kShowSettingsWindow:
|
||||||
ShowSettingsWindow();
|
ShowSettingsWindow();
|
||||||
@@ -514,16 +484,13 @@ TTracker::MessageReceived(BMessage *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case kFSClipboardChanges:
|
case kFSClipboardChanges:
|
||||||
{
|
|
||||||
fClipboardRefsWatcher->UpdatePoseViews(message);
|
fClipboardRefsWatcher->UpdatePoseViews(message);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case kShowVolumeSpaceBar:
|
case kShowVolumeSpaceBar:
|
||||||
case kSpaceBarColorChanged: {
|
case kSpaceBarColorChanged:
|
||||||
gPeriodicUpdatePoses.DoPeriodicUpdate(true);
|
gPeriodicUpdatePoses.DoPeriodicUpdate(true);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
_inherited::MessageReceived(message);
|
_inherited::MessageReceived(message);
|
||||||
@@ -1335,9 +1302,6 @@ TTracker::ReadyToRun()
|
|||||||
fClipboardRefsWatcher = new BClipboardRefsWatcher();
|
fClipboardRefsWatcher = new BClipboardRefsWatcher();
|
||||||
fClipboardRefsWatcher->Run();
|
fClipboardRefsWatcher->Run();
|
||||||
|
|
||||||
fAutoMounter = new AutoMounter();
|
|
||||||
fAutoMounter->Run();
|
|
||||||
|
|
||||||
fTaskLoop = new StandAloneTaskLoop(true);
|
fTaskLoop = new StandAloneTaskLoop(true);
|
||||||
|
|
||||||
// open desktop window
|
// open desktop window
|
||||||
@@ -1383,6 +1347,8 @@ TTracker::ReadyToRun()
|
|||||||
if (!BootedInSafeMode()) {
|
if (!BootedInSafeMode()) {
|
||||||
// kick of transient query killer
|
// kick of transient query killer
|
||||||
DeleteTransientQueriesTask::StartUpTransientQueryCleaner();
|
DeleteTransientQueriesTask::StartUpTransientQueryCleaner();
|
||||||
|
// the mount_server will have mounted the previous volumes already.
|
||||||
|
_OpenPreviouslyOpenedWindows();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1570,10 +1536,10 @@ TTracker::WatchNode(const node_ref *node, uint32 flags,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AutoMounter *
|
BMessenger
|
||||||
TTracker::AutoMounterLoop()
|
TTracker::MountServer() const
|
||||||
{
|
{
|
||||||
return fAutoMounter;
|
return BMessenger(kMountServerSignature);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ All rights reserved.
|
|||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
class AutoMounter;
|
|
||||||
class BClipboardRefsWatcher;
|
class BClipboardRefsWatcher;
|
||||||
class BContainerWindow;
|
class BContainerWindow;
|
||||||
class BDeskWindow;
|
class BDeskWindow;
|
||||||
@@ -127,7 +126,7 @@ class TTracker : public BApplication {
|
|||||||
// again
|
// again
|
||||||
|
|
||||||
TaskLoop *MainTaskLoop() const;
|
TaskLoop *MainTaskLoop() const;
|
||||||
AutoMounter *AutoMounterLoop();
|
BMessenger MountServer() const;
|
||||||
|
|
||||||
bool QueryActiveForDevice(dev_t);
|
bool QueryActiveForDevice(dev_t);
|
||||||
void CloseActiveQueryWindows(dev_t);
|
void CloseActiveQueryWindows(dev_t);
|
||||||
@@ -216,7 +215,6 @@ class TTracker : public BApplication {
|
|||||||
WindowList fWindowList;
|
WindowList fWindowList;
|
||||||
BClipboardRefsWatcher *fClipboardRefsWatcher;
|
BClipboardRefsWatcher *fClipboardRefsWatcher;
|
||||||
BTrashWatcher *fTrashWatcher;
|
BTrashWatcher *fTrashWatcher;
|
||||||
AutoMounter *fAutoMounter;
|
|
||||||
TaskLoop *fTaskLoop;
|
TaskLoop *fTaskLoop;
|
||||||
int32 fNodeMonitorCount;
|
int32 fNodeMonitorCount;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user