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