add_gdal_version.diff

Proposed patch - Alexander Bruy, 2010-06-12 11:46 AM

Download (2.08 KB)

View differences:

python/plugins/GdalTools/GdalTools.py (working copy)
288 288

  
289 289
  def doAbout( self ):
290 290
    from tools.doAbout import GdalToolsAboutDialog as About
291
    d = About( self.iface )
291
    d = About( self.iface, str( self.GdalVersion ) )
292 292
    d.exec_()
python/plugins/GdalTools/tools/GdalTools_utils.py (working copy)
617 617
      vers = [0, 0, 0]
618 618

  
619 619
      nums = str(string).split(".")
620
      
620

  
621 621
      if len(nums) > 0:
622 622
        n = QString(nums[0]).remove( QRegExp( "[^0-9].*$" ) )
623 623
        if not n.isEmpty():
624
          vers[0] = int(n)
624
          vers[0] = str(n)
625 625
      if len(nums) > 1:
626 626
        n = QString(nums[1]).remove( QRegExp( "[^0-9].*$" ) )
627 627
        if not n.isEmpty():
628
          vers[1] = int(n)
628
          vers[1] = str(n)
629 629
      if len(nums) > 2:
630 630
        n = QString(nums[2]).remove( QRegExp( "[^0-9].*$" ) )
631 631
        if not n.isEmpty():
632
          vers[2] = int(n)
632
          vers[2] = str(n)
633 633

  
634 634
      return (vers[0], vers[1], vers[2])
635 635

  
python/plugins/GdalTools/tools/doAbout.py (working copy)
10 10

  
11 11
class GdalToolsAboutDialog(QDialog, Ui_Dialog):
12 12

  
13
  def __init__(self, iface):
13
  def __init__(self, iface, gdalVersion):
14 14
      QDialog.__init__(self, iface.mainWindow())
15 15
      self.iface = iface
16 16
      self.setupUi(self)
17 17

  
18 18
      QObject.connect(self.btnWeb, SIGNAL("clicked()"), self.openWebsite)
19 19

  
20
      self.lblVersion.setText( version() )
20
      self.lblVersion.setText( version() + self.tr("\n(using GDAL v. ") + gdalVersion + ")" )
21 21
      self.textEdit.setText(self.getText())
22 22

  
23 23
  def getText(self):