From 2672d3b979e1b8d2bd242cef661e1043cfc91597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Carrillo?= Date: Wed, 17 Aug 2016 23:25:04 -0500 Subject: [PATCH] [v0.3.0] Added changelog for v0.3.0. Added link to documentation (it's aware of language [en|es]). --- AutoFields.py | 5 ++++- AutoFieldsDockWidget.py | 12 +++++++++++- MessageManager.py | 1 - __init__.py | 4 ++-- changelog.txt | 8 ++++++++ metadata.txt | 16 ++++++++++++---- 6 files changed, 37 insertions(+), 9 deletions(-) diff --git a/AutoFields.py b/AutoFields.py index 03cf794..d1d29a8 100644 --- a/AutoFields.py +++ b/AutoFields.py @@ -36,6 +36,7 @@ class AutoFields: def __init__( self, iface ): self.iface = iface self.messageMode = 'production' # 'production' or 'debug' + self.language='en' self.installTranslator() @@ -76,7 +77,7 @@ def initGui( self ): self.autoFieldManager = AutoFieldManager( self.messageManager, self.iface ) self.autoFieldManager.readAutoFields() - self.dockWidget = AutoFieldsDockWidget( self.iface.mainWindow(), self.iface, self.autoFieldManager, self.messageManager ) + self.dockWidget = AutoFieldsDockWidget( self.iface.mainWindow(), self.iface, self.autoFieldManager, self.messageManager, self.language ) self.iface.addDockWidget( Qt.RightDockWidgetArea, self.dockWidget ) @@ -103,6 +104,8 @@ def installTranslator( self ): locale = QSettings().value( "locale/userLocale", type=str ) myLocale = str( locale[0:2] ) + if myLocale == 'es': + self.language='es' if os.path.exists( userPluginPath ): translationPath = os.path.join( userPluginPath, 'i18n', "AutoFields_" + myLocale + ".qm" ) diff --git a/AutoFieldsDockWidget.py b/AutoFieldsDockWidget.py index bcf7e3a..7e5f407 100644 --- a/AutoFieldsDockWidget.py +++ b/AutoFieldsDockWidget.py @@ -34,9 +34,10 @@ class AutoFieldsDockWidget( QDockWidget, Ui_AutoFieldsDockWidget ): """ Class in charge of all the UI logic """ - def __init__( self, parent, iface, autoFieldManager, messageManager ): + def __init__( self, parent, iface, autoFieldManager, messageManager, language='en' ): self.iface = iface self.msg = messageManager + self.language = language QDockWidget.__init__( self, parent ) # Set up the user interface from Designer. self.setupUi( self ) @@ -107,6 +108,9 @@ def __init__( self, parent, iface, autoFieldManager, messageManager ): self.chkOnlyEnabledAutoFields.toggled.connect( self.saveShowOnlyEnabledPreference ) self.btnRemoveAutoFields.clicked.connect( self.removeAutoFieldFromTable ) + # About Tab + self.btnHelp.clicked.connect( self.openDocumentation ) + def populateLayersTable( self, foo=None, foo2=None, foo3=None ): """ List vector layers that support changes in attributes and are writable. @@ -590,6 +594,12 @@ def saveShowOnlyEnabledPreference( self, status ): self.populateAutoFieldsTable() + def openDocumentation( self ): + """ Open a browser to show documentation page """ + import webbrowser + webbrowser.open( "http://geotux.tuxfamily.org/index.php/"+ self.language +"/geo-blogs/item/333-autofields-plugin-for-qgis" ) + + def disconnectAll( self ): """ Terminates all SIGNAL/SLOT connections created by this class """ QgsMapLayerRegistry.instance().legendLayersAdded.disconnect( self.populateLayersTable ) diff --git a/MessageManager.py b/MessageManager.py index 6089c23..4f0028b 100644 --- a/MessageManager.py +++ b/MessageManager.py @@ -20,7 +20,6 @@ ***************************************************************************/ """ #from qgis.core import QgsMessageLog -from qgis.gui import QgsMessageBar from PyQt4.QtGui import QPushButton class MessageManager(): diff --git a/__init__.py b/__init__.py index 5797cdc..c059dd1 100644 --- a/__init__.py +++ b/__init__.py @@ -26,10 +26,10 @@ def description(): return "Automatic vector field updates when modifying or creating features" def version(): - return "Version 0.2.7" + return "Version 0.3.0" def qgisMinimumVersion(): - return "2.0" + return "2.12" def icon(): return "icon.png" diff --git a/changelog.txt b/changelog.txt index 185262f..12c586c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,12 @@ Changes: + [0.3.0] (20160817) + - Official release! + - AutoFieldManager: normalize sources from 'Add PostgreSQL layer' and + DBManager so that they coincide. + - AutoFieldManager: Make createAutoFields return the autoFieldId on success, + as it can be used later to remove the AutoField via removeAutoField. + - GUI: Layer list now listens to Layer Tree SIGNALs to keep itself updated. + - Added link to documentation from About tab. It's aware of language [en|es]. [0.2.7] (20160804) - Implement order for AutoFields storage and for setting event connections, so that scenarios of AutoFields depending on other AutoFields become diff --git a/metadata.txt b/metadata.txt index ac3d475..6a0b03e 100644 --- a/metadata.txt +++ b/metadata.txt @@ -1,13 +1,21 @@ [general] name=AutoFields description=Automatic attribute updates when creating or modifying vector features -version=0.2.7 -qgisMinimumVersion=2.0 +version=0.3.0 +qgisMinimumVersion=2.12 category=Vector author=Germán Carrillo (GeoTux) email=gcarrillo@linuxmail.org changelog= - [0.2.7] (20160804) + [0.3.0] (20160817) + - Official release! + - AutoFieldManager: normalize sources from 'Add PostgreSQL layer' and + DBManager so that they coincide. + - AutoFieldManager: Make createAutoFields return the autoFieldId on success, + as it can be used later to remove the AutoField via removeAutoField. + - GUI: Layer list now listens to Layer Tree SIGNALs to keep itself updated. + - Added link to documentation from About tab. It's aware of language [en|es]. + [0.2.7] (20160804) - Implement order for AutoFields storage and for setting event connections, so that scenarios of AutoFields depending on other AutoFields become predictable. @@ -57,7 +65,7 @@ tags=area, auto, automatic, attribute, calculation, column, coordinates, expression, feature, field, fill, geometry, layer, populate, property, refresh, shapefile, trigger, update, vector about=This plugin allows you to configure vector fields to be automatically calculated for you when digitizing new features or modifying existing ones. Think about it as triggers in a database or as an automatic Field Calculator. -homepage=http://geotux.tuxfamily.org +homepage=http://geotux.tuxfamily.org/index.php/en/geo-blogs/item/333-autofields-plugin-for-qgis tracker=https://github.com/gacarrillor/AutoFields/issues repository=https://github.com/gacarrillor/AutoFields icon=icon.png