--- a/QScintilla/Editor.py Tue Sep 06 18:33:27 2011 +0200 +++ b/QScintilla/Editor.py Tue Sep 06 19:47:39 2011 +0200 @@ -683,10 +683,16 @@ if not self.miniMenu: self.menu.addMenu(self.exportersMenu) self.menu.addSeparator() + self.menuActs["OpenRejections"] = \ + self.menu.addAction(self.trUtf8("Open 'rejection' file"), + self.__contextOpenRejections) + self.menu.addSeparator() self.menu.addAction(UI.PixmapCache.getIcon("printPreview.png"), self.trUtf8("Print Preview"), self.printPreviewFile) self.menu.addAction(UI.PixmapCache.getIcon("print.png"), self.trUtf8('Print'), self.printFile) + else: + self.menuActs["OpenRejections"] = None self.menu.aboutToShow.connect(self.__showContextMenu) @@ -4113,6 +4119,13 @@ self.menuActs["SpellCheckRemove"].setEnabled( spellingAvailable and self.spellingMenuPos >= 0) + if self.menuActs["OpenRejections"]: + if self.fileName: + rej = "{0}.rej".format(self.fileName) + self.menuActs["OpenRejections"].setEnabled(os.path.exists(rej)) + else: + self.menuActs["OpenRejections"].setEnabled(False) + self.showMenu.emit("Main", self.menu, self) def __showContextMenuAutocompletion(self): @@ -4301,6 +4314,15 @@ """ self.vm.closeEditor(self) + def __contextOpenRejections(self): + """ + Private slot handling the open rejections file context menu entry. + """ + if self.fileName: + rej = "{0}.rej".format(self.fileName) + if os.path.exists(rej): + self.vm.openSourceFile(rej) + def __newView(self): """ Private slot to create a new view to an open document.