Skip to content

Commit

Permalink
Fix: Not Update Display at Detail Scheduler Config
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiramei committed Oct 4, 2024
1 parent d794e32 commit ca70bc3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gui/components/expand/expandTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def __init__(self, **kwargs):
self.label = kwargs.get('label')
self.key = kwargs.get('key')
self.dataType = kwargs.get('dataType', 'str')
self.readOnly = kwargs.get('readOnly', False)


class ComboBoxCustom(ComboBox):
Expand Down Expand Up @@ -198,6 +199,7 @@ def __init__(self, configItems: list[dict], parent=None, config=None, all_label_
currentKey = cfg.key
inputComponent = LineEdit(self)
inputComponent.setMinimumWidth(200)
inputComponent.setReadOnly(cfg.readOnly)
if currentKey == 'pre_task' or currentKey == 'post_task':
inputComponent.setText(self.parseToDisplay(self.config.get(currentKey)))
else:
Expand Down
12 changes: 12 additions & 0 deletions gui/components/expand/featureSwitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ def __init__(self, detail_config: dict, all_label_list: list, parent=None, cs=No
super().__init__(parent)
self.titleLabel = SubtitleLabel(self.tr('配置详情'), self)
configItems = [
{
'label': self.tr('事件名称'),
'dataType': 'str',
'key': 'event_name',
'readOnly': True
},
{
'label': self.tr('优先级'),
'dataType': 'int',
Expand Down Expand Up @@ -271,6 +277,12 @@ def _update_detail(self, index):
if self._event_config[j]['event_name'] == dic['event_name']:
self._event_config[j].update(config)
break

# Update Current Order Config
for j in range(0, len(self._crt_order_config)):
if self._crt_order_config[j]['event_name'] == dic['event_name']:
self._crt_order_config[j].update(config)
break
self._save_config()

def _refresh(self):
Expand Down

0 comments on commit ca70bc3

Please sign in to comment.