2012-10-05 23:28:47 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
"""
|
|
|
|
***************************************************************************
|
|
|
|
ContextAction.py
|
|
|
|
---------------------
|
|
|
|
Date : August 2012
|
|
|
|
Copyright : (C) 2012 by Victor Olaya
|
|
|
|
Email : volayaf at gmail dot com
|
|
|
|
***************************************************************************
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************
|
|
|
|
"""
|
|
|
|
|
|
|
|
__author__ = 'Victor Olaya'
|
|
|
|
__date__ = 'August 2012'
|
|
|
|
__copyright__ = '(C) 2012, Victor Olaya'
|
2013-10-01 20:52:22 +03:00
|
|
|
|
|
|
|
|
2016-04-22 10:38:48 +02:00
|
|
|
from qgis.PyQt.QtCore import QCoreApplication
|
2019-02-01 12:22:23 +10:00
|
|
|
from qgis.PyQt.QtGui import QIcon
|
2014-10-03 14:44:01 +03:00
|
|
|
|
2015-08-22 14:29:41 +02:00
|
|
|
|
2017-11-27 13:23:49 +02:00
|
|
|
class ContextAction:
|
2012-09-15 18:25:25 +03:00
|
|
|
|
2019-02-01 12:22:23 +10:00
|
|
|
def __init__(self):
|
|
|
|
self.name = None
|
|
|
|
self.is_separator = False
|
|
|
|
|
2016-04-06 10:50:54 +02:00
|
|
|
def setData(self, itemData, toolbox):
|
|
|
|
self.itemData = itemData
|
2013-10-01 20:52:22 +03:00
|
|
|
self.toolbox = toolbox
|
2014-04-06 12:27:51 +02:00
|
|
|
|
2014-10-03 14:44:01 +03:00
|
|
|
def tr(self, string, context=''):
|
|
|
|
if context == '':
|
2018-01-29 15:50:16 +02:00
|
|
|
context = self.__class__.__name__
|
2016-03-14 20:26:58 +01:00
|
|
|
return QCoreApplication.translate(context, string)
|
2019-02-01 12:22:23 +10:00
|
|
|
|
|
|
|
def icon(self):
|
|
|
|
return QIcon()
|
|
|
|
|
|
|
|
def isEnabled(self):
|
|
|
|
return True
|
|
|
|
|
|
|
|
def execute(self):
|
|
|
|
pass
|