From b45d1b24ec788943e5d9c6fd71387ed54cdec99b Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sun, 22 Feb 2004 10:20:30 +0000 Subject: [PATCH] - handle case, when having problems to open image file - disable FAT-button since it's not yet ready svn path=/trunk/; revision=8299 --- .../subsys/system/explorer/doxy-footer.html | 2 +- .../system/explorer/shell/filechild.cpp | 42 ++++++++++++------- .../system/explorer/shell/mainframe.cpp | 2 + 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/reactos/subsys/system/explorer/doxy-footer.html b/reactos/subsys/system/explorer/doxy-footer.html index 5855b19a591..da80c841467 100644 --- a/reactos/subsys/system/explorer/doxy-footer.html +++ b/reactos/subsys/system/explorer/doxy-footer.html @@ -3,7 +3,7 @@
ROS Explorer Source Code Documentation -
generated on 11.02.2004 by +
generated on 22.02.2004 by
doxygen
diff --git a/reactos/subsys/system/explorer/shell/filechild.cpp b/reactos/subsys/system/explorer/shell/filechild.cpp index 28ca0572140..ddb78ac00f9 100644 --- a/reactos/subsys/system/explorer/shell/filechild.cpp +++ b/reactos/subsys/system/explorer/shell/filechild.cpp @@ -101,7 +101,10 @@ FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info) CONTEXT("FileChildWindow::FileChildWindow()"); TCHAR drv[_MAX_DRIVE+1]; - Entry* entry; + Entry* entry = NULL; + + _left = NULL; + _right = NULL; switch(info._etype) { case ET_SHELL: { //@@ evtl. Aufteilung von FileChildWindow in ShellChildWindow, WinChildWindow, UnixChildWindow @@ -156,7 +159,7 @@ FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info) entry = _root._entry->read_tree(info._path, SORT_NONE); break; - case ET_FAT: + case ET_FAT: { _root._drive_type = DRIVE_UNKNOWN; _tsplitpath(info._path, drv, NULL, NULL, NULL); @@ -164,9 +167,13 @@ FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info) lstrcpy(_root._volname, TEXT("FAT XXX")); //@@ lstrcpy(_root._fs, TEXT("FAT")); lstrcpy(_root._path, drv); - _root._entry = new FATDrive(TEXT("c:/reactos-bochs/cdrv.img")); //TEXT("\\\\.\\F:")); //@@ - entry = _root._entry->read_tree(info._path, SORT_NONE); - break; + FATDrive* drive = new FATDrive(TEXT("c:/reactos-bochs/cdrv.img")); //TEXT("\\\\.\\F:")); //@@ + + if (drive->_hDrive != INVALID_HANDLE_VALUE) { + _root._entry = drive; + entry = _root._entry->read_tree(info._path, SORT_NONE); + } + break;} default: // ET_WINDOWS _root._drive_type = GetDriveType(info._path); @@ -179,24 +186,27 @@ FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info) entry = _root._entry->read_tree(info._path, SORT_NAME); } - if (info._etype != ET_SHELL) - wsprintf(_root._entry->_data.cFileName, TEXT("%s - %s"), drv, _root._fs); -/*@@else - lstrcpy(_root._entry->_data.cFileName, TEXT("GetDesktopFolder"));*/ + if (_root._entry) { + if (info._etype != ET_SHELL) + wsprintf(_root._entry->_data.cFileName, TEXT("%s - %s"), drv, _root._fs); + /*@@else + lstrcpy(_root._entry->_data.cFileName, TEXT("GetDesktopFolder"));*/ - _root._entry->_data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; + _root._entry->_data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; - if (info._open_mode & OWM_EXPLORE) ///@todo Is not-explore-mode for FileChildWindow completely implemented? + if (info._open_mode & OWM_EXPLORE) ///@todo Is not-explore-mode for FileChildWindow completely implemented? _left_hwnd = *(_left=new Pane(_hwnd, IDW_TREE_LEFT, IDW_HEADER_LEFT, _root._entry, true, COL_CONTENT)); - _right_hwnd = *(_right=new Pane(_hwnd, IDW_TREE_RIGHT, IDW_HEADER_RIGHT, NULL, false, - COL_TYPE|COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_INDEX|COL_LINKS|COL_CONTENT)); + _right_hwnd = *(_right=new Pane(_hwnd, IDW_TREE_RIGHT, IDW_HEADER_RIGHT, NULL, false, + COL_TYPE|COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_INDEX|COL_LINKS|COL_CONTENT)); + } _sortOrder = SORT_NAME; _header_wdths_ok = false; - set_curdir(entry, hwnd); + if (entry) + set_curdir(entry, hwnd); if (_left_hwnd) { int idx = ListBox_FindItemData(_left_hwnd, ListBox_GetCurSel(_left_hwnd), _left->_cur); @@ -346,7 +356,7 @@ void FileChildWindow::resize_children(int cx, int cy) cx = _split_pos + SPLIT_WIDTH/2; - { + if (_left && _right) { WINDOWPOS wp; HD_LAYOUT hdl; @@ -397,7 +407,7 @@ LRESULT FileChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) case WM_SETFOCUS: { TCHAR path[MAX_PATH]; - if (_left->_cur) { + if (_left && _left->_cur) { _left->_cur->get_path(path); SetCurrentDirectory(path); } diff --git a/reactos/subsys/system/explorer/shell/mainframe.cpp b/reactos/subsys/system/explorer/shell/mainframe.cpp index 9db46e270c7..72af7146c96 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.cpp +++ b/reactos/subsys/system/explorer/shell/mainframe.cpp @@ -144,12 +144,14 @@ MainFrame::MainFrame(HWND hwnd) SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn); ++drivebarBtn.iString; +#ifdef _DEBUG // insert FAT direct file system access button SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("FAT\0")); drivebarBtn.idCommand = ID_DRIVE_FAT; SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn); ++drivebarBtn.iString; +#endif // insert web control button SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("Web\0"));