by
Changes to 5 files · Browse files at b36b6e880807 Showing diff from parent 11d189320589 3ee430ad8ca3 Diff from another changeset...
@@ -45,6 +45,7 @@ d5840485b34265572ffb4d5bb1226b1577163115 1.1.7
edc8ec8b18a98abada33fb312e2c5cfb8e336eb4 1.1.8
065d9654030e19ba2c92a9c3616f37d2ab427caa 1.1.9
+031e24094f5337ffdb4eee32f54773ecd5a1adc1 1.1.9.1
653ff9fb4ccf16833bab58fbc765ff8829dc1265 1.9
6f97499d3d53aaf4cc1ec3c626191b13eb3aed58 1.9.1
dc23fbf831944fdf894cade250161131c11c9ce4 1.9.2
|
@@ -195,11 +195,11 @@ if len(parts) == 7:
file, line, level, errno, lib, func, reason = parts
if func == 'SSL3_GET_SERVER_CERTIFICATE':
- err = local._('SSL: Server certificate verify failed')
+ err = _('SSL: Server certificate verify failed')
elif errno == '00000000':
- err = local._('SSL: unknown error %s:%s') % (file, line)
+ err = _('SSL: unknown error %s:%s') % (file, line)
else:
- err = local._('SSL error: %s') % reason
+ err = _('SSL error: %s') % reason
self.ui.write_err(err + '\n')
except (Exception, OSError, IOError), e:
self.ui.write_err(str(e) + '\n')
|
@@ -196,7 +196,7 @@ {
MenuDescription md = menuDescList[i];
- if (md.name.size() == 0)
+ if (md.name.empty())
{
TDEBUG_TRACE("**** InitMenuMaps: ignoring entry with empty name");
break;
@@ -205,7 +205,7 @@ TDEBUG_TRACE("InitMenuMaps: adding " << md.name);
// Look for translation of menu and help text
- if (lang.size())
+ if (!lang.empty())
GetCMenuTranslation(lang, md.name, md.menuText, md.helpText);
MenuDescMap[md.name] = md;
@@ -396,6 +396,20 @@ return 0;
}
+void
+CShellExtCMenu::TweakMenuForVista(HMENU hMenu)
+{
+ if (!SysInfo::Instance().IsVistaOrLater())
+ return;
+
+ MENUINFO MenuInfo = {};
+ MenuInfo.cbSize = sizeof(MenuInfo);
+ MenuInfo.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS;
+ MenuInfo.dwStyle = MNS_CHECKORBMP;
+
+ SetMenuInfo(hMenu, &MenuInfo);
+}
+
#define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i)))
// IContextMenu
@@ -440,14 +454,14 @@ Tokenize(promoted_string, promoted, ",");
// Select menu to show
- bool fileMenu = myFiles.size() > 0;
+ bool fileMenu = !myFiles.empty();
bool isHgrepo = false;
std::string cwd;
if (!myFolder.empty())
{
cwd = myFolder;
}
- else if (!myFiles.empty())
+ else if (fileMenu)
{
cwd = IsDirectory(myFiles[0])? myFiles[0] : DirName(myFiles[0]);
}
@@ -546,18 +560,8 @@ if (isSeparator && indexSubMenu > 0)
RemoveMenu(hSubMenu, indexSubMenu - 1, MF_BYPOSITION);
- if (SysInfo::Instance().IsVistaOrLater())
- {
- MENUINFO MenuInfo;
-
- memset(&MenuInfo, 0, sizeof(MenuInfo));
+ TweakMenuForVista(hSubMenu);
- MenuInfo.cbSize = sizeof(MenuInfo);
- MenuInfo.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS;
- MenuInfo.dwStyle = MNS_CHECKORBMP;
-
- SetMenuInfo(hSubMenu, &MenuInfo);
- }
}
TDEBUG_TRACE(" CShellExtCMenu::QueryContextMenu: adding main THG menu");
@@ -568,18 +572,7 @@
InitStatus::check();
- if (SysInfo::Instance().IsVistaOrLater())
- {
- MENUINFO MenuInfo;
-
- memset(&MenuInfo, 0, sizeof(MenuInfo));
-
- MenuInfo.cbSize = sizeof(MenuInfo);
- MenuInfo.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS;
- MenuInfo.dwStyle = MNS_CHECKORBMP;
-
- SetMenuInfo(hMenu, &MenuInfo);
- }
+ TweakMenuForVista(hMenu);
return ResultFromShort(idCmd - idCmdFirst);
}
|
@@ -14,6 +14,7 @@ std::string myFolder;
void RunDialog(const std::string&);
+ void TweakMenuForVista(HMENU menu);
public:
explicit CShellExtCMenu(char dummy);
|
@@ -55,7 +55,7 @@ $(THGSHELL_TARGET): ThgVersion $(OBJECTS_THGSGELL)
cl /EP ThgCLSIDs-template.wxi > ThgCLSIDs.wxi
rc /dTHG_SHELL_FNAME="$@" $(THG_EXTRA_RCFLAGS) shellext.rc
- link /OUT:$@ $(LDFLAGS_THGSHELL) $** shellext.res
+ link /OUT:$@ $(LDFLAGS_THGSHELL) $(OBJECTS_THGSGELL) shellext.res
mt -nologo -manifest $@.manifest -outputresource:"$@;#2"
dirstate.exe: dirstate.obj $(OBJECTS_DIRSTATE)
|
Loading...