Skip to content

Commit

Permalink
Enable opening the default Python or Julia in the Basic Console witho…
Browse files Browse the repository at this point in the history
…ut running a Tool first

- There are two new buttons in the Main Windows' Consoles menu for this purpose
  • Loading branch information
ptsavol committed Jan 14, 2025
1 parent fcaa2a0 commit d7ab408
Show file tree
Hide file tree
Showing 12 changed files with 945 additions and 152 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/)
### Added

- Support for Python 3.13.
- You can now open a detached Basic Console with the default Python or Julia from the Consoles menu. Default
Python and Julia are defined in app settings (File->Settings->Tools)

### Changed

Expand Down
17 changes: 17 additions & 0 deletions spinetoolbox/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,23 @@ def icon(self, info):
return super().icon(info)


def basic_console_icon(language):
"""Returns an SVG icon for the given language or an empty QIcon if not available.
Args:
language (str): Kernel language
Returns:
QIcon: Icon
"""
if language == "python":
return QIcon(":/symbols/python-logo.svg")

Check warning on line 685 in spinetoolbox/helpers.py

View check run for this annotation

Codecov / codecov/patch

spinetoolbox/helpers.py#L685

Added line #L685 was not covered by tests
elif language == "julia":
return QIcon(":/symbols/julia-logo.svg")

Check warning on line 687 in spinetoolbox/helpers.py

View check run for this annotation

Codecov / codecov/patch

spinetoolbox/helpers.py#L687

Added line #L687 was not covered by tests
else:
return QIcon()

Check warning on line 689 in spinetoolbox/helpers.py

View check run for this annotation

Codecov / codecov/patch

spinetoolbox/helpers.py#L689

Added line #L689 was not covered by tests


def ensure_window_is_on_screen(window, size):
"""
Checks if window is on screen and if not, moves and resizes it to make it visible on the primary screen.
Expand Down
Loading

0 comments on commit d7ab408

Please sign in to comment.