138 win.removeEventFilter(self) |
139 win.removeEventFilter(self) |
139 self.closeActiveSubWindow() |
140 self.closeActiveSubWindow() |
140 win.closeIt() |
141 win.closeIt() |
141 self.__removingView = False |
142 self.__removingView = False |
142 |
143 |
143 def _addView(self, win, fn = None, noName = ""): |
144 def _addView(self, win, fn=None, noName=""): |
144 """ |
145 """ |
145 Protected method to add a view (i.e. window) |
146 Protected method to add a view (i.e. window) |
146 |
147 |
147 @param win editor window to be added |
148 @param win editor window to be added |
148 @param fn filename of this editor |
149 @param fn filename of this editor |
175 pw.resize(sz) |
176 pw.resize(sz) |
176 |
177 |
177 win.setFocus() |
178 win.setFocus() |
178 win.installEventFilter(self) |
179 win.installEventFilter(self) |
179 |
180 |
180 def _showView(self, win, fn = None): |
181 def _showView(self, win, fn=None): |
181 """ |
182 """ |
182 Private method to show a view (i.e. window) |
183 Private method to show a view (i.e. window) |
183 |
184 |
184 @param win editor window to be shown |
185 @param win editor window to be shown |
185 @param fn filename of this editor (string) |
186 @param fn filename of this editor (string) |
229 act = menu.addAction("{0}{1}".format(accel, txt)) |
230 act = menu.addAction("{0}{1}".format(accel, txt)) |
230 act.triggered[()].connect(self.__windowMapper.map) |
231 act.triggered[()].connect(self.__windowMapper.map) |
231 self.__windowMapper.setMapping(act, subWindow) |
232 self.__windowMapper.setMapping(act, subWindow) |
232 idx += 1 |
233 idx += 1 |
233 |
234 |
234 addActions(windowMenu, |
235 addActions(windowMenu, |
235 [None, self.nextChildAct, self.prevChildAct, |
236 [None, self.nextChildAct, self.prevChildAct, |
236 self.tileAct, self.cascadeAct, |
237 self.tileAct, self.cascadeAct, |
237 self.restoreAllAct, self.iconizeAllAct, |
238 self.restoreAllAct, self.iconizeAllAct, |
238 None]) |
239 None]) |
239 for act in [self.restoreAllAct, self.iconizeAllAct]: |
240 for act in [self.restoreAllAct, self.iconizeAllAct]: |
240 act.setEnabled(len(self.editors) != 0) |
241 act.setEnabled(len(self.editors) != 0) |
241 for act in [self.nextChildAct, self.prevChildAct, self.tileAct, |
242 for act in [self.nextChildAct, self.prevChildAct, self.tileAct, |
242 self.cascadeAct]: |
243 self.cascadeAct]: |
243 act.setEnabled(len(self.editors) > 1) |
244 act.setEnabled(len(self.editors) > 1) |
244 |
245 |
245 act = windowMenu.addMenu(self.windowsMenu) |
246 act = windowMenu.addMenu(self.windowsMenu) |
246 if len(self.editors) == 0: |
247 if len(self.editors) == 0: |