diff options
author | Cole Robinson <crobinso@redhat.com> | 2018-03-15 21:22:14 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2018-03-15 21:24:48 -0400 |
commit | dabbc8d5bdef57d018488e55f82468142bce693f (patch) | |
tree | 8408b442156217115dfff09d21d888276a9676f7 /virtManager/error.py | |
parent | 5ebe8b818493b66844fdc21e3845f7c6c41a3bde (diff) | |
download | virt-manager-dabbc8d5bdef57d018488e55f82468142bce693f.tar.gz |
engine: Remove centralized conn.open handling
Move connection opening logic to each caller, since needs are
slightly different.
Diffstat (limited to 'virtManager/error.py')
-rw-r--r-- | virtManager/error.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/virtManager/error.py b/virtManager/error.py index 4a913545..99624234 100644 --- a/virtManager/error.py +++ b/virtManager/error.py @@ -49,7 +49,14 @@ def _launch_dialog(dialog, primary_text, secondary_text, title, class vmmErrorDialog(vmmGObject): - def __init__(self, parent=None): + # singleton instance for non-UI classes + @classmethod + def get_instance(cls): + if not cls._instance: + cls._instance = cls(None) + return cls._instance + + def __init__(self, parent): vmmGObject.__init__(self) self._parent = parent self._simple = None |