Changeset 9683dff013bb…
Parent 875fe9a6a44d…
by
Changes to 9 files · Browse files at 9683dff013bb Showing diff from parent 875fe9a6a44d Diff from another changeset...
@@ -16,6 +16,7 @@ #include "stdafx.h"
#include "RegistryConfig.h"
+#include "TortoiseUtils.h"
int GetRegistryConfig(const CString& strName, CString& strRes)
{
@@ -33,3 +34,30 @@ ::RegCloseKey(hKey);
return lRes == ERROR_SUCCESS;
}
+
+void GetCMenuTranslation(const CString& strLang, LPCTSTR lpszName,
+ CStringW& strMenuText, CStringW& strHelpText)
+{
+ CStringW strSubKey = L"Software\\TortoiseHg\\CMenu\\";
+ strSubKey += strLang;
+ strSubKey += L"\\";
+ strSubKey += lpszName;
+
+ ATLTRACE(L"GetCMenuTranslation: '%s'\n", (LPCWSTR)strSubKey);
+
+ HKEY hKey = 0;
+ LONG lRes = ::RegOpenKeyExW(HKEY_CURRENT_USER, strSubKey, 0, KEY_READ, &hKey);
+
+ if (lRes == ERROR_SUCCESS && hKey)
+ {
+ GetRegSZValueW(hKey, L"menuText", strMenuText);
+ GetRegSZValueW(hKey, L"helpText", strHelpText);
+ }
+ else
+ {
+ ATLTRACE(L"GetCMenuTranslation: RegOpenKeyExW('%s') failed\n",
+ (LPCWSTR)strSubKey);
+ }
+
+ if (hKey) ::RegCloseKey(hKey);
+}
|
@@ -16,3 +16,5 @@ #pragma once
int GetRegistryConfig(const CString& strName, CString& strRes);
+void GetCMenuTranslation(const CString& strLang, LPCTSTR lpszName,
+ CStringW& strMenuText, CStringW& strHelpText);
|
@@ -20,6 +20,7 @@ #include "StringUtils.h"
#include "THgStatus.h"
#include "Kiln.h"
+#include "KeyboardHelpDialog.h"
void RunDialog(HWND hWnd, const CString& strCmd, const CAtlList<CString>& listFiles,
const CString& strFolder)
@@ -79,6 +80,11 @@ }
return;
}
+ else if (strCmd == "keyboard")
+ {
+ CKeyboardHelpDialog dlg;
+ dlg.DoModal(hWnd);
+ }
else if (strCmd == "kiln")
{
KilnOpenRepo(hWnd, strCwd);
|
@@ -57,6 +57,41 @@
#endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_KEYBOARDHELP DIALOGEX 0, 0, 243, 167
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Keyboard Help"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,97,146,50,14
+ LTEXT "The following shortcut keys are available when using TortoiseHg from Windows Explorer.",IDC_TOPTEXT,7,7,229,16
+ LISTBOX IDC_KEYLIST,7,34,229,101,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_KEYBOARDHELP, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 236
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 160
+ END
+END
+#endif // APSTUDIO_INVOKED
+
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
|
@@ -206,6 +206,7 @@ <ClCompile Include="Dirstate.cpp" />
<ClCompile Include="DirstateCache.cpp" />
<ClCompile Include="IconBitmapUtils.cpp" />
+ <ClCompile Include="KeyboardHelpDialog.cpp" />
<ClCompile Include="Kiln.cpp" />
<ClCompile Include="QueryDirstate.cpp" />
<ClCompile Include="RegistryConfig.cpp" />
@@ -236,6 +237,7 @@ <ClInclude Include="Dirstate.h" />
<ClInclude Include="DirstateCache.h" />
<ClInclude Include="IconBitmapUtils.h" />
+ <ClInclude Include="KeyboardHelpDialog.h" />
<ClInclude Include="Kiln.h" />
<ClInclude Include="QueryDirstate.h" />
<ClInclude Include="RegistryConfig.h" />
|
@@ -84,6 +84,9 @@ <ClCompile Include="RunDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="KeyboardHelpDialog.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Directory.h">
@@ -155,6 +158,9 @@ <ClInclude Include="RunDialog.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="KeyboardHelpDialog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="THgShell.def">
|
|
@@ -116,6 +116,9 @@ { "kilnfiles", L"Kiln",
L"Opens the selected files in Kiln.",
"kiln.ico", 0 },
+ { "keyboard", L"Keyboard Help",
+ L"Displays a list of keyboard shortcuts.",
+ "", 0 },
// Add new items here.
// Template:
@@ -156,6 +159,7 @@ "repoconf",
"userconf",
NULL,
+ "keyboard",
"about",
};
@@ -176,6 +180,7 @@ NULL,
"kilnfiles",
NULL,
+ "keyboard",
"about",
};
@@ -189,6 +194,7 @@ NULL,
"workbench",
NULL,
+ "keyboard",
"about",
};
@@ -200,33 +206,6 @@ m_mapMenuId[idCmd] = m_mapMenuDesc[strName];
}
-void GetCMenuTranslation(const CString& strLang, LPCTSTR lpszName,
- CStringW& strMenuText, CStringW& strHelpText)
-{
- CStringW strSubKey = L"Software\\TortoiseHg\\CMenu\\";
- strSubKey += strLang;
- strSubKey += L"\\";
- strSubKey += lpszName;
-
- ATLTRACE(L"GetCMenuTranslation: '%s'\n", (LPCWSTR)strSubKey);
-
- HKEY hKey = 0;
- LONG lRes = ::RegOpenKeyExW(HKEY_CURRENT_USER, strSubKey, 0, KEY_READ, &hKey);
-
- if (lRes == ERROR_SUCCESS && hKey)
- {
- GetRegSZValueW(hKey, L"menuText", strMenuText);
- GetRegSZValueW(hKey, L"helpText", strHelpText);
- }
- else
- {
- ATLTRACE(L"GetCMenuTranslation: RegOpenKeyExW('%s') failed\n",
- (LPCWSTR)strSubKey);
- }
-
- if (hKey) ::RegCloseKey(hKey);
-}
-
void CTortoiseHgCmenuBase::InitMenuMaps(const CMenuDescription *pMenuDescs, int nCount)
{
if (m_mapMenuDesc.IsEmpty())
@@ -272,33 +251,36 @@ mii.cch = strMenuText.GetLength();
mii.wID = idCmd;
- if (CSysInfo::IsVistaOrLater())
+ if (!strIconName.IsEmpty())
{
- HBITMAP hBitmap = GetTortoiseIconBitmap(strIconName);
- if (hBitmap)
+ if (CSysInfo::IsVistaOrLater())
{
- mii.fMask |= MIIM_BITMAP;
- mii.hbmpItem = hBitmap;
+ HBITMAP hBitmap = GetTortoiseIconBitmap(strIconName);
+ if (hBitmap)
+ {
+ mii.fMask |= MIIM_BITMAP;
+ mii.hbmpItem = hBitmap;
+ }
+ else
+ {
+ ATLTRACE(" ***** InsertMenuItemWithIcon1: can't find '%s'\n",
+ (LPCTSTR)strIconName);
+ }
}
else
{
- ATLTRACE(" ***** InsertMenuItemWithIcon1: can't find '%s'\n",
- (LPCTSTR)strIconName);
- }
- }
- else
- {
- HICON hIcon = GetTortoiseIcon(strIconName);
- if (hIcon)
- {
- mii.fMask |= MIIM_BITMAP | MIIM_DATA;
- mii.dwItemData = (ULONG_PTR)hIcon;
- mii.hbmpItem = HBMMENU_CALLBACK;
- }
- else
- {
- ATLTRACE(" ***** InsertMenuItemWithIcon1: can't find '%s'\n",
- (LPCTSTR)strIconName);
+ HICON hIcon = GetTortoiseIcon(strIconName);
+ if (hIcon)
+ {
+ mii.fMask |= MIIM_BITMAP | MIIM_DATA;
+ mii.dwItemData = (ULONG_PTR)hIcon;
+ mii.hbmpItem = HBMMENU_CALLBACK;
+ }
+ else
+ {
+ ATLTRACE(" ***** InsertMenuItemWithIcon1: can't find '%s'\n",
+ (LPCTSTR)strIconName);
+ }
}
}
::InsertMenuItemW(hMenu, indexMenu, TRUE, &mii);
|
@@ -9,14 +9,17 @@ #define IDR_MODIFIED 105
#define IDR_UNVERSIONED 106
#define IDR_KEYBOARD 107
+#define IDD_KEYBOARDHELP 108
+#define IDC_KEYLIST 1000
+#define IDC_TOPTEXT 1001
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 108
+#define _APS_NEXT_RESOURCE_VALUE 109
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_CONTROL_VALUE 1002
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|
@@ -24,7 +24,7 @@ #include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
+#include <atlwin.h>
#include <atlstr.h>
#include <atlcoll.h>
-#include <atlutil.h>
#include <shlobj.h>
|
Loading...