diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
commit | abada90e3f84dc703b8ddc9efcbed8a946fadead (patch) | |
tree | 2c6f9dccd510ea97cb927a7bd635422efaae547a /cpp/demo/IcePatch2 | |
parent | removing trace message (diff) | |
download | ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2 ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip |
Expanded tabs into spaces
Diffstat (limited to 'cpp/demo/IcePatch2')
-rwxr-xr-x | cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp | 196 | ||||
-rwxr-xr-x | cpp/demo/IcePatch2/MFC/stdafx.h | 24 |
2 files changed, 110 insertions, 110 deletions
diff --git a/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp b/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp index 5aaca0ee731..5f8d6f61acf 100755 --- a/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp +++ b/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp @@ -25,77 +25,77 @@ class DialogPatcherFeedback : public IcePatch2::PatcherFeedback public: DialogPatcherFeedback(CPatchDlg* dialog) : - _dialog(dialog), + _dialog(dialog), _filesPatched(0) { - assert(_dialog); + assert(_dialog); } virtual bool noFileSummary(const string& reason) { - return IDYES == AfxMessageBox(L"Cannot load file summary. Perform a thorough patch?", MB_YESNO|MB_ICONSTOP); + return IDYES == AfxMessageBox(L"Cannot load file summary. Perform a thorough patch?", MB_YESNO|MB_ICONSTOP); } virtual bool checksumStart() { - return _dialog->checksumStart(); + return _dialog->checksumStart(); } virtual bool checksumProgress(const string& path) { - return _dialog->checksumProgress(path); + return _dialog->checksumProgress(path); } virtual bool checksumEnd() { - return _dialog->checksumEnd(); + return _dialog->checksumEnd(); } virtual bool fileListStart() { - return _dialog->fileListStart(); + return _dialog->fileListStart(); } virtual bool fileListProgress(Ice::Int percent) { - return _dialog->fileListProgress(percent); + return _dialog->fileListProgress(percent); } virtual bool fileListEnd() { - return _dialog->fileListEnd(); + return _dialog->fileListEnd(); } virtual bool patchStart(const string& path, Ice::Long size, Ice::Long totalProgress, Ice::Long totalSize) { - return _dialog->patchStart(path, size, totalProgress, totalSize); + return _dialog->patchStart(path, size, totalProgress, totalSize); } virtual bool patchProgress(Ice::Long progress, Ice::Long size, Ice::Long totalProgress, Ice::Long totalSize) { - return _dialog->patchProgress(progress, size, totalProgress, totalSize); + return _dialog->patchProgress(progress, size, totalProgress, totalSize); } virtual bool patchEnd() { - ++_filesPatched; - return _dialog->patchEnd(); + ++_filesPatched; + return _dialog->patchEnd(); } virtual int filesPatched() const { - return _filesPatched; + return _filesPatched; } private: @@ -181,10 +181,10 @@ CPatchDlg::patchStart(const string& path, Ice::Long size, Ice::Long totalProgres { if(!_isPatch) { - _startTime = IceUtil::Time::now(); - _status->SetWindowText(CString(L" Patching...")); - _speed->SetWindowText(CString(L" 0.0 KB/s")); - _isPatch = true; + _startTime = IceUtil::Time::now(); + _status->SetWindowText(CString(L" Patching...")); + _speed->SetWindowText(CString(L" 0.0 KB/s")); + _isPatch = true; } CString file; @@ -200,15 +200,15 @@ CPatchDlg::patchProgress(Ice::Long, Ice::Long, Ice::Long totalProgress, Ice::Lon IceUtil::Time elapsed = IceUtil::Time::now() - _startTime; if(elapsed.toSeconds() > 0) { - CString speed; - speed.Format(L" %s/s", convertSize(totalProgress / elapsed.toSeconds())); - _speed->SetWindowText(speed); + CString speed; + speed.Format(L" %s/s", convertSize(totalProgress / elapsed.toSeconds())); + _speed->SetWindowText(speed); } int pcnt = 100; if(totalSize > 0) { - pcnt = static_cast<int>(totalProgress * 100 / totalSize); + pcnt = static_cast<int>(totalProgress * 100 / totalSize); } CString percent; percent.Format(L"%d%%", pcnt); @@ -339,18 +339,18 @@ CPatchDlg::OnSelectDir() LPITEMIDLIST pidl = SHBrowseForFolder(&info); if(pidl != 0) { - // + // // Get the name of the selected folder. - // + // TCHAR path[MAX_PATH]; if(SHGetPathFromIDList(pidl, path)) { - _path->SetWindowText(path); + _path->SetWindowText(path); } - // + // // Free up memory used. - // + // IMalloc * imalloc = 0; if(SUCCEEDED(SHGetMalloc(&imalloc))) { @@ -365,61 +365,61 @@ CPatchDlg::OnStartPatch() { try { - Ice::PropertiesPtr properties = _communicator->getProperties(); - - // - // Set the patch directory. - // - CString path; - _path->GetWindowText(path); - if(path.IsEmpty()) - { - AfxMessageBox(CString(L"Please select a patch directory."), MB_OK|MB_ICONEXCLAMATION); - return; - } - properties->setProperty("IcePatch2.Directory", IceUtil::wstringToString(wstring(path))); - - // - // Set the thorough patch flag. - // - string thorough = _thorough->GetCheck() == BST_CHECKED ? "1" : "0"; - properties->setProperty("IcePatch2.Thorough", thorough); - - // - // Set the remove orphan flag. - // - string remove = _remove->GetCheck() == BST_CHECKED ? "1" : "0"; - properties->setProperty("IcePatch2.Remove", remove); + Ice::PropertiesPtr properties = _communicator->getProperties(); + + // + // Set the patch directory. + // + CString path; + _path->GetWindowText(path); + if(path.IsEmpty()) + { + AfxMessageBox(CString(L"Please select a patch directory."), MB_OK|MB_ICONEXCLAMATION); + return; + } + properties->setProperty("IcePatch2.Directory", IceUtil::wstringToString(wstring(path))); + + // + // Set the thorough patch flag. + // + string thorough = _thorough->GetCheck() == BST_CHECKED ? "1" : "0"; + properties->setProperty("IcePatch2.Thorough", thorough); + + // + // Set the remove orphan flag. + // + string remove = _remove->GetCheck() == BST_CHECKED ? "1" : "0"; + properties->setProperty("IcePatch2.Remove", remove); DialogPatcherFeedbackPtr feedback = new DialogPatcherFeedback(this); - IcePatch2::PatcherPtr patcher = new IcePatch2::Patcher(_communicator, feedback); - - // - // Disable a few controls during the patch process. - // - _path->EnableWindow(false); - _select->EnableWindow(false); - _thorough->EnableWindow(false); - _remove->EnableWindow(false); - _start->EnableWindow(false); - - // - // Patch - // - bool aborted = !patcher->prepare(); - if(!aborted) - { - aborted = !patcher->patch(""); - } - if(!aborted) - { - patcher->finish(); - } - - // - // Reset and indicate the completion status. - // - reset(aborted ? L" Aborted" : L" Completed"); + IcePatch2::PatcherPtr patcher = new IcePatch2::Patcher(_communicator, feedback); + + // + // Disable a few controls during the patch process. + // + _path->EnableWindow(false); + _select->EnableWindow(false); + _thorough->EnableWindow(false); + _remove->EnableWindow(false); + _start->EnableWindow(false); + + // + // Patch + // + bool aborted = !patcher->prepare(); + if(!aborted) + { + aborted = !patcher->patch(""); + } + if(!aborted) + { + patcher->finish(); + } + + // + // Reset and indicate the completion status. + // + reset(aborted ? L" Aborted" : L" Completed"); } catch(const IceUtil::Exception& ex) { @@ -500,24 +500,24 @@ CPatchDlg::convertSize(Ice::Long size) const } else { - final = start / megabyte; - if(final >= 1) - { - units = L"MB"; - } - else - { - final = start / kilobyte; - if(final >= 1) - { - units = L"KB"; - } - else - { - final = start; - units = L"B"; - } - } + final = start / megabyte; + if(final >= 1) + { + units = L"MB"; + } + else + { + final = start / kilobyte; + if(final >= 1) + { + units = L"KB"; + } + else + { + final = start; + units = L"B"; + } + } } CString convert; diff --git a/cpp/demo/IcePatch2/MFC/stdafx.h b/cpp/demo/IcePatch2/MFC/stdafx.h index ea41685f994..b9072540cc6 100755 --- a/cpp/demo/IcePatch2/MFC/stdafx.h +++ b/cpp/demo/IcePatch2/MFC/stdafx.h @@ -21,30 +21,30 @@ #endif #ifndef VC_EXTRALEAN -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #endif // Modify the following defines if you have to target a platform prior to the ones specified below. // Refer to MSDN for the latest info on corresponding values for different platforms. -#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later. -#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. +#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later. +#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. #endif -#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. -#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. -#endif +#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. +#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. +#endif #if 0 -#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. +#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. #endif -#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later. -#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later. +#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later. +#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later. #endif #endif -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit // turns off MFC's hiding of some common and often safely ignored warning messages #define _AFX_ALL_WARNINGS @@ -52,9 +52,9 @@ #include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions -#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls +#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls #ifndef _AFX_NO_AFXCMN_SUPPORT -#include <afxcmn.h> // MFC support for Windows Common Controls +#include <afxcmn.h> // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT #include <Ice/Ice.h> |