summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2013-10-14 22:19:26 +0200
committerMichael Buesch <m@bues.ch>2013-10-14 22:19:26 +0200
commit41e1c1fa5bbe5e0205701f1dddc1849b8ab672b8 (patch)
tree66b02e61b02aadcf392ef23c3559a0b4a79735cd
parent272b14d33f0944e45ab7ae92a39cd5d7617c1df4 (diff)
downloadtoprammer-41e1c1fa5bbe5e0205701f1dddc1849b8ab672b8.tar.xz
toprammer-41e1c1fa5bbe5e0205701f1dddc1849b8ab672b8.zip
gui: Show chip maintainer
Signed-off-by: Michael Buesch <m@bues.ch>
-rwxr-xr-xtoprammer-gui74
1 files changed, 32 insertions, 42 deletions
diff --git a/toprammer-gui b/toprammer-gui
index 1596923..010a65d 100755
--- a/toprammer-gui
+++ b/toprammer-gui
@@ -1509,50 +1509,28 @@ class InfoBufferWidget(BufferWidget):
font.setFamily("monospace")
font.setPointSize(7)
self.zifLayout.setFont(font)
- self.layout().addWidget(self.zifLayout, 0, 0, 5, 1)
-
- l = QLabel("Chip name:", self)
- l.setAlignment(Qt.AlignTop | Qt.AlignLeft)
- self.layout().addWidget(l, 0, 1)
- self.chipName = QLabel(self)
- self.chipName.setAlignment(Qt.AlignTop | Qt.AlignLeft)
- font = self.chipName.font()
- font.setBold(True)
- self.chipName.setFont(font)
- self.layout().addWidget(self.chipName, 0, 2)
-
- l = QLabel("Comment:", self)
- l.setAlignment(Qt.AlignTop | Qt.AlignLeft)
- self.layout().addWidget(l, 1, 1)
- self.comment = QLabel(self)
- self.comment.setAlignment(Qt.AlignTop | Qt.AlignLeft)
- font = self.comment.font()
- font.setBold(True)
- self.comment.setFont(font)
- self.layout().addWidget(self.comment, 1, 2)
-
- l = QLabel("Packages:", self)
- l.setAlignment(Qt.AlignTop | Qt.AlignLeft)
- self.layout().addWidget(l, 2, 1)
- self.packages = QLabel(self)
- self.packages.setAlignment(Qt.AlignTop | Qt.AlignLeft)
- font = self.packages.font()
- font.setBold(True)
- self.packages.setFont(font)
- self.layout().addWidget(self.packages, 2, 2)
-
- l = QLabel("Chip signature bytes:", self)
- l.setAlignment(Qt.AlignTop | Qt.AlignLeft)
- self.layout().addWidget(l, 3, 1)
- self.chipSig = QLabel(self)
- self.chipSig.setAlignment(Qt.AlignTop | Qt.AlignLeft)
- font = self.chipSig.font()
- font.setBold(True)
- self.chipSig.setFont(font)
- self.layout().addWidget(self.chipSig, 3, 2)
+ self.layout().addWidget(self.zifLayout, 0, 0, 6, 1)
+
+ def addLabel(name, y):
+ l = QLabel(name, self)
+ l.setAlignment(Qt.AlignTop | Qt.AlignLeft)
+ self.layout().addWidget(l, y, 1)
+ label = QLabel(self)
+ label.setAlignment(Qt.AlignTop | Qt.AlignLeft)
+ font = label.font()
+ font.setBold(True)
+ label.setFont(font)
+ self.layout().addWidget(label, y, 2)
+ return label
+
+ self.chipName = addLabel("Chip name:", 0)
+ self.comment = addLabel("Comment:", 1)
+ self.packages = addLabel("Packages:", 2)
+ self.chipSig = addLabel("Chip signature bytes:", 3)
+ self.maintainer = addLabel("Chip maintainer:", 4)
self.layout().setColumnStretch(3, 99)
- self.layout().setRowStretch(4, 99)
+ self.layout().setRowStretch(5, 99)
self.clear()
@@ -1562,6 +1540,7 @@ class InfoBufferWidget(BufferWidget):
self.setChipSignature(None)
self.setChipLayout(None)
self.setPackages(None)
+ self.setMaintainer(None)
def setChipSignature(self, bindata):
if bindata:
@@ -1589,10 +1568,21 @@ class InfoBufferWidget(BufferWidget):
else:
self.packages.setText("Unknown")
+ def setMaintainer(self, maintainer):
+ if maintainer:
+ # Remove email address
+ idx = maintainer.find("<")
+ if idx >= 0:
+ maintainer = maintainer[:idx]
+ self.maintainer.setText(maintainer.strip())
+ else:
+ self.maintainer.setText("None")
+
def setupDescription(self, chipDescription):
self.chipName.setText(chipDescription.description)
self.setComment(chipDescription.comment)
self.setPackages(chipDescription.packages)
+ self.setMaintainer(chipDescription.maintainer)
def setChipLayout(self, asciiArtLayout):
if asciiArtLayout:
bues.ch cgit interface