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); }
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); }
void DesktopSettingsView::RecordRevertSettings() { TrackerSettings settings; fShowDisksIcon = settings.ShowDisksIcon(); fMountVolumesOntoDesktop = settings.MountVolumesOntoDesktop(); fMountSharedVolumesOntoDesktop = settings.MountSharedVolumesOntoDesktop(); fEjectWhenUnmounting = settings.EjectWhenUnmounting(); }
bool DesktopSettingsView::IsDefaultable() const { TrackerSettings settings; return settings.ShowDisksIcon() != false || settings.MountVolumesOntoDesktop() != true || settings.MountSharedVolumesOntoDesktop() != true || settings.EjectWhenUnmounting() != true; }
void DesktopSettingsView::ShowCurrentSettings() { TrackerSettings settings; fShowDisksIconRadioButton->SetValue(settings.ShowDisksIcon()); fMountVolumesOntoDesktopRadioButton->SetValue(settings.MountVolumesOntoDesktop()); fMountSharedVolumesOntoDesktopCheckBox->SetValue(settings.MountSharedVolumesOntoDesktop()); fMountSharedVolumesOntoDesktopCheckBox->SetEnabled(settings.MountVolumesOntoDesktop()); }