make just one plugin out of both components

wilder-5.14
Aaron Seigo 12 years ago
parent 9cca8ce2ef
commit b9fbc59d20
  1. 51
      components/CMakeLists.txt
  2. 20
      components/interactiveconsole/CMakeLists.txt
  3. 1
      components/interactiveconsole/interactiveconsole.h
  4. 30
      components/interactiveconsole/interactiveconsoleplugin.cpp
  5. 34
      components/interactiveconsole/interactiveconsoleplugin.h
  6. 2
      components/qmldir
  7. 8
      components/shellprivateplugin.cpp
  8. 2
      components/shellprivateplugin.h
  9. 34
      components/widgetexplorer/CMakeLists.txt
  10. 19
      shell/shellcorona.cpp

@ -1,6 +1,49 @@
install(DIRECTORY qml/ DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/workspace/components)
project(plasmashellprivateplugin)
add_definitions(-DTRANSLATION_DOMAIN=\"widgetexplorer\")
add_subdirectory(interactiveconsole)
if (KF5TextEditor_FOUND)
add_subdirectory(widgetexplorer)
endif()
set(interactiveconsole_SRCS
interactiveconsole/interactiveconsole.cpp
)
endif (KF5TextEditor_FOUND)
set(plasmashellprivateplugin_SRCS
widgetexplorer/kcategorizeditemsviewmodels.cpp
widgetexplorer/plasmaappletitemmodel.cpp
widgetexplorer/openwidgetassistant.cpp
widgetexplorer/widgetexplorer.cpp
shellprivateplugin.cpp
${interactiveconsole_SRCS}
)
add_library(plasmashellprivateplugin SHARED ${plasmashellprivateplugin_SRCS})
target_link_libraries(plasmashellprivateplugin
Qt5::Core
Qt5::Quick
Qt5::Qml
Qt5::Gui
Qt5::Widgets
Qt5::Quick
Qt5::Qml
KF5::Plasma
KF5::PlasmaQuick
KF5::I18n
KF5::Service
KF5::NewStuff
KF5::KIOFileWidgets
KF5::WindowSystem
)
if (KF5TextEditor_FOUND)
target_link_libraries(plasmashellprivateplugin
KF5::TextEditor)
endif (KF5TextEditor_FOUND)
install(TARGETS plasmashellprivateplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/shell)
install(FILES widgetexplorer/plasmoids.knsrc DESTINATION ${CONFIG_INSTALL_DIR})
install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/shell)
install(DIRECTORY qml/ DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/workspace/components)

@ -1,20 +0,0 @@
project(plasmainteractiveconsole)
add_definitions(-DTRANSLATION_DOMAIN=\"interactiveconsole\")
set(interactiveconsole_SRC
interactiveconsole.cpp
interactiveconsoleplugin.cpp
)
add_library(plasmainteractiveconsole SHARED ${interactiveconsole_SRC})
target_link_libraries(plasmainteractiveconsole
Qt5::Quick
Qt5::Script
Qt5::Widgets
KF5::Plasma
KF5::I18n
KF5::TextEditor)
install(TARGETS plasmainteractiveconsole DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/shell)

@ -23,7 +23,6 @@
#include <QDialog>
#include <QPointer>
#include <QScriptValue>
#include <KIO/Job>

@ -1,30 +0,0 @@
/*
* Copyright 2014 Aaron Seigo <aseigo@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program 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 General Public License for more details
*
* You should have received a copy of the GNU Library 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 "interactiveconsoleplugin.h"
#include <QtQml>
#include "interactiveconsole.h"
void InteractiveConsolePlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.shell"));
qmlRegisterType<InteractiveConsole>(uri, 2, 0, "InteractiveConsole");
}

@ -1,34 +0,0 @@
/*
* Copyright 2014 Aaron Seigo <aseigo@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program 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 General Public License for more details
*
* You should have received a copy of the GNU Library 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 INTERACTIVECONSOLEPLUGIN
#define INTERACTIVECONSOLEPLUGIN
#include <QQmlExtensionPlugin>
class InteractiveConsolePlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.kde.plasmashell.interactiveconsole")
public:
void registerTypes(const char *uri);
};
#endif

@ -1,2 +1,2 @@
module org.kde.plasma.private.shell
plugin plasmawidgetexplorerplugin
plugin plasmashellprivateplugin

@ -20,17 +20,19 @@
THE SOFTWARE.
*/
#include "widgetexplorerplugin.h"
#include "shellprivateplugin.h"
#include <QtQml>
#include "widgetexplorer.h"
#include "widgetexplorer/widgetexplorer.h"
#include "interactiveconsole/interactiveconsole.h"
#include <plasma/containment.h>
void WidgetExplorerPlugin::registerTypes(const char *uri)
void PlasmaShellPrivatePlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.shell"));
qmlRegisterType<Plasma::Containment>();
qmlRegisterType<WidgetExplorer>(uri, 2, 0, "WidgetExplorer");
qmlRegisterType<InteractiveConsole>(uri, 2, 0, "InteractiveConsoleWindow");
}

