summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/demo/IcePatch2/MFC/PatchClient.cpp6
-rwxr-xr-xcpp/demo/IcePatch2/MFC/PatchClient.rc16
-rwxr-xr-xcpp/demo/IcePatch2/MFC/PatchClientDlg.cpp18
-rwxr-xr-xcpp/demo/IcePatch2/MFC/PatchClientDlg.h1
-rwxr-xr-xcpp/demo/IcePatch2/MFC/README6
-rwxr-xr-xcpp/demo/IcePatch2/MFC/mfcpatchC.dsp4
-rwxr-xr-xcpp/demo/IcePatch2/MFC/resource.h1
7 files changed, 33 insertions, 19 deletions
diff --git a/cpp/demo/IcePatch2/MFC/PatchClient.cpp b/cpp/demo/IcePatch2/MFC/PatchClient.cpp
index 7533d60277e..66abeb27f8c 100755
--- a/cpp/demo/IcePatch2/MFC/PatchClient.cpp
+++ b/cpp/demo/IcePatch2/MFC/PatchClient.cpp
@@ -56,11 +56,9 @@ CPatchClientApp::InitInstance()
}
Ice::PropertiesPtr properties = communicator->getProperties();
- CString path = properties->getPropertyWithDefault("IcePatch2.Endpoints", "").c_str();
- if(path.IsEmpty())
+ if(properties->getProperty("IcePatch2.Endpoints").empty())
{
- AfxMessageBox(CString("Please run with the --IcePatch2.Endpoints option."), MB_OK|MB_ICONEXCLAMATION);
- return FALSE;
+ properties->setProperty("IcePatch2.Endpoints", "tcp -h 127.0.0.1 -p 10000");
}
CPatchDlg dlg(communicator);
diff --git a/cpp/demo/IcePatch2/MFC/PatchClient.rc b/cpp/demo/IcePatch2/MFC/PatchClient.rc
index b2b04eee1a6..4ab19312756 100755
--- a/cpp/demo/IcePatch2/MFC/PatchClient.rc
+++ b/cpp/demo/IcePatch2/MFC/PatchClient.rc
@@ -71,7 +71,7 @@ IDR_MAINFRAME ICON DISCARDABLE "PatchClient.ico"
// Dialog
//
-IDD_PATCHCLIENT_DIALOG DIALOGEX 0, 0, 234, 145
+IDD_PATCHCLIENT_DIALOG DIALOGEX 0, 0, 234, 148
STYLE DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
@@ -83,17 +83,17 @@ BEGIN
PUSHBUTTON "...",IDC_SELECTDIR,209,7,18,14,BS_CENTER,
WS_EX_CLIENTEDGE | WS_EX_STATICEDGE
CONTROL "Thorough",IDC_THOROUGH,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,63,29,47,10
+ WS_TABSTOP,33,25,47,10
PUSHBUTTON "Patch",IDC_STARTPATCH,122,27,50,14
PUSHBUTTON "Cancel",IDC_CANCELPATCH,177,27,50,14
- LTEXT "",IDC_STATUSBAR,0,132,117,12,SS_CENTERIMAGE |
+ LTEXT "",IDC_STATUSBAR,0,135,117,12,SS_CENTERIMAGE |
SS_ENDELLIPSIS,WS_EX_STATICEDGE
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_GROUP,
- 118,132,81,12,WS_EX_STATICEDGE
- RTEXT "",IDC_PERCENT,200,132,33,12,SS_CENTERIMAGE,
+ 118,135,81,12,WS_EX_STATICEDGE
+ RTEXT "",IDC_PERCENT,200,135,33,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
LTEXT "Patch Directory:",IDC_STATIC,7,10,52,8
- GROUPBOX "Patch Information",IDC_STATIC,7,46,220,78,0,
+ GROUPBOX "Patch Information",IDC_STATIC,7,53,220,78,0,
WS_EX_TRANSPARENT
CONTROL "Current File:",IDC_STATIC,"Static",SS_LEFTNOWORDWRAP,13,
63,46,8
@@ -106,6 +106,8 @@ BEGIN
LTEXT "",IDC_FILE,63,59,156,14,SS_CENTERIMAGE,WS_EX_STATICEDGE
LTEXT "",IDC_SPEED,63,101,156,14,SS_CENTERIMAGE | NOT WS_GROUP,
WS_EX_STATICEDGE
+ CONTROL "Remove Orphans",IDC_ORPHAN,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,33,37,71,10
END
@@ -164,7 +166,7 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 227
TOPMARGIN, 7
- BOTTOMMARGIN, 138
+ BOTTOMMARGIN, 141
END
END
#endif // APSTUDIO_INVOKED
diff --git a/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp b/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp
index f3b02d65ca4..cbfe479a5de 100755
--- a/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp
+++ b/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp
@@ -259,6 +259,7 @@ CPatchDlg::OnInitDialog()
//
_path = (CEdit*)GetDlgItem(IDC_PATH);
_thorough = (CButton*)GetDlgItem(IDC_THOROUGH);
+ _remove = (CButton*)GetDlgItem(IDC_ORPHAN);
_select = (CButton*)GetDlgItem(IDC_SELECTDIR);
_start = (CButton*)GetDlgItem(IDC_STARTPATCH);
_cancel = (CButton*)GetDlgItem(IDC_CANCELPATCH);
@@ -279,6 +280,9 @@ CPatchDlg::OnInitDialog()
CString thorough = properties->getPropertyWithDefault("IcePatch2.Thorough", "0").c_str();
_thorough->SetCheck(thorough != "0");
+ CString remove = properties->getPropertyWithDefault("IcePatch2.Remove", "0").c_str();
+ _remove->SetCheck(remove != "0");
+
//
// Indicate ready status.
//
@@ -362,12 +366,6 @@ CPatchDlg::OnStartPatch()
Ice::PropertiesPtr properties = _communicator->getProperties();
//
- // Since this is a demo, we want to prevent files from
- // accidental deletion.
- //
- properties->setProperty("IcePatch2.Remove", "0");
-
- //
// Set the patch directory.
//
CString path;
@@ -385,6 +383,12 @@ CPatchDlg::OnStartPatch()
std::string thorough = _thorough->GetCheck() == BST_CHECKED ? "1" : "0";
properties->setProperty("IcePatch2.Thorough", thorough);
+ //
+ // Set the remove orphan flag.
+ //
+ std::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);
@@ -394,6 +398,7 @@ CPatchDlg::OnStartPatch()
_path->EnableWindow(false);
_select->EnableWindow(false);
_thorough->EnableWindow(false);
+ _remove->EnableWindow(false);
_start->EnableWindow(false);
//
@@ -440,6 +445,7 @@ CPatchDlg::reset(const CString& status)
_path->EnableWindow(true);
_select->EnableWindow(true);
_thorough->EnableWindow(true);
+ _remove->EnableWindow(true);
_start->EnableWindow(true);
_status->SetWindowText(status);
diff --git a/cpp/demo/IcePatch2/MFC/PatchClientDlg.h b/cpp/demo/IcePatch2/MFC/PatchClientDlg.h
index 5064edc41ef..5cd569792da 100755
--- a/cpp/demo/IcePatch2/MFC/PatchClientDlg.h
+++ b/cpp/demo/IcePatch2/MFC/PatchClientDlg.h
@@ -43,6 +43,7 @@ protected:
IceUtil::Time _startTime;
CEdit* _path;
CButton* _thorough;
+ CButton* _remove;
CButton* _select;
CButton* _start;
CButton* _cancel;
diff --git a/cpp/demo/IcePatch2/MFC/README b/cpp/demo/IcePatch2/MFC/README
index 42740916452..6f0a3686113 100755
--- a/cpp/demo/IcePatch2/MFC/README
+++ b/cpp/demo/IcePatch2/MFC/README
@@ -24,9 +24,11 @@ a new command window and execute this command:
> mkdir C:\icepatch_download
-Now you can start the IcePatch2 client:
+Now you can start the IcePatch2 client (You will also need to pass a
+"IcePatch2.Endpoints" argument if you use a endpoint other than the
+one shown above when you start icepatch2server):
-> patch --IcePatch2.Endpoints="tcp -h 127.0.0.1 -p 10000"
+> patch
Click the "..." button to the right of the Patch Directory field and
select the empty directory you just created. Then click the "Patch"
diff --git a/cpp/demo/IcePatch2/MFC/mfcpatchC.dsp b/cpp/demo/IcePatch2/MFC/mfcpatchC.dsp
index 4328650d90c..0ae5370b950 100755
--- a/cpp/demo/IcePatch2/MFC/mfcpatchC.dsp
+++ b/cpp/demo/IcePatch2/MFC/mfcpatchC.dsp
@@ -134,6 +134,10 @@ SOURCE=.\StdAfx.h
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
+SOURCE=.\PatchClient.ico
+# End Source File
+# Begin Source File
+
SOURCE=.\res\PatchClient.ico
# End Source File
# Begin Source File
diff --git a/cpp/demo/IcePatch2/MFC/resource.h b/cpp/demo/IcePatch2/MFC/resource.h
index 7dcc4bc8442..d97e574378b 100755
--- a/cpp/demo/IcePatch2/MFC/resource.h
+++ b/cpp/demo/IcePatch2/MFC/resource.h
@@ -19,6 +19,7 @@
#define IDC_THOROUGH 1015
#define IDC_PATH 1016
#define IDC_SELECTDIR 1017
+#define IDC_ORPHAN 1018
#define IDC_FILE 1023
#define IDC_TOTAL 1024
#define IDC_SPEED 1025