Skip to content

Commit

Permalink
Merge pull request #22228 from ccordoba12/minor-ui-improvements-for-run
Browse files Browse the repository at this point in the history
PR: Minor UI improvements to the Run entry in Preferences
  • Loading branch information
ccordoba12 authored Jul 4, 2024
2 parents 29bbf6a + 17e34e8 commit c30d8bc
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
48 changes: 26 additions & 22 deletions spyder/plugins/run/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
from qtpy.QtCore import Qt
from qtpy.QtWidgets import (
QAbstractItemView,
QGroupBox,
QHBoxLayout,
QHeaderView,
QLabel,
QVBoxLayout,
QWidget,
)

# Local imports
Expand Down Expand Up @@ -208,15 +208,15 @@ def setup_page(self):

about_label = QLabel(
_(
"The following are the global configuration settings of the "
"different plugins that can execute files in Spyder."
"The following are the global configuration presets of the "
"different runners that can execute files in Spyder."
)
)
about_label.setWordWrap(True)

# The paremeters table needs to be created before the executor_combo
# below, although is displayed after it.
params_label = QLabel(_('Available parameters:'))
params_label = QLabel(_('Configuration presets:'))
self.params_table = RunParametersTableView(self, self.table_model)
self.params_table.setMaximumHeight(180)

Expand All @@ -225,7 +225,7 @@ def setup_page(self):
params_table_layout.addWidget(self.params_table)
params_table_layout.addSpacing(2 * AppStyle.MarginSize)

executor_label = QLabel(_("Executor:"))
executor_label = QLabel(_("Runner:"))
self.executor_combo = SpyderComboBox(self)
self.executor_combo.setMinimumWidth(250)
self.executor_combo.currentIndexChanged.connect(
Expand Down Expand Up @@ -285,18 +285,18 @@ def setup_page(self):
buttons_layout.addStretch()

# Final layout
vlayout = QVBoxLayout()
vlayout.addWidget(about_label)
vlayout.addSpacing(3 * AppStyle.MarginSize)
vlayout.addLayout(executor_layout)
vlayout.addSpacing(3 * AppStyle.MarginSize)
vlayout.addWidget(params_label)
vlayout.addLayout(params_table_layout)
vlayout.addSpacing(AppStyle.MarginSize)
vlayout.addLayout(buttons_layout)
vlayout.addStretch()
executor_widget = QWidget(self)
executor_widget.setLayout(vlayout)
presets_group = QGroupBox(_("Global presets"))
presets_layout = QVBoxLayout()
presets_group.setLayout(presets_layout)

presets_layout.addWidget(about_label)
presets_layout.addSpacing(3 * AppStyle.MarginSize)
presets_layout.addLayout(executor_layout)
presets_layout.addSpacing(3 * AppStyle.MarginSize)
presets_layout.addWidget(params_label)
presets_layout.addLayout(params_table_layout)
presets_layout.addSpacing(AppStyle.MarginSize)
presets_layout.addLayout(buttons_layout)

# --- Editor interactions tab ---
newcb = self.create_checkbox
Expand All @@ -305,15 +305,19 @@ def setup_page(self):
run_cell_box = newcb(_("Copy full cell contents to the console when "
"running code cells"), 'run_cell_copy')

run_group = QGroupBox(_("Editor interactions"))
run_layout = QVBoxLayout()
run_group.setLayout(run_layout)

run_layout.addWidget(saveall_box)
run_layout.addWidget(run_cell_box)
run_widget = QWidget(self)
run_widget.setLayout(run_layout)

# --- Tabs ---
self.create_tab(_("Global configurations"), executor_widget)
self.create_tab(_("Editor interactions"), run_widget)
# --- Page layout ----
vlayout = QVBoxLayout()
vlayout.addWidget(presets_group)
vlayout.addWidget(run_group)
vlayout.addStretch()
self.setLayout(vlayout)

def executor_index_changed(self, index: int):
# Save previous executor configuration
Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/run/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def headerData(
elif section == self.CONTEXT:
return _('Context')
elif section == self.NAME:
return _('Parameters name')
return _('Name')

def rowCount(self, parent: QModelIndex = None) -> int:
return len(self.params_index)
Expand Down
10 changes: 5 additions & 5 deletions spyder/plugins/run/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def setup(self):
self.executor_combo.setMinimumWidth(250)
executor_tip = TipWidget(
_(
"This is the plugin that will be used for execution when you "
"This is the runner that will be used for execution when you "
"click on the Run button"
),
icon=ima.icon('question_tip'),
Expand All @@ -597,7 +597,7 @@ def setup(self):
parameters_tip = TipWidget(
_(
"Select between global or local (i.e. for this file) "
"execution parameters. You can set the latter below"
"configuration presets. You can set the latter below"
),
icon=ima.icon('question_tip'),
hover_icon=ima.icon('question_tip_hover'),
Expand Down Expand Up @@ -634,9 +634,9 @@ def setup(self):
)
name_params_tip = TipWidget(
_(
"You can set as many configurations as you want by providing "
"different names. Each one will be saved after clicking the "
"Ok button below"
"You can set as many configuration presets as you want by "
"providing different names. Each one will be saved after "
"clicking the Ok button below"
),
icon=ima.icon('question_tip'),
hover_icon=ima.icon('question_tip_hover'),
Expand Down

0 comments on commit c30d8bc

Please sign in to comment.