Changeset View
Changeset View
Standalone View
Standalone View
plugins/python/exportlayers/uiexportlayers.py
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Line(s) | 162 | else: | |||
---|---|---|---|---|---|
164 | _fileFormat = self.formatsComboBox.currentText() | 164 | _fileFormat = self.formatsComboBox.currentText() | ||
165 | if '[jpeg]' in nodeName: | 165 | if '[jpeg]' in nodeName: | ||
166 | _fileFormat = 'jpeg' | 166 | _fileFormat = 'jpeg' | ||
167 | elif '[png]' in nodeName: | 167 | elif '[png]' in nodeName: | ||
168 | _fileFormat = 'png' | 168 | _fileFormat = 'png' | ||
169 | 169 | | |||
170 | layerFileName = '{0}{1}/{2}.{3}'.format(self.directoryTextField.text(), | 170 | layerFileName = '{0}{1}/{2}.{3}'.format(self.directoryTextField.text(), | ||
171 | parentDir, node.name(), _fileFormat) | 171 | parentDir, node.name(), _fileFormat) | ||
172 | node.save(layerFileName, self.xResSpinBox.value(), self.yResSpinBox.value()) | 172 | node.save(layerFileName, self.xResSpinBox.value(), | ||
173 | self.yResSpinBox.value(), krita.InfoObject()) | ||||
173 | 174 | | |||
174 | if node.childNodes(): | 175 | if node.childNodes(): | ||
175 | self._exportLayers(node, fileFormat, newDir) | 176 | self._exportLayers(node, fileFormat, newDir) | ||
176 | 177 | | |||
177 | def _selectDir(self): | 178 | def _selectDir(self): | ||
178 | directory = QFileDialog.getExistingDirectory(self.mainDialog, i18n("Select a Folder"), os.path.expanduser("~"), QFileDialog.ShowDirsOnly) | 179 | directory = QFileDialog.getExistingDirectory(self.mainDialog, i18n("Select a Folder"), os.path.expanduser("~"), QFileDialog.ShowDirsOnly) | ||
179 | self.directoryTextField.setText(directory) | 180 | self.directoryTextField.setText(directory) | ||
180 | 181 | | |||
181 | def _setResolution(self, index): | 182 | def _setResolution(self, index): | ||
182 | document = self.documentsList[index] | 183 | document = self.documentsList[index] | ||
183 | self.xResSpinBox.setValue(document.width()) | 184 | self.xResSpinBox.setValue(document.width()) | ||
184 | self.yResSpinBox.setValue(document.height()) | 185 | self.yResSpinBox.setValue(document.height()) |