dtmovesidebyarea_dialog.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # -*- coding: utf-8 -*-
  2. """
  3. dtmovesidebyarea_dialog
  4. ```````````````````````
  5. """
  6. """
  7. Part of DigitizingTools, a QGIS plugin that
  8. subsumes different tools neded during digitizing sessions
  9. * begin : 2013-08-15
  10. * copyright : (C) 2013 by Angelos Tzotsos
  11. * email : tzotsos@gmail.com
  12. This program is free software; you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation; either version 2 of the License, or
  15. (at your option) any later version.
  16. """
  17. from builtins import str
  18. from qgis.PyQt import QtCore, QtWidgets, uic
  19. import os
  20. FORM_CLASS, _ = uic.loadUiType(os.path.join(
  21. os.path.dirname(__file__), 'ui_dtmovesidebyarea.ui'))
  22. class DtMoveSideByArea_Dialog(QtWidgets.QDialog, FORM_CLASS):
  23. unsetTool = QtCore.pyqtSignal()
  24. moveSide = QtCore.pyqtSignal()
  25. def __init__(self, parent, flags):
  26. super().__init__(parent, flags)
  27. self.setupUi(self)
  28. self.method = "fixed"
  29. def initGui(self):
  30. self.radioFixed.setChecked(True)
  31. self.radioVariable.setChecked(False)
  32. pass
  33. def writeArea(self, area):
  34. self.area_label.setText(str(area))
  35. self.targetArea.setText(str(area))
  36. @QtCore.pyqtSlot()
  37. def on_radioFixed_clicked(self):
  38. self.method = "fixed"
  39. @QtCore.pyqtSlot()
  40. def on_radioVariable_clicked(self):
  41. self.method = "variable"
  42. @QtCore.pyqtSlot()
  43. def on_buttonClose_clicked(self):
  44. self.unsetTool.emit()
  45. self.close()
  46. @QtCore.pyqtSlot()
  47. def on_moveButton_clicked(self):
  48. self.moveSide.emit()
  49. pass