[commit] r2392 - trunk/GME/Gme
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Thu Oct 24 15:37:08 CDT 2013
Author: volgy
Date: Thu Oct 24 15:37:08 2013
New Revision: 2392
Log:
Add SVN client classes. Not integrated with GUI code yet.
Added:
trunk/GME/Gme/SVNClient.cpp
trunk/GME/Gme/SVNClient.h
trunk/GME/Gme/SVNDialogCommit.cpp
trunk/GME/Gme/SVNDialogCommit.h
trunk/GME/Gme/SVNDialogLogin.cpp
trunk/GME/Gme/SVNDialogLogin.h
trunk/GME/Gme/SVNDialogPlaintext.cpp
trunk/GME/Gme/SVNDialogPlaintext.h
trunk/GME/Gme/SVNDialogSSLServerTrust.cpp
trunk/GME/Gme/SVNDialogSSLServerTrust.h
Modified:
trunk/GME/Gme/GME.rc
trunk/GME/Gme/GME.vcxproj
trunk/GME/Gme/GME.vcxproj.filters
trunk/GME/Gme/resource.h
Modified: trunk/GME/Gme/GME.rc
==============================================================================
--- trunk/GME/Gme/GME.rc Thu Oct 24 15:36:06 2013 (r2391)
+++ trunk/GME/Gme/GME.rc Thu Oct 24 15:37:08 2013 (r2392)
@@ -1066,6 +1066,70 @@
"{1758EDFF-969C-4f6e-AF81-E8AF07A33799}",WS_TABSTOP,7,7,172,76
END
+IDD_DIALOG_SVNCOMMIT DIALOGEX 0, 0, 316, 183
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Subversion Commit"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,205,162,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,259,162,50,14
+ LTEXT "Filename:",IDC_STATIC,16,18,32,8
+ LTEXT "Repository:",IDC_STATIC,16,36,38,8
+ LTEXT "Revision:",IDC_STATIC,16,56,30,8
+ EDITTEXT IDC_EDIT_SVNCOMMIT_FILENAME,57,14,245,14,ES_AUTOHSCROLL | ES_READONLY
+ EDITTEXT IDC_EDIT_SVNCOMMIT_REPO,57,34,245,14,ES_AUTOHSCROLL | ES_READONLY
+ EDITTEXT IDC_EDIT_SVNCOMMIT_REVISION,57,54,50,14,ES_AUTOHSCROLL | ES_READONLY
+ LTEXT "Log Message:",IDC_STATIC,16,76,45,8
+ EDITTEXT IDC_EDIT_SVNCOMMIT_LOG,15,89,286,62,ES_AUTOHSCROLL
+END
+
+IDD_DIALOG_SVNPLAINTEXT DIALOGEX 0, 0, 268, 135
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Subversion Plaintext Warning"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ PUSHBUTTON "Yes",IDOK,156,114,50,14
+ DEFPUSHBUTTON "No",IDCANCEL,210,114,50,14
+ LTEXT "Realm:",IDC_STATIC,7,15,23,8
+ EDITTEXT IDC_EDIT_REALM,36,12,222,14,ES_AUTOHSCROLL | ES_READONLY
+ LTEXT "ATTENTION!\r\rYour password/passphrase can only be stored to disk unencrypted! You are advised to configure your system so that Subversion can store passwords encrypted, if possible. See the documentation for details.",IDC_STATIC,12,36,246,48
+ LTEXT "Do you want to store password unencrypted ?",IDC_STATIC,48,96,150,8
+END
+
+IDD_DIALOG_SVNSSLSERVERTRUST DIALOGEX 0, 0, 284, 183
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Subversion SSL Server Trust Warning"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ PUSHBUTTON "Accept",IDOK,157,162,50,14
+ DEFPUSHBUTTON "Cancel",IDCANCEL,227,162,50,14
+ LTEXT "ATTENTION!\r\rValidating the SSL server certificate failed. See details below.",IDC_STATIC,7,7,246,29
+ LTEXT "Host:",IDC_STATIC,6,44,18,8
+ EDITTEXT IDC_EDIT_HOST,47,42,229,14,ES_AUTOHSCROLL | ES_READONLY
+ LTEXT "Fingerprint:",IDC_STATIC,6,63,38,8
+ EDITTEXT IDC_EDIT_FINGERPRINT,47,60,229,14,ES_AUTOHSCROLL | ES_READONLY
+ LTEXT "Issuer:",IDC_STATIC,6,81,24,8
+ EDITTEXT IDC_EDIT_ISSUER,47,78,229,14,ES_AUTOHSCROLL | ES_READONLY
+ LTEXT "Problems:",IDC_STATIC,6,102,32,8
+ EDITTEXT IDC_EDIT_PROBLEMS,48,102,229,54,ES_AUTOHSCROLL | ES_READONLY
+ CONTROL "Accept Permanently",IDC_CHECK_PERMANENT,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,65,164,80,10
+END
+
+IDD_DIALOG_SVNLOGIN DIALOGEX 0, 0, 207, 103
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Subversion Login"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,96,82,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,150,82,50,14
+ LTEXT "Realm:",IDC_STATIC,7,9,23,8
+ EDITTEXT IDC_EDIT_REALM,36,7,164,14,ES_AUTOHSCROLL | ES_READONLY
+ LTEXT "Username",IDC_STATIC,7,33,33,8
+ EDITTEXT IDC_EDIT_USERNAME,50,30,150,14,ES_AUTOHSCROLL
+ LTEXT "Password:",IDC_STATIC,7,55,34,8
+ EDITTEXT IDC_EDIT_PASSWORD,50,52,150,14,ES_PASSWORD | ES_AUTOHSCROLL
+ CONTROL "Save credentials",IDC_CHECK_PERMANENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,84,69,10,WS_EX_RIGHT
+END
/////////////////////////////////////////////////////////////////////////////
//
@@ -1262,6 +1326,38 @@
TOPMARGIN, 7
BOTTOMMARGIN, 127
END
+
+ IDD_DIALOG_SVNCOMMIT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 309
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 176
+ END
+
+ IDD_DIALOG_SVNPLAINTEXT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 261
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 128
+ END
+
+ IDD_DIALOG_SVNSSLSERVERTRUST, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 277
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 176
+ END
+
+ IDD_DIALOG_SVNLOGIN, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 200
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 96
+ END
END
#endif // APSTUDIO_INVOKED
Modified: trunk/GME/Gme/GME.vcxproj
==============================================================================
--- trunk/GME/Gme/GME.vcxproj Thu Oct 24 15:36:06 2013 (r2391)
+++ trunk/GME/Gme/GME.vcxproj Thu Oct 24 15:37:08 2013 (r2392)
@@ -114,7 +114,7 @@
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
- <AdditionalIncludeDirectories>../Common;../Interfaces;../Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../Common;../Interfaces;../Include;../Include/subversion;../Include/apr;../Include/apr-util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -130,7 +130,7 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>gdiplus.lib;xerces-c_3.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>..\lib;..\lib\subv_$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -202,7 +202,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../Common;../Interfaces;../Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../Common;../Interfaces;../Include;../Include/subversion;../Include/apr;../Include/apr-util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -217,7 +217,7 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>gdiplus.lib;xerces-c_3D.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>..\lib;..\lib\subv_$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -360,6 +360,11 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
+ <ClCompile Include="SVNClient.cpp" />
+ <ClCompile Include="SVNDialogCommit.cpp" />
+ <ClCompile Include="SVNDialogLogin.cpp" />
+ <ClCompile Include="SVNDialogPlaintext.cpp" />
+ <ClCompile Include="SVNDialogSSLServerTrust.cpp" />
<ClCompile Include="SyncAspListCtrl.cpp" />
<ClCompile Include="SyncObjsListCtrl.cpp" />
</ItemGroup>
@@ -513,6 +518,11 @@
<ClInclude Include="search.h" />
<ClInclude Include="Splash.h" />
<ClInclude Include="StdAfx.h" />
+ <ClInclude Include="SVNClient.h" />
+ <ClInclude Include="SVNDialogCommit.h" />
+ <ClInclude Include="SVNDialogLogin.h" />
+ <ClInclude Include="SVNDialogPlaintext.h" />
+ <ClInclude Include="SVNDialogSSLServerTrust.h" />
<ClInclude Include="SyncAspListCtrl.h" />
<ClInclude Include="SyncObjsListCtrl.h" />
<ClInclude Include="targetver.h" />
Modified: trunk/GME/Gme/GME.vcxproj.filters
==============================================================================
--- trunk/GME/Gme/GME.vcxproj.filters Thu Oct 24 15:36:06 2013 (r2391)
+++ trunk/GME/Gme/GME.vcxproj.filters Thu Oct 24 15:37:08 2013 (r2392)
@@ -228,6 +228,21 @@
<ClCompile Include="CSGUIInterop.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="SVNClient.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SVNDialogCommit.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SVNDialogLogin.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SVNDialogPlaintext.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SVNDialogSSLServerTrust.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="AnnotatorEventSink.rgs">
@@ -590,6 +605,21 @@
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="SVNClient.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SVNDialogCommit.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SVNDialogLogin.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SVNDialogPlaintext.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SVNDialogSSLServerTrust.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="GME.rc">
Added: trunk/GME/Gme/SVNClient.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/GME/Gme/SVNClient.cpp Thu Oct 24 15:37:08 2013 (r2392)
@@ -0,0 +1,668 @@
+#include "StdAfx.h"
+
+#include "SVNClient.h"
+#include "svn_dso.h"
+#include "svn_utf.h"
+#include "svn_nls.h"
+#include "svn_fs.h"
+#include "svn_hash.h"
+#include "svn_props.h"
+
+#include "SVNDialogCommit.h"
+#include "SVNDialogPlaintext.h"
+#include "SVNDialogSSLServerTrust.h"
+#include "SVNDialogLogin.h"
+
+#pragma comment(lib, "advapi32.lib")
+#pragma comment(lib, "shfolder.lib")
+#pragma comment(lib, "ws2_32.lib")
+#pragma comment(lib, "secur32.lib")
+#pragma comment(lib, "crypt32.lib")
+#pragma comment(lib, "version.lib")
+#pragma comment(lib, "psapi.lib")
+
+
+// Subversion libraries and dependencies
+#pragma comment(lib, "libapr-1.lib")
+#pragma comment(lib, "libaprutil-1.lib")
+#pragma comment(lib, "libapriconv-1.lib")
+#pragma comment(lib, "xml.lib")
+
+#pragma comment(lib, "libeay32.lib")
+#pragma comment(lib, "ssleay32.lib")
+
+#pragma comment(lib, "svn_client-1.lib")
+#pragma comment(lib, "svn_delta-1.lib")
+#pragma comment(lib, "svn_diff-1.lib")
+#pragma comment(lib, "svn_fs-1.lib")
+#pragma comment(lib, "libsvn_fs_fs-1.lib")
+#pragma comment(lib, "libsvn_fs_util-1.lib")
+#pragma comment(lib, "svn_ra-1.lib")
+#pragma comment(lib, "libsvn_ra_local-1.lib")
+#pragma comment(lib, "libsvn_ra_svn-1.lib")
+#pragma comment(lib, "svn_repos-1.lib")
+#pragma comment(lib, "svn_subr-1.lib")
+#pragma comment(lib, "svn_wc-1.lib")
+#pragma comment(lib, "libsvn_ra_serf-1.lib")
+#pragma comment(lib, "serf-1.lib")
+
+// These are contained by serf-1.lib
+// NOTE: zlibstatD.lib includes /DEFAULTLIB:"MSVCRT" disrectives
+// (instead of "MSVCRTD"), resulting in linker warnings.
+
+//#ifdef _DEBUG
+// #pragma comment(lib, "zlibstatD.lib")
+//#else
+// #pragma comment(lib, "zlibstat.lib")
+//#endif
+
+#define SVNTHROW(FUNC) \
+ do { \
+ svn_error_t* _err = (FUNC); \
+ if( _err ) { \
+ throw CSVNError(_err); \
+ } \
+ } while(false)
+
+
+///////////////////////////////////////////////////////////////////////
+// SVN Error
+///////////////////////////////////////////////////////////////////////
+CSVNError::CSVNError(svn_error_t* e) : svnError(e)
+{
+}
+
+CSVNError::~CSVNError()
+{
+ svn_error_clear(svnError);
+}
+
+CString CSVNError::msg() const
+{
+ char buf[SVN_ERROR_MSG_MAX];
+
+ const char *ret = svn_err_best_message(svnError, buf, sizeof(buf));
+ return CString(ret);
+}
+
+///////////////////////////////////////////////////////////////////////
+// SVN Pool
+///////////////////////////////////////////////////////////////////////
+CSVNPool::CSVNPool(apr_pool_t* parentPool)
+{
+ pool = svn_pool_create(parentPool);
+}
+
+CSVNPool::~CSVNPool()
+{
+ if (pool) {
+ svn_pool_destroy(pool);
+ pool = NULL;
+ }
+}
+
+CSVNPool::operator apr_pool_ptr() const
+{
+ return pool;
+}
+
+
+///////////////////////////////////////////////////////////////////////
+// SVN Client
+///////////////////////////////////////////////////////////////////////
+CSVNClient::CSVNClient()
+ : isInitialized(false), ctx(NULL), pool(NULL)
+{
+}
+
+
+CSVNClient::~CSVNClient(void)
+{
+
+ POSITION p = svnFiles.GetHeadPosition();
+ while (p) {
+ delete svnFiles.GetNext(p);
+ }
+ // NOTE: there is a memory allocation problem in serf
+ // it causes problems when SSL certificates are rejected during conn. setup
+ // svn_pool_destroy mitigates this problem (memory leaks "only" instead of accessing freed memory)
+ svn_pool_destroy(pool);
+ apr_terminate();
+}
+
+void CSVNClient::initialize(void)
+{
+ apr_status_t status;
+
+ // TODO: subversion/libsvn_subr/cmdline.c contains a lot of esoteric stuff
+ // such as "setvbuf", input/output encodings, exception handlers, locale settings, etc.
+
+ /* Initialize the APR subsystem, and register an atexit() function
+ to Uninitialize that subsystem at program exit. */
+ status = apr_initialize();
+ if (status)
+ {
+ // this is not a real svn error, but coming from apr
+ throw CSVNError(svn_error_create(status, NULL, NULL));
+ }
+
+ /* DSO pool must be created before any other pools used by the
+ application so that pool cleanup doesn't unload DSOs too
+ early. See docstring of svn_dso_initialize2(). */
+ SVNTHROW(svn_dso_initialize2());
+
+ /* Create a pool for use by the UTF-8 routines. It will be cleaned
+ up by APR at exit time. */
+ pool = svn_pool_create(NULL);
+ svn_utf_initialize2(FALSE, pool);
+ SVNTHROW(svn_nls_init());
+
+ /* Create top-level memory pool. */
+ pool = svn_pool_create(NULL);
+
+ /* Initialize the FS library. */
+ //SVNTHROW(svn_fs_initialize(pool));
+
+ /* Initialize the RA library. */
+ SVNTHROW(svn_ra_initialize(pool));
+
+ /* Make sure the ~/.subversion run-time config files exist */
+ SVNTHROW(svn_config_ensure(NULL, pool));
+
+
+ /* All clients need to fill out a client_ctx object. */
+ {
+ apr_hash_t *cfg_hash;
+ svn_config_t *cfg_config;
+
+ /* Load the run-time config file into a hash */
+ SVNTHROW(svn_config_get_config (&cfg_hash, NULL, pool));
+
+ cfg_config = (svn_config_t *)svn_hash_gets(cfg_hash, SVN_CONFIG_CATEGORY_CONFIG);
+
+ /* Initialize and allocate the client_ctx object. */
+ SVNTHROW(svn_client_create_context2(&ctx, cfg_hash, pool));
+
+
+ /* Set the working copy administrative directory name. */
+ if (getenv ("SVN_ASP_DOT_NET_HACK"))
+ {
+ SVNTHROW(svn_wc_set_adm_dir ("_svn", pool));
+ }
+
+ /* Callbacks */
+
+ /* A func (& context) which receives event signals during checkouts, updates, commits, etc. */
+ ctx->notify_func2 = cbNotify;
+ ctx->notify_baton2 = this;
+
+ /* A func (& context) which can receive log messages */
+ ctx->log_msg_func3 = cbLog;
+ ctx->log_msg_baton3 = this;
+
+ /* A func (& context) which checks whether the user cancelled */
+ ctx->cancel_func = cbCancel;
+ ctx->cancel_baton = this;
+
+ /* A func (& context) for network progress */
+ ctx->progress_func = cbProgress;
+ ctx->progress_baton = this;
+
+ /* A func (& context) for conflict resolution */
+ ctx->conflict_func2 = cbConflict;
+ ctx->conflict_baton2 = this;
+
+ /* Make the client_ctx capable of authenticating users */
+ {
+ svn_auth_provider_object_t *provider;
+ apr_array_header_t *providers;
+
+ /* For caching encrypted username/password and client cert passwords - no prompting */
+ SVNTHROW(svn_auth_get_platform_specific_client_providers(&providers, cfg_config, pool));
+
+ /* For caching unencrypted username/password (also from config file) - prompting only to confirm storing creds in cleartext */
+ svn_auth_get_simple_provider2(&provider, cbAuthPlaintextPrompt, this, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ /* For guessing and optionally saving username - no prompting */
+ svn_auth_get_username_provider(&provider, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ /* For validating server SSL certs from windows certificate store - no prompting (windows itself might show a dialog ?) */
+ SVNTHROW(svn_auth_get_platform_specific_provider(&provider, "windows", "ssl_server_trust", pool));
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ /* For validating and/or storing SSL server certs (in custom files) - no prompting */
+ svn_auth_get_ssl_server_trust_file_provider(&provider, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ /* For retrieving custom client certificate (file path) from server config - no prompting */
+ svn_auth_get_ssl_client_cert_file_provider(&provider, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ svn_auth_get_ssl_client_cert_pw_file_provider2(&provider, cbAuthPlaintextPassphrasePrompt, this, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ svn_auth_get_simple_prompt_provider(&provider, cbAuthSimplePrompt, this, 2 /* retry limit */, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ svn_auth_get_username_prompt_provider(&provider, cbAuthUsernamePrompt, this, 2 /* retry limit */, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ svn_auth_get_ssl_server_trust_prompt_provider(&provider, cbAuthSSLServerTrustPrompt, this, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ svn_auth_get_ssl_client_cert_pw_prompt_provider(&provider, cbAuthSSLClientCertPWPrompt, this, 2 /* retry limit */, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ /* If configuration allows, add a provider for client-cert path
+ prompting, too. */
+ svn_boolean_t ssl_client_cert_file_prompt;
+ SVNTHROW(svn_config_get_bool(cfg_config, &ssl_client_cert_file_prompt,
+ SVN_CONFIG_SECTION_AUTH,
+ SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE_PROMPT,
+ FALSE));
+ if (ssl_client_cert_file_prompt)
+ {
+ svn_auth_get_ssl_client_cert_prompt_provider(&provider, cbAuthSSLClientCertPrompt, this, 2 /* retry limit */, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+ }
+
+ /* Register the auth-providers into the context's auth_baton. */
+ svn_auth_open (&ctx->auth_baton, providers, pool);
+ }
+ }
+
+ isInitialized = true;
+}
+
+CSVNFile* CSVNClient::embraceFile(const CString & filePath)
+{
+ CSVNFile* svnFile = new CSVNFile(this, filePath);
+ if (svnFile) {
+ svnFiles.AddTail(svnFile);
+ }
+ return svnFile;
+}
+
+void CSVNClient::forgetFile(CSVNFile* svnFile)
+{
+ POSITION p = svnFiles.Find(svnFile);
+ while (p) {
+ delete svnFiles.GetAt(p);
+ svnFiles.RemoveAt(p);
+ p = svnFiles.Find(svnFile);
+ }
+}
+
+///////////////////////////////////////////////////////////////////////
+// SVN Client Context Callbacks
+///////////////////////////////////////////////////////////////////////
+void CSVNClient::cbNotify(
+ void *baton,
+ const svn_wc_notify_t *notify,
+ apr_pool_t *pool)
+{
+ CSVNClient *self = (CSVNClient*)baton;
+ ASSERT(self);
+ self->lastNotifyAction = notify->action;
+}
+
+svn_error_t* CSVNClient::cbLog(
+ const char **log_msg,
+ const char **tmp_file,
+ const apr_array_header_t *commit_items,
+ void *baton,
+ apr_pool_t *pool)
+{
+ CSVNClient *self = (CSVNClient*)baton;
+ CSVNDialogCommit dlg;
+ *log_msg = NULL;
+
+ ASSERT(self);
+
+ if (apr_is_empty_array(commit_items)) {
+ return SVN_NO_ERROR;
+ }
+
+ svn_client_commit_item3_t* item = APR_ARRAY_IDX(commit_items, 0, svn_client_commit_item3_t*);
+ dlg.filename = item->path;
+ dlg.repository = item->url;
+ dlg.revision = item->revision;
+ if (dlg.DoModal() == IDOK) {
+ svn_string_t* logMsg = svn_string_create(CStringA(dlg.logMessage), pool);
+ *log_msg = logMsg->data;
+ self->canceledOperation = false;
+ }
+ else {
+ self->canceledOperation = true;
+ }
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t* CSVNClient::cbCancel(void *cancel_baton)
+{
+ // not needed now (cancel button on user interfaces ?)
+ return SVN_NO_ERROR;
+}
+
+void CSVNClient::cbProgress(
+ apr_off_t progress,
+ apr_off_t total,
+ void *baton,
+ apr_pool_t *pool)
+{
+ //TODO: implement this
+}
+
+svn_error_t* CSVNClient::cbConflict(
+ svn_wc_conflict_result_t **result,
+ const svn_wc_conflict_description2_t *description,
+ void *baton, apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ // too advanced to handle in this client
+ return SVN_NO_ERROR;
+}
+
+///////////////////////////////////////////////////////////////////////
+// SVN Client Auth Callbacks
+///////////////////////////////////////////////////////////////////////
+
+//
+// Auth callback function for asking whether storing a password to disk in plaintext is allowed.
+//
+svn_error_t* CSVNClient::cbAuthPlaintextPrompt(
+ svn_boolean_t *may_save_plaintext,
+ const char *realmstring,
+ void *baton,
+ apr_pool_t *pool)
+{
+ CSVNDialogPlaintext dlg;
+ dlg.realm = realmstring;
+ *may_save_plaintext = (dlg.DoModal() == IDOK) ? TRUE : FALSE;
+ return SVN_NO_ERROR;
+}
+
+svn_error_t* CSVNClient::cbAuthPlaintextPassphrasePrompt(
+ svn_boolean_t *may_save_plaintext,
+ const char *realmstring,
+ void *baton,
+ apr_pool_t *pool)
+{
+ CSVNDialogPlaintext dlg;
+ dlg.realm = realmstring;
+ *may_save_plaintext = (dlg.DoModal() == IDOK) ? TRUE : FALSE;
+ return SVN_NO_ERROR;
+}
+
+svn_error_t* CSVNClient::cbAuthSimplePrompt(
+ svn_auth_cred_simple_t **cred,
+ void *baton,
+ const char *realm,
+ const char *username,
+ svn_boolean_t may_save,
+ apr_pool_t *pool)
+{
+ CSVNDialogLogin dlg;
+ dlg.realm = realm;
+ dlg.passwordEnabled = TRUE;
+ dlg.permanentEnabled = may_save;
+
+ if (dlg.DoModal() == IDOK) {
+ svn_auth_cred_simple_t *ret = (svn_auth_cred_simple_t *)apr_pcalloc(pool, sizeof(*ret));
+ svn_string_t* username_s = svn_string_create(CStringA(dlg.username), pool);
+ ret->username = username_s ? username_s->data : NULL;
+ svn_string_t* password_s = svn_string_create(CStringA(dlg.password), pool);
+ ret->password = password_s ? password_s->data : NULL;
+ ret->may_save = dlg.permanent;
+ *cred = ret;
+ }
+ else {
+ *cred = NULL;
+ }
+ return SVN_NO_ERROR;
+}
+
+svn_error_t* CSVNClient::cbAuthUsernamePrompt(
+ svn_auth_cred_username_t **cred,
+ void *baton,
+ const char *realm,
+ svn_boolean_t may_save,
+ apr_pool_t *pool)
+{
+ CSVNDialogLogin dlg;
+ dlg.realm = realm;
+ dlg.passwordEnabled = FALSE;
+ dlg.permanentEnabled = may_save;
+
+ if (dlg.DoModal() == IDOK) {
+ svn_auth_cred_username_t *ret = (svn_auth_cred_username_t *)apr_pcalloc(pool, sizeof(*ret));
+ svn_string_t* username_s = svn_string_create(CStringA(dlg.username), pool);
+ ret->username = username_s ? username_s->data : NULL;
+ ret->may_save = dlg.permanent;
+ *cred = ret;
+ }
+ else {
+ *cred = NULL;
+ }
+ return SVN_NO_ERROR;
+}
+
+svn_error_t* CSVNClient::cbAuthSSLServerTrustPrompt(
+ svn_auth_cred_ssl_server_trust_t **cred,
+ void *baton,
+ const char *realm,
+ apr_uint32_t failures,
+ const svn_auth_ssl_server_cert_info_t *cert_info,
+ svn_boolean_t may_save,
+ apr_pool_t *pool)
+{
+ CSVNDialogSSLServerTrust dlg;
+ dlg.host = cert_info->hostname;
+ dlg.fingerprint = cert_info->fingerprint;
+ dlg.issuer = cert_info->issuer_dname;
+ dlg.permanentEnabled = may_save;
+
+ if (failures & SVN_AUTH_SSL_NOTYETVALID) {
+ dlg.problems += _T("Certificate is not yet valid.\r");
+ }
+ if (failures & SVN_AUTH_SSL_EXPIRED) {
+ dlg.problems += _T("Certificate has expired.\r");
+ }
+ if (failures & SVN_AUTH_SSL_CNMISMATCH) {
+ dlg.problems += _T("Certificate's CN does not match the remote hostname.\r");
+ }
+ if (failures & SVN_AUTH_SSL_UNKNOWNCA) {
+ dlg.problems += _T("Certificate authority is unknown or not trusted.\r");
+ }
+ if (failures & SVN_AUTH_SSL_OTHER) {
+ dlg.problems += _T("Other failure.\r");
+ }
+
+ if (dlg.DoModal() == IDOK) {
+ svn_auth_cred_ssl_server_trust_t *ret = (svn_auth_cred_ssl_server_trust_t *)apr_pcalloc(pool, sizeof(*ret));
+ ret->accepted_failures = failures;
+ ret->may_save = dlg.permanent;
+ *cred = ret;
+ }
+ else {
+ *cred = NULL;
+ }
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t* CSVNClient::cbAuthSSLClientCertPWPrompt(
+ svn_auth_cred_ssl_client_cert_pw_t **cred,
+ void *baton,
+ const char *realm,
+ svn_boolean_t may_save,
+ apr_pool_t *pool)
+{
+ // Unsupported
+ *cred = NULL;
+ return SVN_NO_ERROR;
+}
+
+svn_error_t* CSVNClient::cbAuthSSLClientCertPrompt(
+ svn_auth_cred_ssl_client_cert_t **cred,
+ void *baton,
+ const char *realm,
+ svn_boolean_t may_save,
+ apr_pool_t *pool)
+{
+ // Unsupported
+ *cred = NULL;
+ return SVN_NO_ERROR;
+}
+
+
+///////////////////////////////////////////////////////////////////////
+// SVN File
+///////////////////////////////////////////////////////////////////////
+CSVNFile::CSVNFile(CSVNClient* client, const CString & filePath)
+ : client(client), filePath(filePath), versioned(false), tracked(false), owned(false), latest(false)
+{
+}
+
+CSVNFile::~CSVNFile()
+{
+}
+
+void CSVNFile::updateStatus(bool checkServer)
+{
+ svn_error_t* e;
+
+ if (client->isInitialized) {
+ CSVNPool scratch_pool(client->pool);
+
+ svn_opt_revision_t revision = {svn_opt_revision_head, {0}};
+
+ e = svn_client_status5(NULL, client->ctx, CStringA(filePath),
+ &revision, svn_depth_immediates, TRUE, checkServer ? TRUE : FALSE,
+ FALSE, FALSE, TRUE, NULL, cbStatus, this, scratch_pool);
+
+ if (e && e->apr_err == SVN_ERR_WC_NOT_WORKING_COPY) {
+ versioned = tracked = owned = latest = false;
+ svn_error_clear(e);
+ }
+ else {
+ SVNTHROW(e);
+ }
+ }
+}
+
+bool CSVNFile::isVersioned()
+{
+ updateStatus();
+ return versioned;
+}
+
+bool CSVNFile::isTracked()
+{
+ updateStatus();
+ return tracked;
+}
+
+bool CSVNFile::isOwned()
+{
+ updateStatus();
+ return owned;
+}
+
+bool CSVNFile::isLatest()
+{
+ updateStatus(true);
+ return latest;
+}
+
+bool CSVNFile::update()
+{
+ CStringA filePathA(filePath);
+ const char* target = filePathA;
+ CSVNPool scratch_pool(client->pool);
+ apr_array_header_t* targets = apr_array_make(scratch_pool, 1, sizeof(target));
+ APR_ARRAY_PUSH(targets, const char*) = target;
+
+ svn_opt_revision_t revision = {svn_opt_revision_head, {0}};
+
+ SVNTHROW(svn_client_update4(NULL, targets, &revision, svn_depth_files, FALSE, FALSE, FALSE,
+ TRUE, FALSE, client->ctx, scratch_pool));
+
+ return (client->lastNotifyAction == svn_wc_notify_update_completed);
+}
+
+bool CSVNFile::takeOwnership()
+{
+ CStringA filePathA(filePath);
+ const char* target = filePathA;
+ CSVNPool scratch_pool(client->pool);
+ apr_array_header_t* targets = apr_array_make(scratch_pool, 1, sizeof(target));
+ APR_ARRAY_PUSH(targets, const char*) = target;
+
+ SVNTHROW(svn_client_lock(targets, "GME auto-locking", FALSE, client->ctx, scratch_pool));
+
+ return (client->lastNotifyAction == svn_wc_notify_locked);
+}
+
+bool CSVNFile::commit()
+{
+ CStringA filePathA(filePath);
+ const char* target = filePathA;
+ CSVNPool scratch_pool(client->pool);
+ apr_array_header_t* targets = apr_array_make(scratch_pool, 1, sizeof(target));
+ APR_ARRAY_PUSH(targets, const char*) = target;
+
+ SVNTHROW(svn_client_commit6(targets, svn_depth_immediates, FALSE, FALSE, FALSE,
+ FALSE, FALSE, NULL, NULL, NULL, NULL, client->ctx, scratch_pool));
+
+ // commit does not release the lock if the file was not changed (empty commit)
+ if (!client->canceledOperation) {
+ updateStatus();
+ if (owned) {
+ SVNTHROW(svn_client_unlock(targets, FALSE, client->ctx, scratch_pool));
+ updateStatus();
+ }
+ }
+
+ return !client->canceledOperation;
+}
+
+///////////////////////////////////////////////////////////////////////
+// Operation Callbacks
+///////////////////////////////////////////////////////////////////////
+svn_error_t* CSVNFile::cbStatus(
+ void *baton,
+ const char *path,
+ const svn_client_status_t *status,
+ apr_pool_t *scratch_pool)
+{
+ CSVNFile* self = (CSVNFile*)baton;
+
+ if (status->versioned) {
+ self->versioned = true;
+ self->latest = (status->ood_changed_rev == SVN_INVALID_REVNUM);
+ self->owned = (status->lock != NULL);
+
+ self->tracked = false;
+ apr_hash_t* props;
+ svn_opt_revision_t revision = {svn_opt_revision_base, {0}};
+
+ SVN_ERR(svn_client_propget(&props, SVN_PROP_NEEDS_LOCK, CStringA(self->filePath),
+ &revision, FALSE, self->client->ctx, scratch_pool));
+
+ if (apr_hash_count(props)) {
+ svn_string_t *hval;
+ apr_hash_index_t* hi = apr_hash_first(scratch_pool, props);
+ apr_hash_this(hi, NULL, 0, (void**)&hval);
+ if (hval && !svn_string_isempty(hval)) {
+ self->tracked = true;
+ }
+ }
+
+ }
+
+ return SVN_NO_ERROR;
+}
\ No newline at end of file
Added: trunk/GME/Gme/SVNClient.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/GME/Gme/SVNClient.h Thu Oct 24 15:37:08 2013 (r2392)
@@ -0,0 +1,119 @@
+#pragma once
+
+#include "svn_client.h"
+#include "svn_config.h"
+#include "svn_pools.h"
+
+class CSVNClient;
+
+#define SVN_ERROR_MSG_MAX 256
+
+class CSVNError
+{
+ friend class CSVNClient;
+ friend class CSVNFile;
+
+private:
+ CSVNError(svn_error_t* e);
+ CSVNError(const CSVNError&) {ASSERT(("Copying CVSNError objects are not supported", false));}
+
+public:
+ virtual ~CSVNError();
+ CString msg() const;
+
+private:
+ svn_error_t *svnError;
+};
+
+class CSVNPool
+{
+ typedef apr_pool_t* apr_pool_ptr;
+public:
+ CSVNPool(apr_pool_t* parentPool);
+ CSVNPool(const CSVNPool&) {ASSERT(("Copying CSVNPool objects are not supported", false));}
+ virtual ~CSVNPool();
+
+ operator apr_pool_ptr() const;
+
+private:
+ apr_pool_ptr pool;
+};
+
+class CSVNFile
+{
+ friend class CSVNClient;
+
+private:
+ CSVNFile(CSVNClient* client, const CString & filePath);
+
+ void updateStatus(bool checkServer = false);
+
+ // Callbacks
+ static svn_error_t* cbStatus(void *baton, const char *path, const svn_client_status_t *status, apr_pool_t *scratch_pool);
+
+public:
+ virtual ~CSVNFile();
+
+ bool isVersioned();
+ bool isTracked();
+ bool isOwned();
+ bool isLatest();
+
+ bool update();
+ bool takeOwnership();
+ bool commit();
+
+private:
+ CSVNClient *client;
+ CString filePath;
+ bool versioned;
+ bool tracked;
+ bool owned;
+ bool latest;
+};
+
+
+class CSVNClient
+{
+ friend class CSVNFile;
+
+public:
+ CSVNClient();
+ virtual ~CSVNClient();
+
+ void initialize();
+
+ CSVNFile* embraceFile(const CString & filePath);
+ void forgetFile(CSVNFile* svnFile);
+
+private:
+ // Context Callbacks
+ static void cbNotify(void *baton, const svn_wc_notify_t *notify, apr_pool_t *pool);
+ static svn_error_t* cbLog(const char **log_msg, const char **tmp_file, const apr_array_header_t *commit_items, void *baton, apr_pool_t *pool);
+ static svn_error_t* cbCancel(void *cancel_baton);
+ static void cbProgress(apr_off_t progress, apr_off_t total, void *baton, apr_pool_t *pool);
+ static svn_error_t* cbConflict(svn_wc_conflict_result_t **result, const svn_wc_conflict_description2_t *description, void *baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool);
+
+ // Auth Callbacks
+ static svn_error_t* cbAuthPlaintextPrompt(svn_boolean_t *may_save_plaintext, const char *realmstring, void *baton, apr_pool_t *pool);
+ static svn_error_t* cbAuthPlaintextPassphrasePrompt(svn_boolean_t *may_save_plaintext, const char *realmstring, void *baton, apr_pool_t *pool);
+ static svn_error_t* cbAuthSimplePrompt(svn_auth_cred_simple_t **cred, void *baton, const char *realm, const char *username, svn_boolean_t may_save, apr_pool_t *pool);
+ static svn_error_t* cbAuthUsernamePrompt(svn_auth_cred_username_t **cred, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool);
+ static svn_error_t* cbAuthSSLServerTrustPrompt(svn_auth_cred_ssl_server_trust_t **cred, void *baton, const char *realm, apr_uint32_t failures, const svn_auth_ssl_server_cert_info_t *cert_info, svn_boolean_t may_save, apr_pool_t *pool);
+ static svn_error_t* cbAuthSSLClientCertPWPrompt(svn_auth_cred_ssl_client_cert_pw_t **cred, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool);
+ static svn_error_t* cbAuthSSLClientCertPrompt(svn_auth_cred_ssl_client_cert_t **cred, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool);
+
+private:
+ CList<CSVNFile*, CSVNFile*> svnFiles;
+
+ bool isInitialized;
+
+ // These are valid only if initialized
+ svn_client_ctx_t *ctx;
+ apr_pool_t *pool;
+
+ // Internal communication
+ bool canceledOperation;
+ svn_wc_notify_action_t lastNotifyAction;
+};
+
Added: trunk/GME/Gme/SVNDialogCommit.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/GME/Gme/SVNDialogCommit.cpp Thu Oct 24 15:37:08 2013 (r2392)
@@ -0,0 +1,41 @@
+// SVNDialogCommit.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "SVNDialogCommit.h"
+#include "afxdialogex.h"
+
+
+// CSVNDialogCommit dialog
+
+IMPLEMENT_DYNAMIC(CSVNDialogCommit, CDialogEx)
+
+CSVNDialogCommit::CSVNDialogCommit(CWnd* pParent /*=NULL*/)
+ : CDialogEx(CSVNDialogCommit::IDD, pParent)
+ , filename(_T(""))
+ , repository(_T(""))
+ , revision(0)
+ , logMessage(_T(""))
+{
+
+}
+
+CSVNDialogCommit::~CSVNDialogCommit()
+{
+}
+
+void CSVNDialogCommit::DoDataExchange(CDataExchange* pDX)
+{
+ CDialogEx::DoDataExchange(pDX);
+ DDX_Text(pDX, IDC_EDIT_SVNCOMMIT_FILENAME, filename);
+ DDX_Text(pDX, IDC_EDIT_SVNCOMMIT_REPO, repository);
+ DDX_Text(pDX, IDC_EDIT_SVNCOMMIT_REVISION, revision);
+ DDX_Text(pDX, IDC_EDIT_SVNCOMMIT_LOG, logMessage);
+}
+
+
+BEGIN_MESSAGE_MAP(CSVNDialogCommit, CDialogEx)
+END_MESSAGE_MAP()
+
+
+// CSVNDialogCommit message handlers
Added: trunk/GME/Gme/SVNDialogCommit.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/GME/Gme/SVNDialogCommit.h Thu Oct 24 15:37:08 2013 (r2392)
@@ -0,0 +1,26 @@
+#pragma once
+
+
+// CSVNDialogCommit dialog
+
+class CSVNDialogCommit : public CDialogEx
+{
+ DECLARE_DYNAMIC(CSVNDialogCommit)
+
+public:
+ CSVNDialogCommit(CWnd* pParent = NULL); // standard constructor
+ virtual ~CSVNDialogCommit();
+
+// Dialog Data
+ enum { IDD = IDD_DIALOG_SVNCOMMIT };
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+
+ DECLARE_MESSAGE_MAP()
+public:
+ CString filename;
+ CString repository;
+ long revision;
+ CString logMessage;
+};
Added: trunk/GME/Gme/SVNDialogLogin.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/GME/Gme/SVNDialogLogin.cpp Thu Oct 24 15:37:08 2013 (r2392)
@@ -0,0 +1,59 @@
+// SVNDialogLogin.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "SVNDialogLogin.h"
+#include "afxdialogex.h"
+
+
+// CSVNDialogLogin dialog
+
+IMPLEMENT_DYNAMIC(CSVNDialogLogin, CDialogEx)
+
+CSVNDialogLogin::CSVNDialogLogin(CWnd* pParent /*=NULL*/)
+ : CDialogEx(CSVNDialogLogin::IDD, pParent)
+ , realm(_T(""))
+ , username(_T(""))
+ , password(_T(""))
+{
+
+}
+
+CSVNDialogLogin::~CSVNDialogLogin()
+{
+}
+
+void CSVNDialogLogin::DoDataExchange(CDataExchange* pDX)
+{
+ CDialogEx::DoDataExchange(pDX);
+ DDX_Check(pDX, IDC_CHECK_PERMANENT, permanent);
+ DDX_Text(pDX, IDC_EDIT_REALM, realm);
+ DDX_Text(pDX, IDC_EDIT_USERNAME, username);
+ DDX_Text(pDX, IDC_EDIT_PASSWORD, password);
+}
+
+
+BEGIN_MESSAGE_MAP(CSVNDialogLogin, CDialogEx)
+// ON_BN_CLICKED(IDC_CHECK_SAVECREDS, &CSVNDialogLogin::OnBnClickedCheckSavecreds)
+END_MESSAGE_MAP()
+
+
+// CSVNDialogLogin message handlers
+
+
+//void CSVNDialogLogin::OnBnClickedCheckSavecreds()
+//{
+// // TODO: Add your control notification handler code here
+//}
+
+
+BOOL CSVNDialogLogin::OnInitDialog()
+{
+ CDialogEx::OnInitDialog();
+
+ GetDlgItem(IDC_CHECK_PERMANENT)->EnableWindow(permanentEnabled);
+ GetDlgItem(IDC_EDIT_PASSWORD)->EnableWindow(passwordEnabled);
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
Added: trunk/GME/Gme/SVNDialogLogin.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/GME/Gme/SVNDialogLogin.h Thu Oct 24 15:37:08 2013 (r2392)
@@ -0,0 +1,30 @@
+#pragma once
+
+
+// CSVNDialogLogin dialog
+
+class CSVNDialogLogin : public CDialogEx
+{
+ DECLARE_DYNAMIC(CSVNDialogLogin)
+
+public:
+ CSVNDialogLogin(CWnd* pParent = NULL); // standard constructor
+ virtual ~CSVNDialogLogin();
+
+// Dialog Data
+ enum { IDD = IDD_DIALOG_SVNLOGIN };
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+
+ DECLARE_MESSAGE_MAP()
+public:
+// afx_msg void OnBnClickedCheckSavecreds();
+ BOOL permanent;
+ CString realm;
+ CString username;
+ CString password;
+ BOOL permanentEnabled;
+ BOOL passwordEnabled;
+ virtual BOOL OnInitDialog();
+};
Added: trunk/GME/Gme/SVNDialogPlaintext.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/GME/Gme/SVNDialogPlaintext.cpp Thu Oct 24 15:37:08 2013 (r2392)
@@ -0,0 +1,35 @@
+// SVNDialogPlaintext.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "SVNDialogPlaintext.h"
+#include "afxdialogex.h"
+
+
+// CSVNDialogPlaintext dialog
+
+IMPLEMENT_DYNAMIC(CSVNDialogPlaintext, CDialogEx)
+
+CSVNDialogPlaintext::CSVNDialogPlaintext(CWnd* pParent /*=NULL*/)
+ : CDialogEx(CSVNDialogPlaintext::IDD, pParent)
+ , realm(_T(""))
+{
+
+}
+
+CSVNDialogPlaintext::~CSVNDialogPlaintext()
+{
+}
+
+void CSVNDialogPlaintext::DoDataExchange(CDataExchange* pDX)
+{
+ CDialogEx::DoDataExchange(pDX);
+ DDX_Text(pDX, IDC_EDIT1, realm);
+}
+
+
+BEGIN_MESSAGE_MAP(CSVNDialogPlaintext, CDialogEx)
+END_MESSAGE_MAP()
+
+
+// CSVNDialogPlaintext message handlers
Added: trunk/GME/Gme/SVNDialogPlaintext.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/GME/Gme/SVNDialogPlaintext.h Thu Oct 24 15:37:08 2013 (r2392)
@@ -0,0 +1,23 @@
+#pragma once
+
+
+// CSVNDialogPlaintext dialog
+
+class CSVNDialogPlaintext : public CDialogEx
+{
+ DECLARE_DYNAMIC(CSVNDialogPlaintext)
+
+public:
+ CSVNDialogPlaintext(CWnd* pParent = NULL); // standard constructor
+ virtual ~CSVNDialogPlaintext();
+
+// Dialog Data
+ enum { IDD = IDD_DIALOG_SVNPLAINTEXT };
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+
+ DECLARE_MESSAGE_MAP()
+public:
+ CString realm;
+};
Added: trunk/GME/Gme/SVNDialogSSLServerTrust.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/GME/Gme/SVNDialogSSLServerTrust.cpp Thu Oct 24 15:37:08 2013 (r2392)
@@ -0,0 +1,55 @@
+// SVNDialogSSLServerTrust.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "SVNDialogSSLServerTrust.h"
+#include "afxdialogex.h"
+
+
+// CSVNDialogSSLServerTrust dialog
+
+IMPLEMENT_DYNAMIC(CSVNDialogSSLServerTrust, CDialogEx)
+
+CSVNDialogSSLServerTrust::CSVNDialogSSLServerTrust(CWnd* pParent /*=NULL*/)
+ : CDialogEx(CSVNDialogSSLServerTrust::IDD, pParent)
+ , host(_T(""))
+ , fingerprint(_T(""))
+ , issuer(_T(""))
+ , problems(_T(""))
+ , permanent(FALSE)
+ , permanentEnabled(TRUE)
+{
+
+}
+
+CSVNDialogSSLServerTrust::~CSVNDialogSSLServerTrust()
+{
+}
+
+void CSVNDialogSSLServerTrust::DoDataExchange(CDataExchange* pDX)
+{
+ CDialogEx::DoDataExchange(pDX);
+ DDX_Text(pDX, IDC_EDIT_HOST, host);
+ DDX_Text(pDX, IDC_EDIT_FINGERPRINT, fingerprint);
+ DDX_Text(pDX, IDC_EDIT_ISSUER, issuer);
+ DDX_Text(pDX, IDC_EDIT_PROBLEMS, problems);
+ DDX_Check(pDX, IDC_CHECK_PERMANENT, permanent);
+}
+
+
+BEGIN_MESSAGE_MAP(CSVNDialogSSLServerTrust, CDialogEx)
+END_MESSAGE_MAP()
+
+
+// CSVNDialogSSLServerTrust message handlers
+
+
+BOOL CSVNDialogSSLServerTrust::OnInitDialog()
+{
+ CDialogEx::OnInitDialog();
+
+ GetDlgItem(IDC_CHECK_PERMANENT)->EnableWindow(permanentEnabled);
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
Added: trunk/GME/Gme/SVNDialogSSLServerTrust.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/GME/Gme/SVNDialogSSLServerTrust.h Thu Oct 24 15:37:08 2013 (r2392)
@@ -0,0 +1,29 @@
+#pragma once
+
+
+// CSVNDialogSSLServerTrust dialog
+
+class CSVNDialogSSLServerTrust : public CDialogEx
+{
+ DECLARE_DYNAMIC(CSVNDialogSSLServerTrust)
+
+public:
+ CSVNDialogSSLServerTrust(CWnd* pParent = NULL); // standard constructor
+ virtual ~CSVNDialogSSLServerTrust();
+
+// Dialog Data
+ enum { IDD = IDD_DIALOG_SVNSSLSERVERTRUST };
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+
+ DECLARE_MESSAGE_MAP()
+public:
+ CString host;
+ CString fingerprint;
+ CString issuer;
+ CString problems;
+ BOOL permanent;
+ virtual BOOL OnInitDialog();
+ BOOL permanentEnabled;
+};
Modified: trunk/GME/Gme/resource.h
==============================================================================
--- trunk/GME/Gme/resource.h Thu Oct 24 15:36:06 2013 (r2391)
+++ trunk/GME/Gme/resource.h Thu Oct 24 15:37:08 2013 (r2392)
@@ -99,6 +99,13 @@
#define IDB_WINS_TOOLBAR24 222
#define IDB_MODELING_TOOLBAR24 223
#define IDB_MAIN_TOOLBAR24 224
+#define IDD_DIALOG_SVNCOMMIT 225
+#define IDD_DIALOG_SVNPLAINTEXT 226
+#define IDD_DIALOG_SVNSSLSERVERTRUST 227
+#define IDD_DIALOG_SVNLOGIN 228
+#define IDD_PRINT_DIALOG 229
+#define IDD_PRINTSETUP_DIALOG 230
+#define IDD_PARADIGMPROPERTIES_DIALOG 231
#define IDC_NAME 1000
#define IDC_TYPENAME 1001
#define IDC_KINDNAME 1002
@@ -201,9 +208,18 @@
#define IDC_LIST1 1124
#define IDC_EMERGENCY_INFO_STATIC 1125
#define IDC_MINIDUMP_INFO_STATIC 1126
-#define IDD_PRINT_DIALOG 1538
-#define IDD_PRINTSETUP_DIALOG 1539
-#define IDD_PARADIGMPROPERTIES_DIALOG 1540
+#define IDC_EDIT_SVNCOMMIT_FILENAME 1127
+#define IDC_EDIT_SVNCOMMIT_REPO 1128
+#define IDC_EDIT_SVNCOMMIT_REVISION 1129
+#define IDC_EDIT_FINGERPRINT 1130
+#define IDC_EDIT_SVNCOMMIT_LOG 1131
+#define IDC_EDIT_ISSUER 1132
+#define IDC_EDIT_PROBLEMS 1133
+#define IDC_CHECK_PERMANENT 1134
+#define IDC_EDIT_REALM 1135
+#define IDC_EDIT_USERNAME 1136
+#define IDC_EDIT_PASSWORD 1137
+#define IDC_EDIT_HOST 1138
#define ID_USER_TOOL1 6150
#define ID_USER_TOOL2 6151
#define ID_USER_TOOL3 6152
@@ -523,9 +539,9 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 225
+#define _APS_NEXT_RESOURCE_VALUE 232
#define _APS_NEXT_COMMAND_VALUE 33272
-#define _APS_NEXT_CONTROL_VALUE 1132
+#define _APS_NEXT_CONTROL_VALUE 1139
#define _APS_NEXT_SYMED_VALUE 119
#endif
#endif
More information about the gme-commit
mailing list