141 |
141 |
142 # initialize the APIs manager |
142 # initialize the APIs manager |
143 self.apisManager = APIsManager(parent = self) |
143 self.apisManager = APIsManager(parent = self) |
144 |
144 |
145 self.__cooperationClient = None |
145 self.__cooperationClient = None |
|
146 |
|
147 self.__lastFocusWidget = None |
146 |
148 |
147 def setReferences(self, ui, dbs): |
149 def setReferences(self, ui, dbs): |
148 """ |
150 """ |
149 Public method to set some references needed later on. |
151 Public method to set some references needed later on. |
150 |
152 |
3753 if not isinstance(now, (Editor, Shell, Terminal)): |
3755 if not isinstance(now, (Editor, Shell, Terminal)): |
3754 self.editActGrp.setEnabled(False) |
3756 self.editActGrp.setEnabled(False) |
3755 self.copyActGrp.setEnabled(False) |
3757 self.copyActGrp.setEnabled(False) |
3756 self.viewActGrp.setEnabled(False) |
3758 self.viewActGrp.setEnabled(False) |
3757 self.searchActGrp.setEnabled(False) |
3759 self.searchActGrp.setEnabled(False) |
|
3760 |
|
3761 if isinstance(old, (Editor, Shell, Terminal)): |
|
3762 self.__lastFocusWidget = old |
3758 |
3763 |
3759 ################################################################## |
3764 ################################################################## |
3760 ## Below are the action methods for the edit menu |
3765 ## Below are the action methods for the edit menu |
3761 ################################################################## |
3766 ################################################################## |
3762 |
3767 |
5024 aw = self.activeWindow() |
5029 aw = self.activeWindow() |
5025 if aw is not None: |
5030 if aw is not None: |
5026 fn = aw.getFileName() |
5031 fn = aw.getFileName() |
5027 if fn and e5App().getObject("Project").isProjectFile(fn): |
5032 if fn and e5App().getObject("Project").isProjectFile(fn): |
5028 aw.cancelSharedEdit() |
5033 aw.cancelSharedEdit() |
|
5034 |
|
5035 ####################################################################### |
|
5036 ## Symbols viewer related methods |
|
5037 ####################################################################### |
|
5038 |
|
5039 def insertSymbol(self, txt): |
|
5040 """ |
|
5041 Private slot to insert a symbol text into the active window. |
|
5042 |
|
5043 @param txt text to be inserted (string) |
|
5044 """ |
|
5045 if self.__lastFocusWidget == e5App().getObject("Shell"): |
|
5046 e5App().getObject("Shell").insert(txt) |
|
5047 elif self.__lastFocusWidget == e5App().getObject("Terminal"): |
|
5048 e5App().getObject("Terminal").insert(txt) |
|
5049 else: |
|
5050 aw = self.activeWindow() |
|
5051 if aw is not None: |
|
5052 curline, curindex = aw.getCursorPosition() |
|
5053 aw.insert(txt) |
|
5054 aw.setCursorPosition(curline, curindex + len(txt)) |