251 """ |
251 """ |
252 Private method to initialize the viewlist context menu. |
252 Private method to initialize the viewlist context menu. |
253 """ |
253 """ |
254 self.__menu = QMenu(self) |
254 self.__menu = QMenu(self) |
255 self.__menu.addAction( |
255 self.__menu.addAction( |
256 UI.PixmapCache.getIcon("tabClose.png"), |
256 UI.PixmapCache.getIcon("tabClose"), |
257 self.tr('Close'), self.__contextMenuClose) |
257 self.tr('Close'), self.__contextMenuClose) |
258 self.closeOthersMenuAct = self.__menu.addAction( |
258 self.closeOthersMenuAct = self.__menu.addAction( |
259 UI.PixmapCache.getIcon("tabCloseOther.png"), |
259 UI.PixmapCache.getIcon("tabCloseOther"), |
260 self.tr("Close Others"), |
260 self.tr("Close Others"), |
261 self.__contextMenuCloseOthers) |
261 self.__contextMenuCloseOthers) |
262 self.__menu.addAction( |
262 self.__menu.addAction( |
263 self.tr('Close All'), self.__contextMenuCloseAll) |
263 self.tr('Close All'), self.__contextMenuCloseAll) |
264 self.__menu.addSeparator() |
264 self.__menu.addSeparator() |
265 self.saveMenuAct = self.__menu.addAction( |
265 self.saveMenuAct = self.__menu.addAction( |
266 UI.PixmapCache.getIcon("fileSave.png"), |
266 UI.PixmapCache.getIcon("fileSave"), |
267 self.tr('Save'), self.__contextMenuSave) |
267 self.tr('Save'), self.__contextMenuSave) |
268 self.__menu.addAction( |
268 self.__menu.addAction( |
269 UI.PixmapCache.getIcon("fileSaveAs.png"), |
269 UI.PixmapCache.getIcon("fileSaveAs"), |
270 self.tr('Save As...'), self.__contextMenuSaveAs) |
270 self.tr('Save As...'), self.__contextMenuSaveAs) |
271 self.__menu.addAction( |
271 self.__menu.addAction( |
272 UI.PixmapCache.getIcon("fileSaveAll.png"), |
272 UI.PixmapCache.getIcon("fileSaveAll"), |
273 self.tr('Save All'), self.__contextMenuSaveAll) |
273 self.tr('Save All'), self.__contextMenuSaveAll) |
274 self.__menu.addSeparator() |
274 self.__menu.addSeparator() |
275 self.openRejectionsMenuAct = self.__menu.addAction( |
275 self.openRejectionsMenuAct = self.__menu.addAction( |
276 self.tr("Open 'rejection' file"), |
276 self.tr("Open 'rejection' file"), |
277 self.__contextMenuOpenRejections) |
277 self.__contextMenuOpenRejections) |
278 self.__menu.addSeparator() |
278 self.__menu.addSeparator() |
279 self.__menu.addAction( |
279 self.__menu.addAction( |
280 UI.PixmapCache.getIcon("print.png"), |
280 UI.PixmapCache.getIcon("print"), |
281 self.tr('Print'), self.__contextMenuPrintFile) |
281 self.tr('Print'), self.__contextMenuPrintFile) |
282 self.__menu.addSeparator() |
282 self.__menu.addSeparator() |
283 self.copyPathAct = self.__menu.addAction( |
283 self.copyPathAct = self.__menu.addAction( |
284 self.tr("Copy Path to Clipboard"), |
284 self.tr("Copy Path to Clipboard"), |
285 self.__contextMenuCopyPathToClipboard) |
285 self.__contextMenuCopyPathToClipboard) |
594 """ |
594 """ |
595 currentRow = self.viewlist.currentRow() |
595 currentRow = self.viewlist.currentRow() |
596 index = self.editors.index(editor) |
596 index = self.editors.index(editor) |
597 keys = [] |
597 keys = [] |
598 if m: |
598 if m: |
599 keys.append("fileModified.png") |
599 keys.append("fileModified") |
600 if editor.hasSyntaxErrors(): |
600 if editor.hasSyntaxErrors(): |
601 keys.append("syntaxError22.png") |
601 keys.append("syntaxError22") |
602 elif editor.hasWarnings(): |
602 elif editor.hasWarnings(): |
603 keys.append("warning22.png") |
603 keys.append("warning22") |
604 if not keys: |
604 if not keys: |
605 keys.append("empty.png") |
605 keys.append("empty") |
606 item = self.viewlist.item(index) |
606 item = self.viewlist.item(index) |
607 if item: |
607 if item: |
608 item.setIcon(UI.PixmapCache.getCombinedIcon(keys)) |
608 item.setIcon(UI.PixmapCache.getCombinedIcon(keys)) |
609 self.viewlist.setCurrentRow(currentRow) |
609 self.viewlist.setCurrentRow(currentRow) |
610 self._checkActions(editor) |
610 self._checkActions(editor) |
618 """ |
618 """ |
619 currentRow = self.viewlist.currentRow() |
619 currentRow = self.viewlist.currentRow() |
620 index = self.editors.index(editor) |
620 index = self.editors.index(editor) |
621 keys = [] |
621 keys = [] |
622 if editor.isModified(): |
622 if editor.isModified(): |
623 keys.append("fileModified.png") |
623 keys.append("fileModified") |
624 if editor.hasSyntaxErrors(): |
624 if editor.hasSyntaxErrors(): |
625 keys.append("syntaxError22.png") |
625 keys.append("syntaxError22") |
626 elif editor.hasWarnings(): |
626 elif editor.hasWarnings(): |
627 keys.append("warning22.png") |
627 keys.append("warning22") |
628 if not keys: |
628 if not keys: |
629 keys.append("empty.png") |
629 keys.append("empty") |
630 item = self.viewlist.item(index) |
630 item = self.viewlist.item(index) |
631 if item: |
631 if item: |
632 item.setIcon(UI.PixmapCache.getCombinedIcon(keys)) |
632 item.setIcon(UI.PixmapCache.getCombinedIcon(keys)) |
633 self.viewlist.setCurrentRow(currentRow) |
633 self.viewlist.setCurrentRow(currentRow) |
634 |
634 |