diff options
author | Dennis Syrovatsky <dennis@tightvnc.com> | 2005-12-15 10:02:16 +0000 |
---|---|---|
committer | Dennis Syrovatsky <dennis@tightvnc.com> | 2005-12-15 10:02:16 +0000 |
commit | b0b7247602f2c18015f321d7c2b7642a04e03987 (patch) | |
tree | b9f489317503e4d5b8af50ccaff09bf9b993d395 | |
parent | 04e05c3f5ff036c6f544cdb3ca0fa9d70fa2177e (diff) | |
download | tigervnc-b0b7247602f2c18015f321d7c2b7642a04e03987.tar.gz tigervnc-b0b7247602f2c18015f321d7c2b7642a04e03987.zip |
Added FTBrowseDlg::addItems methods.
Added some code to the FTDialog class for control browsing folders
in the "Browse Folders" dialog.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@456 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | vncviewer/FTBrowseDlg.cxx | 17 | ||||
-rw-r--r-- | vncviewer/FTBrowseDlg.h | 4 | ||||
-rw-r--r-- | vncviewer/FTDialog.cxx | 11 | ||||
-rw-r--r-- | vncviewer/FTDialog.h | 4 |
4 files changed, 35 insertions, 1 deletions
diff --git a/vncviewer/FTBrowseDlg.cxx b/vncviewer/FTBrowseDlg.cxx index 9c930322..81cd882e 100644 --- a/vncviewer/FTBrowseDlg.cxx +++ b/vncviewer/FTBrowseDlg.cxx @@ -58,6 +58,23 @@ FTBrowseDlg::destroy() EndDialog(m_hwndDlg, 0); } +void +FTBrowseDlg::addItems(FileInfo *pFI) +{ + TVITEM tvi; + TVINSERTSTRUCT tvins; + + for (unsigned int i = 0; i < pFI->getNumEntries(); i++) + { + tvi.mask = TVIF_TEXT; + tvi.pszText = pFI->getNameAt(i);; + tvins.hParent = NULL; + tvins.item = tvi; + tvins.hParent = TreeView_InsertItem(GetDlgItem(m_hwndDlg, IDC_FTBROWSETREE), &tvins); + TreeView_InsertItem(GetDlgItem(m_hwndDlg, IDC_FTBROWSETREE), &tvins); + } +} + BOOL CALLBACK FTBrowseDlg::FTBrowseDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { diff --git a/vncviewer/FTBrowseDlg.h b/vncviewer/FTBrowseDlg.h index 716efcbb..0ebf5693 100644 --- a/vncviewer/FTBrowseDlg.h +++ b/vncviewer/FTBrowseDlg.h @@ -33,6 +33,8 @@ namespace rfb { namespace win32 { + class FTDialog; + class FTBrowseDlg { public: @@ -44,6 +46,8 @@ namespace rfb { bool create(); void destroy(); + void addItems(FileInfo *pFI); + private: HWND m_hwndDlg; FTDialog *m_pFTDlg; diff --git a/vncviewer/FTDialog.cxx b/vncviewer/FTDialog.cxx index b5782d6e..b7ec9ba9 100644 --- a/vncviewer/FTDialog.cxx +++ b/vncviewer/FTDialog.cxx @@ -44,6 +44,7 @@ FTDialog::FTDialog(HINSTANCE hInst, FileTransfer *pFT) m_pCancelingDlg = NULL; m_pCreateFolderDlg = NULL; m_pRenameDlg = NULL; + m_pBrowseDlg = NULL; m_hwndFTDialog = NULL; m_hwndLocalPath = NULL; @@ -369,7 +370,12 @@ FTDialog::onLocalBrowse() void FTDialog::onRemoteBrowse() { - + if (m_pBrowseDlg != NULL) return; + + m_pBrowseDlg = new FTBrowseDlg(this); + m_pBrowseDlg->create(); + + m_pFileTransfer->requestFileList("", FT_FLR_DEST_BROWSE, true); } void @@ -877,6 +883,9 @@ FTDialog::setStatusText(LPCSTR format,...) void FTDialog::addBrowseItems(FileInfo *pFI) { + if (m_pBrowseDlg == NULL) return; + + m_pBrowseDlg->addItems(pFI); } void diff --git a/vncviewer/FTDialog.h b/vncviewer/FTDialog.h index 6cb9d6e3..d505e5f1 100644 --- a/vncviewer/FTDialog.h +++ b/vncviewer/FTDialog.h @@ -32,11 +32,13 @@ #include <vncviewer/FileTransfer.h> #include <vncviewer/FTListView.h> #include <vncviewer/FTProgress.h> +#include <vncviewer/FTBrowseDlg.h> #include <vncviewer/resource.h> namespace rfb { namespace win32 { class FileTransfer; + class FTBrowseDlg; class FTDialog { @@ -142,6 +144,8 @@ namespace rfb { FTListView *m_pLocalLV; FTListView *m_pRemoteLV; + FTBrowseDlg *m_pBrowseDlg; + int m_FTMenuSource; char m_szLocalPath[FT_FILENAME_SIZE]; |