Skip to content

Commit 72d78bc

Browse files
committed
Lazy load UI
1 parent 3a64e9f commit 72d78bc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

spritesheetExporter/spritesheet_exporter.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010

1111
class SpritesheetExporter(Extension):
12-
controller = Controller()
13-
1412
def __init__(self, parent):
1513
"""
1614
Always initialise the superclass.
@@ -35,7 +33,15 @@ def createActions(self, window):
3533
)
3634

3735
export_action.setToolTip("Export animation in timeline as spritesheet")
38-
export_action.triggered.connect(self.controller.show_dialog)
36+
export_action.triggered.connect(self._show_dialog)
37+
38+
def _show_dialog(self) -> None:
39+
"""
40+
Creates the controller if it does not exist, and shows the dialog.
41+
"""
42+
if not hasattr(self, "_controller"):
43+
self._controller = Controller()
44+
self._controller.show_dialog()
3945

4046

4147
Scripter.addExtension(SpritesheetExporter(Krita.instance()))

0 commit comments

Comments
 (0)