by
Changes to 9 files · Browse files at 602d012a678e Showing diff from parent 9ba2ff2d944a 9592a5ea3c41 Diff from another changeset...
@@ -628,6 +628,7 @@ self.commitButtonEnable.emit(True)
self.repo.decrementBusyCount()
if ret == 0:
+ self.branchop = None
umsg = self.msgte.text()
if umsg:
self.addMessageToHistory(umsg)
|
@@ -626,6 +626,9 @@ olddata = ctx.p1()[wfile].data()
if '\0' in olddata:
self.error = 'binary file'
+ elif len(olddata) > ctx._repo.maxdiff:
+ p = _('File or diffs not displayed: ')
+ self.error = p + _('File is larger than the specified max size.\n')
else:
self.contents = hglib.tounicode(olddata)
self.flabel += _(' <i>(was deleted)</i>')
|
@@ -226,8 +226,7 @@ def stopClicked(self):
if self.thread and self.thread.isRunning():
self.thread.cancel()
- if self.thread.wait( 2000 ):
- self.thread = None
+ self.thread.wait(2000)
def keyPressEvent(self, event):
if event.key() == Qt.Key_Escape:
@@ -458,7 +457,12 @@ count += 1
if not matchfn(wfile):
continue
- data = ctx[wfile].data() # load file data
+ try:
+ data = ctx[wfile].data() # load file data
+ except EnvironmentError:
+ self.showMessage.emit(_('Skipping %s, unable to read') %
+ hglib.tounicode(wfile))
+ continue
if util.binary(data):
continue
for i, line in enumerate(data.splitlines()):
|
@@ -41,8 +41,7 @@ settings = opts['settings']
slist = settings.value('settings/'+opts['cpath']).toStringList()
self.previous = [s for s in slist if s]
- self.setFixedWidth(ENTRY_WIDTH)
-
+ self.setMinimumWidth(ENTRY_WIDTH)
def resetList(self):
self.clear()
ucur = hglib.tounicode(self.curvalue)
@@ -109,10 +108,8 @@ self.opts = opts
self.curvalue = None
self.setEchoMode(QLineEdit.Password)
- self.setFixedWidth(ENTRY_WIDTH)
-
+ self.setMinimumWidth(ENTRY_WIDTH)
## common APIs for all edit widgets
-
def setValue(self, curvalue):
self.curvalue = curvalue
if curvalue:
@@ -136,8 +133,7 @@ cpath = self.opts['cpath']
assert cpath.startswith('tortoisehg.')
self.fname = cpath[11:]
- self.setFixedWidth(ENTRY_WIDTH)
-
+ self.setMinimumWidth(ENTRY_WIDTH)
def on_clicked(self, checked):
def newFont(font):
self.setText(font.toString())
|
@@ -151,9 +151,11 @@ notify = func(parent, hu, repo, files)
o, e = hu.getdata()
if e:
- QMessageBox.warning(parent, name + _(' errors'), str(e))
+ QMessageBox.warning(parent, name + _(' errors'),
+ hglib.tounicode(str(e)))
elif o:
- QMessageBox.information(parent, name + _(' output'), str(o))
+ QMessageBox.information(parent, name + _(' output'),
+ hglib.tounicode(str(o)))
elif notify:
wfiles = [repo.wjoin(x) for x in files]
shlib.shell_notify(wfiles)
|
|
@@ -17,7 +17,7 @@ // According to http://msdn.microsoft.com/en-us/library/bb776094%28VS.85%29.aspx
// the help texts for the commands should be reasonably short (under 40 characters)
-static MenuDescription CMenuMenuDescList[] =
+static const MenuDescription CMenuMenuDescList[] =
{
{"commit", L"Commit...",
L"Commit changes in repository",
@@ -122,15 +122,10 @@;
-typedef std::map<UINT, MenuDescription> MenuIdCmdMap;
-
-static MenuDescriptionMap CMenuMenuDescMap;
-static MenuIdCmdMap MenuIdMap;
-
-void AddMenuList(UINT idCmd, const std::string& name, MenuDescriptionMap& menuDescMap)
+void CShellExtCMenu::AddMenuList(UINT idCmd, const std::string& name)
{
TDEBUG_TRACE("AddMenuList: idCmd = " << idCmd << " name = " << name);
- MenuIdMap[idCmd] = menuDescMap[name];
+ myMenuIdMap[idCmd] = myDescMap[name];
}
@@ -169,15 +164,9 @@ RegCloseKey(hkey);
}
-MenuDescriptionMap& CShellExtCMenu::GetMenuDescriptionMap()
+void CShellExtCMenu::InitMenuMaps(const MenuDescription *menuDescs, std::size_t sz)
{
- return CMenuMenuDescMap;
-}
-
-void CShellExtCMenu::InitMenuMaps(MenuDescription *menuDescs, std::size_t sz)
-{
- MenuDescriptionMap& menuDescMap = GetMenuDescriptionMap();
- if (menuDescMap.empty())
+ if (myDescMap.empty())
{
std::string lang;
GetRegistryConfig("CMenuLang", lang);
@@ -198,12 +187,12 @@ if (!lang.empty())
GetCMenuTranslation(lang, md.name, md.menuText, md.helpText);
- menuDescMap[md.name] = md;
+ myDescMap[md.name] = md;
}
}
- MenuIdMap.clear();
+ myMenuIdMap.clear();
}
@@ -309,11 +298,8 @@ HMENU hMenu, const std::string& name, UINT indexMenu,
UINT idCmd, UINT idCmdFirst, const std::wstring& prefix)
{
-
- MenuDescriptionMap& menuDescMap = GetMenuDescriptionMap();
-
- MenuDescriptionMap::iterator iter = menuDescMap.find(name);
- if (iter == menuDescMap.end())
+ MenuDescriptionMap::iterator iter = myDescMap.find(name);
+ if (iter == myDescMap.end())
{
TDEBUG_TRACE("***** InsertMenuItemByName: can't find menu info for " << name);
return;
@@ -321,7 +307,7 @@
MenuDescription md = iter->second;
- AddMenuList(idCmd - idCmdFirst, name, menuDescMap);
+ AddMenuList(idCmd - idCmdFirst, name);
InsertMenuItemWithIcon1(
hMenu, indexMenu, idCmd, prefix + md.menuText, md.iconName);
}
@@ -583,8 +569,8 @@ {
UINT idCmd = LOWORD(lpcmi->lpVerb);
TDEBUG_TRACE("CShellExtCMenu::InvokeCommand: idCmd = " << idCmd);
- MenuIdCmdMap::iterator iter = MenuIdMap.find(idCmd);
- if (iter != MenuIdMap.end())
+ MenuIdCmdMap::iterator iter = myMenuIdMap.find(idCmd);
+ if (iter != myMenuIdMap.end())
{
RunDialog(iter->second.name);
hr = S_OK;
@@ -636,8 +622,8 @@ << ", cchMax = " << cchMax
);
- MenuIdCmdMap::iterator iter = MenuIdMap.find(static_cast<UINT>(idCmd));
- if (iter == MenuIdMap.end())
+ MenuIdCmdMap::iterator iter = myMenuIdMap.find(static_cast<UINT>(idCmd));
+ if (iter == myMenuIdMap.end())
{
TDEBUG_TRACE("***** CShellExtCMenu::GetCommandString: idCmd not found");
}
|
@@ -16,6 +16,9 @@
typedef std::map<std::string, MenuDescription> MenuDescriptionMap;
+typedef std::map<UINT, MenuDescription> MenuIdCmdMap;
+
+
class CShellExtCMenu: public IContextMenu3, IShellExtInit
{
@@ -23,16 +26,18 @@ ULONG m_cRef;
std::vector<std::string> myFiles;
std::string myFolder;
+ MenuDescriptionMap myDescMap;
+ MenuIdCmdMap myMenuIdMap;
virtual void RunDialog(const std::string&);
- virtual MenuDescriptionMap& GetMenuDescriptionMap();
void TweakMenuForVista(HMENU menu);
void PrintDebugHeader(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj);
- void InitMenuMaps(MenuDescription *menuDescs, std::size_t sz);
+ void InitMenuMaps(const MenuDescription *menuDescs, std::size_t sz);
void InsertMenuItemByName(
HMENU hMenu, const std::string& name, UINT indexMenu,
UINT idCmd, UINT idCmdFirst, const std::wstring& prefix);
+ void AddMenuList(UINT idCmd, const std::string& name);
public:
explicit CShellExtCMenu(const char dummy);
|
@@ -7,7 +7,7 @@ // According to http://msdn.microsoft.com/en-us/library/bb776094%28VS.85%29.aspx
// the help texts for the commands should be reasonably short (under 40 characters)
-static MenuDescription CDndMenuDescList[] =
+static const MenuDescription CDndMenuDescList[] =
{
{"drag_move", L"Hg Move versioned item(s) here",
L"", "hg.ico", 0},
@@ -24,12 +24,6 @@ "drag_move drag_copy"
;
-static MenuDescriptionMap CDndMenuDescMap;
-
-MenuDescriptionMap& CShellExtDnd::GetMenuDescriptionMap()
-{
- return CDndMenuDescMap;
-}
#define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i)))
|
@@ -10,7 +10,6 @@
protected:
virtual void RunDialog(const std::string&);
- virtual MenuDescriptionMap& GetMenuDescriptionMap();
public:
explicit CShellExtDnd(const char dummy);
|
Loading...