Differential D4666 Diff 11492 plugins/extensions/pykrita/plugin/plugins/scripter/ui_scripter/actions/debugaction/debugaction.py
Changeset View
Changeset View
Standalone View
Standalone View
plugins/extensions/pykrita/plugin/plugins/scripter/ui_scripter/actions/debugaction/debugaction.py
1 | from PyQt5.QtWidgets import QAction | 1 | from PyQt5.QtWidgets import QAction | ||
---|---|---|---|---|---|
2 | from PyQt5.QtGui import QIcon, QPixmap | 2 | from PyQt5.QtGui import QIcon, QPixmap | ||
3 | from scripter import resources_rc | ||||
3 | 4 | | |||
4 | 5 | | |||
5 | class DebugAction(QAction): | 6 | class DebugAction(QAction): | ||
6 | 7 | | |||
7 | def __init__(self, scripter, parent=None): | 8 | def __init__(self, scripter, parent=None): | ||
8 | super(DebugAction, self).__init__(parent) | 9 | super(DebugAction, self).__init__(parent) | ||
9 | self.scripter = scripter | 10 | self.scripter = scripter | ||
10 | 11 | | |||
11 | self.triggered.connect(self.debug) | 12 | self.triggered.connect(self.debug) | ||
12 | 13 | | |||
13 | self.setText('Debug') | 14 | self.setText('Debug') | ||
14 | # path to the icon | 15 | # path to the icon | ||
15 | #self.setIcon(QIcon('/home/eliakincosta/Pictures/debug.svg')) | 16 | self.setIcon(QIcon(':/icons/debug.svg')) | ||
16 | 17 | | |||
17 | @property | 18 | @property | ||
18 | def parent(self): | 19 | def parent(self): | ||
19 | return 'toolBar' | 20 | return 'toolBar' | ||
20 | 21 | | |||
21 | def debug(self): | 22 | def debug(self): | ||
22 | if self.scripter.uicontroller.invokeAction('save'): | 23 | if self.scripter.uicontroller.invokeAction('save'): | ||
23 | self.scripter.uicontroller.setActiveWidget('Debugger') | 24 | self.scripter.uicontroller.setActiveWidget('Debugger') | ||
24 | self.scripter.debugcontroller.start(self.scripter.documentcontroller.activeDocument) | 25 | self.scripter.debugcontroller.start(self.scripter.documentcontroller.activeDocument) | ||
25 | widget = self.scripter.uicontroller.findStackWidget('Debugger') | 26 | widget = self.scripter.uicontroller.findStackWidget('Debugger') | ||
26 | widget.startDebugger() | 27 | widget.startDebugger() |