diff --git a/CMakeLists.txt b/CMakeLists.txt index 32c0ba7..a0d4b9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,8 @@ set(RESOURCES ${CMAKE_SOURCE_DIR}/resources/wiki_logo.svg ${CMAKE_SOURCE_DIR}/resources/DistInfo.qml ${CMAKE_SOURCE_DIR}/resources/Test.qml - ${CMAKE_SOURCE_DIR}/resources/resources.qrc) + ${CMAKE_SOURCE_DIR}/resources/resources.qrc + ${CMAKE_SOURCE_DIR}/shared/AlteratorQMLStyle/AlteratorQMLStyle.qrc) set(SHARED ${CMAKE_SOURCE_DIR}/shared/AlteratorWindow.qml @@ -37,6 +38,7 @@ set(SHARED ${CMAKE_SOURCE_DIR}/shared/qmldir) add_executable(new_alterator + ${CMAKE_SOURCE_DIR}/shared/AlteratorQMLStyle/AlteratorQMLStyle.qrc ${CMAKE_SOURCE_DIR}/shared/shared.qrc ${CMAKE_SOURCE_DIR}/resources/resources.qrc ${CMAKE_SOURCE_DIR}/src/dist_info.cpp diff --git a/alterator/alteratorlib b/alterator/alteratorlib index 1903db0..ee4eb70 100644 --- a/alterator/alteratorlib +++ b/alterator/alteratorlib @@ -1,7 +1,7 @@ #ifndef ALTERATOLIB_H #define ALTERATOLIB_H #include "alterator/include/alterator_loader.h" -#include "alterator/include/dbus_connector.h" -#include "alterator/include/dbus_interface.h" -#include "alterator/include/dbus_action.h" +#include "alterator/include/dbus_qml_connector.h" +#include "alterator/include/new_interface.h" +#include "alterator/include/dbus_property_map.h" #endif diff --git a/alterator/include/dbus_action.h b/alterator/include/dbus_action.h deleted file mode 100644 index 9236216..0000000 --- a/alterator/include/dbus_action.h +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include - -namespace Alterator { -class DBusAction : public QObject{ -public: - DBusAction(QDBusInterface *iface, QObject *parent = nullptr); - virtual void execute(QList args) = 0; -protected: - QDBusInterface *interface; -}; - -class DBusSetProperty : public DBusAction{ -public: - DBusSetProperty(QDBusInterface *iface, QObject *parent = nullptr); - void execute(QList args); -}; - -class DBusCall : public DBusAction{ -public: - DBusCall(QDBusInterface *iface, QObject *parent = nullptr); - void execute(QList args); -}; -} diff --git a/alterator/include/dbus_connector.h b/alterator/include/dbus_connector.h deleted file mode 100644 index 9492a35..0000000 --- a/alterator/include/dbus_connector.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef DBUS_CONNECTOR_H -#define DBUS_CONNECTOR_H - -#include -#include -#include -#include "dbus_interface.h" -#include - -namespace Alterator{ -class DBusConnector: public QObject -{ - Q_OBJECT -public: - DBusConnector(QObject *parent = nullptr); - -signals: - //void pushInLogs(QString targetId, QList logs); - void giveInterface(QString targetId, DBusInterface *iface); - -public slots: - void ifaceReq(QString senderId, QString shortName - , QString service, QString path - , QString interface, bool isSessionBus); -private: -// QHash realIfaces; -// QHash introspections; -}; -} - -#endif // DBUS_CONNECTOR_H diff --git a/alterator/include/dbus_interface.h b/alterator/include/dbus_interface.h deleted file mode 100644 index b478dd9..0000000 --- a/alterator/include/dbus_interface.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef DBUS_INTERFACE_H -#define DBUS_INTERFACE_H - -#include -#include -#include -#include -#include "dbus_property_map.h" - -namespace Alterator{ -class DBusInterface: public QObject{ - Q_OBJECT -// Q_ENUM(QDBus::CallMode) -public: - DBusInterface( QString sname, QString service, QString path, - QString interface, bool isSessionBus, QObject *parent = 0 ); - - QString getShortName(); - DBusPropertyMap *getProperties(); - QString getIfaceName(); - QString getServiceName(); - QString getAdress(); - QDBusInterface *getRealIface(); - bool getISB(); -public slots: - void propertyUpdatedFromDBus( - QDBusArgument ifaceName - , QDBusArgument changedProperties - , QDBusArgument invalidProperties); - void updateDBus(QString key, QVariant input); -private: - QDBusInterface *realIface; - DBusPropertyMap *properties; - QString shortName; - QString ifaceName; - QString serviceName; - QString adress; - bool isSessionBus; - - DBusPropertyMap *introspectProperties(QString service, QString path, - QString interface, bool isSessionBus); -}; -} - -#endif // DBUS_INTERFACE_H diff --git a/alterator/include/new_interface.h b/alterator/include/new_interface.h index 83c5cff..9e9711c 100644 --- a/alterator/include/new_interface.h +++ b/alterator/include/new_interface.h @@ -9,7 +9,7 @@ #include "dbus_property_map.h" namespace Alterator{ -class newInterface: public QQmlComponent{ +class DBusInterface: public QQmlComponent{ Q_OBJECT Q_PROPERTY(QString initialServiceName READ getInitialServiceName @@ -38,7 +38,7 @@ class newInterface: public QQmlComponent{ NOTIFY propertiesChanged) public: - newInterface(QObject *parent = 0); + DBusInterface(QObject *parent = 0); DBusPropertyMap* getProperties(); QString getInitialIfaceName(); diff --git a/alterator/src/alterator_loader.cpp b/alterator/src/alterator_loader.cpp index 108c8a7..7242c7e 100644 --- a/alterator/src/alterator_loader.cpp +++ b/alterator/src/alterator_loader.cpp @@ -7,17 +7,23 @@ #include #include #include +#include +#include #include "new_interface.h" namespace Alterator { Loader::Loader(QObject *p):QObject(p) { - QQuickStyle::setStyle("Universal"); + int fontId = QFontDatabase::addApplicationFont("../shared/fonts/static/Montserrat-Medium.ttf"); + QStringList fontList = QFontDatabase::applicationFontFamilies(fontId); + QString family = fontList.first(); + QGuiApplication::setFont(QFont(family)); + QQuickStyle::setStyle("AlteratorQMLStyle"); engine = new QQmlApplicationEngine(this); engine->addImportPath("../../new_alterator/"); - qmlRegisterType("Alterator.newInterface", 1, 0, "NewInterface"); + qmlRegisterType("Alterator.DBusInterface", 1, 0, "DBusInterface"); qmlRegisterType("Alterator.DistInfo", 1, 0, "DistInfo"); - QString startingPage = "../resources/DistInfo.qml"; + QString startingPage = "../resources/SystemInformation.qml"; past = QHash>(); future = QHash>(); widgets = QHash(); diff --git a/alterator/src/dbus_action.cpp b/alterator/src/dbus_action.cpp deleted file mode 100644 index f96779b..0000000 --- a/alterator/src/dbus_action.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "dbus_action.h" - -namespace Alterator { -DBusAction::DBusAction(QDBusInterface *iface, QObject *parent) : QObject(parent){ - interface = iface; -} -DBusSetProperty::DBusSetProperty(QDBusInterface *iface, QObject *parent) : DBusAction(iface, parent){} -DBusCall::DBusCall(QDBusInterface *iface, QObject *parent) : DBusAction(iface, parent){} - -void DBusSetProperty::execute(QList args){ - auto t = args[0].toString().toStdString(); - const char *name = t.c_str(); - interface->setProperty(name, args[1].toString()); -} -void DBusCall::execute(QList args){ - QString name = args[0].toString(); - args.removeFirst(); - interface->callWithArgumentList(QDBus::Block, name, args); -} -} diff --git a/alterator/src/dbus_connector.cpp b/alterator/src/dbus_connector.cpp deleted file mode 100644 index 6e7c43e..0000000 --- a/alterator/src/dbus_connector.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "dbus_connector.h" -#include "dbus_property_map.h" -#include -#include -#include - -namespace Alterator{ -DBusConnector::DBusConnector(QObject *parent): QObject(parent) -{ - // realIfaces = QHash(); - // introspections = QHash(); -} - -void DBusConnector::ifaceReq(QString senderId, QString shortName - , QString service, QString path - , QString interface, bool isSessionBus){ - qDebug() << 1; - DBusInterface *iface = new DBusInterface( - shortName, service, path, interface, isSessionBus, this); - emit giveInterface(senderId, iface); - qDebug() << 1; -} -} diff --git a/alterator/src/dbus_interface.cpp b/alterator/src/dbus_interface.cpp deleted file mode 100644 index 2e639d8..0000000 --- a/alterator/src/dbus_interface.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include "dbus_interface.h" -#include - -namespace Alterator { -DBusInterface::DBusInterface( - QString sname, QString service, QString path, - QString interface, bool isb, QObject *parent): QObject(parent){ - ifaceName = interface; - serviceName = service; - adress = path; - isSessionBus = isb; - shortName = sname; - realIface = new QDBusInterface( - serviceName, adress, ifaceName, - isSessionBus ? QDBusConnection::sessionBus() - : QDBusConnection::systemBus(), - this); - properties = introspectProperties(service, path, interface, isb); - connect(properties, &DBusPropertyMap::updateDBusS, - this, &DBusInterface::updateDBus); - if(isSessionBus){ - QDBusConnection::sessionBus().connect( - service, path, "org.freedesktop.DBus.Properties" - , "PropertiesChanged", this - , SLOT(propertyUpdatedFromDBus()) );} - else{ - QDBusConnection::systemBus().connect( - service, path, "org.freedesktop.DBus.Properties" - , "PropertiesChanged", this - , SLOT(propertyUpdatedFromDBus()) );} -} - -QString DBusInterface::getShortName(){return shortName;} -DBusPropertyMap *DBusInterface::getProperties(){return properties;} -QString DBusInterface::getIfaceName(){return ifaceName;} -QString DBusInterface::getServiceName(){return serviceName;} -QString DBusInterface::getAdress(){return adress;} -QDBusInterface *DBusInterface::getRealIface(){return realIface;} -bool DBusInterface::getISB(){return isSessionBus;} - -void DBusInterface::propertyUpdatedFromDBus( - QDBusArgument ifaceName - , QDBusArgument changedProperties - , QDBusArgument invalidProperties){ - QString in; - ifaceName >> in; - if (in != DBusInterface::ifaceName){ - return; - } - changedProperties.beginMap(); - while(!changedProperties.atEnd()){ - QString key; - QVariant val; - changedProperties.beginMapEntry(); - changedProperties >> key >> val; - changedProperties.endMapEntry(); - properties->insert(key, val); - changedProperties.endMapEntry(); - } - changedProperties.endMap(); - invalidProperties.beginArray(); - while(!invalidProperties.atEnd()){ - QString key; - invalidProperties.beginMapEntry(); - invalidProperties >> key; - changedProperties.endMapEntry(); - properties->clear(key); - } - invalidProperties.endArray(); -} - -void DBusInterface::updateDBus(QString key, QVariant input){ - auto t = key.toLocal8Bit(); - realIface->setProperty(t.data(), input); -} - -DBusPropertyMap *DBusInterface::introspectProperties(QString service, QString path - , QString interface, bool isSessionBus) -{ - QDBusInterface props = - QDBusInterface(service, path - , "org.freedesktop.DBus.Properties", - isSessionBus ? QDBusConnection::sessionBus() - : QDBusConnection::systemBus()); - QQmlPropertyMap *t = new QQmlPropertyMap(this); - DBusPropertyMap *introspection = new DBusPropertyMap(t, this); - QHash res = props.call("GetAll", interface).arguments()[0].toHash(); - QMutableHashIterator i(res); - i.toFront(); - while(i.hasNext()){ - introspection->insert(i.key(), i.value()); - i.next(); - } - return introspection; -} -} diff --git a/alterator/src/dbus_property_map.cpp b/alterator/src/dbus_property_map.cpp index dfdd6bc..14ddbd1 100644 --- a/alterator/src/dbus_property_map.cpp +++ b/alterator/src/dbus_property_map.cpp @@ -7,7 +7,7 @@ DBusPropertyMap::DBusPropertyMap(QQmlPropertyMap *derived, QObject *parent) : QQ QVariant DBusPropertyMap::updateValue(const QString &key, const QVariant &input){ emit(updateDBusS(key, input)); auto t = parent(); - newInterface *iface = qobject_cast(parent()->parent()); + DBusInterface *iface = qobject_cast(parent()->parent()); if(iface->updateDBus(key, input)){ return input; }else{ diff --git a/alterator/src/new_interface.cpp b/alterator/src/new_interface.cpp index c7277be..9925382 100644 --- a/alterator/src/new_interface.cpp +++ b/alterator/src/new_interface.cpp @@ -3,46 +3,48 @@ #include namespace Alterator { -newInterface::newInterface(QObject *parent) : QQmlComponent(parent){ +DBusInterface::DBusInterface(QObject *parent) : QQmlComponent(parent){ status = 0; QQmlPropertyMap * t = new QQmlPropertyMap(this); properties = new DBusPropertyMap(t, t); connect(this, SIGNAL(step()), this, SLOT(progress())); + qDebug() << "constructor"; } -DBusPropertyMap* newInterface::getProperties(){return properties;} -QString newInterface::getInitialIfaceName(){return initialIfaceName;} -QString newInterface::getInitialAdress(){return initialAdress;} -bool newInterface::getInitialISB(){return initialIsSessionBus;} -QString newInterface::getInitialServiceName(){return initialServiceName;} +DBusPropertyMap* DBusInterface::getProperties(){return properties;} +QString DBusInterface::getInitialIfaceName(){return initialIfaceName;} +QString DBusInterface::getInitialAdress(){return initialAdress;} +bool DBusInterface::getInitialISB(){return initialIsSessionBus;} +QString DBusInterface::getInitialServiceName(){return initialServiceName;} -QString newInterface::getIfaceName(){return ifaceName;} -QString newInterface::getAdress(){return adress;} -bool newInterface::getISB(){return isSessionBus;} -QString newInterface::getServiceName(){return serviceName;} +QString DBusInterface::getIfaceName(){return ifaceName;} +QString DBusInterface::getAdress(){return adress;} +bool DBusInterface::getISB(){return isSessionBus;} +QString DBusInterface::getServiceName(){return serviceName;} -void newInterface::setInitialServiceName(QString s){ +void DBusInterface::setInitialServiceName(QString s){ initialServiceName = s; emit step(); + qDebug() << "set SName"; } -void newInterface::setInitialIfaceName(QString s){ +void DBusInterface::setInitialIfaceName(QString s){ initialIfaceName = s; emit step(); } -void newInterface::setInitialAdress(QString s){ +void DBusInterface::setInitialAdress(QString s){ initialAdress = s; emit step(); } -void newInterface::setInitialISB(bool b){ +void DBusInterface::setInitialISB(bool b){ initialIsSessionBus = b; emit step(); } -void newInterface::propertyUpdatedFromDBus(QDBusMessage mess){ +void DBusInterface::propertyUpdatedFromDBus(QDBusMessage mess){ QString ifaceName = mess.arguments()[0].toString(); QVariantMap changedProperties = qdbus_cast( mess.arguments()[1].value() ); QStringList invalidProperties = mess.arguments()[2].toStringList(); - if (ifaceName != newInterface::ifaceName){ + if (ifaceName != DBusInterface::ifaceName){ return; } QMapIterator i(changedProperties); @@ -59,7 +61,7 @@ void newInterface::propertyUpdatedFromDBus(QDBusMessage mess){ emit(propertiesChanged(properties)); } -bool newInterface::updateDBus(QString key, QVariant val){ +bool DBusInterface::updateDBus(QString key, QVariant val){ auto t = key.toLocal8Bit(); QDBusInterface props = QDBusInterface(serviceName, adress, @@ -75,7 +77,7 @@ bool newInterface::updateDBus(QString key, QVariant val){ } } -void newInterface::progress(){ +void DBusInterface::progress(){ status++; if (status == 4){ ifaceName = initialIfaceName; @@ -152,7 +154,7 @@ void newInterface::progress(){ } } -QVariant newInterface::call(QString method, QVariantList args){ +QVariant DBusInterface::call(QString method, QVariantList args){ QDBusMessage ans = realIface->callWithArgumentList(QDBus::Block, method, args); if(ans.type() == QDBusMessage::ErrorMessage){ logSignal("There is no such method \"" + method + @@ -164,13 +166,13 @@ QVariant newInterface::call(QString method, QVariantList args){ } } -void newInterface::onCompleted(){ +void DBusInterface::onCompleted(){ for(int i = 0; i < initialLog.size(); i++){ emit logSignal(initialLog[i]); } } -void newInterface::dbusConnect(QString signalOnDBus, QString slotInQML){ +void DBusInterface::dbusConnect(QString signalOnDBus, QString slotInQML){ const QMetaObject *const meta = metaObject(); int border = staticMetaObject.methodCount(); auto t1 = meta->method(30).methodSignature(); diff --git a/resources/DistInfo.qml b/resources/DistInfo.qml index c835656..088cf09 100644 --- a/resources/DistInfo.qml +++ b/resources/DistInfo.qml @@ -1,3 +1,4 @@ + import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Layouts 1.15 @@ -19,6 +20,7 @@ ScrollView { initialIsSessionBus : false Component.onCompleted:{ + console.log("completed") logSignal.connect(window.addRecord) completed.connect(hostname.onCompleted) completed() diff --git a/resources/SystemInformation.qml b/resources/SystemInformation.qml new file mode 100644 index 0000000..a2211d1 --- /dev/null +++ b/resources/SystemInformation.qml @@ -0,0 +1,289 @@ +import QtQuick 2.15 +import QtQuick.Window 2.15 +import QtQuick.Layouts 1.15 +import QtQuick.Controls 2.15 +import Alterator.DistInfo 1.0 +import Alterator.DBusInterface 1.0 + +Item { + id: systemInfo + + anchors.fill: parent + + property int keyWidth: 130 + property int valWidth: 280 + property int columnSpacing: -10 + + DBusInterface{ + id: hostname + initialServiceName: "org.freedesktop.hostname1" + initialAdress: "/org/freedesktop/hostname1" + initialInterfaceName: "org.freedesktop.hostname1" + initialIsSessionBus : false + + Component.onCompleted:{ + logSignal.connect(window.addRecord) + completed.connect(hostname.onCompleted) + completed() + } + } + + ScrollView{ + anchors.fill: parent + contentWidth: width + contentHeight: height + + ColumnLayout{ + anchors.fill: parent + Page{ + Layout.preferredWidth: Layout.maximumWidth + header: RowLayout{ + TextArea{ + text: "ALT edition" + } + Rectangle{ + Layout.fillWidth: true + Layout.minimumHeight: 1 + Layout.maximumHeight: 1 + color: "black" + } + } + + RowLayout{ + anchors.fill: parent + ColumnLayout{ + spacing: columnSpacing + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "Kernel" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: hostname.properties.KernelName + " " + hostname.properties.KernelRelease + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "OS version" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: "TODO"//hostname.properties.Deployment + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "Updated to" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: hostname.properties.OperatingSystemPrettyName + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + } + Image{ + sourceSize.width: 100 + sourceSize.height: 100 + source: "../resources/wiki_logo.svg" + } + } + } + + Page{ + Layout.preferredWidth: Layout.maximumWidth + header: RowLayout{ + TextArea{ + text: "System" + } + Rectangle{ + Layout.fillWidth: true + Layout.minimumHeight: 1 + Layout.maximumHeight: 1 + color: "black" + } + } + + ColumnLayout{ + anchors.fill: parent + spacing: columnSpacing + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "Chassis" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: hostname.properties.Chassis + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "Vendor" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: hostname.properties.HardwareVendor + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "Device name" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: hostname.properties.HardwareModel + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "Processor" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: "TODO"//hostname.properties. + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "RAM" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: "TODO"//hostname.properties.HardwareModel + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "GPU" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: "TODO"//hostname.properties.HardwareModel + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + } + } + + Page{ + Layout.preferredWidth: Layout.maximumWidth + header: RowLayout{ + TextArea{ + text: "Computer name, domain..." + } + Rectangle{ + Layout.fillWidth: true + Layout.minimumHeight: 1 + Layout.maximumHeight: 1 + color: "black" + } + } + + ColumnLayout{ + anchors.fill: parent + spacing: columnSpacing + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "Hostname" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: hostname.properties.Hostname + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "Realm" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: "TODO"//hostname.properties.HardwareVendor + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "Domain role" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: "TODO"//hostname.properties.HardwareModel + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + RowLayout{ + Layout.leftMargin: 10 + Layout.rightMargin: 20 + Layout.fillWidth: true + TextArea{ + text: "Workgroup" + Layout.minimumWidth: keyWidth + } + TextArea{ + text: "TODO"//hostname.properties. + Layout.fillWidth: true + Layout.minimumWidth: valWidth + } + } + } + } + Item{Layout.fillHeight: true} + } + } +} diff --git a/resources/resources.qrc b/resources/resources.qrc index 8c5c039..88de060 100644 --- a/resources/resources.qrc +++ b/resources/resources.qrc @@ -3,5 +3,6 @@ wiki_logo.svg DistInfo.qml Test.qml + SystemInformation.qml diff --git a/shared/AlteratorWindow.qml b/shared/AlteratorWindow.qml index cfc78da..2a563b9 100644 --- a/shared/AlteratorWindow.qml +++ b/shared/AlteratorWindow.qml @@ -2,7 +2,7 @@ import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 -import QtQuick.Controls.Universal 2.15 +import QtQuick.Controls.Styles 1.4 Window{ id: window @@ -15,11 +15,6 @@ Window{ width: 600 height: 650 - Universal.theme: Universal.Light - Universal.accent: Universal.Violet - Universal.background: Universal.theme === Universal.Light ? "white" : "black" - Universal.foreground: Universal.theme === Universal.Light ? "black" : Universal.Violet - visible: true onClosing: { @@ -37,11 +32,10 @@ Window{ logRepeater.model++ } - Rectangle{ + Pane{ id: windowRect anchors.fill: parent - color: Universal.theme === Universal.Light ? "white" : "black" // onHeightChanged: { // openReqS("../resources/DistInfo.qml") @@ -115,8 +109,8 @@ Window{ text: window.log[index] font.pointSize: 10 background: Rectangle { - color: Universal.theme === Universal.Light ? "white" : "black" - border.color: Universal.theme === Universal.Light ? "white" : "black" + color: "white"//Universal.theme === Universal.Light ? "white" : "black" + border.color: "white"//Universal.theme === Universal.Light ? "white" : "black" } } } diff --git a/shared/TextWithHeader.qml b/shared/TextWithHeader.qml index 00abaac..945cf30 100644 --- a/shared/TextWithHeader.qml +++ b/shared/TextWithHeader.qml @@ -4,7 +4,6 @@ import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 import Qt.labs.qmlmodels 1.0 import QtQml 2.15 -import QtQuick.Controls.Universal 2.15 Rectangle{ @@ -19,7 +18,6 @@ Rectangle{ Layout.minimumHeight: l1.height Layout.maximumHeight: l1.height Layout.fillWidth: true - color: Universal.theme === Universal.Light ? "white" : "black" ColumnLayout{ id: l1 diff --git a/shared/shared.qrc b/shared/shared.qrc index 6cacfdf..ed0d6eb 100644 --- a/shared/shared.qrc +++ b/shared/shared.qrc @@ -3,5 +3,6 @@ TextWithHeader.qml AlteratorToolBar.qml AlteratorWindow.qml + someStyle.js diff --git a/shared/someStyle.js b/shared/someStyle.js new file mode 100644 index 0000000..f5c106d --- /dev/null +++ b/shared/someStyle.js @@ -0,0 +1,3 @@ +function func() { + +}