Commit 2ac15bd6 authored by Steve Borho's avatar Steve Borho
Browse files

Merge with stable

......@@ -214,7 +214,7 @@ class ManifestWidget(QWidget, qtlib.TaskWidget):
_('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 @@ class ManifestWidget(QWidget, qtlib.TaskWidget):
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 @@ class ManifestWidget(QWidget, qtlib.TaskWidget):
ctx._repo.maxdiff = self._repo.maxdiff
self._fileview.setContext(ctx)
self._fileview.displayFile(path, self.status)
@pyqtSlot()
def _updatecontent(self):
self.displayFile()
......
......@@ -61,7 +61,7 @@ class ManifestModel(QAbstractItemModel):
"""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:
......@@ -309,9 +309,9 @@ class ManifestModel(QAbstractItemModel):
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 @@ class MessageEntry(qscilib.Scintilla):
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 @@ class MessageEntry(qscilib.Scintilla):
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 @@ class MessageEntry(qscilib.Scintilla):
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 @@ class Scintilla(QsciScintilla):
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 @@ class SyncWidget(QWidget, qtlib.TaskWidget):
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))
......
......@@ -529,7 +529,7 @@ class Workbench(QMainWindow):
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment