Revert "Renamed Tracker option "Don't move files to Trash" (#9352)"
This reverts commit 45f77dcd70
.
This commit is contained in:
parent
64a1f5a020
commit
163a394833
@ -140,7 +140,7 @@ const uint32 kUpdateVolumeSpaceBar = 'UpSB';
|
||||
const uint32 kShowVolumeSpaceBar = 'ShSB';
|
||||
const uint32 kSpaceBarColorChanged = 'SBcc';
|
||||
|
||||
const uint32 kMoveFilesToTrashChanged = 'STdm';
|
||||
const uint32 kDontMoveFilesToTrashChanged = 'STdm';
|
||||
const uint32 kAskBeforeDeleteFileChanged = 'STad';
|
||||
|
||||
} // namespace BPrivate
|
||||
|
@ -604,7 +604,7 @@ BContainerWindow::BContainerWindow(LockingList<BWindow>* list,
|
||||
app->StartWatching(this, kWindowsShowFullPathChanged);
|
||||
app->StartWatching(this, kSingleWindowBrowseChanged);
|
||||
app->StartWatching(this, kShowNavigatorChanged);
|
||||
app->StartWatching(this, kMoveFilesToTrashChanged);
|
||||
app->StartWatching(this, kDontMoveFilesToTrashChanged);
|
||||
app->Unlock();
|
||||
}
|
||||
|
||||
@ -625,7 +625,7 @@ BContainerWindow::~BContainerWindow()
|
||||
app->StopWatching(this, kWindowsShowFullPathChanged);
|
||||
app->StopWatching(this, kSingleWindowBrowseChanged);
|
||||
app->StopWatching(this, kShowNavigatorChanged);
|
||||
app->StopWatching(this, kMoveFilesToTrashChanged);
|
||||
app->StopWatching(this, kDontMoveFilesToTrashChanged);
|
||||
app->Unlock();
|
||||
}
|
||||
|
||||
@ -1687,10 +1687,10 @@ BContainerWindow::MessageReceived(BMessage* message)
|
||||
settings.SingleWindowBrowse());
|
||||
break;
|
||||
|
||||
case kMoveFilesToTrashChanged:
|
||||
case kDontMoveFilesToTrashChanged:
|
||||
{
|
||||
bool dontMoveToTrash
|
||||
= settings.MoveFilesToTrash();
|
||||
= settings.DontMoveFilesToTrash();
|
||||
|
||||
BMenuItem* item
|
||||
= fFileContextMenu->FindItem(kMoveToTrash);
|
||||
@ -1934,8 +1934,8 @@ BContainerWindow::AddFileMenu(BMenu* menu)
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Duplicate"),
|
||||
new BMessage(kDuplicateSelection), 'D'));
|
||||
|
||||
menu->AddItem(new BMenuItem(TrackerSettings().MoveFilesToTrash()
|
||||
? B_TRANSLATE("Move to Trash") : B_TRANSLATE("Delete"),
|
||||
menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash()
|
||||
? B_TRANSLATE("Delete") : B_TRANSLATE("Move to Trash"),
|
||||
new BMessage(kMoveToTrash), 'T'));
|
||||
|
||||
menu->AddSeparatorItem();
|
||||
@ -2758,8 +2758,8 @@ BContainerWindow::AddFileContextMenus(BMenu* menu)
|
||||
}
|
||||
|
||||
if (!IsTrash() && !InTrash()) {
|
||||
menu->AddItem(new BMenuItem(TrackerSettings().MoveFilesToTrash()
|
||||
? B_TRANSLATE("Move to Trash") : B_TRANSLATE("Delete"),
|
||||
menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash()
|
||||
? B_TRANSLATE("Delete") : B_TRANSLATE("Move to Trash"),
|
||||
new BMessage(kMoveToTrash), 'T'));
|
||||
|
||||
// add separator for copy to/move to items (navigation items)
|
||||
|
@ -2842,9 +2842,9 @@ status_t
|
||||
_DeleteTask(BObjectList<entry_ref>* list, bool confirm)
|
||||
{
|
||||
if (confirm) {
|
||||
bool MoveToTrash = TrackerSettings().MoveFilesToTrash();
|
||||
bool dontMoveToTrash = TrackerSettings().DontMoveFilesToTrash();
|
||||
|
||||
if (MoveToTrash) {
|
||||
if (!dontMoveToTrash) {
|
||||
BAlert* alert = new BAlert("",
|
||||
B_TRANSLATE_NOCOLLECT(kDeleteConfirmationStr),
|
||||
B_TRANSLATE("Cancel"), B_TRANSLATE("Move to Trash"),
|
||||
|
@ -885,9 +885,9 @@ TFilePanel::AddFileContextMenus(BMenu* menu)
|
||||
new BMessage(kGetInfo), 'I'));
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Edit name"),
|
||||
new BMessage(kEditItem), 'E'));
|
||||
menu->AddItem(new BMenuItem(TrackerSettings().MoveFilesToTrash()
|
||||
? B_TRANSLATE("Move to Trash")
|
||||
: B_TRANSLATE("Delete"),
|
||||
menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash()
|
||||
? B_TRANSLATE("Delete")
|
||||
: B_TRANSLATE("Move to Trash"),
|
||||
new BMessage(kMoveToTrash), 'T'));
|
||||
menu->AddSeparatorItem();
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Cut"),
|
||||
|
@ -2323,7 +2323,7 @@ BPoseView::MessageReceived(BMessage* message)
|
||||
{
|
||||
TrackerSettings settings;
|
||||
|
||||
if ((modifiers() & B_SHIFT_KEY) != 0 || !settings.MoveFilesToTrash())
|
||||
if ((modifiers() & B_SHIFT_KEY) != 0 || settings.DontMoveFilesToTrash())
|
||||
DeleteSelection(true, settings.AskBeforeDeleteFile());
|
||||
else
|
||||
MoveSelectionToTrash();
|
||||
@ -6461,7 +6461,7 @@ BPoseView::KeyDown(const char* bytes, int32 count)
|
||||
} else {
|
||||
TrackerSettings settings;
|
||||
|
||||
if ((modifiers() & B_SHIFT_KEY) != 0 || !settings.MoveFilesToTrash())
|
||||
if ((modifiers() & B_SHIFT_KEY) != 0 || settings.DontMoveFilesToTrash())
|
||||
DeleteSelection(true, settings.AskBeforeDeleteFile());
|
||||
else
|
||||
MoveSelectionToTrash();
|
||||
|
@ -491,7 +491,7 @@ BPoseView::DeleteProperty(BMessage* _SCRIPTING_ONLY(specifier),
|
||||
|
||||
if (error == B_OK) {
|
||||
TrackerSettings settings;
|
||||
if (settings.MoveFilesToTrash()) {
|
||||
if (!settings.DontMoveFilesToTrash()) {
|
||||
// move the list we build into trash, don't make the
|
||||
// trashing task select the next item
|
||||
MoveListToTrash(entryList, false, false);
|
||||
|
@ -956,12 +956,12 @@ TrashSettingsView::TrashSettingsView()
|
||||
:
|
||||
SettingsView("TrashSettingsView")
|
||||
{
|
||||
fMoveFilesToTrashCheckBox = new BCheckBox("",
|
||||
B_TRANSLATE("Move deleted files to Trash first"),
|
||||
new BMessage(kMoveFilesToTrashChanged));
|
||||
fDontMoveFilesToTrashCheckBox = new BCheckBox("",
|
||||
B_TRANSLATE("Don't move files to Trash"),
|
||||
new BMessage(kDontMoveFilesToTrashChanged));
|
||||
|
||||
fAskBeforeDeleteFileCheckBox = new BCheckBox("",
|
||||
B_TRANSLATE("Ask before deleting for good"),
|
||||
B_TRANSLATE("Ask before delete"),
|
||||
new BMessage(kAskBeforeDeleteFileChanged));
|
||||
|
||||
const float spacing = be_control_look->DefaultItemSpacing();
|
||||
@ -970,7 +970,7 @@ TrashSettingsView::TrashSettingsView()
|
||||
layout->SetOrientation(B_VERTICAL);
|
||||
layout->SetSpacing(0);
|
||||
BGroupLayoutBuilder(layout)
|
||||
.Add(fMoveFilesToTrashCheckBox)
|
||||
.Add(fDontMoveFilesToTrashCheckBox)
|
||||
.Add(fAskBeforeDeleteFileCheckBox)
|
||||
.AddGlue()
|
||||
.SetInsets(spacing, spacing, spacing, spacing);
|
||||
@ -981,7 +981,7 @@ TrashSettingsView::TrashSettingsView()
|
||||
void
|
||||
TrashSettingsView::AttachedToWindow()
|
||||
{
|
||||
fMoveFilesToTrashCheckBox->SetTarget(this);
|
||||
fDontMoveFilesToTrashCheckBox->SetTarget(this);
|
||||
fAskBeforeDeleteFileCheckBox->SetTarget(this);
|
||||
}
|
||||
|
||||
@ -995,11 +995,11 @@ TrashSettingsView::MessageReceived(BMessage* message)
|
||||
TrackerSettings settings;
|
||||
|
||||
switch (message->what) {
|
||||
case kMoveFilesToTrashChanged:
|
||||
settings.SetMoveFilesToTrash(
|
||||
fMoveFilesToTrashCheckBox->Value() == 1);
|
||||
case kDontMoveFilesToTrashChanged:
|
||||
settings.SetDontMoveFilesToTrash(
|
||||
fDontMoveFilesToTrashCheckBox->Value() == 1);
|
||||
|
||||
tracker->SendNotices(kMoveFilesToTrashChanged);
|
||||
tracker->SendNotices(kDontMoveFilesToTrashChanged);
|
||||
Window()->PostMessage(kSettingsContentsModified);
|
||||
break;
|
||||
|
||||
@ -1023,7 +1023,7 @@ TrashSettingsView::SetDefaults()
|
||||
{
|
||||
TrackerSettings settings;
|
||||
|
||||
settings.SetMoveFilesToTrash(true);
|
||||
settings.SetDontMoveFilesToTrash(false);
|
||||
settings.SetAskBeforeDeleteFile(true);
|
||||
|
||||
ShowCurrentSettings();
|
||||
@ -1036,7 +1036,7 @@ TrashSettingsView::IsDefaultable() const
|
||||
{
|
||||
TrackerSettings settings;
|
||||
|
||||
return settings.MoveFilesToTrash() != true
|
||||
return settings.DontMoveFilesToTrash() != false
|
||||
|| settings.AskBeforeDeleteFile() != true;
|
||||
}
|
||||
|
||||
@ -1046,7 +1046,7 @@ TrashSettingsView::Revert()
|
||||
{
|
||||
TrackerSettings settings;
|
||||
|
||||
settings.SetMoveFilesToTrash(fMoveFilesToTrash);
|
||||
settings.SetDontMoveFilesToTrash(fDontMoveFilesToTrash);
|
||||
settings.SetAskBeforeDeleteFile(fAskBeforeDeleteFile);
|
||||
|
||||
ShowCurrentSettings();
|
||||
@ -1061,7 +1061,7 @@ TrashSettingsView::_SendNotices()
|
||||
if (!tracker)
|
||||
return;
|
||||
|
||||
tracker->SendNotices(kMoveFilesToTrashChanged);
|
||||
tracker->SendNotices(kDontMoveFilesToTrashChanged);
|
||||
tracker->SendNotices(kAskBeforeDeleteFileChanged);
|
||||
}
|
||||
|
||||
@ -1071,7 +1071,7 @@ TrashSettingsView::ShowCurrentSettings()
|
||||
{
|
||||
TrackerSettings settings;
|
||||
|
||||
fMoveFilesToTrashCheckBox->SetValue(settings.MoveFilesToTrash());
|
||||
fDontMoveFilesToTrashCheckBox->SetValue(settings.DontMoveFilesToTrash());
|
||||
fAskBeforeDeleteFileCheckBox->SetValue(settings.AskBeforeDeleteFile());
|
||||
}
|
||||
|
||||
@ -1081,7 +1081,7 @@ TrashSettingsView::RecordRevertSettings()
|
||||
{
|
||||
TrackerSettings settings;
|
||||
|
||||
fMoveFilesToTrash = settings.MoveFilesToTrash();
|
||||
fDontMoveFilesToTrash = settings.DontMoveFilesToTrash();
|
||||
fAskBeforeDeleteFile = settings.AskBeforeDeleteFile();
|
||||
}
|
||||
|
||||
@ -1089,8 +1089,8 @@ TrashSettingsView::RecordRevertSettings()
|
||||
bool
|
||||
TrashSettingsView::IsRevertable() const
|
||||
{
|
||||
return fMoveFilesToTrash
|
||||
!= (fMoveFilesToTrashCheckBox->Value() > 0)
|
||||
return fDontMoveFilesToTrash
|
||||
!= (fDontMoveFilesToTrashCheckBox->Value() > 0)
|
||||
|| fAskBeforeDeleteFile
|
||||
!= (fAskBeforeDeleteFileCheckBox->Value() > 0);
|
||||
}
|
||||
|
@ -181,10 +181,10 @@ class TrashSettingsView : public SettingsView {
|
||||
private:
|
||||
void _SendNotices();
|
||||
|
||||
BCheckBox* fMoveFilesToTrashCheckBox;
|
||||
BCheckBox* fDontMoveFilesToTrashCheckBox;
|
||||
BCheckBox* fAskBeforeDeleteFileCheckBox;
|
||||
|
||||
bool fMoveFilesToTrash;
|
||||
bool fDontMoveFilesToTrash;
|
||||
bool fAskBeforeDeleteFile;
|
||||
|
||||
typedef SettingsView _inherited;
|
||||
|
@ -82,7 +82,7 @@ class TTrackerState : public Settings {
|
||||
HexScalarValueSetting* fFreeSpaceColor;
|
||||
HexScalarValueSetting* fWarningSpaceColor;
|
||||
|
||||
BooleanValueSetting* fMoveFilesToTrash;
|
||||
BooleanValueSetting* fDontMoveFilesToTrash;
|
||||
BooleanValueSetting* fAskBeforeDeleteFile;
|
||||
|
||||
Benaphore fInitLock;
|
||||
@ -202,8 +202,8 @@ TTrackerState::LoadSettingsIfNeeded()
|
||||
Add(fWarningSpaceColor
|
||||
= new HexScalarValueSetting("WarningSpaceColor", 0xc0cb0000, "", ""));
|
||||
|
||||
Add(fMoveFilesToTrash
|
||||
= new BooleanValueSetting("MoveFilesToTrash", true));
|
||||
Add(fDontMoveFilesToTrash
|
||||
= new BooleanValueSetting("DontMoveFilesToTrash", false));
|
||||
Add(fAskBeforeDeleteFile
|
||||
= new BooleanValueSetting("AskBeforeDeleteFile", true));
|
||||
|
||||
@ -509,16 +509,16 @@ TrackerSettings::SetRecentFoldersCount(int32 count)
|
||||
|
||||
|
||||
bool
|
||||
TrackerSettings::MoveFilesToTrash()
|
||||
TrackerSettings::DontMoveFilesToTrash()
|
||||
{
|
||||
return gTrackerState.fMoveFilesToTrash->Value();
|
||||
return gTrackerState.fDontMoveFilesToTrash->Value();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TrackerSettings::SetMoveFilesToTrash(bool enabled)
|
||||
TrackerSettings::SetDontMoveFilesToTrash(bool enabled)
|
||||
{
|
||||
gTrackerState.fMoveFilesToTrash->SetValue(enabled);
|
||||
gTrackerState.fDontMoveFilesToTrash->SetValue(enabled);
|
||||
}
|
||||
|
||||
|
||||
|
@ -118,8 +118,8 @@ class TrackerSettings {
|
||||
bool ClockIs24Hr();
|
||||
void SetClockTo24Hr(bool);
|
||||
|
||||
bool MoveFilesToTrash();
|
||||
void SetMoveFilesToTrash(bool);
|
||||
bool DontMoveFilesToTrash();
|
||||
void SetDontMoveFilesToTrash(bool);
|
||||
bool AskBeforeDeleteFile();
|
||||
void SetAskBeforeDeleteFile(bool);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user