From 789dfc04924494f1153acc4841d75902cf7f5f96 Mon Sep 17 00:00:00 2001 From: Camille GOUTTEBROZE Date: Fri, 5 Dec 2014 09:05:21 +0100 Subject: [PATCH] Default splash screen and default logo for default profile generator --- src/AppQuickStart/app-quickstart.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/AppQuickStart/app-quickstart.py b/src/AppQuickStart/app-quickstart.py index 04409a99e..4fb31e6a6 100755 --- a/src/AppQuickStart/app-quickstart.py +++ b/src/AppQuickStart/app-quickstart.py @@ -216,14 +216,17 @@ def profileGenerateSources( options, args ) : except ImportError: found = False - #Generate splash and logo + #Generate logo and splash + logo_destination = os.path.join( app_resources_dir, 'app_logo.png') + splash_destination = os.path.join( app_resources_dir, 'splash.png') + about_destination = os.path.join( app_resources_dir, 'about.png') if found : import ImageFont font = ImageFont.truetype( os.path.join( kernel_resources_dir, "Anita semi square.ttf" ) , 18 ) #Generate and save logo app_logo = profileGenerateLogo( options.name, font ) - app_logo.save( os.path.join( app_resources_dir, 'app_logo.png'), "PNG" ) + app_logo.save( logo_destination, "PNG" ) #Generate and splash screen and about image if options.slogan : @@ -231,8 +234,17 @@ def profileGenerateSources( options, args ) : else : subtext = "Powered by SALOME" im = profileGenerateSplash( kernel_resources_dir, options.name, options.version, subtext ) - im.save( os.path.join( app_resources_dir, 'splash.png'), "PNG" ) - im.save( os.path.join( app_resources_dir, 'about.png'), "PNG" ) + im.save( splash_destination, "PNG" ) + im.save( about_destination, "PNG" ) + else : + gui_resources_dir = os.path.join( os.environ["GUI_ROOT_DIR"], "share", "salome", "resources", "gui" ) + logo_name = os.path.join( gui_resources_dir, "icon_applogo.png" ) + if os.path.exists( logo_name ) : + shutil.copy( logo_name, logo_destination ) + about_name = os.path.join( gui_resources_dir, "icon_about.png" ) + if os.path.exists( about_name ) : + shutil.copy( about_name, about_destination ) + shutil.copy( about_name, splash_destination ) #End of script print "Sources of %s were generated in %s." %( options.name, app_dir ) -- 2.39.2