virt-manager/virtManager/about.py

45 lines
1.3 KiB
Python
Raw Normal View History

# Copyright (C) 2006, 2013 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com>
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
from virtinst import log
from .baseclass import vmmGObjectUI
2010-12-09 01:26:19 +03:00
2010-12-09 01:26:19 +03:00
class vmmAbout(vmmGObjectUI):
2018-03-13 18:52:11 +03:00
@classmethod
def show_instance(cls, parentobj):
try:
if not cls._instance:
cls._instance = vmmAbout()
2018-03-13 18:52:11 +03:00
cls._instance.show(parentobj.topwin)
except Exception as e: # pragma: no cover
2018-03-13 18:52:11 +03:00
parentobj.err.show_err(
_("Error launching 'About' dialog: %s") % str(e))
2010-12-09 01:26:19 +03:00
def __init__(self):
vmmGObjectUI.__init__(self, "about.ui", "vmm-about")
self._cleanup_on_app_close()
self.builder.connect_signals({
"on_vmm_about_delete_event": self.close,
"on_vmm_about_response": self.close,
2012-11-08 17:15:02 +04:00
})
2018-03-13 18:52:11 +03:00
def show(self, parent):
log.debug("Showing about")
2010-12-09 01:26:19 +03:00
self.topwin.set_version(self.config.get_appversion())
2018-03-13 18:52:11 +03:00
self.topwin.set_transient_for(parent)
2010-12-09 01:26:19 +03:00
self.topwin.present()
def close(self, ignore1=None, ignore2=None):
log.debug("Closing about")
2010-12-09 01:26:19 +03:00
self.topwin.hide()
return 1
2010-12-09 01:26:19 +03:00
def _cleanup(self):
pass