Пример #1
0
	def editPlace(self, place):
		"""
		Method called when the user double clicks on a place in the list.
		"""
		row = self._placesWidget.getRowValues(place)
		self.selectCell(row['x'], row['y'])
		dialog = formPlaceDialog(self, self._app, row=row)
		dialog.entityUpdated.connect(self.unselectCell)
		dialog.entityUpdated.connect(self.refreshEntity)
		dialog.entityUpdated.connect(self._placesWidget.setData)
		dialog.entityUpdated.connect(self._app.flagAsUnsaved)
Пример #2
0
	def addPlace(self, x, y):
		"""
		Method called when the user click on a cell in the map to add a place.
		"""

		if not self._app.map.isCellOnLand((x, y)):
			self.alert(_('ERROR_PLACE_IN_WATER'))
			return

		dialog = formPlaceDialog(self, self._app, coordinates=(x, y))
		dialog.entityAdded.connect(self.unselectCell)
		dialog.entityAdded.connect(self.displayEntity)
		dialog.entityAdded.connect(self._placesWidget.setData)
		dialog.entityAdded.connect(self._app.flagAsUnsaved)

		self.disableRecordingMode()