Ticket #8406: focus_newly_created_directory_local_only.patch
File focus_newly_created_directory_local_only.patch, 4.2 KB (added by , 12 years ago) |
---|
-
src/interface/LocalListView.cpp
1220 1220 wxBell(); 1221 1221 1222 1222 DisplayDir(m_dir); 1223 1224 if (res) 1225 { 1226 CLocalPath lp(fn.GetPath()); 1227 FocusSingleItem(lp.GetLastSegment()); 1223 1228 } 1229 } 1224 1230 1225 1231 void CLocalListView::OnMenuDelete(wxCommandEvent& event) 1226 1232 { … … 1311 1317 wxCommandEvent cmdEvent; 1312 1318 OnMenuUpload(cmdEvent); 1313 1319 } 1320 else if (code == 'N' && event.ControlDown() && event.ShiftDown()) 1321 { 1322 wxCommandEvent cmdEvent; 1323 OnMenuMkdir(cmdEvent); 1324 } 1314 1325 else 1315 1326 event.Skip(); 1316 1327 } … … 1593 1604 } 1594 1605 } 1595 1606 1607 void CLocalListView::FocusSingleItem(const wxString& itemName, long int state /*= wxLIST_STATE_FOCUSED*/) 1608 { 1609 if (itemName == _T("")) 1610 return; 1611 1612 for (unsigned int i = 0; i < m_indexMapping.size(); i++) 1613 { 1614 const CLocalFileData &data = m_fileData[m_indexMapping[i]]; 1615 if (data.name == itemName) 1616 { 1617 SetItemState(i, state, state); 1618 EnsureVisible(i); 1619 } 1620 else 1621 { 1622 SetItemState(i, 0, state); 1623 } 1624 } 1625 return; 1626 } 1627 1596 1628 void CLocalListView::OnStateChange(CState* pState, enum t_statechange_notifications notification, const wxString& data, const void* data2) 1597 1629 { 1598 1630 if (notification == STATECHANGE_LOCAL_DIR) -
src/interface/state.h
169 169 wxString GetPreviouslyVisitedLocalSubdir() const { return m_previouslyVisitedLocalSubdir; } 170 170 wxString GetPreviouslyVisitedRemoteSubdir() const { return m_previouslyVisitedRemoteSubdir; } 171 171 172 void SetPreviouslyVisitedLocalSubdir(wxString new_subdir) { m_previouslyVisitedLocalSubdir = new_subdir; } 173 void SetPreviouslyVisitedRemoteSubdir(wxString new_subdir) { m_previouslyVisitedRemoteSubdir = new_subdir; } 174 172 175 protected: 173 176 void SetServer(const CServer* server); 174 177 -
src/interface/RemoteListView.cpp
1845 1851 wxCommandEvent cmdEvent; 1846 1852 OnMenuDownload(cmdEvent); 1847 1853 } 1854 else if (code == 'N' && event.ControlDown() && event.ShiftDown()) 1855 { 1856 wxCommandEvent cmdEvent; 1857 OnMenuMkdir(cmdEvent); 1858 } 1848 1859 else 1849 1860 event.Skip(); 1850 1861 } -
src/interface/LocalListView.h
53 53 // ReselectItems 54 54 void ReselectItems(const std::list<wxString>& selectedNames, wxString focused); 55 55 56 // Set focus (or other) state on the named item, remove the same state from every other 57 void FocusSingleItem(const wxString& itemName, long int state = wxLIST_STATE_FOCUSED); 58 56 59 #ifdef __WXMSW__ 57 60 void DisplayDrives(); 58 61 void DisplayShares(wxString computer); -
src/interface/state.cpp
308 308 } 309 309 310 310 if (p == m_localDir.GetParent()) 311 m_previouslyVisitedLocalSubdir = m_localDir.GetLastSegment();311 SetPreviouslyVisitedLocalSubdir(m_localDir.GetLastSegment()); 312 312 else 313 m_previouslyVisitedLocalSubdir = _T("");313 SetPreviouslyVisitedLocalSubdir(_T("")); 314 314 315 315 316 316 m_localDir = p; … … 335 335 m_pDirectoryListing = 0; 336 336 NotifyHandlers(STATECHANGE_REMOTE_DIR); 337 337 } 338 m_previouslyVisitedRemoteSubdir = _T("");338 SetPreviouslyVisitedRemoteSubdir(_T("")); 339 339 return true; 340 340 } 341 341 … … 343 343 344 344 if (pDirectoryListing && m_pDirectoryListing && 345 345 pDirectoryListing->path == m_pDirectoryListing->path.GetParent()) 346 m_previouslyVisitedRemoteSubdir = m_pDirectoryListing->path.GetLastSegment();347 else 348 m_previouslyVisitedRemoteSubdir = _T("");346 SetPreviouslyVisitedRemoteSubdir(m_pDirectoryListing->path.GetLastSegment()); 347 else if (!modified) // On modification (like mkdir), there might be hinting stored so we don't clear the m_previouslyVisitedRemoteSubdir 348 SetPreviouslyVisitedRemoteSubdir(_T("")); 349 349 350 350 if (modified) 351 351 {