ContextAction.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. """
  2. ***************************************************************************
  3. ContextAction.py
  4. ---------------------
  5. Date : August 2012
  6. Copyright : (C) 2012 by Victor Olaya
  7. Email : volayaf at gmail dot com
  8. ***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************
  16. """
  17. __author__ = 'Victor Olaya'
  18. __date__ = 'August 2012'
  19. __copyright__ = '(C) 2012, Victor Olaya'
  20. from qgis.PyQt.QtCore import QCoreApplication
  21. from qgis.PyQt.QtGui import QIcon
  22. class ContextAction:
  23. def __init__(self):
  24. self.name = None
  25. self.is_separator = False
  26. def setData(self, itemData, toolbox):
  27. self.itemData = itemData
  28. self.toolbox = toolbox
  29. def tr(self, string, context=''):
  30. if context == '':
  31. context = self.__class__.__name__
  32. return QCoreApplication.translate(context, string)
  33. def icon(self):
  34. return QIcon()
  35. def isEnabled(self):
  36. return True
  37. def execute(self):
  38. pass