summaryrefslogtreecommitdiff
path: root/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
committerBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
commitabada90e3f84dc703b8ddc9efcbed8a946fadead (patch)
tree2c6f9dccd510ea97cb927a7bd635422efaae547a /cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp
parentremoving trace message (diff)
downloadice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip
Expanded tabs into spaces
Diffstat (limited to 'cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp')
-rwxr-xr-xcpp/demo/IcePatch2/MFC/PatchClientDlg.cpp196
1 files changed, 98 insertions, 98 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;