Commit 4b339cd4 authored by 李智's avatar 李智
Browse files

Using GitProcessBar to show add process!


Signed-off-by: 李智's avatarFrank Li <lznuaa@gmail.com>
parent fec771c9
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -55,6 +55,7 @@ bool AddCommand::Execute()
dlg.m_pathList = pathList;
if (dlg.DoModal() == IDOK)
{
#if 0
CString cmd,out;
int success=0;
for(int i=0;i<dlg.m_pathList.GetCount();i++)
......@@ -70,22 +71,23 @@ bool AddCommand::Execute()
message.Format(_T("%d file added"),success);
CMessageBox::Show(NULL,message,_T("TortoiseGit"),MB_OK);
return TRUE;
#if 0
#endif
if (dlg.m_pathList.GetCount() == 0)
return FALSE;
CSVNProgressDlg progDlg;
CGitProgressDlg progDlg;
theApp.m_pMainWnd = &progDlg;
progDlg.SetCommand(CSVNProgressDlg::SVNProgress_Add);
progDlg.SetCommand(CGitProgressDlg::GitProgress_Add);
if (parser.HasVal(_T("closeonend")))
progDlg.SetAutoClose(parser.GetLongVal(_T("closeonend")));
progDlg.SetPathList(dlg.m_pathList);
ProjectProperties props;
props.ReadPropsPathList(dlg.m_pathList);
progDlg.SetProjectProperties(props);
//ProjectProperties props;
//props.ReadPropsPathList(dlg.m_pathList);
//progDlg.SetProjectProperties(props);
progDlg.SetItemCount(dlg.m_pathList.GetCount());
progDlg.DoModal();
bRet = !progDlg.DidErrorsOccur();
#endif
}
// }
}
......
......@@ -31,11 +31,11 @@ CLogFile::~CLogFile(void)
bool CLogFile::Open()
{
CTSVNPath logfile = CTSVNPath(CPathUtils::GetAppDataDirectory() + _T("\\logfile.txt"));
CTGitPath logfile = CTGitPath(CPathUtils::GetAppDataDirectory() + _T("\\logfile.txt"));
return Open(logfile);
}
bool CLogFile::Open(const CTSVNPath& logfile)
bool CLogFile::Open(const CTGitPath& logfile)
{
m_lines.clear();
m_logfile = logfile;
......
......@@ -37,7 +37,7 @@ public:
/**
* Opens the log file and reads its contents
*/
bool Open(const CTSVNPath& logfile);
bool Open(const CTGitPath& logfile);
/**
* Opens the default log file for TortoiseSVN and reads its contents
*/
......
This diff is collapsed.
......@@ -66,6 +66,11 @@ typedef enum
#define WM_SHOWCONFLICTRESOLVER (WM_APP + 100)
typedef enum
{
git_wc_notify_add,
}git_wc_notify_action_t;
/**
* \ingroup TortoiseProc
* Handles different Subversion commands and shows the notify messages
......@@ -140,14 +145,15 @@ private:
class NotificationData
{
public:
NotificationData() :
NotificationData(){} ;
git_wc_notify_action_t action;
#if 0
action((git_wc_notify_action_t)-1),
kind(git_node_none),
content_state(git_wc_notify_state_inapplicable),
prop_state(git_wc_notify_state_inapplicable),
rev(0),
#endif
color(::GetSysColor(COLOR_WINDOWTEXT)),
bConflictedActionItem(false),
bAuxItem(false)
......@@ -157,6 +163,7 @@ private:
// merge_range.end = 0;
// merge_range.start = 0;
}
#endif
public:
// The text we put into the first column (the Git action for normal items, just text for aux items)
CString sActionColumnText;
......@@ -181,16 +188,18 @@ private:
};
protected:
#if 0 //implement the virtual methods from Git base class
virtual BOOL Notify(const CTGitPath& path, git_wc_notify_action_t action,
//Need update in the future implement the virtual methods from Git base class
virtual BOOL Notify(const CTGitPath& path, git_wc_notify_action_t action
/*
git_node_kind_t kind, const CString& mime_type,
git_wc_notify_state_t content_state,
git_wc_notify_state_t prop_state, LONG rev,
const git_lock_t * lock, git_wc_notify_lock_state_t lock_state,
const CString& changelistname,
git_merge_range_t * range,
git_error_t * err, apr_pool_t * pool);
#endif
git_error_t * err, apr_pool_t * pool*/
);
// virtual git_wc_conflict_choice_t ConflictResolveCallback(const git_wc_conflict_description_t *description, CString& mergedfile);
virtual BOOL OnInitDialog();
virtual BOOL Cancel();
......
......@@ -400,6 +400,14 @@
RelativePath="..\TGitCache\CacheInterface.cpp"
>
</File>
<File
RelativePath=".\LogFile.cpp"
>
</File>
<File
RelativePath=".\LogFile.h"
>
</File>
<File
RelativePath=".\ProjectProperties.cpp"
>
......@@ -578,11 +586,11 @@
>
</File>
<File
RelativePath=".\explorer.ico"
RelativePath="..\Resources\explorer.ico"
>
</File>
<File
RelativePath="..\Resources\explorer.ico"
RelativePath=".\explorer.ico"
>
</File>
<File
......@@ -818,19 +826,19 @@
>
</File>
<File
RelativePath=".\newfolder.ico"
RelativePath="..\Resources\newfolder.ico"
>
</File>
<File
RelativePath="..\Resources\newfolder.ico"
RelativePath=".\newfolder.ico"
>
</File>
<File
RelativePath=".\open.ico"
RelativePath="..\Resources\open.ico"
>
</File>
<File
RelativePath="..\Resources\open.ico"
RelativePath=".\open.ico"
>
</File>
<File
......@@ -934,19 +942,19 @@
>
</File>
<File
RelativePath=".\save.ico"
RelativePath="..\Resources\save.ico"
>
</File>
<File
RelativePath="..\Resources\save.ico"
RelativePath=".\save.ico"
>
</File>
<File
RelativePath=".\saveas.ico"
RelativePath="..\Resources\saveas.ico"
>
</File>
<File
RelativePath="..\Resources\saveas.ico"
RelativePath=".\saveas.ico"
>
</File>
<File
......@@ -1038,11 +1046,11 @@
>
</File>
<File
RelativePath=".\up.ico"
RelativePath="..\Resources\up.ico"
>
</File>
<File
RelativePath="..\Resources\up.ico"
RelativePath=".\up.ico"
>
</File>
<File
......@@ -1773,6 +1781,14 @@
RelativePath=".\StatGraphDlg.h"
>
</File>
<File
RelativePath=".\SVNProgressDlg.cpp"
>
</File>
<File
RelativePath=".\SVNProgressDlg.h"
>
</File>
</Filter>
<Filter
Name="Git"
......
......@@ -18,10 +18,11 @@
//
#include "StdAfx.h"
#include "registry.h"
#include "resource.h"
#include "AppUtils.h"
#include "..\TortoiseProc\resource.h"
#include "..\TortoiseProc\AppUtils.h"
#include "PathUtils.h"
#include ".\soundutils.h"
#include "mmsystem.h"
#pragma comment(lib, "Winmm")
......@@ -33,18 +34,18 @@ CSoundUtils::~CSoundUtils(void)
{
}
void CSoundUtils::RegisterTSVNSounds()
void CSoundUtils::RegisterTGitSounds()
{
// create the event labels
CRegString eventlabelerr = CRegString(_T("AppEvents\\EventLabels\\TSVN_Error\\"));
CRegString eventlabelerr = CRegString(_T("AppEvents\\EventLabels\\TGit_Error\\"));
eventlabelerr = CString(MAKEINTRESOURCE(IDS_ERR_ERROR));
CRegString eventlabelwarn = CRegString(_T("AppEvents\\EventLabels\\TSVN_Warning\\"));
CRegString eventlabelwarn = CRegString(_T("AppEvents\\EventLabels\\TGit_Warning\\"));
eventlabelwarn = CString(MAKEINTRESOURCE(IDS_WARN_WARNING));
CRegString eventlabelnote = CRegString(_T("AppEvents\\EventLabels\\TSVN_Notification\\"));
CRegString eventlabelnote = CRegString(_T("AppEvents\\EventLabels\\TGit_Notification\\"));
eventlabelnote = CString(MAKEINTRESOURCE(IDS_WARN_NOTE));
CRegString appscheme = CRegString(_T("AppEvents\\Schemes\\Apps\\TortoiseProc\\"));
appscheme = _T("TortoiseSVN");
appscheme = _T("TortoiseGit");
CString apppath = CPathUtils::GetAppDirectory();
......@@ -61,39 +62,39 @@ void CSoundUtils::RegisterTSVNSounds()
CString name = schemenames.GetNext(pos);
if ((name.CompareNoCase(_T(".none"))!=0)&&(name.CompareNoCase(_T(".nosound"))!=0))
{
CString errorkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TSVN_Error\\") + name + _T("\\");
CString errorkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TGit_Error\\") + name + _T("\\");
CRegString errorkeyval = CRegString(errorkey);
if (((CString)(errorkeyval)).IsEmpty())
{
errorkeyval = apppath + _T("TortoiseSVN_Error.wav");
errorkeyval = apppath + _T("TortoiseGit_Error.wav");
}
CString warnkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TSVN_Warning\\") + name + _T("\\");
CString warnkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TGit_Warning\\") + name + _T("\\");
CRegString warnkeyval = CRegString(warnkey);
if (((CString)(warnkeyval)).IsEmpty())
{
warnkeyval = apppath + _T("TortoiseSVN_Warning.wav");
warnkeyval = apppath + _T("TortoiseGit_Warning.wav");
}
CString notificationkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TSVN_Notification\\") + name + _T("\\");
CString notificationkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TGit_Notification\\") + name + _T("\\");
CRegString notificationkeyval = CRegString(notificationkey);
if (((CString)(notificationkeyval)).IsEmpty())
{
notificationkeyval = apppath + _T("TortoiseSVN_Notification.wav");
notificationkeyval = apppath + _T("TortoiseGit_Notification.wav");
}
}
}
}
void CSoundUtils::PlayTSVNWarning()
void CSoundUtils::PlayTGitWarning()
{
PlaySound(_T("TSVN_Warning"), NULL, SND_APPLICATION | SND_ASYNC | SND_NODEFAULT);
PlaySound(_T("TGit_Warning"), NULL, SND_APPLICATION | SND_ASYNC | SND_NODEFAULT);
}
void CSoundUtils::PlayTSVNError()
void CSoundUtils::PlayTGitError()
{
PlaySound(_T("TSVN_Error"), NULL, SND_APPLICATION | SND_ASYNC | SND_NODEFAULT);
PlaySound(_T("TGit_Error"), NULL, SND_APPLICATION | SND_ASYNC | SND_NODEFAULT);
}
void CSoundUtils::PlayTSVNNotification()
void CSoundUtils::PlayTGitNotification()
{
PlaySound(_T("TSVN_Notification"), NULL, SND_APPLICATION | SND_ASYNC | SND_NODEFAULT);
PlaySound(_T("TGit_Notification"), NULL, SND_APPLICATION | SND_ASYNC | SND_NODEFAULT);
}
\ No newline at end of file
......@@ -30,11 +30,11 @@ public:
/**
* Registers our own sounds under the available sound schemes
* Users then can customize the TSVN sounds in the sounds panel of Windows.
* Users then can customize the TGit sounds in the sounds panel of Windows.
*/
static void RegisterTSVNSounds();
static void RegisterTGitSounds();
static void PlayTSVNWarning();
static void PlayTSVNError();
static void PlayTSVNNotification();
static void PlayTGitWarning();
static void PlayTGitError();
static void PlayTGitNotification();
};
......@@ -85,13 +85,13 @@
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
Name="Release|Win32"
OutputDirectory="..\..\bin\$(ConfigurationName)\bin"
IntermediateDirectory="..\..\obj\Utils\$(ConfigurationName)\"
ConfigurationType="4"
UseOfMFC="2"
UseOfATL="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -107,19 +107,19 @@
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="../git;../;../ext/scintilla/include;../ext/hunspell;./MiscUi"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2"
WarningLevel="3"
DebugInformationFormat="3"
DisableSpecificWarnings="4996,4018"
/>
<Tool
Name="VCManagedResourceCompilerTool"
......@@ -150,13 +150,13 @@
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="..\..\bin\$(ConfigurationName)\bin"
IntermediateDirectory="..\..\obj\Utils\$(ConfigurationName)\"
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="2"
UseOfATL="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -172,19 +172,19 @@
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
Optimization="0"
AdditionalIncludeDirectories="../git;../;../ext/scintilla/include;../ext/hunspell;./MiscUi"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
DebugInformationFormat="3"
DisableSpecificWarnings="4996,4018"
/>
<Tool
Name="VCManagedResourceCompilerTool"
......@@ -344,6 +344,14 @@
RelativePath=".\RWSection.cpp"
>
</File>
<File
RelativePath=".\SoundUtils.cpp"
>
</File>
<File
RelativePath=".\SoundUtils.h"
>
</File>
<File
RelativePath=".\stdafx.cpp"
>
......@@ -356,7 +364,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
......@@ -364,7 +372,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment