checkpoint. getting stuck

This commit is contained in:
Brennen Raimer
2019-04-24 16:56:31 -04:00
parent ecfb8032d9
commit cd8a2c2ce7
2 changed files with 20 additions and 17 deletions

View File

@@ -44,7 +44,7 @@
},
"MSYS2": {
"page": "https://www.msys2.org/",
"category": "development.languages.C / C++",
"category": "development.languages.c and c++",
"homepage": "https://www.msys2.org",
"icon url": "https://avatars1.githubusercontent.com/u/6759993?s=200&v=4",
"search": {
@@ -246,7 +246,7 @@
},
"Cppcheck": {
"page": "https://portableapps.com/apps/development/cppcheck-portable",
"category": "development.languages.C/C++",
"category": "development.languages.c and c++",
"homepage": "http://cppcheck.sourceforge.net/",
"search": {
"selector": "",

View File

@@ -7,6 +7,7 @@ import zipfile
from pathlib import Path
from queue import Queue
import json
from operator import itemgetter
import psutil
from PyQt5 import QtCore, QtGui, QtNetwork, QtWebEngineWidgets, QtWidgets
@@ -155,16 +156,13 @@ class InstallerWizard(QtWidgets.QWizard):
else:
self._display_error(f"Encountered an error while loading supported tools from {request.url().toString()}", reply.errorString()).finished.connect(lambda x: self.back())
def _populate_menu(self):
"""Populates the selection menu with items loaded from supported_tools.json
"""
for name, info in self.__tools__.items():
placement = [level.capitalize().strip() for level in info["category"].split(".") if level] + [name]
root = self.selection_menu.invisibleRootItem()
#children = [root.child(i) for i in range(root.childCount())]
children = list(MenuIterator(root, QtWidgets.QTreeWidgetItemIterator.All))
children = [root.child(i) for i in range(root.childCount())]
while placement:
current_level = placement.pop()
@@ -197,6 +195,11 @@ class InstallerWizard(QtWidgets.QWizard):
self.selection_menu.resizeColumnToContents(0)
self.selection_menu.resizeColumnToContents(1)
def _create_placements(self):
placements = [[level.capitalize().strip() for level in info["category"].split(".") if info["category"]] + [name] for name, info in self.__tools__.items()]
for menu_placement in placements:
self.__tools__[menu_placement[-1]]["placement"] = menu_placement
@QtCore.pyqtSlot("QTreeWidgetItem*", "int")
def _open_homepage(self, item, column):
"""Receives the itemClicked signal from the selection_menu QTreeWidget and if the user has clicked a homepage, opens it in a new browser tab.