mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[about] filtering invalid folder | [gem_selector] sorting managers by class name
This commit is contained in:
@@ -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(''))
|
||||
|
||||
@@ -40,7 +40,10 @@ class GemSelectorPanel(QWidget):
|
||||
gem_options = []
|
||||
default = set()
|
||||
|
||||
for m in manager.managers:
|
||||
managers = [*manager.managers]
|
||||
managers.sort(key=lambda c: c.__class__.__name__)
|
||||
|
||||
for m in managers:
|
||||
if m.can_work():
|
||||
modname = m.__module__.split('.')[-2]
|
||||
op = InputOption(label=i18n.get('gem.{}.label'.format(modname), modname.capitalize()),
|
||||
|
||||
Reference in New Issue
Block a user