52 |
52 |
53 def __init__(self, fileName="", parent=None, fromEric=False, project=None): |
53 def __init__(self, fileName="", parent=None, fromEric=False, project=None): |
54 """ |
54 """ |
55 Constructor |
55 Constructor |
56 |
56 |
57 @param fileName name of a file to load on startup (string) |
57 @param fileName name of a file to load on startup |
58 @param parent parent widget of this window (QWidget) |
58 @type str |
|
59 @param parent parent widget of this window |
|
60 @type QWidget |
59 @param fromEric flag indicating whether it was called from within |
61 @param fromEric flag indicating whether it was called from within |
60 eric (boolean) |
62 eric |
61 @param project reference to the project object (Project) |
63 @type bool |
|
64 @param project reference to the project object |
|
65 @type Project |
62 """ |
66 """ |
63 super().__init__(parent) |
67 super().__init__(parent) |
64 self.setObjectName("eric7_hex_editor") |
68 self.setObjectName("eric7_hex_editor") |
65 |
69 |
66 self.__srHistory = { |
70 self.__srHistory = { |
1550 @pyqtSlot(QAction) |
1554 @pyqtSlot(QAction) |
1551 def __openRecentHexFile(self, act): |
1555 def __openRecentHexFile(self, act): |
1552 """ |
1556 """ |
1553 Private method to open a file from the list of recently opened files. |
1557 Private method to open a file from the list of recently opened files. |
1554 |
1558 |
1555 @param act reference to the action that triggered (QAction) |
1559 @param act reference to the action that triggered |
|
1560 @type QAction |
1556 """ |
1561 """ |
1557 fileName = act.data() |
1562 fileName = act.data() |
1558 if fileName and self.__maybeSave(): |
1563 if fileName and self.__maybeSave(): |
1559 self.__loadHexFile(fileName) |
1564 self.__loadHexFile(fileName) |
1560 self.__editor.setReadOnly(Preferences.getHexEditor("OpenReadOnly")) |
1565 self.__editor.setReadOnly(Preferences.getHexEditor("OpenReadOnly")) |
1589 def __addToRecentList(self, fileName): |
1594 def __addToRecentList(self, fileName): |
1590 """ |
1595 """ |
1591 Private method to add a file name to the list of recently opened files. |
1596 Private method to add a file name to the list of recently opened files. |
1592 |
1597 |
1593 @param fileName name of the file to be added |
1598 @param fileName name of the file to be added |
|
1599 @type str |
1594 """ |
1600 """ |
1595 if fileName: |
1601 if fileName: |
1596 for recent in self.__recent[:]: |
1602 for recent in self.__recent[:]: |
1597 if FileSystemUtilities.samepath(fileName, recent): |
1603 if FileSystemUtilities.samepath(fileName, recent): |
1598 self.__recent.remove(recent) |
1604 self.__recent.remove(recent) |