2013-10-28 04:59:46 +08:00
|
|
|
# Copyright (C) 2006, 2013 Red Hat, Inc.
|
2006-06-29 03:50:17 +08:00
|
|
|
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
#
|
2018-03-21 03:00:02 +08:00
|
|
|
# This work is licensed under the GNU GPLv2.
|
|
|
|
# See the COPYING file in the top-level directory.
|
2006-06-14 22:59:40 +08:00
|
|
|
|
2012-02-01 08:07:32 +08:00
|
|
|
import logging
|
|
|
|
|
2014-09-13 04:10:45 +08:00
|
|
|
from .baseclass import vmmGObjectUI
|
2010-12-09 06:26:19 +08:00
|
|
|
|
2013-04-14 02:34:52 +08:00
|
|
|
|
2010-12-09 06:26:19 +08:00
|
|
|
class vmmAbout(vmmGObjectUI):
|
2018-03-13 23:52:11 +08:00
|
|
|
@classmethod
|
|
|
|
def show_instance(cls, parentobj):
|
|
|
|
try:
|
|
|
|
if not cls._instance:
|
2018-03-18 04:08:20 +08:00
|
|
|
cls._instance = vmmAbout()
|
2018-03-13 23:52:11 +08:00
|
|
|
cls._instance.show(parentobj.topwin)
|
|
|
|
except Exception as e:
|
|
|
|
parentobj.err.show_err(
|
|
|
|
_("Error launching 'About' dialog: %s") % str(e))
|
|
|
|
|
2010-12-09 06:26:19 +08:00
|
|
|
def __init__(self):
|
2013-09-23 04:10:16 +08:00
|
|
|
vmmGObjectUI.__init__(self, "about.ui", "vmm-about")
|
2018-03-15 19:43:56 +08:00
|
|
|
self._cleanup_on_app_close()
|
2006-06-14 22:59:40 +08:00
|
|
|
|
2013-02-17 02:31:46 +08:00
|
|
|
self.builder.connect_signals({
|
2006-06-14 22:59:40 +08:00
|
|
|
"on_vmm_about_delete_event": self.close,
|
2006-09-12 00:34:46 +08:00
|
|
|
"on_vmm_about_response": self.close,
|
2012-11-08 21:15:02 +08:00
|
|
|
})
|
2006-06-14 22:59:40 +08:00
|
|
|
|
2018-03-13 23:52:11 +08:00
|
|
|
def show(self, parent):
|
2012-02-01 07:16:54 +08:00
|
|
|
logging.debug("Showing about")
|
2010-12-09 06:26:19 +08:00
|
|
|
self.topwin.set_version(self.config.get_appversion())
|
2018-03-13 23:52:11 +08:00
|
|
|
self.topwin.set_transient_for(parent)
|
2010-12-09 06:26:19 +08:00
|
|
|
self.topwin.present()
|
2006-06-14 22:59:40 +08:00
|
|
|
|
2010-11-30 03:06:43 +08:00
|
|
|
def close(self, ignore1=None, ignore2=None):
|
2012-02-01 07:16:54 +08:00
|
|
|
logging.debug("Closing about")
|
2010-12-09 06:26:19 +08:00
|
|
|
self.topwin.hide()
|
2006-06-14 22:59:40 +08:00
|
|
|
return 1
|
2010-12-09 06:26:19 +08:00
|
|
|
|
2011-07-24 09:16:54 +08:00
|
|
|
def _cleanup(self):
|
|
|
|
pass
|