Skip to content

Commit

Permalink
Merge pull request #30 from Septima/qgis3
Browse files Browse the repository at this point in the history
Migrate to QGIS3
  • Loading branch information
AsgerPetersen authored Feb 13, 2018
2 parents 7c7e50c + 74dbc7b commit 4d4bfb2
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 515 deletions.
4 changes: 2 additions & 2 deletions src/geosearch_dk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ LOCALES = en
# If locales are enabled, set the name of the lrelease binary on your system. If
# you have trouble compiling the translations, you may have to specify the full path to
# lrelease
LRELEASE = lrelease
LRELEASE = /usr/local/Cellar/qt/5.10.0_1/bin/lrelease
#LRELEASE = lrelease-qt4


Expand Down Expand Up @@ -64,7 +64,7 @@ UI_FILES = \

EXTRAS = icon.png metadata.txt

COMPILED_RESOURCE_FILES = resources_rc.py
COMPILED_RESOURCE_FILES =

PEP8EXCLUDE=pydev,resources_rc.py,conf.py,third_party,ui

Expand Down
5 changes: 3 additions & 2 deletions src/geosearch_dk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
* *
***************************************************************************/
"""
from __future__ import absolute_import

import pluginmetadata
from . import pluginmetadata

def name():
return pluginmetadata.metadata['name']
Expand Down Expand Up @@ -46,5 +47,5 @@ def email():
return pluginmetadata.metadata['email']

def classFactory(iface):
from septimageosearch import SeptimaGeoSearch
from .septimageosearch import SeptimaGeoSearch
return SeptimaGeoSearch(iface)
19 changes: 8 additions & 11 deletions src/geosearch_dk/autosuggest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@
"""

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtNetwork import *
from PyQt4.uic import loadUi
#import microjson

from qgis.PyQt.QtCore import QObject, Qt, QEvent, QTimer, QPoint
from qgis.PyQt.QtWidgets import QTreeWidget, QTreeWidgetItem, QFrame, QApplication
from qgis.PyQt.QtGui import QPalette, QKeyEvent
from qgis.PyQt.QtNetwork import QNetworkReply, QNetworkRequest, QNetworkAccessManager
from qgis.PyQt.uic import loadUi
from qgis.core import QgsMessageLog

#PLUGINNAME = "Septima Geo Search"


# TODO: Add events to completer? http://www.valuedlessons.com/2008/04/events-in-python.html

class AutoSuggest(QObject):
Expand Down Expand Up @@ -131,7 +127,7 @@ def showCompletion(self, rows):
item.setText(0, row[0])
#item.setText(1, hit['type'])
item.setTextAlignment(1, Qt.AlignRight)
item.setTextColor(1, color)
item.setForeground(1, color)
item.setData(2, Qt.UserRole, (row[1],)) # Try immutable py obj #http://stackoverflow.com/questions/9257422/how-to-get-the-original-python-data-from-qvariant

self.popup.setCurrentItem(self.popup.topLevelItem(0))
Expand Down Expand Up @@ -179,8 +175,9 @@ def handleNetworkData(self, networkReply):
#print "received url:", url.toString()
if not networkReply.error():
response = networkReply.readAll()
pystring = str(response, 'utf-8')
#print "Response: ", response
rows = self.parseresult_func( response )
rows = self.parseresult_func( pystring )
self.showCompletion( rows )

