Commit 31e2c6d0 authored by Sébastien Lafargue's avatar Sébastien Lafargue
Browse files

html preview: prevent multiple preview opening

parent fb8c48ba
...@@ -273,6 +273,12 @@ class HtmlPreviewAddin(GObject.Object, Ide.EditorViewAddin): ...@@ -273,6 +273,12 @@ class HtmlPreviewAddin(GObject.Object, Ide.EditorViewAddin):
stack = view.get_ancestor(Ide.LayoutStack) stack = view.get_ancestor(Ide.LayoutStack)
stack.add(web_view) stack.add(web_view)
self.action.set_enabled(False)
web_view.connect('destroy', lambda *_: self.web_view_destroyed(web_view))
def web_view_destroyed(self, web_view):
self.action.set_enabled(True)
def search_sphinx_base_dir(self, path): def search_sphinx_base_dir(self, path):
context = self.workbench.get_context() context = self.workbench.get_context()
vcs = context.get_vcs() vcs = context.get_vcs()
......
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