Ticket #13137: filezilla_remote_temp_copy.patch

File filezilla_remote_temp_copy.patch, 3.5 KB (added by jez9999, 9 days ago)

Patch to allow remote file to be view as temp. copy and add corresponding pref

  • src/interface/Options.cpp

    diff a/src/interface/Options.cpp b/src/interface/Options.cpp
    a b static unsigned int register_interface_options()  
    9696        { "Comparison hide identical", false, option_flags::normal },
    9797        { "Search sort order", L"", option_flags::normal },
    9898        { "Edit track local", true, option_flags::normal },
     99        { "Edit track remote", true, option_flags::normal },
    99100        { "Prevent idle sleep", true, option_flags::normal },
    100101        { "Filteredit window size", L"", option_flags::normal },
    101102        { "Enable invalid char filter", true, option_flags::normal },
  • src/interface/Options.h

    diff a/src/interface/Options.h b/src/interface/Options.h
    a b enum interfaceOptions : unsigned int  
    6868    OPTION_COMPARE_HIDEIDENTICAL,
    6969    OPTION_SEARCH_SORTORDER,
    7070    OPTION_EDIT_TRACK_LOCAL,
     71    OPTION_EDIT_TRACK_REMOTE,
    7172    OPTION_PREVENT_IDLESLEEP,
    7273    OPTION_FILTEREDIT_SIZE,
    7374    OPTION_INVALID_CHAR_REPLACE_ENABLE,
  • src/interface/RemoteListView.cpp

    diff a/src/interface/RemoteListView.cpp b/src/interface/RemoteListView.cpp
    a b void CRemoteListView::OnContextMenu(wxContextMenuEvent& event)  
    10501050    item->SetBitmap(MakeBmpBundle(wxArtProvider::GetBitmap(_T("ART_DOWNLOADADD"), wxART_MENU)));
    10511051    menu.Append(item);
    10521052    menu.Append(XRCID("ID_ENTER"), _("E&nter directory"), _("Enter selected directory"));
    1053     menu.Append(XRCID("ID_EDIT"), _("&View/Edit"));
     1053    menu.Append(XRCID("ID_EDIT"), options_.get_bool(OPTION_EDIT_TRACK_REMOTE) ? _("&View/Edit") : _("&View temp copy"));
    10541054
    10551055    menu.AppendSeparator();
    10561056    menu.Append(XRCID("ID_MKDIR"), _("&Create directory"), _("Create a new subdirectory in the current directory"));
  • src/interface/edithandler.cpp

    diff a/src/interface/edithandler.cpp b/src/interface/edithandler.cpp
    a b void CEditHandler::FinishTransfer(bool successful, std::wstring const& fileName,  
    648648        if (wxFileName::FileExists(iter->localFile)) {
    649649            iter->state = edit;
    650650            if (LaunchEditor(remote, *iter)) {
     651                if (!options_.get_bool(OPTION_EDIT_TRACK_REMOTE)) {
     652                    m_fileDataList[remote].erase(iter);
     653                }
    651654                break;
    652655            }
    653656        }
  • src/interface/settings/optionspage_edit.cpp

    diff a/src/interface/settings/optionspage_edit.cpp b/src/interface/settings/optionspage_edit.cpp
    a b struct COptionsPageEdit::impl final  
    2525    wxRadioButton* use_default_{};
    2626
    2727    wxCheckBox* watch_{};
     28    wxCheckBox* watch_remote_{};
    2829};
    2930
    3031COptionsPageEdit::COptionsPageEdit()
    bool COptionsPageEdit::CreateControls(wxWindow* parent)  
    9192
    9293    impl_->watch_ = new wxCheckBox(this, nullID, _("&Watch locally edited files and prompt to upload modifications"));
    9394    main->Add(impl_->watch_);
     95    impl_->watch_remote_ = new wxCheckBox(this, nullID, _("&Watch edited remote files and prompt to upload modifications"));
     96    main->Add(impl_->watch_remote_);
    9497
    9598    return true;
    9699}
    bool COptionsPageEdit::LoadPage()  
    120123    }
    121124
    122125    impl_->watch_->SetValue(m_pOptions->get_bool(OPTION_EDIT_TRACK_LOCAL));
     126    impl_->watch_remote_->SetValue(m_pOptions->get_bool(OPTION_EDIT_TRACK_REMOTE));
    123127
    124128    SetCtrlState();
    125129
    bool COptionsPageEdit::SavePage()  
    137141
    138142    m_pOptions->set(OPTION_EDIT_ALWAYSDEFAULT, impl_->use_default_->GetValue() && !impl_->default_none_->GetValue());
    139143    m_pOptions->set(OPTION_EDIT_TRACK_LOCAL, impl_->watch_->GetValue());
     144    m_pOptions->set(OPTION_EDIT_TRACK_REMOTE, impl_->watch_remote_->GetValue());
    140145
    141146    return true;
    142147}