Commits

Yuya Nishihara committed 115117e

workbench: keep single instance of ServeDialog by DialogKeeper (closes #1845)

This change is intended to eliminate dependency to run.serve, but thankfully
it fixes #1845. If the dialog is minimized to tray, it will be activated again.

Comments (0)

Files changed (1)

tortoisehg/hgqt/workbench.py

 from mercurial.error import RepoError
 from tortoisehg.util import paths, hglib
 
-from tortoisehg.hgqt import thgrepo, cmdui, qtlib, mq
+from tortoisehg.hgqt import thgrepo, cmdui, qtlib, mq, serve
 from tortoisehg.hgqt.i18n import _
 from tortoisehg.hgqt.repowidget import RepoWidget
 from tortoisehg.hgqt.reporegistry import RepoRegistryView
             getattr(w, op)()
 
     def serve(self):
-        from tortoisehg.hgqt import run
+        self._dialogs.open(Workbench._createServeDialog)
+
+    def _createServeDialog(self):
         w = self.repoTabsWidget.currentWidget()
         if w:
-            run.serve(w.repo.ui, root=w.repo.root)
+            return serve.run(w.repo.ui, root=w.repo.root)
         else:
-            run.serve(self.ui)
+            return serve.run(self.ui)
 
     def loadall(self):
         w = self.repoTabsWidget.currentWidget()