Plugins/ViewManagerPlugins/MdiArea/MdiArea.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1112
8a7d1b9d18db
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
18 import UI.PixmapCache 18 import UI.PixmapCache
19 19
20 from E5Gui.E5Action import E5Action, addActions 20 from E5Gui.E5Action import E5Action, addActions
21 21
22 import Utilities 22 import Utilities
23
23 24
24 class MdiArea(QMdiArea, ViewManager): 25 class MdiArea(QMdiArea, ViewManager):
25 """ 26 """
26 Class implementing the mdi area viewmanager class. 27 Class implementing the mdi area viewmanager class.
27 28
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:

eric ide

mercurial