6 """ |
6 """ |
7 Module implementing the Programs page. |
7 Module implementing the Programs page. |
8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
11 import sys |
|
12 import re |
11 import re |
13 |
12 |
14 from PyQt4.QtCore import pyqtSlot, Qt, QProcess |
13 from PyQt4.QtCore import pyqtSlot, Qt, QProcess |
15 from PyQt4.QtGui import QApplication, QTreeWidgetItem, QHeaderView, QCursor, \ |
14 from PyQt4.QtGui import QApplication, QTreeWidgetItem, QHeaderView, QCursor, \ |
16 QDialog, QDialogButtonBox |
15 QDialog, QDialogButtonBox |
246 if versionCleanup: |
245 if versionCleanup: |
247 version = version[versionCleanup[0]:versionCleanup[1]] |
246 version = version[versionCleanup[0]:versionCleanup[1]] |
248 break |
247 break |
249 else: |
248 else: |
250 version = self.trUtf8("(not executable)") |
249 version = self.trUtf8("(not executable)") |
251 itm2 = QTreeWidgetItem(itm, [exe, version]) |
250 QTreeWidgetItem(itm, [exe, version]) |
252 itm.setExpanded(True) |
251 itm.setExpanded(True) |
253 else: |
252 else: |
254 itm.setText(1, self.trUtf8("(not found)")) |
253 itm.setText(1, self.trUtf8("(not found)")) |
255 QApplication.processEvents() |
254 QApplication.processEvents() |
256 self.programsList.header().resizeSections(QHeaderView.ResizeToContents) |
255 self.programsList.header().resizeSections(QHeaderView.ResizeToContents) |
269 font = itm.font(0) |
268 font = itm.font(0) |
270 font.setBold(True) |
269 font.setBold(True) |
271 itm.setFont(0, font) |
270 itm.setFont(0, font) |
272 |
271 |
273 if len(entryVersion): |
272 if len(entryVersion): |
274 itm2 = QTreeWidgetItem(itm, [entryText, entryVersion]) |
273 QTreeWidgetItem(itm, [entryText, entryVersion]) |
275 itm.setExpanded(True) |
274 itm.setExpanded(True) |
276 else: |
275 else: |
277 itm.setText(1, self.trUtf8("(not found)")) |
276 itm.setText(1, self.trUtf8("(not found)")) |
278 QApplication.processEvents() |
277 QApplication.processEvents() |
279 self.programsList.header().resizeSections(QHeaderView.ResizeToContents) |
278 self.programsList.header().resizeSections(QHeaderView.ResizeToContents) |