IconEditor/IconEditorWindow.py

changeset 4696
bf4d19a7cade
parent 4647
5c50132b6463
child 5389
9b1c800daff3
equal deleted inserted replaced
4695:9dc08852de25 4696:bf4d19a7cade
283 """<p>Closes all icon editor windows except the first one.</p>""" 283 """<p>Closes all icon editor windows except the first one.</p>"""
284 )) 284 ))
285 self.closeAllAct.triggered.connect(self.__closeAll) 285 self.closeAllAct.triggered.connect(self.__closeAll)
286 self.__actions.append(self.closeAllAct) 286 self.__actions.append(self.closeAllAct)
287 287
288 # TODO: add action to close all other windows 288 self.closeOthersAct = E5Action(
289 self.tr('Close Others'),
290 self.tr('Close Others'),
291 0, 0, self, 'iconEditor_file_close_others')
292 self.closeOthersAct.setStatusTip(self.tr(
293 'Close all other icon editor windows'))
294 self.closeOthersAct.setWhatsThis(self.tr(
295 """<b>Close Others</b>"""
296 """<p>Closes all other icon editor windows.</p>"""
297 ))
298 self.closeOthersAct.triggered.connect(self.__closeOthers)
299 self.__actions.append(self.closeOthersAct)
289 300
290 self.exitAct = E5Action( 301 self.exitAct = E5Action(
291 self.tr('Quit'), 302 self.tr('Quit'),
292 UI.PixmapCache.getIcon("exit.png"), 303 UI.PixmapCache.getIcon("exit.png"),
293 self.tr('&Quit'), 304 self.tr('&Quit'),
814 menu.addSeparator() 825 menu.addSeparator()
815 menu.addAction(self.saveAct) 826 menu.addAction(self.saveAct)
816 menu.addAction(self.saveAsAct) 827 menu.addAction(self.saveAsAct)
817 menu.addSeparator() 828 menu.addSeparator()
818 menu.addAction(self.closeAct) 829 menu.addAction(self.closeAct)
830 menu.addAction(self.closeOthersAct)
819 if self.fromEric: 831 if self.fromEric:
820 menu.addAction(self.closeAllAct) 832 menu.addAction(self.closeAllAct)
821 else: 833 else:
822 menu.addSeparator() 834 menu.addSeparator()
823 menu.addAction(self.exitAct) 835 menu.addAction(self.exitAct)
1105 1117
1106 return self.__saveIconFile(fileName) 1118 return self.__saveIconFile(fileName)
1107 1119
1108 def __closeAll(self): 1120 def __closeAll(self):
1109 """ 1121 """
1122 Private slot to close all windows.
1123 """
1124 self.__closeOthers()
1125 self.close()
1126
1127 def __closeOthers(self):
1128 """
1110 Private slot to close all other windows. 1129 Private slot to close all other windows.
1111 """ 1130 """
1112 for win in self.__class__.windows[:]: 1131 for win in self.__class__.windows[:]:
1113 if win != self: 1132 if win != self:
1114 win.close() 1133 win.close()
1115 self.close()
1116 1134
1117 def __loadIconFile(self, fileName): 1135 def __loadIconFile(self, fileName):
1118 """ 1136 """
1119 Private method to load an icon file. 1137 Private method to load an icon file.
1120 1138

eric ide

mercurial