Exemplo n.º 1
0
    def __init__(self):
        super(LastDocumentsDocker, self).__init__()

        self.baseWidget = QWidget()
        self.layout = QVBoxLayout()
        self.listView = QListView()
        self.loadButton = QPushButton("Refresh")
        self.listModel = lastdocumentslistmodel.LastDocumentsListModel()

        self.listView.setModel(self.listModel)
        self.listView.setFlow(QListView.LeftToRight)

        self.layout.addWidget(self.listView)
        self.layout.addWidget(self.loadButton)

        self.baseWidget.setLayout(self.layout)
        self.setWidget(self.baseWidget)

        self.loadButton.clicked.connect(self.refreshRecentDocuments)
        self.setWindowTitle("Last Documents Docker")

    def canvasChanged(self, canvas):
        pass

    def refreshRecentDocuments(self):
        self.listModel.loadRecentDocuments()


Application.addDockWidgetFactory(krita.DockWidgetFactory("lastdocumentsdocker", krita.DockWidgetFactoryBase.DockRight, LastDocumentsDocker))
Exemplo n.º 2
0
        directoryTextField = QLineEdit()
        directoryDialogButton = QPushButton("...")

        directoryDialogButton.clicked.connect(self.test)

        directorySelectorLayout.addWidget(directoryTextField)
        directorySelectorLayout.addWidget(directoryDialogButton)

        self.scriptsLayout.addRow(
            "Script {0}".format(self.scriptsLayout.rowCount() + 1),
            directorySelectorLayout)

    def test(self):
        obj = self.sender()
        print('button', obj)

    def loadActions(self):
        pass

    def readSettings(self):
        pass

    def writeSettings(self):
        pass


Application.addDockWidgetFactory(
    krita.DockWidgetFactory("scriptdocker",
                            krita.DockWidgetFactoryBase.DockRight,
                            ScriptDocker))
Exemplo n.º 3
0
import krita
from .lastdocumentsdocker import LastDocumentsDocker


Application.addDockWidgetFactory(
    krita.DockWidgetFactory("lastdocumentsdocker",
                            krita.DockWidgetFactoryBase.DockRight,
                            LastDocumentsDocker))
Exemplo n.º 4
0
    def canvasChanged(self, canvas):
        pass

    def addNewRow(self):
        directorySelectorLayout = QHBoxLayout()
        directoryTextField = QLineEdit()
        directoryDialogButton = QPushButton(i18n("..."))

        directoryDialogButton.clicked.connect(self.test)

        directorySelectorLayout.addWidget(directoryTextField)
        directorySelectorLayout.addWidget(directoryDialogButton)

        self.scriptsLayout.addRow(str(i18n("Script {0}")).format(self.scriptsLayout.rowCount() + 1), directorySelectorLayout)

    def test(self):
        obj = self.sender()
        print('button', obj)

    def loadActions(self):
        pass

    def readSettings(self):
        pass

    def writeSettings(self):
        pass


Application.addDockWidgetFactory(krita.DockWidgetFactory("scriptdocker", krita.DockWidgetFactoryBase.DockRight, ScriptDocker))