This repository was archived by the owner on Jan 18, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 228
Changes notification qt6 #2734
Open
mmalczak
wants to merge
5
commits into
m-labs:master
Choose a base branch
from
elhep:changes_notification_qt6
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes notification qt6 #2734
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9a9d024
Add pencil sign if the argument is modified #5
mmalczak a9afe39
Update the pencil sign accordingly to new default values #5
mmalczak 9799592
Notify about the change in experiment default values #5
mmalczak ab6e4ef
Handle the case when default argument value is missing #5
mmalczak b844c40
Notify about the change in experiments layout #5
mmalczak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,22 +63,40 @@ def __init__(self, manager, dock, expurl): | |
| self.setItemWidget(self.bottom_item, 1, buttons) | ||
|
|
||
| def reset_entry(self, key): | ||
| asyncio.ensure_future(self._recompute_argument(key)) | ||
| asyncio.ensure_future(self._recompute_arguments([key])) | ||
|
|
||
| async def _update_defaults(self): | ||
| keys = self._arguments.keys() | ||
| await self._recompute_arguments(keys, False) | ||
| for key in keys: | ||
| widgets = self._arg_to_widgets.get(key, {}) | ||
| entry = widgets.get("entry") | ||
| modified_value_icon = widgets.get("modified_value_icon") | ||
| if entry is not None and modified_value_icon is not None: | ||
| if entry.is_default(): | ||
| modified_value_icon.setVisible_(False) | ||
| else: | ||
| modified_value_icon.setVisible_(True) | ||
|
|
||
| async def _recompute_argument(self, name): | ||
| async def _recompute_arguments(self, keys, update=True): | ||
| try: | ||
| expdesc, _ = await self.manager.compute_expdesc(self.expurl) | ||
| except: | ||
| logger.error("Could not recompute argument '%s' of '%s'", | ||
| name, self.expurl, exc_info=True) | ||
| except Exception: | ||
| logger.error("Could not recompute arguments for keys of '%s'", | ||
| self.expurl, exc_info=True) | ||
| return | ||
| argument = self.manager.get_submission_arguments(self.expurl)[name] | ||
|
|
||
| procdesc = expdesc["arginfo"][name][0] | ||
| state = procdesc_to_entry(procdesc).default_state(procdesc) | ||
| argument["desc"] = procdesc | ||
| argument["state"] = state | ||
| self.update_argument(name, argument) | ||
| for name in keys: | ||
| argument = self.manager.get_submission_arguments(self.expurl)[name] | ||
| try: | ||
| procdesc = expdesc["arginfo"][name][0] | ||
| except KeyError: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This happens when removing an argument from the file and then refreshing the repository HEAD, correct? I am not certain that emitting a warning is the proper way to handle this. The behavior on |
||
| logging.warning(f"Default value for {name} is missing") | ||
| continue | ||
| state = procdesc_to_entry(procdesc).default_state(procdesc) | ||
| argument["desc"] = procdesc | ||
| if update: | ||
| argument["state"] = state | ||
| self.update_argument(name, argument) | ||
| self.dock.apply_window_color() | ||
|
|
||
| def apply_color(self, color): | ||
|
|
@@ -568,6 +586,10 @@ def __init__(self, main_window, dataset_sub, | |
| quick_open_shortcut.setContext(QtCore.Qt.ShortcutContext.ApplicationShortcut) | ||
| quick_open_shortcut.activated.connect(self.show_quick_open) | ||
|
|
||
| def update_open_experiments_defaults(self): | ||
| for experiment in self.open_experiments.values(): | ||
| experiment.argeditor.update_defaults() | ||
|
|
||
| def set_dataset_model(self, model): | ||
| self.datasets = model | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There already exists a
_recompute_arguments_taskin this file hooked up to theRecompute all argumentsbutton, and as such this is confusing. Instead of modifying this function, I would callcompute_expdescdirectly in_update_defaultsand accept the code duplication that comes with it.