Mercurial > lcfOS
comparison python/hexedit.py @ 287:1c7c1e619be8
File movage
author | Windel Bouwman |
---|---|
date | Thu, 21 Nov 2013 11:57:27 +0100 |
parents | 2ccd57b1d78c |
children |
comparison
equal
deleted
inserted
replaced
286:d9df72971cbf | 287:1c7c1e619be8 |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 import sys | 3 import sys |
4 import os | |
4 from PyQt4.QtCore import * | 5 from PyQt4.QtCore import * |
5 from PyQt4.QtGui import * | 6 from PyQt4.QtGui import * |
6 from PyQt4 import uic | 7 from PyQt4 import uic |
7 | 8 |
8 BYTES_PER_LINE, GAP = 8, 12 | 9 BYTES_PER_LINE, GAP = 8, 12 |
165 self.setFocusPolicy(Qt.NoFocus) | 166 self.setFocusPolicy(Qt.NoFocus) |
166 | 167 |
167 class HexEditor(QMainWindow): | 168 class HexEditor(QMainWindow): |
168 def __init__(self): | 169 def __init__(self): |
169 super().__init__() | 170 super().__init__() |
170 uic.loadUi('hexeditor.ui', baseinstance=self) | 171 basedir = os.path.dirname(__file__) |
172 uic.loadUi(os.path.join(basedir, 'hexeditor.ui'), baseinstance=self) | |
171 self.he = HexEdit() | 173 self.he = HexEdit() |
172 self.setCentralWidget(self.he) | 174 self.setCentralWidget(self.he) |
173 self.actionOpen.triggered.connect(self.doOpen) | 175 self.actionOpen.triggered.connect(self.doOpen) |
174 self.actionSave.triggered.connect(self.doSave) | 176 self.actionSave.triggered.connect(self.doSave) |
175 self.actionSaveAs.triggered.connect(self.doSaveAs) | 177 self.actionSaveAs.triggered.connect(self.doSaveAs) |