/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (C) 2017 Simon Stuerz * * * * This file is part of guh-control. * * * * guh-control 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, version 3 of the License. * * * * guh-control 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 guh-control. If not, see . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include #include #include #include #include "engine.h" #include "vendorsproxy.h" #include "deviceclassesproxy.h" #include "devicesproxy.h" #include "pluginsproxy.h" #include "devicediscovery.h" #include "discovery/guhdiscovery.h" #include "discovery/discoverymodel.h" #include "interfacesmodel.h" #include "rulemanager.h" #include "models/rulesfiltermodel.h" #include "types/ruleactions.h" #include "types/ruleaction.h" #include "types/ruleactionparams.h" #include "types/ruleactionparam.h" #include "types/eventdescriptors.h" #include "types/eventdescriptor.h" #include "types/rule.h" #include "models/logsmodel.h" #include "models/valuelogsproxymodel.h" #include "basicconfiguration.h" int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication application(argc, argv); application.setApplicationName("guh-control"); application.setOrganizationName("guh"); QQuickStyle::setStyle("Material"); const char uri[] = "Guh"; qmlRegisterSingletonType(uri, 1, 0, "Engine", Engine::qmlInstance); qmlRegisterUncreatableType(uri, 1, 0, "DeviceManager", "Can't create this in QML. Get it from the Core."); qmlRegisterUncreatableType(uri, 1, 0, "JsonRpcClient", "Can't create this in QML. Get it from the Core."); qmlRegisterUncreatableType(uri, 1, 0, "GuhConnection", "Can't create this in QML. Get it from the Core."); // libguh-common qmlRegisterUncreatableType(uri, 1, 0, "Types", "Can't create this in QML. Get it from the Core."); qmlRegisterUncreatableType(uri, 1, 0, "ParamType", "Can't create this in QML. Get it from the ParamTypes."); qmlRegisterUncreatableType(uri, 1, 0, "ParamTypes", "Can't create this in QML. Get it from the DeviceClass."); qmlRegisterUncreatableType(uri, 1, 0, "EventType", "Can't create this in QML. Get it from the EventTypes."); qmlRegisterUncreatableType(uri, 1, 0, "EventTypes", "Can't create this in QML. Get it from the DeviceClass."); qmlRegisterUncreatableType(uri, 1, 0, "StateType", "Can't create this in QML. Get it from the StateTypes."); qmlRegisterUncreatableType(uri, 1, 0, "StateTypes", "Can't create this in QML. Get it from the DeviceClass."); qmlRegisterUncreatableType(uri, 1, 0, "ActionType", "Can't create this in QML. Get it from the ActionTypes."); qmlRegisterUncreatableType(uri, 1, 0, "ActionTypes", "Can't create this in QML. Get it from the DeviceClass."); qmlRegisterUncreatableType(uri, 1, 0, "State", "Can't create this in QML. Get it from the States."); qmlRegisterUncreatableType(uri, 1, 0, "States", "Can't create this in QML. Get it from the Device."); qmlRegisterUncreatableType(uri, 1, 0, "StatesProxy", "Can't create this in QML. Get it from the Device."); qmlRegisterUncreatableType(uri, 1, 0, "Vendor", "Can't create this in QML. Get it from the Vendors."); qmlRegisterUncreatableType(uri, 1, 0, "Vendors", "Can't create this in QML. Get it from the DeviceManager."); qmlRegisterType(uri, 1, 0, "VendorsProxy"); qmlRegisterUncreatableType(uri, 1, 0, "Device", "Can't create this in QML. Get it from the Devices."); qmlRegisterUncreatableType(uri, 1, 0, "Devices", "Can't create this in QML. Get it from the DeviceManager."); qmlRegisterType(uri, 1, 0, "DevicesProxy"); qmlRegisterType(uri, 1, 0, "DevicesBasicTagsModel"); qmlRegisterType(uri, 1, 0, "InterfacesModel"); qmlRegisterUncreatableType(uri, 1, 0, "DeviceClass", "Can't create this in QML. Get it from the DeviceClasses."); qmlRegisterUncreatableType(uri, 1, 0, "DeviceClasses", "Can't create this in QML. Get it from the DeviceManager."); qmlRegisterType(uri, 1, 0, "DeviceClassesProxy"); qmlRegisterType(uri, 1, 0, "DeviceDiscovery"); qmlRegisterUncreatableType(uri, 1, 0, "RuleManager", "Get it from the Engine"); qmlRegisterUncreatableType(uri, 1, 0, "Rules", "Get it from RuleManager"); qmlRegisterUncreatableType(uri, 1, 0, "Rule", "Get it from Rules"); qmlRegisterUncreatableType(uri, 1, 0, "RuleActions", "Get them from the rule"); qmlRegisterUncreatableType(uri, 1, 0, "RuleAction", "Get it from RuleActions"); qmlRegisterUncreatableType(uri, 1, 0, "RuleActionParams", "Get it from RuleActions"); qmlRegisterUncreatableType(uri, 1, 0, "RuleActionParam", "Get it from RuleActionParams"); qmlRegisterType(uri, 1, 0, "RulesFilterModel"); qmlRegisterUncreatableType(uri, 1, 0, "EventDescriptors", "Get them from rules"); qmlRegisterUncreatableType(uri, 1, 0, "EventDescriptor", "Get them from rules"); qmlRegisterUncreatableType(uri, 1, 0, "ParamTypes", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "ParamType", "Uncreatable"); qmlRegisterType(uri, 1, 0, "Param"); qmlRegisterUncreatableType(uri, 1, 0, "ParamDescriptor", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "ParamDescriptors", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "Plugin", "Can't create this in QML. Get it from the Plugins."); qmlRegisterUncreatableType(uri, 1, 0, "Plugins", "Can't create this in QML. Get it from the DeviceManager."); qmlRegisterType(uri, 1, 0, "PluginsProxy"); qmlRegisterUncreatableType(uri, 1, 0, "BasicConfiguration", "Uncreatable"); qmlRegisterType(uri, 1, 0, "GuhDiscovery"); qmlRegisterUncreatableType(uri, 1, 0, "DiscoveryModel", "Get it from GuhDiscovery"); qmlRegisterType(uri, 1, 0, "LogsModel"); qmlRegisterType(uri, 1, 0, "ValueLogsProxyModel"); qmlRegisterUncreatableType(uri, 1, 0, "LogEntry", "Get them from LogsModel"); Engine::instance(); QQmlApplicationEngine engine; engine.load(QUrl(QLatin1String("qrc:/ui/main.qml"))); return application.exec(); }