[GRASS-SVN] r39771 - in grass/trunk: . gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 20 13:34:40 EST 2009


Author: martinl
Date: 2009-11-20 13:34:40 -0500 (Fri, 20 Nov 2009)
New Revision: 39771

Modified:
   grass/trunk/Makefile
   grass/trunk/contributors.csv
   grass/trunk/gui/wxpython/gui_modules/help.py
   grass/trunk/translators.csv
Log:
note contributors.csv translators.csv (wxGUI/about) + some cosmetics 


Modified: grass/trunk/Makefile
===================================================================
--- grass/trunk/Makefile	2009-11-19 23:17:03 UTC (rev 39770)
+++ grass/trunk/Makefile	2009-11-20 18:34:40 UTC (rev 39771)
@@ -59,7 +59,7 @@
 
 SUBDIRS = $(DIRS)
 
-FILES = AUTHORS COPYING CHANGES REQUIREMENTS.html GPL.TXT
+FILES = AUTHORS COPYING CHANGES REQUIREMENTS.html GPL.TXT contributors.csv translators.csv
 FILES_DST = $(patsubst %,${ARCH_DISTDIR}/%,$(FILES))
 
 # why no locale directory?

Modified: grass/trunk/contributors.csv
===================================================================
--- grass/trunk/contributors.csv	2009-11-19 23:17:03 UTC (rev 39770)
+++ grass/trunk/contributors.csv	2009-11-20 18:34:40 UTC (rev 39771)
@@ -30,7 +30,7 @@
 justin,Justin Hickey,<jhickey hpcc.nectec.or.th>,Thailand,-,-
 markus,Markus Neteler,<neteler cealp.it>,Italy,neteler,yes
 martin,Martin Wegmann,<wegmann biozentrum.uni-wuerzburg.de>,Germany,wegmann,-
-martinl,Martin Landa,<landa.martin gmail.com>,Italy,martinl,yes
+martinl,Martin Landa,<landa.martin gmail.com>,Czech Republic,martinl,yes
 massimo,Massimo Cuomo,<m.cuomo acsys.it>,Switzerland,-,-
 michael,Michael Barton,<michael.barton asu.edu>,USA,cmbarton,yes
 mike,Mike Thomas,<miketh brisbane.paradigmgeo.com>,Australia,-,-

Modified: grass/trunk/gui/wxpython/gui_modules/help.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/help.py	2009-11-19 23:17:03 UTC (rev 39770)
+++ grass/trunk/gui/wxpython/gui_modules/help.py	2009-11-20 18:34:40 UTC (rev 39771)
@@ -361,7 +361,10 @@
         wx.Frame.__init__(self, parent=parent, id=wx.ID_ANY, size=(550,400), 
                           title=_('About GRASS GIS'))
         
-        # version and web site
+        # icon
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+
+        # get version and web site
         version, svn_gis_h_rev, svn_gis_h_date = gcmd.RunCommand('g.version',
                                                                  flags = 'r',
                                                                  read = True).splitlines()
@@ -387,8 +390,57 @@
             infoSizer.Add(item = info, proportion = 0,
                           flag = wx.TOP | wx.ALIGN_CENTER, border = 5)
             i += 1
