Skip to content

wxGUI/animation: Integrate g.gui.animation into the GUI as a tab - #7823

Open
saket0187 wants to merge 1 commit into
OSGeo:mainfrom
saket0187:animation-tab
Open

wxGUI/animation: Integrate g.gui.animation into the GUI as a tab#7823
saket0187 wants to merge 1 commit into
OSGeo:mainfrom
saket0187:animation-tab

Conversation

@saket0187

@saket0187 saket0187 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This PR tries to add animation as a tab just like gmodeler.

AI summary ## Problem

The Animation Tool always opens in its own top-level window, including in the
Single-Window layout where every other tool of its kind is a notebook tab. It
is the odd one out next to the Graphical Modeler, and it does not participate
in the docking, tab and statusbar behaviour the Single-Window layout provides.

Changes

Split the tool the same way the Graphical Modeler is split:

  • animation/panels.py (new) holds AnimationPanel(wx.Panel, MainPageBase)
    with all of the logic, along with AnimationsPanel and the slider classes
    moved unchanged from animation/frame.py.
  • animation/frame.py keeps AnimationFrame, now a thin wx.Frame which
    creates a statusbar and hosts the panel, mirroring gmodeler/frame.py.
  • main_window/frame.py builds the panel with dockable=True, calls
    SetUpPage() and adds it to mainnotebook, so it opens as a tab. It returns
    the panel so a caller can load data into it.

Behaviour outside the Single-Window layout is unchanged: g.gui.animation and
the multi-window layout (lmgr/frame.py) both keep using AnimationFrame and
open a separate window. The menu handler name is unchanged, so no menu data
needed editing, and the animation Makefile installs the new module already
since it globs.

Two pre-existing bugs are fixed as a consequence of the split:

  • the temporary directory was a module-level global, so two animation windows
    would have overwritten each other's path; it is now per instance
  • the provider signals were connected inside for win in self.windows, that
    is four times, which was harmless only because PyDispatcher deduplicates
    receivers

Panes are laid out again on resize, because dragging the notebook tab reparents
the panel and the panes otherwise keep their pre-drag layout until some other
event forces an update.

Testing

Verified that the classes moved out of animation/frame.py are byte-identical
to their previous version, and that every method of the old AnimationFrame
exists on AnimationPanel. InitStatusbar is the one exception: the frame now
creates the statusbar and the panel writes to it through SetStatusText, which
is what lets the tab use the main window's statusbar.

Checked the collaborators against the panel: controller.py uses only
AddWindow, IsWindowShown, RemoveWindow, SetSlider and animationPanel;
toolbars.py calls self.parent.On* including OnCloseWindow; notebook.py
passes askIfSaveWorkspace only to MapPanel, so the panel's
OnCloseWindow(event=None) signature is right.

Screenshot 2026-08-13 at 10 01 02 PM

With the panel separated, a Data Catalog context menu entry for space time
datasets becomes straightforward: OnAnimationTool() returns the panel, and
AnimationPanel.LoadDataset() takes a dataset, so an entry can open the tab
and load the dataset without going through g.gui.animation, which would
always open a separate window.

Claude assistance was used for the refactoring and the review.

@github-actions github-actions Bot added GUI wxGUI related Python Related code is in Python labels Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GUI wxGUI related Python Related code is in Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant