Differential D4666 Diff 11492 plugins/extensions/pykrita/plugin/plugins/scripter/ui_scripter/actions/runaction/runaction.py
Changeset View
Changeset View
Standalone View
Standalone View
plugins/extensions/pykrita/plugin/plugins/scripter/ui_scripter/actions/runaction/runaction.py
1 | from PyQt5.QtWidgets import QAction, QMessageBox | 1 | from PyQt5.QtWidgets import QAction, QMessageBox | ||
---|---|---|---|---|---|
2 | from PyQt5.QtGui import QIcon | 2 | from PyQt5.QtGui import QIcon | ||
3 | import sys | 3 | import sys | ||
4 | from . import docwrapper | 4 | from . import docwrapper | ||
5 | import os | 5 | import os | ||
6 | from scripter import resources_rc | ||||
6 | 7 | | |||
7 | 8 | | |||
8 | class RunAction(QAction): | 9 | class RunAction(QAction): | ||
9 | 10 | | |||
10 | def __init__(self, scripter, parent=None): | 11 | def __init__(self, scripter, parent=None): | ||
11 | super(RunAction, self).__init__(parent) | 12 | super(RunAction, self).__init__(parent) | ||
12 | self.scripter = scripter | 13 | self.scripter = scripter | ||
13 | 14 | | |||
14 | self.editor = self.scripter.uicontroller.editor | 15 | self.editor = self.scripter.uicontroller.editor | ||
15 | self.output = self.scripter.uicontroller.findStackWidget('OutPut') | 16 | self.output = self.scripter.uicontroller.findStackWidget('OutPut') | ||
16 | 17 | | |||
17 | self.triggered.connect(self.run) | 18 | self.triggered.connect(self.run) | ||
18 | 19 | | |||
19 | self.setText('Run') | 20 | self.setText('Run') | ||
20 | # path to the icon | 21 | self.setIcon(QIcon(':/icons/run.svg')) | ||
21 | #self.setIcon(QIcon('/home/eliakincosta/Pictures/play.svg')) | | |||
22 | 22 | | |||
23 | @property | 23 | @property | ||
24 | def parent(self): | 24 | def parent(self): | ||
25 | return 'toolBar' | 25 | return 'toolBar' | ||
26 | 26 | | |||
27 | def run(self): | 27 | def run(self): | ||
28 | stdout = sys.stdout | 28 | stdout = sys.stdout | ||
29 | stderr = sys.stderr | 29 | stderr = sys.stderr | ||
Show All 11 Lines |