mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
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
This commit is contained in:
parent
27e451ceaf
commit
a87414c8f2
@ -603,33 +603,27 @@ class GdalConfig:
|
||||
# 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 qgis.gui import *
|
||||
|
||||
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 @@ class GdalToolsAboutDialog(QDialog, Ui_Dialog):
|
||||
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user