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