-            
-        # copyright information
+        
+        #
+        # create pages
+        #
+        copyrightwin = self.PageCopyright()
+        licensewin   = self.PageLicense()
+        authorwin    = self.PageCredit()
+        contribwin   = self.PageContributors()
+        transwin     = self.PageTranslators()
+
+        # create a flat notebook for displaying information about GRASS
+        nbstyle = FN.FNB_VC8 | \
+                FN.FNB_BACKGROUND_GRADIENT | \
+                FN.FNB_TABS_BORDER_SIMPLE | \
+                FN.FNB_NO_X_BUTTON | \
+                FN.FNB_NO_NAV_BUTTONS
+                
+        aboutNotebook = FN.FlatNotebook(self, id=wx.ID_ANY, style=nbstyle)
+        aboutNotebook.SetTabAreaColour(globalvar.FNPageColor)
+        
+        # make pages for About GRASS notebook
+        pg1 = aboutNotebook.AddPage(infoTxt,      text=_("Info"))
+        pg2 = aboutNotebook.AddPage(copyrightwin, text=_("Copyright"))
+        pg3 = aboutNotebook.AddPage(licensewin,   text=_("License"))
+        pg4 = aboutNotebook.AddPage(authorwin,    text=_("Authors"))
+        pg5 = aboutNotebook.AddPage(contribwin,   text=_("Contributors"))
+        pg5 = aboutNotebook.AddPage(transwin,     text=_("Translators"))
+        
+        # buttons
+        btnClose = wx.Button(parent = self, id = wx.ID_CLOSE)
+        btnSizer = wx.BoxSizer(wx.HORIZONTAL)
+        btnSizer.Add(item = btnClose, proportion = 1,
+                     flag = wx.ALL | wx.EXPAND | wx.ALIGN_RIGHT,
+                     border = 5)
+        # bindings
+        # self.aboutNotebook.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.OnAGPageChanged)
+        btnClose.Bind(wx.EVT_BUTTON, self.OnCloseWindow)
+
+        infoTxt.SetSizer(infoSizer)
+        infoSizer.Fit(infoTxt)
+        
+        sizer = wx.BoxSizer(wx.VERTICAL)
+        sizer.Add(item=aboutNotebook, proportion=1,
+                  flag=wx.EXPAND | wx.ALL, border=1)
+        sizer.Add(item=btnSizer, proportion=0,
+                  flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=1)
+        self.SetSizer(sizer)
+        self.Layout()
+    
+    def PageCopyright(self):
+        """Copyright information"""
         copyfile = os.path.join(os.getenv("GISBASE"), "COPYING")
         if os.path.exists(copyfile):
             copyrightFile = open(copyfile, 'r')
@@ -398,97 +450,162 @@
                                 575, wx.ClientDC(self))
             copyrightFile.close()
         else:
-            copytext = _('COPYING file missing')
+            copytext = _('%s file missing') % 'COPYING'
+        
         # put text into a scrolling panel
         copyrightwin = scrolled.ScrolledPanel(self, id=wx.ID_ANY, 
                                               size=wx.DefaultSize,
-                                              style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
+                                              style = wx.TAB_TRAVERSAL | wx.SUNKEN_BORDER)
         copyrighttxt = wx.StaticText(copyrightwin, id=wx.ID_ANY, label=copytext)
-        copyrightwin.SetAutoLayout(1)
-        copyrightwin.SetupScrolling()
+        copyrightwin.SetAutoLayout(True)
         copyrightwin.sizer = wx.BoxSizer(wx.VERTICAL)
         copyrightwin.sizer.Add(item=copyrighttxt, proportion=1,
-                               flag=wx.EXPAND | wx.ALL, border=1)
+                               flag=wx.EXPAND | wx.ALL, border=3)
         copyrightwin.SetSizer(copyrightwin.sizer)
         copyrightwin.Layout()
-
-        # license
+        copyrightwin.SetupScrolling()
+        
+        return copyrightwin
+    
+    def PageLicense(self):
+        """Licence about"""
         licfile = os.path.join(os.getenv("GISBASE"), "GPL.TXT")
         if os.path.exists(licfile):
             licenceFile = open(licfile, 'r')
             license = ''.join(licenceFile.readlines())
             licenceFile.close()
         else:
-            license = _('GPL.TXT file missing')
+            license = _('%s file missing') % 'GPL.TXT'
         # put text into a scrolling panel
         licensewin = scrolled.ScrolledPanel(self, id=wx.ID_ANY, 
-                                            size=wx.DefaultSize,
-                                            style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
+                                            style = wx.TAB_TRAVERSAL | wx.SUNKEN_BORDER)
         licensetxt = wx.StaticText(licensewin, id=wx.ID_ANY, label=license)
-        licensewin.SetAutoLayout(1)
-        licensewin.SetupScrolling()
+        licensewin.SetAutoLayout(True)
         licensewin.sizer = wx.BoxSizer(wx.VERTICAL)
         licensewin.sizer.Add(item=licensetxt, proportion=1,
-                flag=wx.EXPAND | wx.ALL, border=1)
+                flag=wx.EXPAND | wx.ALL, border=3)
         licensewin.SetSizer(licensewin.sizer)
         licensewin.Layout()
+        licensewin.SetupScrolling()
         
