diff --git a/bauh/view/qt/components.py b/bauh/view/qt/components.py index b2348d8e..1721653f 100644 --- a/bauh/view/qt/components.py +++ b/bauh/view/qt/components.py @@ -1,12 +1,11 @@ -from PyQt5.QtCore import Qt -from PyQt5.QtWidgets import QRadioButton, QFormLayout, QGroupBox, QCheckBox, QComboBox, QGridLayout, QWidget, \ - QVBoxLayout, QLabel, QSizePolicy -from bauh_api.abstract.view import SingleSelectComponent, SelectOption, MultipleSelectComponent, SelectViewType +from PyQt5.QtWidgets import QRadioButton, QGroupBox, QCheckBox, QComboBox, QGridLayout, QWidget, \ + QLabel, QSizePolicy +from bauh_api.abstract.view import SingleSelectComponent, InputOption, MultipleSelectComponent, SelectViewType class RadioButtonQt(QRadioButton): - def __init__(self, model: SelectOption, model_parent: SingleSelectComponent): + def __init__(self, model: InputOption, model_parent: SingleSelectComponent): super(RadioButtonQt, self).__init__() self.model = model self.model_parent = model_parent @@ -19,7 +18,7 @@ class RadioButtonQt(QRadioButton): class CheckboxQt(QCheckBox): - def __init__(self, model: SelectOption, model_parent: MultipleSelectComponent): + def __init__(self, model: InputOption, model_parent: MultipleSelectComponent): super(CheckboxQt, self).__init__() self.model = model self.model_parent = model_parent @@ -102,7 +101,7 @@ class ComboSelectQt(QGroupBox): class MultipleSelectQt(QGroupBox): def __init__(self, model: MultipleSelectComponent): - super(MultipleSelectQt, self).__init__(model.label + ' :') + super(MultipleSelectQt, self).__init__(model.label + ' :' if model.label else None) self.setStyleSheet("QGroupBox { font-weight: bold }") self.model = model self._layout = QGridLayout() diff --git a/bauh/view/qt/thread.py b/bauh/view/qt/thread.py index d7738400..99d9260e 100644 --- a/bauh/view/qt/thread.py +++ b/bauh/view/qt/thread.py @@ -46,7 +46,7 @@ class AsyncAction(QThread, ProcessWatcher): if msg: self.signal_output.emit(msg) - def show_message(self, title: str, body: str, type_: MessageType): + def show_message(self, title: str, body: str, type_: MessageType = MessageType.INFO): self.signal_message.emit({'title': title, 'body': body, 'type': type_}) def notify_finished(self, res: object): diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index 1b3d4855..4fe48f6a 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -223,7 +223,7 @@ class ManageWindow(QWidget): return action def _ask_confirmation(self, msg: dict): - diag = ConfirmationDialog(msg['title'], msg['body'], self.locale_keys) + diag = ConfirmationDialog(title=msg['title'], body=msg['body'], locale_keys=self.locale_keys, components=msg['options']) self.signal_user_res.emit(diag.is_confirmed()) def _show_message(self, msg: dict):