networkReply.deleteLater()
Expand Down
Binary file modified src/geosearch_dk/i18n/en.qm
Binary file not shown.
16 changes: 8 additions & 8 deletions src/geosearch_dk/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<message>
<location filename="ui_settings.ui" line="148"/>
<source>Filter</source>
<translation type="Filter"></translation>
<translation>Filter</translation>
</message>
<message encoding="UTF-8">
<location filename="ui_settings.ui" line="160"/>
Expand Down Expand Up @@ -96,31 +96,31 @@
<context>
<name>Geosearch DK</name>
<message>
<location filename="septimageosearch.py" line="74"/>
<location filename="septimageosearch.py" line="77"/>
<source>&amp;Indstillinger</source>
<translation>Settings</translation>
</message>
<message>
<location filename="septimageosearch.py" line="79"/>
<location filename="septimageosearch.py" line="82"/>
<source>&amp;Om pluginet</source>
<translation>About</translation>
</message>
</context>
<context>
<name>SearchBox</name>
<message encoding="UTF-8">
<location filename="searchbox.py" line="298"/>
<location filename="searchbox.py" line="329"/>
<source>Geosearch DK lader brugeren zoome til navngivne steder i Danmark.&lt;br /&gt;Pluginet benytter tjenesten &apos;geosearch&apos; fra &lt;a href=&quot;http://kortforsyningen.dk/&quot;&gt;kortforsyningen.dk&lt;/a&gt; og kræver derfor et gyldigt login til denne tjeneste.&lt;br /&gt;Pluginets webside: &lt;a href=&quot;http://github.com/Septima/qgis-geosearch&quot;&gt;github.com/Septima/qgis-geosearch&lt;/a&gt;&lt;br /&gt;Udviklet af: Septima&lt;br /&gt;Mail: &lt;a href=&quot;mailto:[email protected]&quot;&gt;[email protected]&lt;/a&gt;&lt;br /&gt;Web: &lt;a href=&quot;http://www.septima.dk&quot;&gt;www.septima.dk&lt;/a&gt;
</source>
<translation>Geosearch DK lets the user zoom to named places in Denmark.&lt;br /&gt;The plugin uses the web service &apos;geosearch&apos; by &lt;a href=&quot;http://kortforsyningen.dk/&quot;&gt;kortforsyningen.dk&lt;/a&gt;. A valid login for this service is therefore needed.&lt;br /&gt;Plugin web site: &lt;a href=&quot;http://github.com/Septima/qgis-geosearch&quot;&gt;github.com/Septima/qgis-geosearch&lt;/a&gt;&lt;br /&gt;Made by: Septima&lt;br /&gt;Mail: &lt;a href=&quot;mailto:[email protected]&quot;&gt;[email protected]&lt;/a&gt;&lt;br /&gt;Web: &lt;a href=&quot;http://www.septima.dk&quot;&gt;www.septima.dk&lt;/a&gt;</translation>
</message>
<message>
<location filename="searchbox.py" line="150"/>
<location filename="searchbox.py" line="175"/>
<source>Bruger afvist af Kortforsyningen</source>
<translation>User rejected by Kortforsyningen</translation>
</message>
<message>
<location filename="searchbox.py" line="151"/>
<location filename="searchbox.py" line="176"/>
<source>Manglende eller ukorrekt brugernavn og password til Kortforsyningen.

Kortforsyningen svarede:
Expand All @@ -131,12 +131,12 @@ Kortforsyningen responded:
</translation>
</message>
<message encoding="UTF-8">
<location filename="searchbox.py" line="76"/>
<location filename="searchbox.py" line="81"/>
<source>Søg adresse, stednavn, postnummer, matrikel m.m.</source>
<translation>Search Danish addresses, road names, place names, postal codes, land registry etc.</translation>
</message>
<message>
<location filename="searchbox.py" line="173"/>
<location filename="searchbox.py" line="198"/>
<source>Ingen resultater</source>
<translation>No results</translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/geosearch_dk/metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

[general]
name=Geosearch DK
qgisMinimumVersion=2.8
qgisMaximumVersion=2.99
qgisMinimumVersion=3.0
qgisMaximumVersion=3.98
description=Search and zoom to named places in Denmark
about= Uses Kortforsyningen services for searching addresses, road names, place names, land registry and a lot more. Developed by Septima.
version=0.2.7
version=1.0.0
author=Asger Skovbo Petersen, Septima
[email protected]

Expand All @@ -23,7 +23,7 @@ [email protected]
# Optional items:

# Uncomment the following line and add your changelog entries:
changelog=
changelog=2018-02-12 1.0.0 Migrate to QGIS3
2016-09-15 0.2.7 Make marker symbology customizable through QGIS global settings.
2016-04-21 0.2.6 Fix bug storing settings on some QGIS configurations. User needs to set municipality filter again after installing this version.
2016-01-25 0.2.5 Added the possibility to limit the search to adresses/placenames/cadstral numbers/etc. in the searchbox by using keywords or by specifying the resulttype in the settingsdialog. This work was funded by Ballerup Kommune.
Expand Down
Loading

0 comments on commit 4d4bfb2

Please sign in to comment.