diff options
author | Dennis Syrovatsky <dennis@tightvnc.com> | 2005-11-07 09:52:36 +0000 |
---|---|---|
committer | Dennis Syrovatsky <dennis@tightvnc.com> | 2005-11-07 09:52:36 +0000 |
commit | 4ab41857e73cdc1d7931a2b8a1dd209baea3939f (patch) | |
tree | 1a4977c69dfb21af670827c63daebc2972be7417 | |
parent | 6c6786d2b046d588032b0154cfc4a9be95ec3154 (diff) | |
download | tigervnc-4ab41857e73cdc1d7931a2b8a1dd209baea3939f.tar.gz tigervnc-4ab41857e73cdc1d7931a2b8a1dd209baea3939f.zip |
Added FileTransfer::createFileTransfer.
Code improvements.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@383 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | vncviewer/FTDialog.cxx | 30 | ||||
-rw-r--r-- | vncviewer/FTDialog.h | 4 | ||||
-rw-r--r-- | vncviewer/FTProgress.cxx | 2 | ||||
-rw-r--r-- | vncviewer/FileTransfer.cxx | 12 | ||||
-rw-r--r-- | vncviewer/FileTransfer.h | 11 |
5 files changed, 48 insertions, 11 deletions
diff --git a/vncviewer/FTDialog.cxx b/vncviewer/FTDialog.cxx index f4f82206..e4d18302 100644 --- a/vncviewer/FTDialog.cxx +++ b/vncviewer/FTDialog.cxx @@ -39,6 +39,8 @@ FTDialog::FTDialog(HINSTANCE hInst, FileTransfer *pFT) m_pLocalLV = NULL; m_pRemoteLV = NULL; m_pProgress = NULL; + + m_hwndFTDialog = false; } FTDialog::~FTDialog() @@ -49,6 +51,8 @@ FTDialog::~FTDialog() bool FTDialog::createFTDialog() { + if (m_hwndFTDialog != NULL) return true; + m_hwndFTDialog = CreateDialogParam(m_hInstance, MAKEINTRESOURCE(IDD_FILETRANSFER_DLG), NULL, @@ -66,21 +70,29 @@ FTDialog::createFTDialog() destroyFTDialog(); return false; } + + initFTDialog(); - m_pLocalLV->initialize(m_hInstance); - m_pRemoteLV->initialize(m_hInstance); - - ShowWindow(m_hwndFTDialog, SW_SHOW); - UpdateWindow(m_hwndFTDialog); - m_bDlgShown = true; - - return true; + if (ShowWindow(m_hwndFTDialog, SW_SHOW) == 0) { + UpdateWindow(m_hwndFTDialog); + m_bDlgShown = true; + return true; + } else { + destroyFTDialog(); + m_bDlgShown = false; + return false; + } } bool FTDialog::initFTDialog() { - return false; + m_pLocalLV->initialize(m_hInstance); + m_pRemoteLV->initialize(m_hInstance); + + m_pProgress->initialize(0,0); + + return true; } bool diff --git a/vncviewer/FTDialog.h b/vncviewer/FTDialog.h index 5bd165c9..a0199100 100644 --- a/vncviewer/FTDialog.h +++ b/vncviewer/FTDialog.h @@ -28,13 +28,15 @@ #include <commctrl.h> #include <rfb/FileInfo.h> +#include <vncviewer/FileTransfer.h> #include <vncviewer/FTListView.h> #include <vncviewer/FTProgress.h> -#include <vncviewer/FileTransfer.h> #include <vncviewer/resource.h> namespace rfb { namespace win32 { + class FileTransfer; + class FTDialog { public: diff --git a/vncviewer/FTProgress.cxx b/vncviewer/FTProgress.cxx index b4c461ad..46316f07 100644 --- a/vncviewer/FTProgress.cxx +++ b/vncviewer/FTProgress.cxx @@ -54,6 +54,8 @@ FTProgress::initialize(DWORD64 totalMaxValue, DWORD maxValue) if (!initProgressControls(totalMaxValue, maxValue)) return false; + setProgressText(); + m_bInitialized = true; return true; } diff --git a/vncviewer/FileTransfer.cxx b/vncviewer/FileTransfer.cxx index b439aa9f..39c387af 100644 --- a/vncviewer/FileTransfer.cxx +++ b/vncviewer/FileTransfer.cxx @@ -28,10 +28,20 @@ using namespace rfb::win32; FileTransfer::FileTransfer() { - + m_bFTDlgShown = false; + m_pFTDialog = new FTDialog(GetModuleHandle(0), this); } FileTransfer::~FileTransfer() { + if (m_pFTDialog != NULL) { + delete m_pFTDialog; + m_pFTDialog = NULL; + } +} +void +FileTransfer::createFileTransfer() +{ + m_bFTDlgShown = m_pFTDialog->createFTDialog(); } diff --git a/vncviewer/FileTransfer.h b/vncviewer/FileTransfer.h index 4a4e725a..0d385e37 100644 --- a/vncviewer/FileTransfer.h +++ b/vncviewer/FileTransfer.h @@ -24,13 +24,24 @@ #ifndef __RFB_WIN32_FILETRANSFER_H__ #define __RFB_WIN32_FILETRANSFER_H__ +#include <vncviewer/FTDialog.h> + namespace rfb { namespace win32 { + class FTDialog; + class FileTransfer { public: FileTransfer(); ~FileTransfer(); + + void createFileTransfer(); + + private: + bool m_bFTDlgShown; + + FTDialog *m_pFTDialog; }; } |