aboutsummaryrefslogtreecommitdiff
path: root/mesongui.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-09-29 17:02:53 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-09-29 17:02:53 +0300
commit5b31a35e493ea1d39d156b4d7b755760c25519ea (patch)
treeed096b09be9ccdfbaf14ae27cef41c4de08ed6f8 /mesongui.py
parent16e7f98a6f5ecdc4dd48ff839c29217be044ec14 (diff)
downloadmeson-5b31a35e493ea1d39d156b4d7b755760c25519ea.zip
meson-5b31a35e493ea1d39d156b4d7b755760c25519ea.tar.gz
meson-5b31a35e493ea1d39d156b4d7b755760c25519ea.tar.bz2
Display compiler info in the GUI.
Diffstat (limited to 'mesongui.py')
-rwxr-xr-xmesongui.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/mesongui.py b/mesongui.py
index 4983965..694ef8c 100755
--- a/mesongui.py
+++ b/mesongui.py
@@ -183,6 +183,46 @@ class DependencyModel(QAbstractItemModel):
def parent(self, index):
return QModelIndex()
+class CoreModel(QAbstractItemModel):
+ def __init__(self, core_data):
+ super().__init__()
+ self.elems = []
+ for langname, comp in core_data.compilers.items():
+ self.elems.append((langname + ' compiler', str(comp.get_exelist())))
+ for langname, comp in core_data.cross_compilers.items():
+ self.elems.append((langname + ' cross compiler', str(comp.get_exelist())))
+
+ def flags(self, index):
+ return PyQt5.QtCore.Qt.ItemIsSelectable | PyQt5.QtCore.Qt.ItemIsEnabled
+
+ def rowCount(self, index):
+ if index.isValid():
+ return 0
+ return len(self.elems)
+
+ def columnCount(self, index):
+ return 2
+
+ def headerData(self, section, orientation, role):
+ if role != PyQt5.QtCore.Qt.DisplayRole:
+ return QVariant()
+ if section == 1:
+ return QVariant('Value')
+ return QVariant('Name')
+
+ def data(self, index, role):
+ if role != PyQt5.QtCore.Qt.DisplayRole:
+ return QVariant()
+ row = index.row()
+ column = index.column()
+ return self.elems[row][column]
+
+ def index(self, row, column, parent):
+ return self.createIndex(row, column)
+
+ def parent(self, index):
+ return QModelIndex()
+
class ProcessRunner():
def __init__(self, rundir, cmdlist):
self.cmdlist = cmdlist
@@ -238,7 +278,12 @@ class MesonGui():
self.path_model = PathModel(self.coredata)
self.target_model = TargetModel(self.build)
self.dep_model = DependencyModel(self.coredata)
+ self.core_model = CoreModel(self.coredata)
self.fill_data()
+ self.ui.core_view.setModel(self.core_model)
+ hv = QHeaderView(1)
+ hv.setModel(self.core_model)
+ self.ui.core_view.setHeader(hv)
self.ui.path_view.setModel(self.path_model)
hv = QHeaderView(1)
hv.setModel(self.path_model)