void TrashSettingsView::MessageReceived(BMessage* message) { TTracker* tracker = dynamic_cast<TTracker*>(be_app); if (!tracker) return; TrackerSettings settings; switch (message->what) { case kDontMoveFilesToTrashChanged: settings.SetDontMoveFilesToTrash( fDontMoveFilesToTrashCheckBox->Value() == 1); tracker->SendNotices(kDontMoveFilesToTrashChanged); Window()->PostMessage(kSettingsContentsModified); break; case kAskBeforeDeleteFileChanged: settings.SetAskBeforeDeleteFile( fAskBeforeDeleteFileCheckBox->Value() == 1); tracker->SendNotices(kAskBeforeDeleteFileChanged); Window()->PostMessage(kSettingsContentsModified); break; default: _inherited::MessageReceived(message); break; } }
void TrashSettingsView::Revert() { TrackerSettings settings; settings.SetDontMoveFilesToTrash(fDontMoveFilesToTrash); settings.SetAskBeforeDeleteFile(fAskBeforeDeleteFile); ShowCurrentSettings(); _SendNotices(); }
void TrashSettingsView::SetDefaults() { TrackerSettings settings; settings.SetDontMoveFilesToTrash(false); settings.SetAskBeforeDeleteFile(true); ShowCurrentSettings(); _SendNotices(); }