Skip to content

Commit

Permalink
Revert "Renamed Tracker option "Don't move files to Trash" (#9352)"
Browse files Browse the repository at this point in the history
This reverts commit 45f77dc.
  • Loading branch information
Humdinger committed Feb 10, 2013
1 parent 64a1f5a commit 163a394
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/kits/tracker/Commands.h
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions src/kits/tracker/ContainerWindow.cpp
Expand Up @@ -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();
}

Expand All @@ -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();
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/kits/tracker/FSUtils.cpp
Expand Up @@ -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"),
Expand Down
6 changes: 3 additions & 3 deletions src/kits/tracker/FilePanelPriv.cpp
Expand Up @@ -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"),
Expand Down
4 changes: 2 additions & 2 deletions src/kits/tracker/PoseView.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/kits/tracker/PoseViewScripting.cpp
Expand Up @@ -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);
Expand Down
36 changes: 18 additions & 18 deletions src/kits/tracker/SettingsViews.cpp
Expand Up @@ -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();
Expand All @@ -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);
Expand All @@ -981,7 +981,7 @@ TrashSettingsView::TrashSettingsView()
void
TrashSettingsView::AttachedToWindow()
{
fMoveFilesToTrashCheckBox->SetTarget(this);
fDontMoveFilesToTrashCheckBox->SetTarget(this);
fAskBeforeDeleteFileCheckBox->SetTarget(this);
}

Expand All @@ -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;

Expand All @@ -1023,7 +1023,7 @@ TrashSettingsView::SetDefaults()
{
TrackerSettings settings;

settings.SetMoveFilesToTrash(true);
settings.SetDontMoveFilesToTrash(false);
settings.SetAskBeforeDeleteFile(true);

ShowCurrentSettings();
Expand All @@ -1036,7 +1036,7 @@ TrashSettingsView::IsDefaultable() const
{
TrackerSettings settings;

return settings.MoveFilesToTrash() != true
return settings.DontMoveFilesToTrash() != false
|| settings.AskBeforeDeleteFile() != true;
}

Expand All @@ -1046,7 +1046,7 @@ TrashSettingsView::Revert()
{
TrackerSettings settings;

settings.SetMoveFilesToTrash(fMoveFilesToTrash);
settings.SetDontMoveFilesToTrash(fDontMoveFilesToTrash);
settings.SetAskBeforeDeleteFile(fAskBeforeDeleteFile);

ShowCurrentSettings();
Expand All @@ -1061,7 +1061,7 @@ TrashSettingsView::_SendNotices()
if (!tracker)
return;

tracker->SendNotices(kMoveFilesToTrashChanged);
tracker->SendNotices(kDontMoveFilesToTrashChanged);
tracker->SendNotices(kAskBeforeDeleteFileChanged);
}

Expand All @@ -1071,7 +1071,7 @@ TrashSettingsView::ShowCurrentSettings()
{
TrackerSettings settings;

fMoveFilesToTrashCheckBox->SetValue(settings.MoveFilesToTrash());
fDontMoveFilesToTrashCheckBox->SetValue(settings.DontMoveFilesToTrash());
fAskBeforeDeleteFileCheckBox->SetValue(settings.AskBeforeDeleteFile());
}

Expand All @@ -1081,16 +1081,16 @@ TrashSettingsView::RecordRevertSettings()
{
TrackerSettings settings;

fMoveFilesToTrash = settings.MoveFilesToTrash();
fDontMoveFilesToTrash = settings.DontMoveFilesToTrash();
fAskBeforeDeleteFile = settings.AskBeforeDeleteFile();
}


bool
TrashSettingsView::IsRevertable() const
{
return fMoveFilesToTrash
!= (fMoveFilesToTrashCheckBox->Value() > 0)
return fDontMoveFilesToTrash
!= (fDontMoveFilesToTrashCheckBox->Value() > 0)
|| fAskBeforeDeleteFile
!= (fAskBeforeDeleteFileCheckBox->Value() > 0);
}
Expand Down
4 changes: 2 additions & 2 deletions src/kits/tracker/SettingsViews.h
Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions src/kits/tracker/TrackerSettings.cpp
Expand Up @@ -82,7 +82,7 @@ class TTrackerState : public Settings {
HexScalarValueSetting* fFreeSpaceColor;
HexScalarValueSetting* fWarningSpaceColor;

BooleanValueSetting* fMoveFilesToTrash;
BooleanValueSetting* fDontMoveFilesToTrash;
BooleanValueSetting* fAskBeforeDeleteFile;

Benaphore fInitLock;
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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);
}


Expand Down
4 changes: 2 additions & 2 deletions src/kits/tracker/TrackerSettings.h
Expand Up @@ -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);

Expand Down

0 comments on commit 163a394

Please sign in to comment.