CreateNewScriptAction.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. """
  2. ***************************************************************************
  3. CreateNewScriptAction.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. import os
  21. from qgis.PyQt.QtCore import QCoreApplication
  22. from qgis.utils import iface
  23. from processing.gui.ToolboxAction import ToolboxAction
  24. from processing.script.ScriptEditorDialog import ScriptEditorDialog
  25. class CreateNewScriptAction(ToolboxAction):
  26. def __init__(self):
  27. self.name = QCoreApplication.translate("CreateNewScriptAction", "Create New Script…")
  28. self.group = self.tr("Tools")
  29. def execute(self):
  30. dlg = ScriptEditorDialog(parent=iface.mainWindow())
  31. dlg.show()