Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Auto select current document in Export Layers

stib bork99491d71940c
diff --git a/plugins/python/exportlayers/uiexportlayers.py b/plugins/python/exportlayers/uiexportlayers.py
index f532b7c54d..4e02ebf147 100644
--- a/plugins/python/exportlayers/uiexportlayers.py
+++ b/plugins/python/exportlayers/uiexportlayers.py
@@ -103,7 +103,7 @@ class UIExportLayers(object):
self.mainLayout.addLayout(self.formLayout)
self.mainLayout.addWidget(self.line)
self.mainLayout.addWidget(self.buttonBox)
-
+
self.mainDialog.resize(500, 300)
self.mainDialog.setWindowTitle(i18n("Export Layers"))
self.mainDialog.setSizeGripEnabled(True)
@@ -118,9 +118,19 @@ class UIExportLayers(object):
if document.fileName()
]
+ currentDoc = None
+ if self.kritaInstance.activeDocument():
+ currentDoc = self.kritaInstance.activeDocument().fileName()
+
+ cdoc = 0
for document in self.documentsList:
- self.widgetDocuments.addItem(document.fileName())
-
+ theName = document.fileName()
+ self.widgetDocuments.addItem(theName)
+ if theName == currentDoc:
+ cdoc = self.widgetDocuments.count() - 1
+ if self.widgetDocuments.count():
+ self.widgetDocuments.setCurrentItem(self.widgetDocuments.item(cdoc))
+
def refreshButtonClicked(self):
self.loadDocuments()
@@ -131,8 +141,8 @@ class UIExportLayers(object):
document for document in self.documentsList
for path in selectedPaths if path == document.fileName()
]
-
self.msgBox = QMessageBox(self.mainDialog)
+
if not selectedDocuments:
self.msgBox.setText(i18n("Select one document."))
elif not self.directoryTextField.text():