add label when there are not env keys to set

This commit is contained in:
Jakub Trllo 2022-04-08 18:54:55 +02:00
parent 2af6e7140e
commit 9893903a57

View file

@ -37,12 +37,10 @@ class LocalEnvironmentsWidgets(QtWidgets.QWidget):
content_widget = QtWidgets.QWidget(self)
content_layout = QtWidgets.QGridLayout(content_widget)
content_layout.setContentsMargins(0, 0, 0, 0)
content_layout.setColumnStretch(0, 0)
content_layout.setColumnStretch(1, 1)
white_list_entity = (
self.system_settings_entity["general"]["local_env_white_list"]
)
row = -1
for row, item in enumerate(white_list_entity):
key = item.value
label_widget = QtWidgets.QLabel(key, self)
@ -54,6 +52,21 @@ class LocalEnvironmentsWidgets(QtWidgets.QWidget):
self._widgets_by_env_key[key] = input_widget
if row < 0:
label_widget = QtWidgets.QLabel(
(
"Your studio does not allow to change"
" Environment variables locally."
),
self
)
content_layout.addWidget(label_widget, 0, 0)
content_layout.setColumnStretch(0, 1)
else:
content_layout.setColumnStretch(0, 0)
content_layout.setColumnStretch(1, 1)
self._layout.addWidget(content_widget, 1)
self._content_layout = content_layout