diff -r b1ca3bcde70b -r 7f3f276d3bf3 UI/Browser.py --- a/UI/Browser.py Sat Jan 09 19:04:34 2016 +0100 +++ b/UI/Browser.py Sat Jan 09 19:44:31 2016 +0100 @@ -53,6 +53,7 @@ @signal pixmapFile(str) emitted to open a pixmap file @signal pixmapEditFile(str) emitted to edit a pixmap file @signal svgFile(str) emitted to open a SVG file + @signal binaryFile(str) emitted to open a file as binary @signal unittestOpen(str) emitted to open a Python file for a unittest """ sourceFile = pyqtSignal((str, ), (str, int), (str, list), (str, int, str)) @@ -64,6 +65,7 @@ pixmapFile = pyqtSignal(str) pixmapEditFile = pyqtSignal(str) svgFile = pyqtSignal(str) + binaryFile = pyqtSignal(str) unittestOpen = pyqtSignal(str) def __init__(self, parent=None): @@ -212,6 +214,9 @@ self.menu = QMenu(self) self.menu.addAction( QCoreApplication.translate('Browser', 'Open'), self._openItem) + self.menu.addAction( + QCoreApplication.translate('Browser', 'Open in Hex Editor'), + self._openHexEditor) self.editPixmapAct = self.menu.addAction( QCoreApplication.translate('Browser', 'Open in Icon Editor'), self._editPixmap) @@ -517,6 +522,16 @@ if itm.isPixmapFile(): self.pixmapEditFile.emit(itm.fileName()) + def _openHexEditor(self): + """ + Protected slot to handle the open in hex editor popup menu entry. + """ + itmList = self.getSelectedItems([BrowserFileItem]) + + for itm in itmList: + if isinstance(itm, BrowserFileItem): + self.binaryFile.emit(itm.fileName()) + def _copyToClipboard(self): """ Protected method to copy the text shown for an entry to the clipboard.