custom_dialog.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # -*- coding: utf-8 -*-
  2. """
  3. /***************************************************************************
  4. customDialog
  5. A QGIS plugin
  6. custom
  7. Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
  8. -------------------
  9. begin : 2024-08-14
  10. git sha : $Format:%H$
  11. copyright : (C) 2024 by custom
  12. email : custom
  13. ***************************************************************************/
  14. /***************************************************************************
  15. * *
  16. * This program is free software; you can redistribute it and/or modify *
  17. * it under the terms of the GNU General Public License as published by *
  18. * the Free Software Foundation; either version 2 of the License, or *
  19. * (at your option) any later version. *
  20. * *
  21. ***************************************************************************/
  22. """
  23. import locale
  24. import math
  25. import operator
  26. from qgis.PyQt.QtCore import QSettings, QDir, QFileInfo, Qt, pyqtSlot
  27. #from qgis.PyQt.QtGui import *
  28. from qgis.PyQt.QtWidgets import QDialog, QFileDialog, QMessageBox, QDialogButtonBox
  29. from qgis.core import QgsCoordinateTransform, QgsCoordinateReferenceSystem, QgsRectangle, QgsProject, QgsSettings
  30. import os
  31. from .ui.ui_custom_dialog_base import Ui_customDialogBase
  32. class customDialog(QDialog, Ui_customDialogBase):
  33. def __init__(self):
  34. QDialog.__init__(self)
  35. self.setupUi(self)
  36. # self.button_box.rejected.connect(self.reject)
  37. # self.button_box.accepted.connect(self.accept)
  38. def reject(self):
  39. QDialog.reject(self)
  40. QMessageBox.warning(self, self.tr('No'), self.tr('No No'))
  41. print("reject")
  42. def accept(self):
  43. QDialog.accept(self)
  44. QMessageBox.warning(self, self.tr('Yes'), self.tr('Yes Yes'))
  45. print("accept")