[GRASS-SVN] r45587 - in grass/trunk/gui: images wxpython wxpython/gui_modules wxpython/scripts

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 6 13:00:13 EST 2011


Author: martinl
Date: 2011-03-06 10:00:13 -0800 (Sun, 06 Mar 2011)
New Revision: 45587

Added:
   grass/trunk/gui/images/__init__.py
   grass/trunk/gui/images/grass_form.png
   grass/trunk/gui/images/grass_splash.png
   grass/trunk/gui/images/grass_splash.xcf
   grass/trunk/gui/images/loc_wizard.png
   grass/trunk/gui/images/loc_wizard_qgis.png
   grass/trunk/gui/images/qgis_world.png
   grass/trunk/gui/images/small_down_arrow.png
   grass/trunk/gui/images/small_up_arrow.png
Removed:
   grass/trunk/gui/images/silesia_splash.png
   grass/trunk/gui/wxpython/images/
Modified:
   grass/trunk/gui/images/Makefile
   grass/trunk/gui/wxpython/Makefile
   grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
   grass/trunk/gui/wxpython/gui_modules/gcpmapdisp.py
   grass/trunk/gui/wxpython/gui_modules/globalvar.py
   grass/trunk/gui/wxpython/gui_modules/location_wizard.py
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/menuform.py
   grass/trunk/gui/wxpython/scripts/r.li.setup.py
   grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: improve splash screen
       clean up images


Modified: grass/trunk/gui/images/Makefile
===================================================================
--- grass/trunk/gui/images/Makefile	2011-03-06 12:29:19 UTC (rev 45586)
+++ grass/trunk/gui/images/Makefile	2011-03-06 18:00:13 UTC (rev 45587)
@@ -1,12 +1,15 @@
 MODULE_TOPDIR = ../..
 
-include $(MODULE_TOPDIR)/include/Make/Dir.make
+include $(MODULE_TOPDIR)/include/Make/Other.make
 
-default:
-	$(MAKE) $(ETC)/gui/images/startup_banner.png
+ETCDIR = $(ETC)/gui/images
 
-$(ETC)/gui/images/%: % | $(ETC)/gui/images
+FILES := $(wildcard *.png)
+
+default: $(patsubst %,$(ETCDIR)/%,$(FILES))
+
+$(ETCDIR)/%.png: %.png | $(ETCDIR)
 	$(INSTALL_DATA) $< $@
 
-$(ETC)/gui/images:
+$(ETCDIR):
 	$(MKDIR) $@

Copied: grass/trunk/gui/images/__init__.py (from rev 45578, grass/trunk/gui/wxpython/images/__init__.py)
===================================================================
--- grass/trunk/gui/images/__init__.py	                        (rev 0)
+++ grass/trunk/gui/images/__init__.py	2011-03-06 18:00:13 UTC (rev 45587)
@@ -0,0 +1,8 @@
+all = [
+    "grass_form.png",
+    "grass_splash.png",
+    "grass_splash.xcf",
+    "loc_wizard.png",
+    "loc_wizard_qgis.png",
+    "qgis_world.png",
+    ]

Copied: grass/trunk/gui/images/grass_form.png (from rev 45578, grass/trunk/gui/wxpython/images/grass_form.png)
===================================================================
(Binary files differ)

Copied: grass/trunk/gui/images/grass_splash.png (from rev 45578, grass/trunk/gui/wxpython/images/grass_splash.png)
===================================================================
(Binary files differ)

Copied: grass/trunk/gui/images/grass_splash.xcf (from rev 45578, grass/trunk/gui/wxpython/images/grass_splash.xcf)
===================================================================
(Binary files differ)

Copied: grass/trunk/gui/images/loc_wizard.png (from rev 45578, grass/trunk/gui/wxpython/images/loc_wizard.png)
===================================================================
(Binary files differ)

Copied: grass/trunk/gui/images/loc_wizard_qgis.png (from rev 45578, grass/trunk/gui/wxpython/images/loc_wizard_qgis.png)
===================================================================
(Binary files differ)

Copied: grass/trunk/gui/images/qgis_world.png (from rev 45578, grass/trunk/gui/wxpython/images/qgis_world.png)
===================================================================
(Binary files differ)

Deleted: grass/trunk/gui/images/silesia_splash.png
===================================================================
(Binary files differ)

Copied: grass/trunk/gui/images/small_down_arrow.png (from rev 45578, grass/trunk/gui/wxpython/images/small_down_arrow.png)
===================================================================
(Binary files differ)

Copied: grass/trunk/gui/images/small_up_arrow.png (from rev 45578, grass/trunk/gui/wxpython/images/small_up_arrow.png)
===================================================================
(Binary files differ)

