Skip to content

Commit

Permalink
Fix loading sidebar gui on certain Linux installations
Browse files Browse the repository at this point in the history
Delay registering replacement stages until after the original stages are created

Fixes #7
  • Loading branch information
fieldOfView committed Jan 25, 2020
1 parent 0504a14 commit f951d77
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SidebarGUIPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self):

self._prepare_stage_view_id = "SolidView" # can be "SolidView" or "XRayView"

Application.getInstance().engineCreatedSignal.connect(self._onEngineCreated)
Application.getInstance().pluginsLoaded.connect(self._onPluginsLoaded)
Application.getInstance().getPreferences().addPreference("sidebargui/expand_extruder_configuration", False)

self._controller = Application.getInstance().getController()
Expand All @@ -29,6 +29,11 @@ def __init__(self):

self._proxy = SidebarGUIProxy()

def _onPluginsLoaded(self):
# delayed connection to engineCreatedSignal to force this plugin to receive that signal
# AFTER the original stages are created
Application.getInstance().engineCreatedSignal.connect(self._onEngineCreated)

def _onEngineCreated(self):
Logger.log("d", "Registering replacement stages")

Expand Down

0 comments on commit f951d77

Please sign in to comment.