Skip to content

Commit

Permalink
* Put system_pythonpath and system_env_variables in separate QGroupBox
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclary committed May 27, 2021
1 parent 6f6601c commit d89c5e5
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions spyder/plugins/maininterpreter/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ def setup_page(self):
self.cus_exec_radio.toggled.connect(self.cus_exec_combo.setEnabled)
pyexec_layout.addWidget(self.cus_exec_combo)

pyexec_group.setLayout(pyexec_layout)

self.pyexec_edit = self.cus_exec_combo.combobox.lineEdit()

# ENV Group
pyenv_group = QGroupBox(_("Environment variables"))
pyenv_label = QLabel(_("For standalone Spyder applications "
"(macOS, Windows), select whether to add user "
"environment variables to the Python "
"interpreter environment."))
pyenv_label.setWordWrap(True)
system_pythonpath = newcb(
_("Use system PYTHONPATH"),
'system_pythonpath',
Expand All @@ -127,7 +138,6 @@ def setup_page(self):
"and immediately to completions"),
tip=_("For standalone applications, use your system PYTHONPATH")
)
pyexec_layout.addWidget(system_pythonpath)
system_env_variables = newcb(
_("Use system environment variables"),
'system_env_variables',
Expand All @@ -136,15 +146,16 @@ def setup_page(self):
tip=_("For standalone applications, use your "
"system environment variables")
)
pyexec_layout.addWidget(system_env_variables)
if not running_in_mac_app() and not is_pynsist():
# Disable preference if not a standalone application
system_pythonpath.setEnabled(False)
system_env_variables.setEnabled(False)

pyexec_group.setLayout(pyexec_layout)

self.pyexec_edit = self.cus_exec_combo.combobox.lineEdit()
pyenv_layout = QVBoxLayout()
pyenv_layout.addWidget(pyenv_label)
pyenv_layout.addWidget(system_pythonpath)
pyenv_layout.addWidget(system_env_variables)
pyenv_group.setLayout(pyenv_layout)

# UMR Group
umr_group = QGroupBox(_("User Module Reloader (UMR)"))
Expand Down Expand Up @@ -193,6 +204,7 @@ def setup_page(self):

vlayout = QVBoxLayout()
vlayout.addWidget(pyexec_group)
vlayout.addWidget(pyenv_group)
vlayout.addWidget(umr_group)
vlayout.addStretch(1)
self.setLayout(vlayout)
Expand Down

0 comments on commit d89c5e5

Please sign in to comment.