Modified: grass/trunk/gui/wxpython/Makefile
===================================================================
--- grass/trunk/gui/wxpython/Makefile	2011-03-06 12:29:19 UTC (rev 45586)
+++ grass/trunk/gui/wxpython/Makefile	2011-03-06 18:00:13 UTC (rev 45587)
@@ -9,10 +9,10 @@
 
 ETCDIR = $(ETC)/gui/wxpython
 
-SRCFILES := $(wildcard scripts/* compat/* gui_modules/* icons/*.* images/* xml/*) gis_set.py gis_set_error.py wxgui.py README
+SRCFILES := $(wildcard scripts/* compat/* gui_modules/* icons/*.* xml/*) gis_set.py gis_set_error.py wxgui.py README
 DSTFILES := $(patsubst %,$(ETCDIR)/%,$(SRCFILES)) $(patsubst %.py,$(ETCDIR)/%.pyc,$(filter %.py,$(SRCFILES)))
 
-DSTDIRS := $(patsubst %,$(ETCDIR)/%,compat gui_modules icons images scripts xml)
+DSTDIRS := $(patsubst %,$(ETCDIR)/%,compat gui_modules icons scripts xml)
 
 default: $(DSTFILES) menustrings.py
 	$(MAKE) parsubdirs

Modified: grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2011-03-06 12:29:19 UTC (rev 45586)
+++ grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2011-03-06 18:00:13 UTC (rev 45587)
@@ -59,11 +59,8 @@
     sys.path.append(CompatPath)
     from compat import subprocess
 
-gmpath = os.path.join(globalvar.ETCWXDIR, "icons")
-sys.path.append(gmpath)
+sys.path.append(os.path.join(globalvar.ETCWXDIR, "icons"))
 
-imgpath = os.path.join(globalvar.ETCWXDIR, "images")
-
 #
 # global variables
 #
@@ -76,7 +73,7 @@
 maptype = 'cell'
 
 def getSmallUpArrowImage():
-    stream = open(os.path.join(imgpath, 'small_up_arrow.png'), 'rb')
+    stream = open(os.path.join(globalvar.ETCIMGDIR, 'small_up_arrow.png'), 'rb')
     try:
         img = wx.ImageFromStream(stream)
     finally:
@@ -84,7 +81,7 @@
     return img
 
 def getSmallDnArrowImage():
-    stream = open(os.path.join(imgpath, 'small_down_arrow.png'), 'rb')
+    stream = open(os.path.join(globalvar.ETCIMGDIR, 'small_down_arrow.png'), 'rb')
     try:
         img = wx.ImageFromStream(stream)
     finally:

Modified: grass/trunk/gui/wxpython/gui_modules/gcpmapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcpmapdisp.py	2011-03-06 12:29:19 UTC (rev 45586)
+++ grass/trunk/gui/wxpython/gui_modules/gcpmapdisp.py	2011-03-06 18:00:13 UTC (rev 45587)
@@ -63,13 +63,6 @@
 from mapdisp_command import Command
 from mapdisp_window import BufferedWindow
 
-import images
-imagepath = images.__path__[0]
-sys.path.append(imagepath)
-
-###
-### global variables
-###
 # for standalone app
 cmdfilename = None
 

Modified: grass/trunk/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/globalvar.py	2011-03-06 12:29:19 UTC (rev 45586)
+++ grass/trunk/gui/wxpython/gui_modules/globalvar.py	2011-03-06 18:00:13 UTC (rev 45587)
@@ -28,6 +28,7 @@
 ETCDIR = os.path.join(os.getenv("GISBASE"), "etc")
 ETCICONDIR = os.path.join(os.getenv("GISBASE"), "etc", "gui", "icons")
 ETCWXDIR = os.path.join(ETCDIR, "gui", "wxpython")
+ETCIMGDIR = os.path.join(ETCDIR, "gui", "images")
 
 sys.path.append(os.path.join(ETCDIR, "python"))
 import grass.script as grass

Modified: grass/trunk/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/location_wizard.py	2011-03-06 12:29:19 UTC (rev 45586)
+++ grass/trunk/gui/wxpython/gui_modules/location_wizard.py	2011-03-06 18:00:13 UTC (rev 45587)
@@ -1729,7 +1729,7 @@
         #
         # define wizard image
         #
-        imagePath = os.path.join(globalvar.ETCWXDIR, "images", "loc_wizard_qgis.png")
+        imagePath = os.path.join(globalvar.ETCIMGDIR, "loc_wizard_qgis.png")
         wizbmp = wx.Image(imagePath, wx.BITMAP_TYPE_PNG)
         wizbmp = wizbmp.ConvertToBitmap()
         
@@ -2143,8 +2143,8 @@
         #
         # image
         #
-        self.img = wx.Image(os.path.join(globalvar.ETCWXDIR, "images",
-                                         "qgis_world.png"), wx.BITMAP_TYPE_PNG).ConvertToBitmap()
+        self.img = wx.Image(os.path.join(globalvar.ETCIMGDIR, "qgis_world.png"),
+                            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
         
         #
         # set current working environment to PERMANENT mapset

Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-03-06 12:29:19 UTC (rev 45586)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-03-06 18:00:13 UTC (rev 45587)
@@ -71,13 +71,6 @@
 from mapdisp_command import Command
 from mapdisp_window import BufferedWindow
 
-import images
-imagepath = images.__path__[0]
-sys.path.append(imagepath)
-
-###
-### global variables
-###
 # for standalone app
 cmdfilename = None
 

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2011-03-06 12:29:19 UTC (rev 45586)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2011-03-06 18:00:13 UTC (rev 45587)
@@ -96,8 +96,6 @@
     wxbase = os.path.join(globalvar.ETCWXDIR)
 
 sys.path.append(wxbase)
-imagepath = os.path.join(wxbase, "images")
-sys.path.append(imagepath)
 
 from grass.script import core as grass
 
@@ -772,8 +770,8 @@
         
         # GRASS logo
         self.logo = wx.StaticBitmap(parent = self.panel,
-                                    bitmap = wx.Bitmap(name = os.path.join(imagepath,
-                                                                       'grass_form.png'),
+                                    bitmap = wx.Bitmap(name = os.path.join(globalvar.ETCIMGDIR,
+                                                                           'grass_form.png'),
                                                      type = wx.BITMAP_TYPE_PNG))
         topsizer.Add(item = self.logo, proportion = 0, border = 3,
                      flag = wx.ALL | wx.ALIGN_CENTER_VERTICAL)

Modified: grass/trunk/gui/wxpython/scripts/r.li.setup.py
===================================================================
--- grass/trunk/gui/wxpython/scripts/r.li.setup.py	2011-03-06 12:29:19 UTC (rev 45586)
+++ grass/trunk/gui/wxpython/scripts/r.li.setup.py	2011-03-06 18:00:13 UTC (rev 45587)
@@ -119,7 +119,7 @@
         #
         # file = "loc_wizard.png"
         file = "loc_wizard_qgis.png"
-        imagePath = os.path.join(globalvar.ETCWXDIR, "images", file)
+        imagePath = os.path.join(globalvar.ETCIMGDIR, file)
         wizbmp = wx.Image(imagePath, wx.BITMAP_TYPE_PNG)
         # wizbmp.Rescale(250,600)
         wizbmp = wizbmp.ConvertToBitmap()
@@ -728,4 +728,4 @@
     app = wx.App()
     gWizard = LocationWizard(None)
 #    gWizard.Show()
-    app.MainLoop()
\ No newline at end of file
+    app.MainLoop()

Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2011-03-06 12:29:19 UTC (rev 45586)
+++ grass/trunk/gui/wxpython/wxgui.py	2011-03-06 18:00:13 UTC (rev 45587)
@@ -57,6 +57,11 @@
     import wx.lib.customtreectrl as CT
     import wx.lib.flatnotebook   as FN
 
+try:
+    import wx.lib.agw.advancedsplash as SC
+except ImportError:
+    SC = None
+
 sys.path.append(os.path.join(globalvar.ETCDIR, "python"))
 from grass.script import core as grass
 
@@ -1474,11 +1479,22 @@
         wx.InitAllImageHandlers()
 
         # create splash screen
-        introImagePath = os.path.join(globalvar.ETCWXDIR, "images", "grass_splash.png")
+        introImagePath = os.path.join(globalvar.ETCIMGDIR, "grass_splash.png")
         introImage     = wx.Image(introImagePath, wx.BITMAP_TYPE_PNG)
         introBmp       = introImage.ConvertToBitmap()
-        wx.SplashScreen (bitmap = introBmp, splashStyle = wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
-                         milliseconds = 2000, parent = None, id = wx.ID_ANY)
+        if SC:
+            splash = SC.AdvancedSplash(bitmap = introBmp, 
+                                       extrastyle = SC.AS_TIMEOUT | SC.AS_CENTER_ON_SCREEN,
+                                       timeout = 2000, parent = None, id = wx.ID_ANY)
+            splash.SetText(_('Starting GRASS GUI...'))
+            splash.SetTextColour(wx.Colour(45, 52, 27))
+            splash.SetTextFont(wx.Font(pointSize = 15, family = wx.DEFAULT, style = wx.NORMAL,
+                                       weight = wx.BOLD))
+            splash.SetTextPosition((150, 430))
+        else:
+            wx.SplashScreen (bitmap = introBmp, splashStyle = wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
+                             milliseconds = 2000, parent = None, id = wx.ID_ANY)
+        
         wx.Yield()
         
         w, h = wx.GetDisplaySize()



More information about the grass-commit mailing list