show waitcursor when switching to anotehr dir

svn path=/trunk/; revision=9115
This commit is contained in:
Martin Fuchs 2004-04-12 17:57:44 +00:00
parent c93eb9e54e
commit ec66d1b6b9
3 changed files with 8 additions and 6 deletions

View file

@ -51,7 +51,7 @@ enum SCAN_FLAGS {
SCAN_EXTRACT_ICONS = 1, SCAN_EXTRACT_ICONS = 1,
SCAN_DO_ACCESS = 2, SCAN_DO_ACCESS = 2,
SCAN_ALL = 3, SCAN_ALL = 0,//@@3,
SCAN_FILESYSTEM = 4 SCAN_FILESYSTEM = 4
}; };

View file

@ -267,6 +267,8 @@ void FileChildWindow::set_curdir(Entry* entry)
_right->_cur = entry; _right->_cur = entry;
if (entry) { if (entry) {
WaitCursor wait;
if (!entry->_scanned) if (!entry->_scanned)
scan_entry(entry); scan_entry(entry);
else { else {
@ -467,6 +469,7 @@ LRESULT FileChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
break;} break;}
case ID_REFRESH: {CONTEXT("ID_REFRESH"); case ID_REFRESH: {CONTEXT("ID_REFRESH");
WaitCursor wait;
bool expanded = _left->_cur->_expanded; bool expanded = _left->_cur->_expanded;
scan_entry(_left->_cur); scan_entry(_left->_cur);
@ -560,13 +563,15 @@ int FileChildWindow::Command(int id, int code)
} }
void FileChildWindow::activate_entry(Pane* pane) void FileChildWindow::activate_entry(Pane* pane) ///@todo enable using <RETURN> key accelerator
{ {
Entry* entry = pane->_cur; Entry* entry = pane->_cur;
if (!entry) if (!entry)
return; return;
WaitCursor wait;
if ((entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || // a directory? if ((entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || // a directory?
entry->_down) // a file with NTFS sub-streams? entry->_down) // a file with NTFS sub-streams?
{ {
@ -611,7 +616,6 @@ void FileChildWindow::scan_entry(Entry* entry)
CONTEXT("FileChildWindow::scan_entry()"); CONTEXT("FileChildWindow::scan_entry()");
int idx = ListBox_GetCurSel(_left_hwnd); int idx = ListBox_GetCurSel(_left_hwnd);
HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
// delete sub entries in left pane // delete sub entries in left pane
for(;;) { for(;;) {
@ -642,8 +646,6 @@ void FileChildWindow::scan_entry(Entry* entry)
_right->set_header(); _right->set_header();
_header_wdths_ok = false; _header_wdths_ok = false;
SetCursor(old_cursor);
} }

View file

@ -100,7 +100,7 @@ struct ShellDirectory : public ShellEntry, public Directory
virtual void read_directory(int scan_flags=SCAN_ALL); virtual void read_directory(int scan_flags=SCAN_ALL);
virtual const void* get_next_path_component(const void*) const; virtual const void* get_next_path_component(const void*) const;
virtual Entry* find_entry(const void* p); virtual Entry* find_entry(const void*);
virtual bool get_path(PTSTR path) const; virtual bool get_path(PTSTR path) const;