コード例 #1
0
void
DesktopSettingsView::ShowCurrentSettings()
{
    TrackerSettings settings;

    fShowDisksIconRadioButton->SetValue(settings.ShowDisksIcon());
    fMountVolumesOntoDesktopRadioButton->SetValue(settings.MountVolumesOntoDesktop());

    fMountSharedVolumesOntoDesktopCheckBox->SetValue(settings.MountSharedVolumesOntoDesktop());
    fMountSharedVolumesOntoDesktopCheckBox->SetEnabled(settings.MountVolumesOntoDesktop());
}
コード例 #2
0
bool
BFilePanelPoseView::FSNotification(const BMessage* message)
{
	if (IsDesktopView()) {
		// Pretty much copied straight from DesktopPoseView.
		// Would be better if the code could be shared somehow.
		switch (message->FindInt32("opcode")) {
			case B_DEVICE_MOUNTED:
			{
				dev_t device;
				if (message->FindInt32("new device", &device) != B_OK)
					break;

				ASSERT(TargetModel() != NULL);
				TrackerSettings settings;

				BVolume volume(device);
				if (volume.InitCheck() != B_OK)
					break;

				if (settings.MountVolumesOntoDesktop()
					&& (!volume.IsShared()
						|| settings.MountSharedVolumesOntoDesktop())) {
					// place an icon for the volume onto the desktop
					CreateVolumePose(&volume, true);
				}
			}
			break;
		}
	}
	return _inherited::FSNotification(message);
}
コード例 #3
0
bool
DesktopPoseView::FSNotification(const BMessage* message)
{
    switch (message->FindInt32("opcode")) {
    case B_DEVICE_MOUNTED:
    {
        dev_t device;
        if (message->FindInt32("new device", &device) != B_OK)
            break;

        ASSERT(TargetModel());
        TrackerSettings settings;

        BVolume volume(device);
        if (volume.InitCheck() != B_OK)
            break;

        if (settings.MountVolumesOntoDesktop()
                && (!volume.IsShared()
                    || settings.MountSharedVolumesOntoDesktop())) {
            // place an icon for the volume onto the desktop
            CreateVolumePose(&volume, true);
        }
    }
    break;
    }

    return _inherited::FSNotification(message);
}
コード例 #4
0
ファイル: SettingsViews.cpp プロジェクト: AmirAbrams/haiku
void
DesktopSettingsView::RecordRevertSettings()
{
	TrackerSettings settings;

	fShowDisksIcon = settings.ShowDisksIcon();
	fMountVolumesOntoDesktop = settings.MountVolumesOntoDesktop();
	fMountSharedVolumesOntoDesktop = settings.MountSharedVolumesOntoDesktop();
	fEjectWhenUnmounting = settings.EjectWhenUnmounting();
}
コード例 #5
0
ファイル: SettingsViews.cpp プロジェクト: AmirAbrams/haiku
bool
DesktopSettingsView::IsDefaultable() const
{
	TrackerSettings settings;

	return settings.ShowDisksIcon() != false
		|| settings.MountVolumesOntoDesktop() != true
		|| settings.MountSharedVolumesOntoDesktop() != true
		|| settings.EjectWhenUnmounting() != true;
}