[about] filtering invalid folder | [gem_selector] sorting managers by class name

This commit is contained in:
Vinícius Moreira
2019-12-16 12:41:41 -03:00
parent e407d97d45
commit 3fdf07bb7d
2 changed files with 7 additions and 2 deletions

View File

@@ -45,17 +45,19 @@ class AboutDialog(QDialog):
layout.addWidget(QLabel(''))
available_gems = [f for f in glob('{}/gems/*'.format(ROOT_DIR)) if not f.endswith('.py')]
available_gems = [f for f in glob('{}/gems/*'.format(ROOT_DIR)) if not f.endswith('.py') and not f.endswith('__pycache__')]
available_gems.sort()
gems_widget = QWidget()
gems_widget.setLayout(QHBoxLayout())
gems_widget.layout().addWidget(QLabel())
for gem_path in available_gems:
icon = QLabel()
pxmap = QPixmap(gem_path + '/resources/img/{}.png'.format(gem_path.split('/')[-1]))
icon.setPixmap(pxmap.scaled(24, 24, Qt.KeepAspectRatio, Qt.SmoothTransformation))
gems_widget.layout().addWidget(icon)
gems_widget.layout().addWidget(QLabel())
layout.addWidget(gems_widget)
layout.addWidget(QLabel(''))