mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-10 04:15:52 +00:00
implement binary module
This commit is contained in:
15
sources/plasmoid/plugin/CMakeLists.txt
Normal file
15
sources/plasmoid/plugin/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
include_directories (${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
${PROJECT_TRDPARTY_DIR}
|
||||
${Qt_INCLUDE}
|
||||
${Kf5_INCLUDE})
|
||||
|
||||
file (GLOB SUBPROJECT_SOURCE *.cpp)
|
||||
|
||||
add_library (${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE})
|
||||
target_link_libraries (${PLUGIN_NAME} ${Qt5Core_LIBRARIES} ${Qt5Qml_LIBRARIES} ${I18n_LIBRARIES} ${Plasma_LIBRARIES})
|
||||
|
||||
install (TARGETS ${PLUGIN_NAME} DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/netctl)
|
||||
install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/netctl)
|
40
sources/plasmoid/plugin/netctl.cpp
Normal file
40
sources/plasmoid/plugin/netctl.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
/***************************************************************************
|
||||
* This file is part of netctl-gui *
|
||||
* *
|
||||
* netctl-gui is free software: you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation, either version 3 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* *
|
||||
* netctl-gui 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 General Public License *
|
||||
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
|
||||
***************************************************************************/
|
||||
|
||||
#include <QtQml>
|
||||
|
||||
#include <pdebug/pdebug.h>
|
||||
|
||||
#include "netctl.h"
|
||||
#include "version.h"
|
||||
|
||||
|
||||
QString NetctlPlugin::parsePattern(QString pattern, const QString key, const QString value)
|
||||
{
|
||||
// if (debug) qDebug() << PDEBUG;
|
||||
|
||||
return pattern.replace(QString("$") + key, value);
|
||||
}
|
||||
|
||||
void NetctlPlugin::registerTypes(const char *uri)
|
||||
{
|
||||
Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.netctl"));
|
||||
|
||||
// qmlRegisterType<ProcessRunner>(uri, 1, 0, "ProcessRunner");
|
||||
// qmlRegisterType<TimeZoneModel>(uri, 1, 0, "TimeZoneModel");
|
||||
// qmlRegisterSingletonType<TimezonesI18n>(uri, 1, 0, "TimezonesI18n", timezonesi18n_singletontype_provider);
|
||||
}
|
38
sources/plasmoid/plugin/netctl.h
Normal file
38
sources/plasmoid/plugin/netctl.h
Normal file
@ -0,0 +1,38 @@
|
||||
/***************************************************************************
|
||||
* This file is part of netctl-gui *
|
||||
* *
|
||||
* netctl-gui is free software: you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation, either version 3 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* *
|
||||
* netctl-gui 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 General Public License *
|
||||
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef NETCTLPLUGIN_H
|
||||
#define NETCTLPLUGIN_H
|
||||
|
||||
#include <QQmlExtensionPlugin>
|
||||
|
||||
|
||||
class QQmlEngine;
|
||||
|
||||
class NetctlPlugin : public QQmlExtensionPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
|
||||
|
||||
public:
|
||||
void registerTypes(const char *uri);
|
||||
static QString parsePattern(QString pattern, const QString key, const QString value);
|
||||
};
|
||||
|
||||
|
||||
#endif /* NETCTLPLUGIN_H */
|
3
sources/plasmoid/plugin/qmldir
Normal file
3
sources/plasmoid/plugin/qmldir
Normal file
@ -0,0 +1,3 @@
|
||||
module org.kde.plasma.private.netctl
|
||||
|
||||
plugin netctlplugin
|
Reference in New Issue
Block a user