Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have Ert sidebar have correct focus on startup and when simulating #9548

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/ert/gui/main_window.py
Copy link
Contributor

@AugustoMagalhaes AugustoMagalhaes Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When working on a new issue I've realized I've forgot to mark this as default (I'm sorry for that btw), but also that when simulation starts there is no selection change to the "Simulation status" button (self.results_button). If you want, you could also add this code to post_init function to achieve that:

 def post_init(self) -> None:
        experiment_panel = ExperimentPanel(
            self.ert_config,
            self.notifier,
            self.config_file,
            self.facade.get_ensemble_size(),
        )
        # This code snippet below
        experiment_panel.experiment_started.connect(
            lambda: self.results_button.setChecked(True)
        )
...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense. Nice catch @AugustoMagalhaes !

Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ def __init__(
self._experiment_panel: ExperimentPanel | None = None
self._plot_window: PlotWindow | None = None
self._manage_experiments_panel: ManageExperimentsPanel | None = None
self._add_sidebar_button("Start simulation", QIcon("img:library_add.svg"))
self._add_sidebar_button(
"Start simulation", QIcon("img:library_add.svg")
).click()
plot_button = self._add_sidebar_button("Create plot", QIcon("img:timeline.svg"))
plot_button.setToolTip("Right click to open external window")
self._add_sidebar_button("Manage experiments", QIcon("img:build_wrench.svg"))
Expand Down Expand Up @@ -235,6 +237,9 @@ def post_init(self) -> None:
self.config_file,
self.facade.get_ensemble_size(),
)
experiment_panel.experiment_started.connect(
lambda: self.results_button.setChecked(True)
)
self.central_layout.addWidget(experiment_panel)
self._experiment_panel = experiment_panel
self.central_panels_map["Start simulation"] = self._experiment_panel
Expand Down
Loading