by
Changes to 12 files · Browse files at dccecd4275b3 Showing diff from parent d74af1d325e1 9cd2c612d391 Diff from another changeset...
@@ -214,7 +214,7 @@ _('Open the selected subrepository in a file browser'),
self.explore),
('terminal', _('Open terminal in subrepository'),
- 'utilities-terminal', 'Alt+Ctrl+T',
+ 'utilities-terminal', 'Alt+Ctrl+T',
_('Open a shell terminal in the selected subrepository root'),
self.terminal),
]:
@@ -485,7 +485,7 @@ def setPath(self, path):
"""Change path to show"""
self._treeview.setCurrentIndex(self._treemodel.indexFromPath(path))
-
+
def displayFile(self):
ctx, path = self._treemodel.fileSubrepoCtxFromPath(self.path)
if ctx is None:
@@ -495,7 +495,7 @@ ctx._repo.maxdiff = self._repo.maxdiff
self._fileview.setContext(ctx)
self._fileview.displayFile(path, self.status)
-
+
@pyqtSlot()
def _updatecontent(self):
self.displayFile()
|
@@ -62,7 +62,7 @@ """Return the subrepo context of the specified index"""
path = self.filePath(index)
return self.fileSubrepoCtxFromPath(path)
-
+
def fileSubrepoCtxFromPath(self, path):
"""Return the subrepo context of the specified file"""
if not path:
@@ -313,9 +313,9 @@ srepo = sub._repo
if srev in srepo:
sctx = srepo[srev]
-
+
self._subinfo[toprelpath]['ctx'] = sctx
-
+
# Add the subrepo contents to the tree
e = addrepocontentstotree(e, sctx, toprelpath)
|
@@ -31,7 +31,9 @@ self.setAutoCompletionSource(QsciScintilla.AcsAPIs)
self.setAutoCompletionFillupsEnabled(True)
self.setLexer(QsciLexerMakefile(self))
- self.lexer().setFont(qtlib.getfont('fontcomment').font())
+ font = qtlib.getfont('fontcomment').font()
+ self.fontHeight = QFontMetrics(font).height()
+ self.lexer().setFont(font)
self.lexer().setColor(QColor(Qt.red), QsciLexerMakefile.Error)
self.setMatchedBraceBackgroundColor(Qt.yellow)
self.setIndentationsUseTabs(False)
@@ -48,6 +50,7 @@ self.setContextMenuPolicy(Qt.CustomContextMenu)
self.customContextMenuRequested.connect(self.menuRequested)
+
def menuRequested(self, point):
line = self.lineAt(point)
point = self.viewport().mapToGlobal(point)
@@ -143,3 +146,12 @@ super(MessageEntry, self).keyPressEvent(newev)
else:
super(MessageEntry, self).keyPressEvent(event)
+
+ def resizeEvent(self, event):
+ super(MessageEntry, self).resizeEvent(event)
+ self.showHScrollBar(self.frameGeometry().height() > self.fontHeight * 3)
+
+ def minimumSizeHint(self):
+ size = super(MessageEntry, self).minimumSizeHint()
+ size.setHeight(self.fontHeight * 3 / 2)
+ return size
|
@@ -305,6 +305,9 @@ self.SendScintilla(self.SCI_INDICSETALPHA, id, 100)
return id
+ def showHScrollBar(self, show=True):
+ self.SendScintilla(self.SCI_SETHSCROLLBAR, show)
+
class SearchToolBar(QToolBar):
conditionChanged = pyqtSignal(unicode, bool, bool)
"""Emitted (pattern, icase, wrap) when search condition changed"""
|
@@ -224,6 +224,7 @@ self.portentry.setAcceptDrops(False)
self.portentry.setToolTip(_('Port'))
self.portentry.setFixedWidth(8 * fontm.width('9'))
+ self.portentry.setValidator(QIntValidator(0, 65536, self.portentry))
self.portentry.textChanged.connect(self.refreshUrl)
tbar.addWidget(self.portentry)
tbar.addWidget(qtlib.Spacer(2, 2))
|
@@ -519,7 +519,7 @@ for u in d.urls():
root = self.find_root(u)
if root:
- self.showRepo(root)
+ self.showRepo(hglib.tounicode(root))
accept = True
if accept:
event.setDropAction(Qt.LinkAction)
|
|
|
@@ -158,7 +158,7 @@ else
{
TDEBUG_TRACEW(
- L"GetCMenuTranslation: RegOpenKeyExW(\""
+ L"GetCMenuTranslation: RegOpenKeyExW(\""
<< subkey << "\") failed"
);
}
@@ -192,7 +192,7 @@
myDescMap[md.name] = md;
}
-
+
}
myMenuIdMap.clear();
@@ -335,7 +335,7 @@ {
memset(&mii, 0, sizeof(MENUITEMINFOW));
mii.cbSize = sizeof(MENUITEMINFOW);
-
+
// first GetMenuItemInfoW call: get size of menu item string
mii.fMask = MIIM_STRING;
BOOL res = ::GetMenuItemInfoW(hMenu, i, true, &mii);
@@ -478,7 +478,7 @@ }
TDEBUG_TRACE(
- "CShellExtCMenu::QueryContextMenu: isHgrepo = "
+ "CShellExtCMenu::QueryContextMenu: isHgrepo = "
<< isHgrepo << ", fileMenu = " << fileMenu
);
@@ -620,7 +620,7 @@ }
TDEBUG_TRACE(
- "CShellExtCMenu::GetCommandString: idCmd = " << idCmd
+ "CShellExtCMenu::GetCommandString: idCmd = " << idCmd
<< ", uFlags = " << uFlags << " (" << sflags << ")"
<< ", cchMax = " << cchMax
);
@@ -639,12 +639,12 @@ {
pszw = iter->second.helpText.c_str();
res = S_OK;
-
+
size_t size = iter->second.helpText.size();
if (size >= 40)
{
TDEBUG_TRACE(
- "***** CShellExtCMenu::GetCommandString: warning:"
+ "***** CShellExtCMenu::GetCommandString: warning:"
<< " length of help text is " << size
<< ", which is not reasonably short (<40)");
}
@@ -673,7 +673,7 @@
if (cchMax < 1)
{
- TDEBUG_TRACE("CShellExtCMenu::GetCommandString: cchMax = "
+ TDEBUG_TRACE("CShellExtCMenu::GetCommandString: cchMax = "
<< cchMax << " (is <1)");
return res;
}
@@ -896,7 +896,7 @@ }
TDEBUG_TRACEW(
- L"---- TortoiseHg shell extension version "
+ L"---- TortoiseHg shell extension version "
<< ThgVersion::get() << L"----"
);
@@ -921,7 +921,7 @@ if (SUCCEEDED(pDataObj->GetData(&fmt, &stg)) && stg.hGlobal)
{
HDROP hDrop = (HDROP) GlobalLock(stg.hGlobal);
-
+
if (hDrop)
{
UINT uNumFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
@@ -931,10 +931,10 @@ {
TDEBUG_TRACE(" DragQueryFile [" << i << "] = " << name);
myFiles.push_back(name);
- }
+ }
}
}
- else
+ else
{
TDEBUG_TRACE(" hDrop is NULL ");
}
@@ -953,7 +953,7 @@ }
// if a directory background
- if (pIDFolder)
+ if (pIDFolder)
{
SHGetPathFromIDList(pIDFolder, name);
TDEBUG_TRACE(" Folder " << name);
|
@@ -37,8 +37,8 @@ void PrintDebugHeader(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj);
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);
+ 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:
|
@@ -73,10 +73,10 @@ {
std::string base;
std::string rest;
-
+
std::string n = n_in;
Directory* cur = this;
-
+
for (;;)
{
@@ -94,7 +94,7 @@ }
Directory* d = 0;
- for (DirsT::iterator i = cur->subdirs_.begin();
+ for (DirsT::iterator i = cur->subdirs_.begin();
i != cur->subdirs_.end(); ++i)
{
if ((*i)->name_ == base) {
|
@@ -95,10 +95,10 @@ new_stat = true;
}
- if (iter->dstate)
+ if (iter->dstate)
{
unset = iter->unset;
-
+
if (!new_stat)
return iter->dstate;
@@ -109,8 +109,8 @@ }
TDEBUG_TRACE("Dirstatecache::get: refreshing " << hgroot);
- }
- else
+ }
+ else
{
TDEBUG_TRACE("Dirstatecache::get: reading " << hgroot);
}
|
@@ -36,14 +36,14 @@ bool unset;
bool usekbfiles;
- E():
- dstate(0),
- dstate_mtime(0),
- dstate_size(0),
+ E():
+ dstate(0),
+ dstate_mtime(0),
+ dstate_size(0),
tickcount(0),
unset(false),
usekbfiles(false)
- {}
+ {}
};
static std::list<E>& cache();
|
@@ -79,7 +79,7 @@
int findHgRoot(char cls, QueryState& cur, QueryState& last, bool outdated)
{
- std::string dp = "["; dp += cls; dp += "] findHgRoot";
+ std::string dp = "["; dp += cls; dp += "] findHgRoot";
{
std::string p = cur.path;
@@ -106,7 +106,7 @@ }
}
- if (!outdated && !last.hgroot.empty()
+ if (!outdated && !last.hgroot.empty()
&& cur.path.size() >= last.hgroot.size()
&& StartsWith(cur.path, last.hgroot + "\\"))
{
@@ -156,7 +156,7 @@ goto exit;
}
- if (has_hg)
+ if (has_hg)
{
cur.hgroot = p;
TDEBUG_TRACE(
@@ -188,7 +188,7 @@
int get_relpath(
- const std::string& hgroot,
+ const std::string& hgroot,
const std::string& path,
std::string& res
)
@@ -202,7 +202,7 @@
if (path[offset] == '\\')
offset++;
-
+
const char* relpathptr = path.c_str() + offset;
res = relpathptr;
@@ -213,11 +213,11 @@int HgQueryDirstate(
const char cls,
const std::string& path,
- const char& filterStatus,
+ const char& filterStatus,
char& outStatus
)
{
- std::string dp = "["; dp += cls; dp += "] HgQueryDirstate: ";
+ std::string dp = "["; dp += cls; dp += "] HgQueryDirstate: ";
static QueryState last;
@@ -231,7 +231,7 @@
const bool outdated = cur.tickcount - last.tickcount > 2000;
- if (!outdated && last.path == path)
+ if (!outdated && last.path == path)
{
outStatus = last.status;
if (outStatus == 'P')
@@ -298,7 +298,7 @@ }
Winstat stat;
- if (0 != stat.lstat(path.c_str()))
+ if (0 != stat.lstat(path.c_str()))
{
TDEBUG_TRACE(dp << "lstat(" << path << ") failed");
last = cur;
@@ -367,7 +367,7 @@
if (basedir_status != 'M')
update = true;
- }
+ }
}
else if (outStatus == 'P')
{
|
Loading...