@ -25,7 +25,7 @@
#include <QQmlExtensionPlugin>
class WidgetExplorerPlugin : public QQmlExtensionPlugin
class PlasmaShellPrivatePlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")

@ -1,34 +0,0 @@
project(plasmawidgetexplorerplugin)
add_definitions(-DTRANSLATION_DOMAIN=\"widgetexplorer\")
set(widgetexplorer_SRC
kcategorizeditemsviewmodels.cpp
plasmaappletitemmodel.cpp
openwidgetassistant.cpp
widgetexplorer.cpp
widgetexplorerplugin.cpp
)
add_library(plasmawidgetexplorerplugin SHARED ${widgetexplorer_SRC})
target_link_libraries(plasmawidgetexplorerplugin
Qt5::Core
Qt5::Quick
Qt5::Qml
Qt5::Gui
Qt5::Widgets
Qt5::Quick
Qt5::Qml
KF5::Plasma
KF5::PlasmaQuick
KF5::I18n
KF5::Service
KF5::NewStuff
KF5::KIOFileWidgets
KF5::WindowSystem
)
install(TARGETS plasmawidgetexplorerplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/shell)
install(FILES plasmoids.knsrc DESTINATION ${CONFIG_INSTALL_DIR})
install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/shell)

@ -982,18 +982,27 @@ void ShellCorona::showInteractiveConsole()
return;
}
qDebug() << "GOT OUR CONSOLE!" << consoleQML;
d->interactiveConsole = new KDeclarative::QmlObject(this);
d->interactiveConsole->setInitializationDelayed(true);
d->interactiveConsole->setSource(QUrl::fromLocalFile(consoleQML));
d->interactiveConsole->completeInitialization();
connect(d->interactiveConsole->rootObject(), SIGNAL(visibleChanged(bool)),
this, SLOT(interactiveConsoleVisibilityChanged(bool)));
QObject *engine = new WorkspaceScripting::ScriptEngine(this, d->interactiveConsole);
d->interactiveConsole->engine()->rootContext()->setContextProperty("scriptEngine", engine);
d->interactiveConsole->completeInitialization();
if (d->interactiveConsole->rootObject()) {
connect(d->interactiveConsole->rootObject(), SIGNAL(visibleChanged(bool)),
this, SLOT(interactiveConsoleVisibilityChanged(bool)));
}
}
d->interactiveConsole->rootObject()->setProperty("mode", "Desktop");
d->interactiveConsole->rootObject()->setProperty("visible", true);
qDebug() << "Going in..." << d->interactiveConsole << d->interactiveConsole->rootObject();
if (d->interactiveConsole->rootObject()) {
d->interactiveConsole->rootObject()->setProperty("mode", "desktop");
d->interactiveConsole->rootObject()->setProperty("visible", true);
}
}
void ShellCorona::loadScriptInInteractiveConsole(const QString &script)

Loading…
Cancel
Save