diff --git a/src/kits/tracker/Commands.h b/src/kits/tracker/Commands.h
index 869270b..a98d614 100644
a
|
b
|
const uint32 kUpdateVolumeSpaceBar = 'UpSB';
|
140 | 140 | const uint32 kShowVolumeSpaceBar = 'ShSB'; |
141 | 141 | const uint32 kSpaceBarColorChanged = 'SBcc'; |
142 | 142 | |
143 | | const uint32 kDontMoveFilesToTrashChanged = 'STdm'; |
| 143 | const uint32 kMoveFilesToTrashChanged = 'STdm'; |
144 | 144 | const uint32 kAskBeforeDeleteFileChanged = 'STad'; |
145 | 145 | |
146 | 146 | } // namespace BPrivate |
diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp
index 6b2611c..c6cf7ce 100644
a
|
b
|
BContainerWindow::BContainerWindow(LockingList<BWindow>* list,
|
604 | 604 | app->StartWatching(this, kWindowsShowFullPathChanged); |
605 | 605 | app->StartWatching(this, kSingleWindowBrowseChanged); |
606 | 606 | app->StartWatching(this, kShowNavigatorChanged); |
607 | | app->StartWatching(this, kDontMoveFilesToTrashChanged); |
| 607 | app->StartWatching(this, kMoveFilesToTrashChanged); |
608 | 608 | app->Unlock(); |
609 | 609 | } |
610 | 610 | |
… |
… |
BContainerWindow::~BContainerWindow()
|
625 | 625 | app->StopWatching(this, kWindowsShowFullPathChanged); |
626 | 626 | app->StopWatching(this, kSingleWindowBrowseChanged); |
627 | 627 | app->StopWatching(this, kShowNavigatorChanged); |
628 | | app->StopWatching(this, kDontMoveFilesToTrashChanged); |
| 628 | app->StopWatching(this, kMoveFilesToTrashChanged); |
629 | 629 | app->Unlock(); |
630 | 630 | } |
631 | 631 | |
… |
… |
BContainerWindow::MessageReceived(BMessage* message)
|
1687 | 1687 | settings.SingleWindowBrowse()); |
1688 | 1688 | break; |
1689 | 1689 | |
1690 | | case kDontMoveFilesToTrashChanged: |
| 1690 | case kMoveFilesToTrashChanged: |
1691 | 1691 | { |
1692 | 1692 | bool dontMoveToTrash |
1693 | | = settings.DontMoveFilesToTrash(); |
| 1693 | = settings.MoveFilesToTrash(); |
1694 | 1694 | |
1695 | 1695 | BMenuItem* item |
1696 | 1696 | = fFileContextMenu->FindItem(kMoveToTrash); |
… |
… |
BContainerWindow::AddFileMenu(BMenu* menu)
|
1934 | 1934 | menu->AddItem(new BMenuItem(B_TRANSLATE("Duplicate"), |
1935 | 1935 | new BMessage(kDuplicateSelection), 'D')); |
1936 | 1936 | |
1937 | | menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash() |
1938 | | ? B_TRANSLATE("Delete") : B_TRANSLATE("Move to Trash"), |
| 1937 | menu->AddItem(new BMenuItem(TrackerSettings().MoveFilesToTrash() |
| 1938 | ? B_TRANSLATE("Move to Trash") : B_TRANSLATE("Delete"), |
1939 | 1939 | new BMessage(kMoveToTrash), 'T')); |
1940 | 1940 | |
1941 | 1941 | menu->AddSeparatorItem(); |
… |
… |
BContainerWindow::AddFileContextMenus(BMenu* menu)
|
2758 | 2758 | } |
2759 | 2759 | |
2760 | 2760 | if (!IsTrash() && !InTrash()) { |
2761 | | menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash() |
2762 | | ? B_TRANSLATE("Delete") : B_TRANSLATE("Move to Trash"), |
| 2761 | menu->AddItem(new BMenuItem(TrackerSettings().MoveFilesToTrash() |
| 2762 | ? B_TRANSLATE("Move to Trash") : B_TRANSLATE("Delete"), |
2763 | 2763 | new BMessage(kMoveToTrash), 'T')); |
2764 | 2764 | |
2765 | 2765 | // add separator for copy to/move to items (navigation items) |
diff --git a/src/kits/tracker/FSUtils.cpp b/src/kits/tracker/FSUtils.cpp
index 040b2a4..b582118 100644
a
|
b
|
status_t
|
2842 | 2842 | _DeleteTask(BObjectList<entry_ref>* list, bool confirm) |
2843 | 2843 | { |
2844 | 2844 | if (confirm) { |
2845 | | bool dontMoveToTrash = TrackerSettings().DontMoveFilesToTrash(); |
| 2845 | bool MoveToTrash = TrackerSettings().MoveFilesToTrash(); |
2846 | 2846 | |
2847 | | if (!dontMoveToTrash) { |
| 2847 | if (MoveToTrash) { |
2848 | 2848 | BAlert* alert = new BAlert("", |
2849 | 2849 | B_TRANSLATE_NOCOLLECT(kDeleteConfirmationStr), |
2850 | 2850 | B_TRANSLATE("Cancel"), B_TRANSLATE("Move to Trash"), |
diff --git a/src/kits/tracker/FilePanelPriv.cpp b/src/kits/tracker/FilePanelPriv.cpp
index 70d8cc3..64cb132 100644
a
|
b
|
TFilePanel::AddFileContextMenus(BMenu* menu)
|
885 | 885 | new BMessage(kGetInfo), 'I')); |
886 | 886 | menu->AddItem(new BMenuItem(B_TRANSLATE("Edit name"), |
887 | 887 | new BMessage(kEditItem), 'E')); |
888 | | menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash() |
889 | | ? B_TRANSLATE("Delete") |
890 | | : B_TRANSLATE("Move to Trash"), |
| 888 | menu->AddItem(new BMenuItem(TrackerSettings().MoveFilesToTrash() |
| 889 | ? B_TRANSLATE("Move to Trash") |
| 890 | : B_TRANSLATE("Delete"), |
891 | 891 | new BMessage(kMoveToTrash), 'T')); |
892 | 892 | menu->AddSeparatorItem(); |
893 | 893 | menu->AddItem(new BMenuItem(B_TRANSLATE("Cut"), |
diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp
index 23e356b..88e95f9 100644
a
|
b
|
BPoseView::MessageReceived(BMessage* message)
|
2323 | 2323 | { |
2324 | 2324 | TrackerSettings settings; |
2325 | 2325 | |
2326 | | if ((modifiers() & B_SHIFT_KEY) != 0 || settings.DontMoveFilesToTrash()) |
| 2326 | if ((modifiers() & B_SHIFT_KEY) != 0 || !settings.MoveFilesToTrash()) |
2327 | 2327 | DeleteSelection(true, settings.AskBeforeDeleteFile()); |
2328 | 2328 | else |
2329 | 2329 | MoveSelectionToTrash(); |
… |
… |
BPoseView::KeyDown(const char* bytes, int32 count)
|
6461 | 6461 | } else { |
6462 | 6462 | TrackerSettings settings; |
6463 | 6463 | |
6464 | | if ((modifiers() & B_SHIFT_KEY) != 0 || settings.DontMoveFilesToTrash()) |
| 6464 | if ((modifiers() & B_SHIFT_KEY) != 0 || !settings.MoveFilesToTrash()) |
6465 | 6465 | DeleteSelection(true, settings.AskBeforeDeleteFile()); |
6466 | 6466 | else |
6467 | 6467 | MoveSelectionToTrash(); |
diff --git a/src/kits/tracker/PoseViewScripting.cpp b/src/kits/tracker/PoseViewScripting.cpp
index 0d87eb2..44cda09 100644
a
|
b
|
BPoseView::DeleteProperty(BMessage* _SCRIPTING_ONLY(specifier),
|
491 | 491 | |
492 | 492 | if (error == B_OK) { |
493 | 493 | TrackerSettings settings; |
494 | | if (!settings.DontMoveFilesToTrash()) { |
| 494 | if (settings.MoveFilesToTrash()) { |
495 | 495 | // move the list we build into trash, don't make the |
496 | 496 | // trashing task select the next item |
497 | 497 | MoveListToTrash(entryList, false, false); |
diff --git a/src/kits/tracker/SettingsViews.cpp b/src/kits/tracker/SettingsViews.cpp
index 5436978..97c4177 100644
a
|
b
|
TrashSettingsView::TrashSettingsView()
|
956 | 956 | : |
957 | 957 | SettingsView("TrashSettingsView") |
958 | 958 | { |
959 | | fDontMoveFilesToTrashCheckBox = new BCheckBox("", |
960 | | B_TRANSLATE("Don't move files to Trash"), |
961 | | new BMessage(kDontMoveFilesToTrashChanged)); |
| 959 | fMoveFilesToTrashCheckBox = new BCheckBox("", |
| 960 | B_TRANSLATE("Move deleted files to Trash"), |
| 961 | new BMessage(kMoveFilesToTrashChanged)); |
962 | 962 | |
963 | 963 | fAskBeforeDeleteFileCheckBox = new BCheckBox("", |
964 | 964 | B_TRANSLATE("Ask before delete"), |
… |
… |
TrashSettingsView::TrashSettingsView()
|
970 | 970 | layout->SetOrientation(B_VERTICAL); |
971 | 971 | layout->SetSpacing(0); |
972 | 972 | BGroupLayoutBuilder(layout) |
973 | | .Add(fDontMoveFilesToTrashCheckBox) |
| 973 | .Add(fMoveFilesToTrashCheckBox) |
974 | 974 | .Add(fAskBeforeDeleteFileCheckBox) |
975 | 975 | .AddGlue() |
976 | 976 | .SetInsets(spacing, spacing, spacing, spacing); |
… |
… |
TrashSettingsView::TrashSettingsView()
|
981 | 981 | void |
982 | 982 | TrashSettingsView::AttachedToWindow() |
983 | 983 | { |
984 | | fDontMoveFilesToTrashCheckBox->SetTarget(this); |
| 984 | fMoveFilesToTrashCheckBox->SetTarget(this); |
985 | 985 | fAskBeforeDeleteFileCheckBox->SetTarget(this); |
986 | 986 | } |
987 | 987 | |
… |
… |
TrashSettingsView::MessageReceived(BMessage* message)
|
995 | 995 | TrackerSettings settings; |
996 | 996 | |
997 | 997 | switch (message->what) { |
998 | | case kDontMoveFilesToTrashChanged: |
999 | | settings.SetDontMoveFilesToTrash( |
1000 | | fDontMoveFilesToTrashCheckBox->Value() == 1); |
| 998 | case kMoveFilesToTrashChanged: |
| 999 | settings.SetMoveFilesToTrash( |
| 1000 | fMoveFilesToTrashCheckBox->Value() == 1); |
1001 | 1001 | |
1002 | | tracker->SendNotices(kDontMoveFilesToTrashChanged); |
| 1002 | tracker->SendNotices(kMoveFilesToTrashChanged); |
1003 | 1003 | Window()->PostMessage(kSettingsContentsModified); |
1004 | 1004 | break; |
1005 | 1005 | |
… |
… |
TrashSettingsView::SetDefaults()
|
1023 | 1023 | { |
1024 | 1024 | TrackerSettings settings; |
1025 | 1025 | |
1026 | | settings.SetDontMoveFilesToTrash(false); |
| 1026 | settings.SetMoveFilesToTrash(true); |
1027 | 1027 | settings.SetAskBeforeDeleteFile(true); |
1028 | 1028 | |
1029 | 1029 | ShowCurrentSettings(); |
… |
… |
TrashSettingsView::IsDefaultable() const
|
1036 | 1036 | { |
1037 | 1037 | TrackerSettings settings; |
1038 | 1038 | |
1039 | | return settings.DontMoveFilesToTrash() != false |
| 1039 | return settings.MoveFilesToTrash() != true |
1040 | 1040 | || settings.AskBeforeDeleteFile() != true; |
1041 | 1041 | } |
1042 | 1042 | |
… |
… |
TrashSettingsView::Revert()
|
1046 | 1046 | { |
1047 | 1047 | TrackerSettings settings; |
1048 | 1048 | |
1049 | | settings.SetDontMoveFilesToTrash(fDontMoveFilesToTrash); |
| 1049 | settings.SetMoveFilesToTrash(fMoveFilesToTrash); |
1050 | 1050 | settings.SetAskBeforeDeleteFile(fAskBeforeDeleteFile); |
1051 | 1051 | |
1052 | 1052 | ShowCurrentSettings(); |
… |
… |
TrashSettingsView::_SendNotices()
|
1061 | 1061 | if (!tracker) |
1062 | 1062 | return; |
1063 | 1063 | |
1064 | | tracker->SendNotices(kDontMoveFilesToTrashChanged); |
| 1064 | tracker->SendNotices(kMoveFilesToTrashChanged); |
1065 | 1065 | tracker->SendNotices(kAskBeforeDeleteFileChanged); |
1066 | 1066 | } |
1067 | 1067 | |
… |
… |
TrashSettingsView::ShowCurrentSettings()
|
1071 | 1071 | { |
1072 | 1072 | TrackerSettings settings; |
1073 | 1073 | |
1074 | | fDontMoveFilesToTrashCheckBox->SetValue(settings.DontMoveFilesToTrash()); |
| 1074 | fMoveFilesToTrashCheckBox->SetValue(settings.MoveFilesToTrash()); |
1075 | 1075 | fAskBeforeDeleteFileCheckBox->SetValue(settings.AskBeforeDeleteFile()); |
1076 | 1076 | } |
1077 | 1077 | |
… |
… |
TrashSettingsView::RecordRevertSettings()
|
1081 | 1081 | { |
1082 | 1082 | TrackerSettings settings; |
1083 | 1083 | |
1084 | | fDontMoveFilesToTrash = settings.DontMoveFilesToTrash(); |
| 1084 | fMoveFilesToTrash = settings.MoveFilesToTrash(); |
1085 | 1085 | fAskBeforeDeleteFile = settings.AskBeforeDeleteFile(); |
1086 | 1086 | } |
1087 | 1087 | |
… |
… |
TrashSettingsView::RecordRevertSettings()
|
1089 | 1089 | bool |
1090 | 1090 | TrashSettingsView::IsRevertable() const |
1091 | 1091 | { |
1092 | | return fDontMoveFilesToTrash |
1093 | | != (fDontMoveFilesToTrashCheckBox->Value() > 0) |
| 1092 | return fMoveFilesToTrash |
| 1093 | != (fMoveFilesToTrashCheckBox->Value() > 0) |
1094 | 1094 | || fAskBeforeDeleteFile |
1095 | 1095 | != (fAskBeforeDeleteFileCheckBox->Value() > 0); |
1096 | 1096 | } |
diff --git a/src/kits/tracker/SettingsViews.h b/src/kits/tracker/SettingsViews.h
index bc3474b..f6c21be 100644
a
|
b
|
class TrashSettingsView : public SettingsView {
|
181 | 181 | private: |
182 | 182 | void _SendNotices(); |
183 | 183 | |
184 | | BCheckBox* fDontMoveFilesToTrashCheckBox; |
| 184 | BCheckBox* fMoveFilesToTrashCheckBox; |
185 | 185 | BCheckBox* fAskBeforeDeleteFileCheckBox; |
186 | 186 | |
187 | | bool fDontMoveFilesToTrash; |
| 187 | bool fMoveFilesToTrash; |
188 | 188 | bool fAskBeforeDeleteFile; |
189 | 189 | |
190 | 190 | typedef SettingsView _inherited; |
diff --git a/src/kits/tracker/TrackerSettings.cpp b/src/kits/tracker/TrackerSettings.cpp
index 7eebfa4..5ee3ed2 100644
a
|
b
|
class TTrackerState : public Settings {
|
82 | 82 | HexScalarValueSetting* fFreeSpaceColor; |
83 | 83 | HexScalarValueSetting* fWarningSpaceColor; |
84 | 84 | |
85 | | BooleanValueSetting* fDontMoveFilesToTrash; |
| 85 | BooleanValueSetting* fMoveFilesToTrash; |
86 | 86 | BooleanValueSetting* fAskBeforeDeleteFile; |
87 | 87 | |
88 | 88 | Benaphore fInitLock; |
… |
… |
TTrackerState::LoadSettingsIfNeeded()
|
202 | 202 | Add(fWarningSpaceColor |
203 | 203 | = new HexScalarValueSetting("WarningSpaceColor", 0xc0cb0000, "", "")); |
204 | 204 | |
205 | | Add(fDontMoveFilesToTrash |
206 | | = new BooleanValueSetting("DontMoveFilesToTrash", false)); |
| 205 | Add(fMoveFilesToTrash |
| 206 | = new BooleanValueSetting("MoveFilesToTrash", true)); |
207 | 207 | Add(fAskBeforeDeleteFile |
208 | 208 | = new BooleanValueSetting("AskBeforeDeleteFile", true)); |
209 | 209 | |
… |
… |
TrackerSettings::SetRecentFoldersCount(int32 count)
|
509 | 509 | |
510 | 510 | |
511 | 511 | bool |
512 | | TrackerSettings::DontMoveFilesToTrash() |
| 512 | TrackerSettings::MoveFilesToTrash() |
513 | 513 | { |
514 | | return gTrackerState.fDontMoveFilesToTrash->Value(); |
| 514 | return gTrackerState.fMoveFilesToTrash->Value(); |
515 | 515 | } |
516 | 516 | |
517 | 517 | |
518 | 518 | void |
519 | | TrackerSettings::SetDontMoveFilesToTrash(bool enabled) |
| 519 | TrackerSettings::SetMoveFilesToTrash(bool enabled) |
520 | 520 | { |
521 | | gTrackerState.fDontMoveFilesToTrash->SetValue(enabled); |
| 521 | gTrackerState.fMoveFilesToTrash->SetValue(enabled); |
522 | 522 | } |
523 | 523 | |
524 | 524 | |
diff --git a/src/kits/tracker/TrackerSettings.h b/src/kits/tracker/TrackerSettings.h
index efec805..edc44d0 100644
a
|
b
|
class TrackerSettings {
|
118 | 118 | bool ClockIs24Hr(); |
119 | 119 | void SetClockTo24Hr(bool); |
120 | 120 | |
121 | | bool DontMoveFilesToTrash(); |
122 | | void SetDontMoveFilesToTrash(bool); |
| 121 | bool MoveFilesToTrash(); |
| 122 | void SetMoveFilesToTrash(bool); |
123 | 123 | bool AskBeforeDeleteFile(); |
124 | 124 | void SetAskBeforeDeleteFile(bool); |