Skip to content
Permalink
Browse files
applied patch to show GDAL version in about dialog, to fix #2804
git-svn-id: http://svn.osgeo.org/qgis/trunk@13725 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler committed Jun 13, 2010
1 parent 27e451c commit a87414c8f2107a74eea7a3c38852dbfa0b1e7e33
@@ -603,33 +603,27 @@ def filename2ShortName(self, fileName):
# class which allows to create version objects and compare them
class Version:
def __init__(self, ver):
self.vers = (0, 0, 0)
self.vers = ('0', '0', '0')

if isinstance(ver, Version):
self.vers = ver.vers
elif isinstance(ver, tuple) or isinstance(ver, list):
self.vers = tuple(ver)
self.vers = map(str, ver)
elif isinstance(ver, str) or isinstance(ver, QString):
self.vers = self.string2vers(ver)

@staticmethod
def string2vers(string):
vers = [0, 0, 0]
vers = ['0', '0', '0']

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

if len(nums) > 0:
n = QString(nums[0]).remove( QRegExp( "[^0-9].*$" ) )
if not n.isEmpty():
vers[0] = int(n)
vers[0] = nums[0]
if len(nums) > 1:
n = QString(nums[1]).remove( QRegExp( "[^0-9].*$" ) )
if not n.isEmpty():
vers[1] = int(n)
vers[1] = nums[1]
if len(nums) > 2:
n = QString(nums[2]).remove( QRegExp( "[^0-9].*$" ) )
if not n.isEmpty():
vers[2] = int(n)
vers[2] = nums[2]

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

@@ -7,6 +7,7 @@

from ui_dialogAbout import Ui_GdalToolsAboutDialog as Ui_Dialog
from GdalTools import version
from GdalTools_utils import GdalConfig

class GdalToolsAboutDialog(QDialog, Ui_Dialog):

@@ -17,7 +18,7 @@ def __init__(self, iface):

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

self.lblVersion.setText( version() )
self.lblVersion.setText( version() + self.tr( "\n(using GDAL v. %1)" ).arg( str( GdalConfig.version() ) ) )
self.textEdit.setText(self.getText())

def getText(self):
@@ -2390,6 +2390,9 @@ void QgisApp::about()
QString versionString = tr( "You are using QGIS version %1 built against code revision %2." )
.arg( QGis::QGIS_VERSION )
.arg( QGis::QGIS_SVN_VERSION );

versionString += tr( "\nThis copy of QGIS has been built with GDAL/OGR %1." ).arg( GDAL_RELEASE_NAME );

#ifdef HAVE_POSTGRESQL
versionString += tr( "\nThis copy of QGIS has been built with PostgreSQL support (%1)." ).arg( PG_VERSION );
#else

0 comments on commit a87414c

Please sign in to comment.