diff --git a/plugins/dockers/CMakeLists.txt b/plugins/dockers/CMakeLists.txt index 9429916ba7..cc248c21c3 100644 --- a/plugins/dockers/CMakeLists.txt +++ b/plugins/dockers/CMakeLists.txt @@ -1,31 +1,32 @@ add_subdirectory(defaultdockers) add_subdirectory(smallcolorselector) add_subdirectory(specificcolorselector) add_subdirectory(digitalmixer) add_subdirectory(advancedcolorselector) add_subdirectory(presetdocker) add_subdirectory(historydocker) add_subdirectory(channeldocker) add_subdirectory(artisticcolorselector) add_subdirectory(tasksetdocker) add_subdirectory(compositiondocker) add_subdirectory(patterndocker) add_subdirectory(griddocker) add_subdirectory(arrangedocker) if(HAVE_OCIO) add_subdirectory(lut) endif() add_subdirectory(overview) add_subdirectory(palettedocker) add_subdirectory(animation) add_subdirectory(presethistory) add_subdirectory(svgcollectiondocker) add_subdirectory(histogram) if(NOT APPLE AND HAVE_QT_QUICK) add_subdirectory(touchdocker) option(ENABLE_CPU_THROTTLE "Build the CPU Throttle Docker" OFF) if (ENABLE_CPU_THROTTLE) add_subdirectory(throttle) endif() endif() +add_subdirectory(logdocker) diff --git a/plugins/dockers/logdocker/CMakeLists.txt b/plugins/dockers/logdocker/CMakeLists.txt new file mode 100644 index 0000000000..b7963b0942 --- /dev/null +++ b/plugins/dockers/logdocker/CMakeLists.txt @@ -0,0 +1,12 @@ +set(KRITA_LOGDOCKER_SOURCES + LogDocker.cpp + LogDockerDock.cpp +) + +ki18n_wrap_ui(KRITA_LOGDOCKER_SOURCES + WdgLogDocker.ui +) + +add_library(kritalogdocker MODULE ${KRITA_LOGDOCKER_SOURCES}) +target_link_libraries(kritalogdocker kritaui) +install(TARGETS kritalogdocker DESTINATION ${KRITA_PLUGIN_INSTALL_DIR}) diff --git a/plugins/dockers/logdocker/LogDocker.cpp b/plugins/dockers/logdocker/LogDocker.cpp new file mode 100644 index 0000000000..577c2fce18 --- /dev/null +++ b/plugins/dockers/logdocker/LogDocker.cpp @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2018 Boudewijn Rempt + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "LogDocker.h" + +#include +#include + +#include +#include + +#include "LogDockerDock.h" + +K_PLUGIN_FACTORY_WITH_JSON(LogDockerPluginFactory, + "krita_logdocker.json", + registerPlugin();) + +class LogDockerDockFactory : public KoDockFactoryBase { +public: + LogDockerDockFactory() + { + } + + virtual ~LogDockerDockFactory() + { + } + + QString id() const override + { + return QString( "LogDocker" ); + } + + virtual Qt::DockWidgetArea defaultDockWidgetArea() const + { + return Qt::RightDockWidgetArea; + } + + QDockWidget* createDockWidget() override + { + LogDockerDock * dockWidget = new LogDockerDock(); + dockWidget->setObjectName(id()); + + return dockWidget; + } + + DockPosition defaultDockPosition() const override + { + return DockMinimized; + } +private: + + +}; + + +LogDockerPlugin::LogDockerPlugin(QObject *parent, const QVariantList &) + : QObject(parent) +{ + KoDockRegistry::instance()->add(new LogDockerDockFactory()); +} + +LogDockerPlugin::~LogDockerPlugin() +{ +} + +#include "LogDocker.moc" diff --git a/plugins/dockers/logdocker/LogDocker.h b/plugins/dockers/logdocker/LogDocker.h new file mode 100644 index 0000000000..40ac6a099e --- /dev/null +++ b/plugins/dockers/logdocker/LogDocker.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018 Boudewijn Rempt + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _LOG_DOCKER_H_ +#define _LOG_DOCKER_H_ + +#include +#include + +class LogDockerPlugin : public QObject +{ + Q_OBJECT +public: + LogDockerPlugin(QObject *parent, const QVariantList &); + ~LogDockerPlugin() override; +}; + +#endif diff --git a/plugins/dockers/logdocker/LogDockerDock.cpp b/plugins/dockers/logdocker/LogDockerDock.cpp new file mode 100644 index 0000000000..9052878cad --- /dev/null +++ b/plugins/dockers/logdocker/LogDockerDock.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018 Boudewijn Rempt + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "LogDockerDock.h" + +#include +#include + +#include + +#include + +#include "kis_canvas2.h" +#include "KisViewManager.h" + +#include + +LogDockerDock::LogDockerDock( ) + : QDockWidget(i18n("Log Viewer")) +{ + QWidget *page = new QWidget(this); + setupUi(page); + bnToggle->setIcon(koIcon("view-list-text")); + bnClear->setIcon(koIcon("edit-clear")); + bnSave->setIcon(koIcon("filesave")); + bnSettings->setIcon(koIcon("settings")); +} + +void LogDockerDock::setCanvas(KoCanvasBase *canvas) +{ + Q_UNUSED(canvas); + setEnabled(true); + +} + + + diff --git a/plugins/dockers/logdocker/LogDockerDock.h b/plugins/dockers/logdocker/LogDockerDock.h new file mode 100644 index 0000000000..ef848acf57 --- /dev/null +++ b/plugins/dockers/logdocker/LogDockerDock.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018 Boudewijn Rempt + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _LOGDOCKER_DOCK_H_ +#define _LOGDOCKER_DOCK_H_ + +#include + +#include + +#include "ui_WdgLogDocker.h" + +class LogDockerDock : public QDockWidget, public KoCanvasObserverBase, public Ui_WdgLogDocker { + Q_OBJECT +public: + LogDockerDock( ); + QString observerName() override { return "LogDockerDock"; } + void setCanvas(KoCanvasBase *canvas) override; + void unsetCanvas() override {} + +private Q_SLOTS: +private: +}; + + +#endif diff --git a/plugins/dockers/logdocker/WdgLogDocker.ui b/plugins/dockers/logdocker/WdgLogDocker.ui new file mode 100644 index 0000000000..db1a042c4a --- /dev/null +++ b/plugins/dockers/logdocker/WdgLogDocker.ui @@ -0,0 +1,87 @@ + + + WdgLogDocker + + + + 0 + 0 + 400 + 260 + + + + Form + + + + + + + + + + + false + + + Enable Logging + + + ... + + + true + + + + + + + Clear the log + + + ... + + + + + + + Save the log + + + ... + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Configure Logging + + + ... + + + + + + + + + + diff --git a/plugins/dockers/logdocker/krita_logdocker.json b/plugins/dockers/logdocker/krita_logdocker.json new file mode 100644 index 0000000000..258421a53a --- /dev/null +++ b/plugins/dockers/logdocker/krita_logdocker.json @@ -0,0 +1,9 @@ +{ + "Id": "Log Docker", + "Type": "Service", + "X-KDE-Library": "kritalogdocker", + "X-KDE-ServiceTypes": [ + "Krita/Dock" + ], + "X-Krita-Version": "28" +}