Skip to content

Commit

Permalink
make enterpressed working, and remove pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
rduivenvoorde committed Feb 18, 2014
1 parent 6def031 commit cae2a8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pdokservicesplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ def initGui(self):
QObject.connect(self.dlg.ui.btnLoadLayer, SIGNAL("clicked()"), self.loadService)

self.dlg.geocoderSearchBtn.clicked.connect(self.searchAddress)
self.dlg.geocoderSearch.returnPressed.connect(self.dlg.geocoderSearchBtn.click)
self.dlg.geocoderSearch.returnPressed.connect(self.searchAddress)

self.dlg.geocoderResultSearch.textChanged.connect(self.filterGeocoderResult)

self.dlg.buttonBox.button(QDialogButtonBox.Close).setAutoDefault(False)


def about(self):
infoString = QString("Written by Richard Duivenvoorde\nEmail - richard@duif.net\n")
Expand Down Expand Up @@ -217,7 +219,7 @@ def loadService(self):
return

def filterGeocoderResult(self, string):
print "filtering geocoder results: %s" % string
#print "filtering geocoder results: %s" % string
self.dlg.geocoderResultView.selectRow(0)
self.geocoderProxyModel.setFilterCaseSensitivity(Qt.CaseInsensitive)
self.geocoderProxyModel.setFilterFixedString(string)
Expand Down Expand Up @@ -318,6 +320,7 @@ def run(self):
QSettings().setValue("/pdokservicesplugin/currenttab", QVariant(self.dlg.tabs.currentIndex()))
else:
QSettings().setValue("/pdokservicesplugin/currenttab", self.dlg.tabs.currentIndex())
self.removePointer()

def geocode(self, string):
addresses = pdokgeocoder.search(string)
Expand Down Expand Up @@ -402,4 +405,4 @@ def setPointer(self, point):

def removePointer(self):
if self.pointer is not None:
self.iface.mapCanvas().scene().removeItem(self.pointer)
self.iface.mapCanvas().scene().removeItem(self.pointer)
1 change: 1 addition & 0 deletions pdokservicesplugindialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def __init__(self):
self.geocoderSearch = self.ui.geocoderSearch
self.geocoderResultSearch = self.ui.geocoderResultSearch
self.geocoderResultView = self.ui.geocoderResultView
self.buttonBox = self.ui.buttonBox
self.geocoderResultView.setSelectionMode(self.geocoderResultView.SingleSelection)
# select whole row if an item is clicked
self.geocoderResultView.setSelectionBehavior(self.geocoderResultView.SelectRows)
Expand Down

0 comments on commit cae2a8e

Please sign in to comment.