Ticket #9352: MoveTrash.diff

File MoveTrash.diff, 11.7 KB (added by humdinger, 12 years ago)

diff renaming everything to "Move file to Trash"

  • src/kits/tracker/Commands.h

    diff --git a/src/kits/tracker/Commands.h b/src/kits/tracker/Commands.h
    index 869270b..a98d614 100644
    a b const uint32 kUpdateVolumeSpaceBar = 'UpSB';  
    140140const uint32 kShowVolumeSpaceBar = 'ShSB';
    141141const uint32 kSpaceBarColorChanged = 'SBcc';
    142142
    143 const uint32 kDontMoveFilesToTrashChanged = 'STdm';
     143const uint32 kMoveFilesToTrashChanged = 'STdm';
    144144const uint32 kAskBeforeDeleteFileChanged = 'STad';
    145145
    146146} // namespace BPrivate
  • src/kits/tracker/ContainerWindow.cpp

    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,  
    604604        app->StartWatching(this, kWindowsShowFullPathChanged);
    605605        app->StartWatching(this, kSingleWindowBrowseChanged);
    606606        app->StartWatching(this, kShowNavigatorChanged);
    607         app->StartWatching(this, kDontMoveFilesToTrashChanged);
     607        app->StartWatching(this, kMoveFilesToTrashChanged);
    608608        app->Unlock();
    609609    }
    610610
    BContainerWindow::~BContainerWindow()  
    625625        app->StopWatching(this, kWindowsShowFullPathChanged);
    626626        app->StopWatching(this, kSingleWindowBrowseChanged);
    627627        app->StopWatching(this, kShowNavigatorChanged);
    628         app->StopWatching(this, kDontMoveFilesToTrashChanged);
     628        app->StopWatching(this, kMoveFilesToTrashChanged);
    629629        app->Unlock();
    630630    }
    631631
    BContainerWindow::MessageReceived(BMessage* message)  
    16871687                            settings.SingleWindowBrowse());
    16881688                        break;
    16891689
    1690                     case kDontMoveFilesToTrashChanged:
     1690                    case kMoveFilesToTrashChanged:
    16911691                        {
    16921692                            bool dontMoveToTrash
    1693                                 = settings.DontMoveFilesToTrash();
     1693                                = settings.MoveFilesToTrash();
    16941694
    16951695                            BMenuItem* item
    16961696                                = fFileContextMenu->FindItem(kMoveToTrash);
    BContainerWindow::AddFileMenu(BMenu* menu)  
    19341934        menu->AddItem(new BMenuItem(B_TRANSLATE("Duplicate"),
    19351935            new BMessage(kDuplicateSelection), 'D'));
    19361936
    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"),
    19391939            new BMessage(kMoveToTrash), 'T'));
    19401940
    19411941        menu->AddSeparatorItem();
    BContainerWindow::AddFileContextMenus(BMenu* menu)  
    27582758    }
    27592759
    27602760    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"),
    27632763            new BMessage(kMoveToTrash), 'T'));
    27642764
    27652765        // add separator for copy to/move to items (navigation items)
  • src/kits/tracker/FSUtils.cpp

    diff --git a/src/kits/tracker/FSUtils.cpp b/src/kits/tracker/FSUtils.cpp
    index 040b2a4..b582118 100644
    a b status_t  
    28422842_DeleteTask(BObjectList<entry_ref>* list, bool confirm)
    28432843{
    28442844    if (confirm) {
    2845         bool dontMoveToTrash = TrackerSettings().DontMoveFilesToTrash();
     2845        bool MoveToTrash = TrackerSettings().MoveFilesToTrash();
    28462846
    2847         if (!dontMoveToTrash) {
     2847        if (MoveToTrash) {
    28482848            BAlert* alert = new BAlert("",
    28492849                B_TRANSLATE_NOCOLLECT(kDeleteConfirmationStr),
    28502850                B_TRANSLATE("Cancel"), B_TRANSLATE("Move to Trash"),
  • src/kits/tracker/FilePanelPriv.cpp

    diff --git a/src/kits/tracker/FilePanelPriv.cpp b/src/kits/tracker/FilePanelPriv.cpp
    index 70d8cc3..64cb132 100644
    a b TFilePanel::AddFileContextMenus(BMenu* menu)  
    885885        new BMessage(kGetInfo), 'I'));
    886886    menu->AddItem(new BMenuItem(B_TRANSLATE("Edit name"),
    887887        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"),
    891891        new BMessage(kMoveToTrash), 'T'));
    892892    menu->AddSeparatorItem();
    893893    menu->AddItem(new BMenuItem(B_TRANSLATE("Cut"),
  • src/kits/tracker/PoseView.cpp

    diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp
    index 23e356b..88e95f9 100644
    a b BPoseView::MessageReceived(BMessage* message)  
    23232323        {
    23242324            TrackerSettings settings;
    23252325
    2326             if ((modifiers() & B_SHIFT_KEY) != 0 || settings.DontMoveFilesToTrash())
     2326            if ((modifiers() & B_SHIFT_KEY) != 0 || !settings.MoveFilesToTrash())
    23272327                DeleteSelection(true, settings.AskBeforeDeleteFile());
    23282328            else
    23292329                MoveSelectionToTrash();
    BPoseView::KeyDown(const char* bytes, int32 count)  
    64616461            } else {
    64626462                TrackerSettings settings;
    64636463
    6464                 if ((modifiers() & B_SHIFT_KEY) != 0 || settings.DontMoveFilesToTrash())
     6464                if ((modifiers() & B_SHIFT_KEY) != 0 || !settings.MoveFilesToTrash())
    64656465                    DeleteSelection(true, settings.AskBeforeDeleteFile());
    64666466                else
    64676467                    MoveSelectionToTrash();
  • src/kits/tracker/PoseViewScripting.cpp

    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),  
    491491
    492492        if (error == B_OK) {
    493493            TrackerSettings settings;
    494             if (!settings.DontMoveFilesToTrash()) {
     494            if (settings.MoveFilesToTrash()) {
    495495                // move the list we build into trash, don't make the
    496496                // trashing task select the next item
    497497                MoveListToTrash(entryList, false, false);
  • src/kits/tracker/SettingsViews.cpp

    diff --git a/src/kits/tracker/SettingsViews.cpp b/src/kits/tracker/SettingsViews.cpp
    index 5436978..97c4177 100644
    a b TrashSettingsView::TrashSettingsView()  
    956956    :
    957957    SettingsView("TrashSettingsView")
    958958{
    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));
    962962
    963963    fAskBeforeDeleteFileCheckBox = new BCheckBox("",
    964964        B_TRANSLATE("Ask before delete"),
    TrashSettingsView::TrashSettingsView()  
    970970    layout->SetOrientation(B_VERTICAL);
    971971    layout->SetSpacing(0);
    972972    BGroupLayoutBuilder(layout)
    973         .Add(fDontMoveFilesToTrashCheckBox)
     973        .Add(fMoveFilesToTrashCheckBox)
    974974        .Add(fAskBeforeDeleteFileCheckBox)
    975975        .AddGlue()
    976976        .SetInsets(spacing, spacing, spacing, spacing);
    TrashSettingsView::TrashSettingsView()  
    981981void
    982982TrashSettingsView::AttachedToWindow()
    983983{
    984     fDontMoveFilesToTrashCheckBox->SetTarget(this);
     984    fMoveFilesToTrashCheckBox->SetTarget(this);
    985985    fAskBeforeDeleteFileCheckBox->SetTarget(this);
    986986}
    987987
    TrashSettingsView::MessageReceived(BMessage* message)  
    995995    TrackerSettings settings;
    996996
    997997    switch (message->what) {
    998         case kDontMoveFilesToTrashChanged:
    999             settings.SetDontMoveFilesToTrash(
    1000                 fDontMoveFilesToTrashCheckBox->Value() == 1);
     998        case kMoveFilesToTrashChanged:
     999            settings.SetMoveFilesToTrash(
     1000                fMoveFilesToTrashCheckBox->Value() == 1);
    10011001
    1002             tracker->SendNotices(kDontMoveFilesToTrashChanged);
     1002            tracker->SendNotices(kMoveFilesToTrashChanged);
    10031003            Window()->PostMessage(kSettingsContentsModified);
    10041004            break;
    10051005
    TrashSettingsView::SetDefaults()  
    10231023{
    10241024    TrackerSettings settings;
    10251025
    1026     settings.SetDontMoveFilesToTrash(false);
     1026    settings.SetMoveFilesToTrash(true);
    10271027    settings.SetAskBeforeDeleteFile(true);
    10281028
    10291029    ShowCurrentSettings();
    TrashSettingsView::IsDefaultable() const  
    10361036{
    10371037    TrackerSettings settings;
    10381038
    1039     return settings.DontMoveFilesToTrash() != false
     1039    return settings.MoveFilesToTrash() != true
    10401040        || settings.AskBeforeDeleteFile() != true;
    10411041}
    10421042
    TrashSettingsView::Revert()  
    10461046{
    10471047    TrackerSettings settings;
    10481048
    1049     settings.SetDontMoveFilesToTrash(fDontMoveFilesToTrash);
     1049    settings.SetMoveFilesToTrash(fMoveFilesToTrash);
    10501050    settings.SetAskBeforeDeleteFile(fAskBeforeDeleteFile);
    10511051
    10521052    ShowCurrentSettings();
    TrashSettingsView::_SendNotices()  
    10611061    if (!tracker)
    10621062        return;
    10631063
    1064     tracker->SendNotices(kDontMoveFilesToTrashChanged);
     1064    tracker->SendNotices(kMoveFilesToTrashChanged);
    10651065    tracker->SendNotices(kAskBeforeDeleteFileChanged);
    10661066}
    10671067
    TrashSettingsView::ShowCurrentSettings()  
    10711071{
    10721072    TrackerSettings settings;
    10731073
    1074     fDontMoveFilesToTrashCheckBox->SetValue(settings.DontMoveFilesToTrash());
     1074    fMoveFilesToTrashCheckBox->SetValue(settings.MoveFilesToTrash());
    10751075    fAskBeforeDeleteFileCheckBox->SetValue(settings.AskBeforeDeleteFile());
    10761076}
    10771077
    TrashSettingsView::RecordRevertSettings()  
    10811081{
    10821082    TrackerSettings settings;
    10831083
    1084     fDontMoveFilesToTrash = settings.DontMoveFilesToTrash();
     1084    fMoveFilesToTrash = settings.MoveFilesToTrash();
    10851085    fAskBeforeDeleteFile = settings.AskBeforeDeleteFile();
    10861086}
    10871087
    TrashSettingsView::RecordRevertSettings()  
    10891089bool
    10901090TrashSettingsView::IsRevertable() const
    10911091{
    1092     return fDontMoveFilesToTrash
    1093             != (fDontMoveFilesToTrashCheckBox->Value() > 0)
     1092    return fMoveFilesToTrash
     1093            != (fMoveFilesToTrashCheckBox->Value() > 0)
    10941094        || fAskBeforeDeleteFile
    10951095            != (fAskBeforeDeleteFileCheckBox->Value() > 0);
    10961096}
  • src/kits/tracker/SettingsViews.h

    diff --git a/src/kits/tracker/SettingsViews.h b/src/kits/tracker/SettingsViews.h
    index bc3474b..f6c21be 100644
    a b class TrashSettingsView : public SettingsView {  
    181181    private:
    182182        void _SendNotices();
    183183
    184         BCheckBox* fDontMoveFilesToTrashCheckBox;
     184        BCheckBox* fMoveFilesToTrashCheckBox;
    185185        BCheckBox* fAskBeforeDeleteFileCheckBox;
    186186
    187         bool fDontMoveFilesToTrash;
     187        bool fMoveFilesToTrash;
    188188        bool fAskBeforeDeleteFile;
    189189
    190190        typedef SettingsView _inherited;
  • src/kits/tracker/TrackerSettings.cpp

    diff --git a/src/kits/tracker/TrackerSettings.cpp b/src/kits/tracker/TrackerSettings.cpp
    index 7eebfa4..5ee3ed2 100644
    a b class TTrackerState : public Settings {  
    8282        HexScalarValueSetting* fFreeSpaceColor;
    8383        HexScalarValueSetting* fWarningSpaceColor;
    8484
    85         BooleanValueSetting* fDontMoveFilesToTrash;
     85        BooleanValueSetting* fMoveFilesToTrash;
    8686        BooleanValueSetting* fAskBeforeDeleteFile;
    8787
    8888        Benaphore fInitLock;
    TTrackerState::LoadSettingsIfNeeded()  
    202202    Add(fWarningSpaceColor
    203203        = new HexScalarValueSetting("WarningSpaceColor", 0xc0cb0000, "", ""));
    204204
    205     Add(fDontMoveFilesToTrash
    206         = new BooleanValueSetting("DontMoveFilesToTrash", false));
     205    Add(fMoveFilesToTrash
     206        = new BooleanValueSetting("MoveFilesToTrash", true));
    207207    Add(fAskBeforeDeleteFile
    208208        = new BooleanValueSetting("AskBeforeDeleteFile", true));
    209209
    TrackerSettings::SetRecentFoldersCount(int32 count)  
    509509
    510510
    511511bool
    512 TrackerSettings::DontMoveFilesToTrash()
     512TrackerSettings::MoveFilesToTrash()
    513513{
    514     return gTrackerState.fDontMoveFilesToTrash->Value();
     514    return gTrackerState.fMoveFilesToTrash->Value();
    515515}
    516516
    517517
    518518void
    519 TrackerSettings::SetDontMoveFilesToTrash(bool enabled)
     519TrackerSettings::SetMoveFilesToTrash(bool enabled)
    520520{
    521     gTrackerState.fDontMoveFilesToTrash->SetValue(enabled);
     521    gTrackerState.fMoveFilesToTrash->SetValue(enabled);
    522522}
    523523
    524524
  • src/kits/tracker/TrackerSettings.h

    diff --git a/src/kits/tracker/TrackerSettings.h b/src/kits/tracker/TrackerSettings.h
    index efec805..edc44d0 100644
    a b class TrackerSettings {  
    118118        bool ClockIs24Hr();
    119119        void SetClockTo24Hr(bool);
    120120
    121         bool DontMoveFilesToTrash();
    122         void SetDontMoveFilesToTrash(bool);
     121        bool MoveFilesToTrash();
     122        void SetMoveFilesToTrash(bool);
    123123        bool AskBeforeDeleteFile();
    124124        void SetAskBeforeDeleteFile(bool);