-        # credits
+        return licensewin
+    
+    def PageCredit(self):
+        """Credit about"""
+                # credits
         authfile = os.path.join(os.getenv("GISBASE"), "AUTHORS")
         if os.path.exists(authfile):
             authorsFile = open(authfile, 'r')
             authors = unicode(''.join(authorsFile.readlines()), "utf-8")
             authorsFile.close()
         else:
-            authors = _('AUTHORS file missing')
+            authors = _('%s file missing') % 'AUTHORS'
         authorwin = scrolled.ScrolledPanel(self, id=wx.ID_ANY, 
-                                           size=wx.DefaultSize,
                                            style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
         authortxt = wx.StaticText(authorwin, id=wx.ID_ANY, label=str(authors))
         authorwin.SetAutoLayout(1)
         authorwin.SetupScrolling()
         authorwin.sizer = wx.BoxSizer(wx.VERTICAL)
         authorwin.sizer.Add(item=authortxt, proportion=1,
-                flag=wx.EXPAND | wx.ALL, border=1)
+                flag=wx.EXPAND | wx.ALL, border=3)
         authorwin.SetSizer(authorwin.sizer)
         authorwin.Layout()      
         
-        # create a flat notebook for displaying information about GRASS
-        nbstyle = FN.FNB_VC8 | \
-                FN.FNB_BACKGROUND_GRADIENT | \
-                FN.FNB_TABS_BORDER_SIMPLE | \
-                FN.FNB_NO_X_BUTTON | \
-                FN.FNB_NO_NAV_BUTTONS
-                
-        aboutNotebook = FN.FlatNotebook(self, id=wx.ID_ANY, style=nbstyle)
-        aboutNotebook.SetTabAreaColour(globalvar.FNPageColor)
+        return authorwin
+
+    def PageContributors(self):
+        """Contributors info"""
+        contribfile = os.path.join(os.getenv("GISBASE"), "contributors.csv")
+        if os.path.exists(contribfile):
+            contribFile = open(contribfile, 'r')
+            contribs = list()
+            for line in contribFile.readlines():
+                cvs_id, name, email, country, osgeo_id, rfc2_agreed = line.split(',')
+                contribs.append((name, email, country, osgeo_id))
+            contribs[0] = (_('Name'), _('E-mail'), _('Country'), _('OSGeo_ID'))
+            contribFile.close()
+        else:
+            contribs = None
         
