Changeset View
Changeset View
Standalone View
Standalone View
plugins/extensions/pykrita/plugin/plugins/scripter/uicontroller.py
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 10 | class UIController(object): | |||
---|---|---|---|---|---|
114 | def findStackWidget(self, widgetName): | 114 | def findStackWidget(self, widgetName): | ||
115 | for index in range(self.stackedWidget.count()): | 115 | for index in range(self.stackedWidget.count()): | ||
116 | widget = self.stackedWidget.widget(index) | 116 | widget = self.stackedWidget.widget(index) | ||
117 | if widget.objectName() == widgetName: | 117 | if widget.objectName() == widgetName: | ||
118 | return widget | 118 | return widget | ||
119 | 119 | | |||
120 | def setDocumentEditor(self, document): | 120 | def setDocumentEditor(self, document): | ||
121 | self.editor.clear() | 121 | self.editor.clear() | ||
122 | self.editor.appendPlainText(document.data) | 122 | self.editor.moveCursor(QTextCursor.Start) | ||
123 | self.editor.insertPlainText(document.data) | ||||
124 | self.editor.moveCursor(QTextCursor.End) | ||||
123 | 125 | | |||
124 | def setStatusBar(self, value='untitled'): | 126 | def setStatusBar(self, value='untitled'): | ||
125 | self.statusBar.setText(value) | 127 | self.statusBar.setText(value) | ||
126 | 128 | | |||
127 | def setActiveWidget(self, widgetName): | 129 | def setActiveWidget(self, widgetName): | ||
128 | index = self.widgetSelector.findText(widgetName) | 130 | index = self.widgetSelector.findText(widgetName) | ||
129 | 131 | | |||
130 | if index!=-1: | 132 | if index!=-1: | ||
Show All 14 Lines |