by
Changes to 5 files · Browse files at 6d1f7432424c Showing diff from parent b2245f94a8fd 0fe7f965f9e3 Diff from another changeset...
@@ -8,6 +8,7 @@ #include "ShellExt.h"
#include "RegistryConfig.h"
#include "TortoiseIconBitmap.h"
+#include "ThgVersion.h"
#include <map>
@@ -107,7 +108,7 @@ /* Add new items here */
// template
- {"", L"", L"", ".ico", 0},
+ //{"", L"", L"", ".ico", 0},
};
const char* const RepoNoFilesMenu =
@@ -196,7 +197,10 @@ MenuDescription md = menuDescList[i];
if (md.name.size() == 0)
+ {
+ TDEBUG_TRACE("**** InitMenuMaps: ignoring entry with empty name");
break;
+ }
TDEBUG_TRACE("InitMenuMaps: adding " << md.name);
@@ -226,7 +230,6 @@
if (SysInfo::Instance().IsVistaOrLater())
{
- TDEBUG_TRACE(" InsertMenuItemWithIcon1: Vista or later detected, using modern context menu style");
HBITMAP hBmp = GetTortoiseIconBitmap(iconName);
if (hBmp)
{
@@ -276,7 +279,6 @@
if (SysInfo::Instance().IsVistaOrLater())
{
- TDEBUG_TRACE(" InsertMenuItemWithIcon1: Vista or later detected, using modern context menu style");
HBITMAP hBmp = GetTortoiseIconBitmap(iconName);
if (hBmp)
{
@@ -870,6 +872,12 @@ TCHAR name[MAX_PATH+1];
TDEBUG_TRACE("CShellExtCMenu::Initialize");
+
+ TDEBUG_TRACEW(
+ L"---- TortoiseHg shell extension version "
+ << ThgVersion::get() << L"----"
+ );
+
TDEBUG_TRACE(" pIDFolder: " << pIDFolder);
TDEBUG_TRACE(" pDataObj: " << pDataObj);
|
@@ -21,7 +21,8 @@ Dirstatecache.obj \
DirectoryStatus.obj \
Thgstatus.obj \
- QueryDirstate.obj
+ QueryDirstate.obj \
+ ThgVersion.obj
OBJECTS_TERMINATE = Thgstatus.obj \
RegistryConfig.obj \
@@ -48,9 +49,11 @@clean:
del *.obj *.dll *.exe *.lib *.exp *.manifest *.res parentid.h ThgCLSIDs.wxi
-$(THGSHELL_TARGET): $(OBJECTS_THGSGELL)
+ThgVersion:
+ create-parentid-h.cmd
+
+$(THGSHELL_TARGET): ThgVersion $(OBJECTS_THGSGELL)
cl /EP ThgCLSIDs-template.wxi > ThgCLSIDs.wxi
- create-parentid-h.cmd
rc /dTHG_SHELL_FNAME="$@" $(THG_EXTRA_RCFLAGS) shellext.rc
link /OUT:$@ $(LDFLAGS_THGSHELL) $** shellext.res
mt -nologo -manifest $@.manifest -outputresource:"$@;#2"
|
|
@@ -0,0 +1,12 @@ + #include "ThgVersion.h"
+#include "parentid.h"
+
+#define TOSTR(x) L ## #x
+#define TOSTR2(x) TOSTR(x)
+
+#define THG_PARENT_ID_STRING TOSTR2(THG_PARENT_ID)
+
+std::wstring ThgVersion::get()
+{
+ return THG_PARENT_ID_STRING;
+}
|
|
@@ -0,0 +1,12 @@ + #ifndef _THGVERSION_H
+#define _THGVERSION_H
+
+#include <string>
+
+class ThgVersion
+{
+public:
+ static std::wstring get();
+};
+
+#endif
|
@@ -23,18 +23,26 @@ #ifdef THG_DEBUG
#include <sstream>
+ #ifdef _M_X64
+ #define THG_PREFIX "[THGx64] "
+ #define THG_PREFIXL L"[THGx64] "
+ #else
+ #define THG_PREFIX "[THGx86] "
+ #define THG_PREFIXL L"[THGx86] "
+ #endif
+
// TDEBUG_TRACE() prints debugging messages to Windows' debugger display.
// The messages can be viewed with Sysinternals DebugView, which may be
// downloaded from Microsoft TechNet.
#define TDEBUG_TRACE(s) if (ThgDebug::enabled()) { \
std::stringstream _the_msg; \
- _the_msg << "[THG] " << s; \
+ _the_msg << THG_PREFIX << s; \
std::string _the_str = _the_msg.str(); \
OutputDebugStringA(_the_str.c_str()); \
}
#define TDEBUG_TRACEW(s) if (ThgDebug::enabled()) { \
std::basic_stringstream<wchar_t> _the_msg; \
- _the_msg << L"[THG] " << s; \
+ _the_msg << THG_PREFIXL << s; \
std::wstring _the_str = _the_msg.str(); \
OutputDebugStringW(_the_str.c_str()); \
}
|
Loading...