Commit 749a8566 authored by Guillaume Seguin's avatar Guillaume Seguin

Fix #472: update_gviz_params failed before GUI creation

parent 568aacd8
...@@ -189,6 +189,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -189,6 +189,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
# FIXME: We need to initialize the main window after loading the # FIXME: We need to initialize the main window after loading the
# configs to restore the size, but this might have some unforeseen # configs to restore the size, but this might have some unforeseen
# consequences. # consequences.
# -- Okai, it seems it breaks things like update_gviz_params ><
os.putenv("UBUNTU_MENUPROXY", "0") os.putenv("UBUNTU_MENUPROXY", "0")
size = (self.settings.last_window_width, self.settings.last_window_height) size = (self.settings.last_window_width, self.settings.last_window_height)
MainWindow.__init__(self, None, title = _("Pronterface"), size = size) MainWindow.__init__(self, None, title = _("Pronterface"), size = size)
...@@ -853,6 +854,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -853,6 +854,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
"preview_grid_step2": "grid"} "preview_grid_step2": "grid"}
if param not in params_map: if param not in params_map:
return return
if not hasattr(self, "gviz"):
# GUI hasn't been loaded yet, ignore this setting
return
trueparam = params_map[param] trueparam = params_map[param]
if hasattr(self.gviz, trueparam): if hasattr(self.gviz, trueparam):
gviz = self.gviz gviz = self.gviz
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment