51 @signal projectFile(str) emitted to open an eric4/5 project file |
51 @signal projectFile(str) emitted to open an eric4/5 project file |
52 @signal multiProjectFile(str) emitted to open an eric4/5 multi project file |
52 @signal multiProjectFile(str) emitted to open an eric4/5 multi project file |
53 @signal pixmapFile(str) emitted to open a pixmap file |
53 @signal pixmapFile(str) emitted to open a pixmap file |
54 @signal pixmapEditFile(str) emitted to edit a pixmap file |
54 @signal pixmapEditFile(str) emitted to edit a pixmap file |
55 @signal svgFile(str) emitted to open a SVG file |
55 @signal svgFile(str) emitted to open a SVG file |
|
56 @signal binaryFile(str) emitted to open a file as binary |
56 @signal unittestOpen(str) emitted to open a Python file for a unittest |
57 @signal unittestOpen(str) emitted to open a Python file for a unittest |
57 """ |
58 """ |
58 sourceFile = pyqtSignal((str, ), (str, int), (str, list), (str, int, str)) |
59 sourceFile = pyqtSignal((str, ), (str, int), (str, list), (str, int, str)) |
59 designerFile = pyqtSignal(str) |
60 designerFile = pyqtSignal(str) |
60 linguistFile = pyqtSignal(str) |
61 linguistFile = pyqtSignal(str) |
62 projectFile = pyqtSignal(str) |
63 projectFile = pyqtSignal(str) |
63 multiProjectFile = pyqtSignal(str) |
64 multiProjectFile = pyqtSignal(str) |
64 pixmapFile = pyqtSignal(str) |
65 pixmapFile = pyqtSignal(str) |
65 pixmapEditFile = pyqtSignal(str) |
66 pixmapEditFile = pyqtSignal(str) |
66 svgFile = pyqtSignal(str) |
67 svgFile = pyqtSignal(str) |
|
68 binaryFile = pyqtSignal(str) |
67 unittestOpen = pyqtSignal(str) |
69 unittestOpen = pyqtSignal(str) |
68 |
70 |
69 def __init__(self, parent=None): |
71 def __init__(self, parent=None): |
70 """ |
72 """ |
71 Constructor |
73 Constructor |
210 |
212 |
211 # create the popup menu for general use |
213 # create the popup menu for general use |
212 self.menu = QMenu(self) |
214 self.menu = QMenu(self) |
213 self.menu.addAction( |
215 self.menu.addAction( |
214 QCoreApplication.translate('Browser', 'Open'), self._openItem) |
216 QCoreApplication.translate('Browser', 'Open'), self._openItem) |
|
217 self.menu.addAction( |
|
218 QCoreApplication.translate('Browser', 'Open in Hex Editor'), |
|
219 self._openHexEditor) |
215 self.editPixmapAct = self.menu.addAction( |
220 self.editPixmapAct = self.menu.addAction( |
216 QCoreApplication.translate('Browser', 'Open in Icon Editor'), |
221 QCoreApplication.translate('Browser', 'Open in Icon Editor'), |
217 self._editPixmap) |
222 self._editPixmap) |
218 self.menu.addSeparator() |
223 self.menu.addSeparator() |
219 self.mimeTypeAct = self.menu.addAction( |
224 self.mimeTypeAct = self.menu.addAction( |
515 for itm in itmList: |
520 for itm in itmList: |
516 if isinstance(itm, BrowserFileItem): |
521 if isinstance(itm, BrowserFileItem): |
517 if itm.isPixmapFile(): |
522 if itm.isPixmapFile(): |
518 self.pixmapEditFile.emit(itm.fileName()) |
523 self.pixmapEditFile.emit(itm.fileName()) |
519 |
524 |
|
525 def _openHexEditor(self): |
|
526 """ |
|
527 Protected slot to handle the open in hex editor popup menu entry. |
|
528 """ |
|
529 itmList = self.getSelectedItems([BrowserFileItem]) |
|
530 |
|
531 for itm in itmList: |
|
532 if isinstance(itm, BrowserFileItem): |
|
533 self.binaryFile.emit(itm.fileName()) |
|
534 |
520 def _copyToClipboard(self): |
535 def _copyToClipboard(self): |
521 """ |
536 """ |
522 Protected method to copy the text shown for an entry to the clipboard. |
537 Protected method to copy the text shown for an entry to the clipboard. |
523 """ |
538 """ |
524 itm = self.model().item(self.currentIndex()) |
539 itm = self.model().item(self.currentIndex()) |