mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 23:24:15 +02:00
[wgem] allow internal URLs installation option
This commit is contained in:
@@ -3,7 +3,8 @@ from PyQt5.QtGui import QIcon, QPixmap
|
||||
from PyQt5.QtWidgets import QRadioButton, QGroupBox, QCheckBox, QComboBox, QGridLayout, QWidget, \
|
||||
QLabel, QSizePolicy, QLineEdit, QToolButton, QHBoxLayout
|
||||
|
||||
from bauh.api.abstract.view import SingleSelectComponent, InputOption, MultipleSelectComponent, SelectViewType
|
||||
from bauh.api.abstract.view import SingleSelectComponent, InputOption, MultipleSelectComponent, SelectViewType, \
|
||||
TextInputComponent
|
||||
from bauh.view.util import resource
|
||||
|
||||
|
||||
@@ -114,6 +115,31 @@ class ComboSelectQt(QGroupBox):
|
||||
self.layout().addWidget(QLabel(model.label + ' :'), 0, 0)
|
||||
self.layout().addWidget(ComboBoxQt(model), 0, 1)
|
||||
|
||||
|
||||
class TextInputQt(QGroupBox):
|
||||
|
||||
def __init__(self, model: TextInputComponent):
|
||||
super(TextInputQt, self).__init__()
|
||||
self.model = model
|
||||
self.setLayout(QGridLayout())
|
||||
self.setStyleSheet('QGridLayout {margin-left: 0} QLabel { font-weight: bold}')
|
||||
self.layout().addWidget(QLabel(model.label + ' :'), 0, 0)
|
||||
|
||||
self.text_input = QLineEdit()
|
||||
|
||||
if model.placeholder:
|
||||
self.text_input.setPlaceholderText(model.placeholder)
|
||||
|
||||
if model.tooltip:
|
||||
self.text_input.setToolTip(model.tooltip)
|
||||
|
||||
self.text_input.textChanged.connect(self._update_model)
|
||||
|
||||
self.layout().addWidget(self.text_input, 0, 1)
|
||||
|
||||
def _update_model(self, text: str):
|
||||
self.model.value = text
|
||||
|
||||
# class ComboSelectQt(QGroupBox):
|
||||
#
|
||||
# def __init__(self, model: SingleSelectComponent):
|
||||
|
||||
@@ -3,9 +3,9 @@ from typing import List
|
||||
from PyQt5.QtCore import QSize
|
||||
from PyQt5.QtWidgets import QMessageBox, QVBoxLayout, QLabel, QWidget, QScrollArea, QFrame
|
||||
|
||||
from bauh.api.abstract.view import ViewComponent, SingleSelectComponent, MultipleSelectComponent
|
||||
from bauh.api.abstract.view import ViewComponent, SingleSelectComponent, MultipleSelectComponent, TextInputComponent
|
||||
from bauh.view.qt import css
|
||||
from bauh.view.qt.components import MultipleSelectQt, new_single_select
|
||||
from bauh.view.qt.components import MultipleSelectQt, new_single_select, TextInputQt
|
||||
from bauh.view.util.translation import I18n
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ class ConfirmationDialog(QMessageBox):
|
||||
inst = new_single_select(comp)
|
||||
elif isinstance(comp, MultipleSelectComponent):
|
||||
inst = MultipleSelectQt(comp, None)
|
||||
elif isinstance(comp, TextInputComponent):
|
||||
inst = TextInputQt(comp)
|
||||
else:
|
||||
raise Exception("Cannot render instances of " + comp.__class__.__name__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user