447 stack.addWidget(win) |
447 stack.addWidget(win) |
448 else: |
448 else: |
449 self.currentStack.addWidget(win) |
449 self.currentStack.addWidget(win) |
450 self.currentStack.setCurrentWidget(win) |
450 self.currentStack.setCurrentWidget(win) |
451 editor.captionChanged.connect(self.__captionChange) |
451 editor.captionChanged.connect(self.__captionChange) |
452 editor.cursorLineChanged.connect(self.__cursorLineChanged) |
452 editor.cursorLineChanged.connect( |
|
453 lambda lineno: self.__cursorLineChanged(lineno, editor)) |
453 |
454 |
454 index = self.editors.index(editor) |
455 index = self.editors.index(editor) |
455 self.viewlist.setCurrentRow(index) |
456 self.viewlist.setCurrentRow(index) |
456 editor.setFocus() |
457 editor.setFocus() |
457 if fn: |
458 if fn: |
475 """ |
476 """ |
476 fn = editor.getFileName() |
477 fn = editor.getFileName() |
477 if fn: |
478 if fn: |
478 self.setEditorName(editor, fn) |
479 self.setEditorName(editor, fn) |
479 |
480 |
480 def __cursorLineChanged(self, lineno): |
481 def __cursorLineChanged(self, lineno, editor): |
481 """ |
482 """ |
482 Private slot to handle a change of the current editor's cursor line. |
483 Private slot to handle a change of the current editor's cursor line. |
483 |
484 |
484 @param lineno line number of the current editor's cursor (zero based) |
485 @param lineno line number of the editor's cursor (zero based) |
485 @type int |
486 @type int |
486 """ |
487 @param editor reference to the editor |
487 editor = self.sender() |
488 @type Editor |
|
489 """ |
488 if editor: |
490 if editor: |
489 fn = editor.getFileName() |
491 fn = editor.getFileName() |
490 if fn: |
492 if fn: |
491 self.editorLineChanged.emit(fn, lineno + 1) |
493 self.editorLineChanged.emit(fn, lineno + 1) |
492 |
494 |