Ticket #9205: tree.patch

File tree.patch, 4.4 KB (added by er11, 8 years ago)

Patch

  • src/interface/LocalTreeView.cpp

    diff -r -u FileZilla3.orig/src/interface/LocalTreeView.cpp FileZilla3/src/interface/LocalTreeView.cpp
    old new  
    207207#endif
    208208EVT_TREE_SEL_CHANGED(wxID_ANY, CLocalTreeView::OnSelectionChanged)
    209209EVT_TREE_BEGIN_DRAG(wxID_ANY, CLocalTreeView::OnBeginDrag)
     210EVT_TREE_BEGIN_RDRAG(wxID_ANY, CLocalTreeView::OnBeginRDrag)
    210211#ifndef __WXMSW__
    211212EVT_KEY_DOWN(CLocalTreeView::OnKeyDown)
    212213#else
     
    245246    m_pVolumeEnumeratorThread = 0;
    246247
    247248    CreateRoot();
     249       
     250    m_ignoreTreeEventItem = false;
    248251#else
    249252    wxTreeItemId root = AddRoot(_T("/"));
    250253    SetItemImage(root, GetIconIndex(dir), wxTreeItemIcon_Normal);
     
    978981    }
    979982}
    980983
     984#ifdef __WXMSW__
     985void CLocalTreeView::OnBeginRDrag(wxTreeEvent& event)
     986{
     987    m_ignoreTreeEventItem = true;
     988}
     989#endif
     990
     991
    981992#ifndef __WXMSW__
    982993void CLocalTreeView::OnKeyDown(wxKeyEvent& event)
    983994{
     
    11091120void CLocalTreeView::OnContextMenu(wxTreeEvent& event)
    11101121{
    11111122    m_contextMenuItem = event.GetItem();
     1123   
     1124#ifdef __WXMSW__
     1125    if (m_ignoreTreeEventItem) {
     1126        m_contextMenuItem = GetSelection();
     1127    }
     1128   
     1129    m_ignoreTreeEventItem = false;
     1130#endif
     1131   
    11121132    if (!m_contextMenuItem.IsOk())
    11131133        return;
    11141134
  • src/interface/LocalTreeView.h

    diff -r -u FileZilla3.orig/src/interface/LocalTreeView.h FileZilla3/src/interface/LocalTreeView.h
    old new  
    5353
    5454    bool CheckSubdirStatus(wxTreeItemId& item, const wxString& path);
    5555
     56#ifdef __WXMSW__
     57    bool m_ignoreTreeEventItem;
     58#endif
     59
    5660    DECLARE_EVENT_TABLE()
    5761    void OnItemExpanding(wxTreeEvent& event);
    5862#ifdef __WXMSW__
     
    6064#endif
    6165    void OnSelectionChanged(wxTreeEvent& event);
    6266    void OnBeginDrag(wxTreeEvent& event);
     67#ifdef __WXMSW__
     68    void OnBeginRDrag(wxTreeEvent& event);
     69#endif
    6370#ifndef __WXMSW__
    6471    void OnKeyDown(wxKeyEvent& event);
    6572#else
  • src/interface/RemoteTreeView.cpp

    diff -r -u FileZilla3.orig/src/interface/RemoteTreeView.cpp FileZilla3/src/interface/RemoteTreeView.cpp
    old new  
    220220EVT_TREE_SEL_CHANGED(wxID_ANY, CRemoteTreeView::OnSelectionChanged)
    221221EVT_TREE_ITEM_ACTIVATED(wxID_ANY, CRemoteTreeView::OnItemActivated)
    222222EVT_TREE_BEGIN_DRAG(wxID_ANY, CRemoteTreeView::OnBeginDrag)
     223#ifdef __WXMSW__
     224EVT_TREE_BEGIN_RDRAG(wxID_ANY, CRemoteTreeView::OnBeginRDrag)
     225#endif //__WXMSW__
    223226#ifndef __WXMSW__
    224227EVT_KEY_DOWN(CRemoteTreeView::OnKeyDown)
    225228#endif //__WXMSW__
     
    255258    m_pQueue = pQueue;
    256259    AddRoot(_T(""));
    257260    m_ExpandAfterList = wxTreeItemId();
     261   
     262#ifdef __WXMSW__
     263    m_ignoreTreeEventItem = false;
     264#endif
    258265
    259266    SetDropTarget(new CRemoteTreeViewDropTarget(this));
    260267
     
    912919#endif
    913920}
    914921
     922#ifdef __WXMSW__
     923void CRemoteTreeView::OnBeginRDrag(wxTreeEvent& event)
     924{
     925    m_ignoreTreeEventItem = true;
     926}
     927#endif
     928
    915929#ifndef __WXMSW__
    916930void CRemoteTreeView::OnKeyDown(wxKeyEvent& event)
    917931{
     
    933947void CRemoteTreeView::OnContextMenu(wxTreeEvent& event)
    934948{
    935949    m_contextMenuItem = event.GetItem();
     950   
     951#ifdef __WXMSW__
     952    if (m_ignoreTreeEventItem) {
     953        m_contextMenuItem = GetSelection();
     954    }
     955   
     956    m_ignoreTreeEventItem = false;
     957#endif
     958
    936959    wxMenu* pMenu = wxXmlResource::Get()->LoadMenu(_T("ID_MENU_REMOTETREE"));
    937960    if (!pMenu)
    938961        return;
  • src/interface/RemoteTreeView.h

    diff -r -u FileZilla3.orig/src/interface/RemoteTreeView.h FileZilla3/src/interface/RemoteTreeView.h
    old new  
    4747    // Used to suspends event processing in OnItemExpanding for example
    4848    bool m_busy;
    4949
     50#ifdef __WXMSW__
     51    bool m_ignoreTreeEventItem;
     52#endif
     53
    5054    wxTreeItemId m_ExpandAfterList;
    5155
    5256    wxTreeItemId m_dropHighlight;
     
    5660    void OnSelectionChanged(wxTreeEvent& event);
    5761    void OnItemActivated(wxTreeEvent& event);
    5862    void OnBeginDrag(wxTreeEvent& event);
     63#ifdef __WXMSW__
     64    void OnBeginRDrag(wxTreeEvent& event);
     65#endif
    5966#ifndef __WXMSW__
    6067    void OnKeyDown(wxKeyEvent& event);
    6168#endif