Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.3, 2.0, and 2.0.1

stable Merge with hgtk

Changeset b36b6e880807

Parents 11d189320589

Parents 3ee430ad8ca3

by Steve Borho

Changes to 5 files · Browse files at b36b6e880807 Showing diff from parent 11d189320589 3ee430ad8ca3 Diff from another changeset...

Change 1 of 1 Show Entire File .hgtags Stacked
 
45
46
47
 
48
49
50
 
45
46
47
48
49
50
51
@@ -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
196
197
198
 
199
200
 
201
202
 
203
204
205
 
195
196
197
 
198
199
 
200
201
 
202
203
204
205
@@ -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
197
198
199
 
200
201
202
 
205
206
207
208
 
209
210
211
 
396
397
398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
400
401
 
440
441
442
443
 
444
445
446
447
448
449
450
 
451
452
453
 
546
547
548
549
550
551
552
553
 
554
555
556
557
558
559
560
561
562
563
 
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
 
583
584
585
 
196
197
198
 
199
200
201
202
 
205
206
207
 
208
209
210
211
 
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
 
454
455
456
 
457
458
459
460
461
462
463
 
464
465
466
467
 
560
561
562
 
 
 
 
 
563
564
 
 
 
 
 
 
565
566
567
 
572
573
574
 
 
 
 
 
 
 
 
 
 
 
 
575
576
577
578
@@ -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
15
16
 
17
18
19
 
14
15
16
17
18
19
20
@@ -14,6 +14,7 @@
  std::string myFolder;     void RunDialog(const std::string&); + void TweakMenuForVista(HMENU menu);    public:   explicit CShellExtCMenu(char dummy);
 
55
56
57
58
 
59
60
61
 
55
56
57
 
58
59
60
61
@@ -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)