Differential D4715 Diff 11612 plugins/extensions/pykrita/plugin/plugins/scripter/ui_scripter/actions/newaction/newaction.py
Changeset View
Changeset View
Standalone View
Standalone View
plugins/extensions/pykrita/plugin/plugins/scripter/ui_scripter/actions/newaction/newaction.py
1 | from PyQt5.QtWidgets import QAction, QMessageBox | 1 | from PyQt5.QtWidgets import QAction, QMessageBox | ||
---|---|---|---|---|---|
2 | from PyQt5.QtGui import QKeySequence | ||||
3 | from PyQt5.QtCore import Qt | ||||
2 | 4 | | |||
3 | 5 | | |||
4 | class NewAction(QAction): | 6 | class NewAction(QAction): | ||
5 | 7 | | |||
6 | def __init__(self, scripter, parent=None): | 8 | def __init__(self, scripter, parent=None): | ||
7 | super(NewAction, self).__init__(parent) | 9 | super(NewAction, self).__init__(parent) | ||
8 | self.scripter = scripter | 10 | self.scripter = scripter | ||
9 | 11 | | |||
10 | self.triggered.connect(self.new) | 12 | self.triggered.connect(self.new) | ||
11 | 13 | | |||
12 | self.setText('New') | 14 | self.setText('New') | ||
13 | self.setObjectName('new') | 15 | self.setObjectName('new') | ||
16 | self.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_N)) | ||||
14 | 17 | | |||
15 | @property | 18 | @property | ||
16 | def parent(self): | 19 | def parent(self): | ||
17 | return 'File' | 20 | return 'File' | ||
18 | 21 | | |||
19 | def new(self): | 22 | def new(self): | ||
20 | msgBox = QMessageBox(self.scripter.uicontroller.mainWidget) | 23 | msgBox = QMessageBox(self.scripter.uicontroller.mainWidget) | ||
21 | 24 | | |||
Show All 15 Lines |