Ticket #8344: reselect_item_we_are_coming_from_in_parent_directory.patch
File reselect_item_we_are_coming_from_in_parent_directory.patch, 3.9 KB (added by , 12 years ago) |
---|
-
src/interface/LocalListView.cpp
318 318 ExitComparisonMode(); 319 319 320 320 ClearSelection(); 321 focused = _T("..");321 focused = m_pState->GetLastLocalFocused(); 322 322 323 323 if (GetItemCount()) 324 324 EnsureVisible(0); … … 1538 1538 if (data.name == focused) 1539 1539 { 1540 1540 SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); 1541 EnsureVisible(i); 1541 1542 return; 1542 1543 } 1543 1544 } … … 1555 1556 if (data.name == focused) 1556 1557 { 1557 1558 SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); 1559 EnsureVisible(i); 1558 1560 focused = _T(""); 1559 1561 } 1560 1562 if (data.dir && *iter == (_T("d") + data.name)) -
src/interface/state.h
163 163 bool GetSecurityInfo(CSftpEncryptionNotification *& pInfo); 164 164 void SetSecurityInfo(CCertificateNotification const& info); 165 165 void SetSecurityInfo(CSftpEncryptionNotification const& info); 166 167 wxString GetLastLocalFocused() const { return m_last_local_focused_item_name; } 168 wxString GetLastRemoteFocused() const { return m_last_remote_focused_item_name; } 169 166 170 protected: 167 171 void SetServer(const CServer* server); 168 172 … … 203 207 204 208 CCertificateNotification* m_pCertificate; 205 209 CSftpEncryptionNotification* m_pSftpEncryptionInfo; 210 211 wxString m_last_local_focused_item_name; 212 wxString m_last_remote_focused_item_name; 206 213 }; 207 214 208 215 class CStateEventHandler -
src/interface/RemoteListView.cpp
719 719 void CRemoteListView::SetDirectoryListing(const CSharedPointer<const CDirectoryListing> &pDirectoryListing, bool modified /*=false*/) 720 720 { 721 721 CancelLabelEdit(); 722 723 wxString prevFocused = m_pState->GetLastRemoteFocused(); 724 std::list<wxString> selectedNames; 722 725 723 726 bool reset = false; 724 727 if (!pDirectoryListing || !m_pDirectoryListing) … … 741 744 wxASSERT(CFilterManager::HasActiveFilters() || GetItemCount() == (int)m_fileData.size()); 742 745 wxASSERT(m_pDirectoryListing->GetCount() + 1 >= (unsigned int)GetItemCount()); 743 746 wxASSERT(m_indexMapping[0] == m_pDirectoryListing->GetCount()); 747 748 ReselectItems(selectedNames, prevFocused); 744 749 745 750 RefreshListOnly(); 746 751 … … 748 753 } 749 754 } 750 755 751 wxString prevFocused;752 std::list<wxString> selectedNames;753 756 if (reset) 754 757 { 755 758 ResetSearchPrefix(); … … 2231 2234 if ((*m_pDirectoryListing)[index].name == focused) 2232 2235 { 2233 2236 SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); 2237 EnsureVisible(i); 2234 2238 return; 2235 2239 } 2236 2240 } … … 2259 2263 if (entry.name == focused) 2260 2264 { 2261 2265 SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); 2266 EnsureVisible(i); 2262 2267 focused = _T(""); 2263 2268 } 2264 2269 if (entry.is_dir() && *iter == (_T("d") + entry.name)) -
src/interface/state.cpp
307 307 } 308 308 } 309 309 310 if (p == m_localDir.GetParent()) 311 m_last_local_focused_item_name = m_localDir.GetLastSegment(); 312 else 313 m_last_local_focused_item_name = _T(""); 314 315 310 316 m_localDir = p; 311 317 312 318 COptions::Get()->SetOption(OPTION_LASTLOCALDIR, m_localDir.GetPath()); … … 333 339 } 334 340 335 341 wxASSERT(pDirectoryListing->m_firstListTime.IsValid()); 342 343 if (pDirectoryListing && m_pDirectoryListing && 344 pDirectoryListing->path == m_pDirectoryListing->path.GetParent()) 345 m_last_remote_focused_item_name = m_pDirectoryListing->path.GetLastSegment(); 346 else 347 m_last_remote_focused_item_name = _T(""); 336 348 349 337 350 if (modified) 338 351 { 339 352 if (!m_pDirectoryListing || m_pDirectoryListing->path != pDirectoryListing->path)