file open: fix clickin on parent dir
@@ -1003,11 +1003,6 @@ class DirectoryList(Window):
def getPath(self):
return self.host.textBuffer.lines[0]
- def setPath(self, path):
- self.host.textBuffer.selectionAll()
- self.host.textBuffer.editPasteLines((path,))
- self.host.textBuffer.updateBasicScrollPosition()
-
def reshape(self, rows, cols, top, left):
"""Change self and sub-windows to fit within the given rectangle."""
app.log.detail('reshape', rows, cols, top, left)
@@ -1031,9 +1026,9 @@ class DirectoryList(Window):
path = os.path.dirname(path)
if len(path) > len(os.path.sep):
path += os.path.sep
- self.setPath(path)
+ self.host.setPath(path)
return
- self.setPath(path + self.contents[row - 2])
+ self.host.setPath(path + self.contents[row - 2])
self.host.controller.createOrOpen()
def mouseDoubleClick(self, paneRow, paneCol, shift, ctrl, alt):
@@ -1090,19 +1085,6 @@ class FileManagerWindow(Window):
self.statusLine = StatusLine(self)
self.statusLine.setParent(self, 0)
- def reshape(self, rows, cols, top, left):
- """Change self and sub-windows to fit within the given rectangle."""
- app.log.detail('reshape', rows, cols, top, left)
- self.optionsRow.reshape(1, cols, top, left)
- top += 1
- rows -= 1
- Window.reshape(self, 1, cols, top, left)
- top += 1
- rows -= 1
- self.statusLine.reshape(1, cols, rows, left)
- rows -= 2
- self.directoryList.reshape(rows, cols, top, left)
-
def mouseClick(self, paneRow, paneCol, shift, ctrl, alt):
row = self.scrollRow + paneRow
col = self.scrollCol + paneCol
@@ -1112,17 +1094,34 @@ class FileManagerWindow(Window):
if col >= len(line):
return
slash = line[col:].find('/')
- self.textBuffer.lines[0] = line[:col + slash + 1]
+ self.setPath(line[:col + slash + 1])
def quitNow(self):
app.log.debug()
self.host.quitNow()
+ def reshape(self, rows, cols, top, left):
+ """Change self and sub-windows to fit within the given rectangle."""
+ app.log.detail('reshape', rows, cols, top, left)
+ self.optionsRow.reshape(1, cols, top, left)
+ top += 1
+ rows -= 1
+ Window.reshape(self, 1, cols, top, left)
+ top += 1
+ rows -= 1
+ self.statusLine.reshape(1, cols, rows, left)
+ rows -= 2
+ self.directoryList.reshape(rows, cols, top, left)
+
def setTextBuffer(self, textBuffer):
textBuffer.lineLimitIndicator = 999999
Window.setTextBuffer(self, textBuffer)
self.controller.setTextBuffer(textBuffer)
+ def setPath(self, path):
+ self.textBuffer.selectionAll()
+ self.textBuffer.editPasteLines((path,))
+
class PaletteWindow(ActiveWindow):
"""A window with example foreground and background text colors."""