-        # make pages for About GRASS notebook
-        pg1 = aboutNotebook.AddPage(infoTxt,    text=_("Info"))
-        pg2 = aboutNotebook.AddPage(copyrightwin, text=_("Copyright"))
-        pg3 = aboutNotebook.AddPage(licensewin,   text=_("License"))
-        pg4 = aboutNotebook.AddPage(authorwin,    text=_("Authors"))
+        contribwin = scrolled.ScrolledPanel(self, id=wx.ID_ANY, 
+                                           style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
+        contribwin.SetAutoLayout(1)
+        contribwin.SetupScrolling()
+        contribwin.sizer = wx.BoxSizer(wx.VERTICAL)
+        
+        if not contribs:
+            contribtxt = wx.StaticText(contribwin, id=wx.ID_ANY,
+                                       label=_('%s file missing') % 'contibutors.csv')
+            contribwin.sizer.Add(item=contribtxt, proportion=1,
+                                 flag=wx.EXPAND | wx.ALL, border=3)
+        else:
+            contribBox = wx.FlexGridSizer(cols=4, vgap=5, hgap=5)
+            for developer in contribs:
+                for item in developer:
+                    contribBox.Add(item = wx.StaticText(parent = contribwin, id = wx.ID_ANY,
+                                                        label = item))
+            contribwin.sizer.Add(item=contribBox, proportion=1,
+                                 flag=wx.EXPAND | wx.ALL, border=3)
+        
+        contribwin.SetSizer(contribwin.sizer)
+        contribwin.Layout()      
+        
+        return contribwin
 
-        # buttons
-        btnClose = wx.Button(parent = self, id = wx.ID_CLOSE)
-        btnSizer = wx.BoxSizer(wx.HORIZONTAL)
-        btnSizer.Add(item = btnClose, proportion = 1,
-                     flag = wx.ALL | wx.EXPAND | wx.ALIGN_RIGHT,
-                     border = 5)
-        # bindings
-        # self.aboutNotebook.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.OnAGPageChanged)
-        btnClose.Bind(wx.EVT_BUTTON, self.OnCloseWindow)
-
-        infoTxt.SetSizer(infoSizer)
-        infoSizer.Fit(infoTxt)
+    def PageTranslators(self):
+        """Translators info"""
+        translatorsfile = os.path.join(os.getenv("GISBASE"), "translators.csv")
+        if os.path.exists(translatorsfile):
+            translatorsFile = open(translatorsfile, 'r')
+            translators = dict()
+            for line in translatorsFile.readlines()[1:]:
+                name, email, languages = line.rstrip('\n').split(',')
+                for language in languages.split(' '):
+                    if not translators.has_key(language):
+                        translators[language] = list()
+                    translators[language].append((name, email))
+            translatorsFile.close()
+        else:
+            translators = None
         
-        sizer = wx.BoxSizer(wx.VERTICAL)
-        sizer.Add(item=aboutNotebook, proportion=1,
-                  flag=wx.EXPAND | wx.ALL, border=1)
-        sizer.Add(item=btnSizer, proportion=0,
-                  flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=1)
-        self.SetSizer(sizer)
-        self.Layout()
+        translatorswin = scrolled.ScrolledPanel(self, id=wx.ID_ANY, 
+                                           style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
+        translatorswin.SetAutoLayout(1)
+        translatorswin.SetupScrolling()
+        translatorswin.sizer = wx.BoxSizer(wx.VERTICAL)
+        
+        if not translators:
+            translatorstxt = wx.StaticText(translatorswin, id=wx.ID_ANY,
+                                           label=_('%s file missing') % 'translators.csv')
+            translatorswin.sizer.Add(item=translatorstxt, proportion=1,
+                                 flag=wx.EXPAND | wx.ALL, border=3)
+        else:
+            translatorsBox = wx.FlexGridSizer(cols=3, vgap=5, hgap=5)
+            languages = translators.keys()
+            languages.sort()
+            translatorsBox.Add(item = wx.StaticText(parent = translatorswin, id = wx.ID_ANY,
+                                                    label = _('Name')))
+            translatorsBox.Add(item = wx.StaticText(parent = translatorswin, id = wx.ID_ANY,
+                                                    label = _('E-mail')))
+            translatorsBox.Add(item = wx.StaticText(parent = translatorswin, id = wx.ID_ANY,
+                                                    label = _('Language')))
+            for lang in languages:
+                for translator in translators[lang]:
+                    name, email = translator
+                    translatorsBox.Add(item = wx.StaticText(parent = translatorswin, id = wx.ID_ANY,
+                                                        label = name))
+                    translatorsBox.Add(item = wx.StaticText(parent = translatorswin, id = wx.ID_ANY,
+                                                        label = email))
+                    translatorsBox.Add(item = wx.StaticText(parent = translatorswin, id = wx.ID_ANY,
+                                                        label = lang))
+            
+            translatorswin.sizer.Add(item=translatorsBox, proportion=1,
+                                 flag=wx.EXPAND | wx.ALL, border=3)
+        
+        translatorswin.SetSizer(translatorswin.sizer)
+        translatorswin.Layout()      
+        
+        return translatorswin
     
     def OnCloseWindow(self, event):
         """!Close window"""

Modified: grass/trunk/translators.csv
===================================================================
--- grass/trunk/translators.csv	2009-11-19 23:17:03 UTC (rev 39770)
+++ grass/trunk/translators.csv	2009-11-20 18:34:40 UTC (rev 39771)
@@ -48,8 +48,8 @@
 Sarawut Ninsawat,<sarawut.map gmail.com>,TH
 Aras.Gor.O Yalcin Yilmaz,<yilmazy istanbul.edu.tr>,TR
 Bui Huu Manh,<bhmanh73 yahoo.com>,VI
-Lê Quốc Thái <lquocthai ioit.ac.vn>,VI
+Lê Quốc Thái, <lquocthai ioit.ac.vn>,VI
 Su Yongheng,<night2008 gmail.com>,ZH
 Zhang Jun,<nilarcs gmail.com>,ZH
-Miroslav Hořejší,miroslav.horejsi fsv.cvut.cz,CZ
-Pavel Valenta,pavel.valenta fsv.cvut.cz,CZ
+Miroslav Hořejší,<miroslav.horejsi fsv.cvut.cz>,CZ
+Pavel Valenta,<pavel.valenta fsv.cvut.cz>,CZ



More information about the grass-commit mailing list