work in progress
This commit is contained in:
parent
02a97842ee
commit
9659b59ad1
@ -27,7 +27,8 @@ set(RESOURCES
|
|||||||
${CMAKE_SOURCE_DIR}/resources/wiki_logo.svg
|
${CMAKE_SOURCE_DIR}/resources/wiki_logo.svg
|
||||||
${CMAKE_SOURCE_DIR}/resources/DistInfo.qml
|
${CMAKE_SOURCE_DIR}/resources/DistInfo.qml
|
||||||
${CMAKE_SOURCE_DIR}/resources/Test.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
|
set(SHARED
|
||||||
${CMAKE_SOURCE_DIR}/shared/AlteratorWindow.qml
|
${CMAKE_SOURCE_DIR}/shared/AlteratorWindow.qml
|
||||||
@ -37,6 +38,7 @@ set(SHARED
|
|||||||
${CMAKE_SOURCE_DIR}/shared/qmldir)
|
${CMAKE_SOURCE_DIR}/shared/qmldir)
|
||||||
|
|
||||||
add_executable(new_alterator
|
add_executable(new_alterator
|
||||||
|
${CMAKE_SOURCE_DIR}/shared/AlteratorQMLStyle/AlteratorQMLStyle.qrc
|
||||||
${CMAKE_SOURCE_DIR}/shared/shared.qrc
|
${CMAKE_SOURCE_DIR}/shared/shared.qrc
|
||||||
${CMAKE_SOURCE_DIR}/resources/resources.qrc
|
${CMAKE_SOURCE_DIR}/resources/resources.qrc
|
||||||
${CMAKE_SOURCE_DIR}/src/dist_info.cpp
|
${CMAKE_SOURCE_DIR}/src/dist_info.cpp
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef ALTERATOLIB_H
|
#ifndef ALTERATOLIB_H
|
||||||
#define ALTERATOLIB_H
|
#define ALTERATOLIB_H
|
||||||
#include "alterator/include/alterator_loader.h"
|
#include "alterator/include/alterator_loader.h"
|
||||||
#include "alterator/include/dbus_connector.h"
|
#include "alterator/include/dbus_qml_connector.h"
|
||||||
#include "alterator/include/dbus_interface.h"
|
#include "alterator/include/new_interface.h"
|
||||||
#include "alterator/include/dbus_action.h"
|
#include "alterator/include/dbus_property_map.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
#include <QObject>
|
|
||||||
#include <QDBusInterface>
|
|
||||||
|
|
||||||
namespace Alterator {
|
|
||||||
class DBusAction : public QObject{
|
|
||||||
public:
|
|
||||||
DBusAction(QDBusInterface *iface, QObject *parent = nullptr);
|
|
||||||
virtual void execute(QList<QString> args) = 0;
|
|
||||||
protected:
|
|
||||||
QDBusInterface *interface;
|
|
||||||
};
|
|
||||||
|
|
||||||
class DBusSetProperty : public DBusAction{
|
|
||||||
public:
|
|
||||||
DBusSetProperty(QDBusInterface *iface, QObject *parent = nullptr);
|
|
||||||
void execute(QList<QVariant> args);
|
|
||||||
};
|
|
||||||
|
|
||||||
class DBusCall : public DBusAction{
|
|
||||||
public:
|
|
||||||
DBusCall(QDBusInterface *iface, QObject *parent = nullptr);
|
|
||||||
void execute(QList<QVariant> args);
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
#ifndef DBUS_CONNECTOR_H
|
|
||||||
#define DBUS_CONNECTOR_H
|
|
||||||
|
|
||||||
#include <QtDBus/QtDBus>
|
|
||||||
#include <QProcess>
|
|
||||||
#include <QHash>
|
|
||||||
#include "dbus_interface.h"
|
|
||||||
#include <QQmlPropertyMap>
|
|
||||||
|
|
||||||
namespace Alterator{
|
|
||||||
class DBusConnector: public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
DBusConnector(QObject *parent = nullptr);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
//void pushInLogs(QString targetId, QList<QString> 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<QString, QDBusInterface *> realIfaces;
|
|
||||||
// QHash<QString, QQmlPropertyMap *> introspections;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // DBUS_CONNECTOR_H
|
|
@ -1,45 +0,0 @@
|
|||||||
#ifndef DBUS_INTERFACE_H
|
|
||||||
#define DBUS_INTERFACE_H
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QDBusInterface>
|
|
||||||
#include <QQmlPropertyMap>
|
|
||||||
#include <QDBusArgument>
|
|
||||||
#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
|
|
@ -9,7 +9,7 @@
|
|||||||
#include "dbus_property_map.h"
|
#include "dbus_property_map.h"
|
||||||
|
|
||||||
namespace Alterator{
|
namespace Alterator{
|
||||||
class newInterface: public QQmlComponent{
|
class DBusInterface: public QQmlComponent{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QString initialServiceName
|
Q_PROPERTY(QString initialServiceName
|
||||||
READ getInitialServiceName
|
READ getInitialServiceName
|
||||||
@ -38,7 +38,7 @@ class newInterface: public QQmlComponent{
|
|||||||
NOTIFY propertiesChanged)
|
NOTIFY propertiesChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
newInterface(QObject *parent = 0);
|
DBusInterface(QObject *parent = 0);
|
||||||
|
|
||||||
DBusPropertyMap* getProperties();
|
DBusPropertyMap* getProperties();
|
||||||
QString getInitialIfaceName();
|
QString getInitialIfaceName();
|
||||||
|
@ -7,17 +7,23 @@
|
|||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QtQml>
|
#include <QtQml>
|
||||||
#include <QQuickStyle>
|
#include <QQuickStyle>
|
||||||
|
#include <QFontDatabase>
|
||||||
|
#include <QGuiApplication>
|
||||||
#include "new_interface.h"
|
#include "new_interface.h"
|
||||||
|
|
||||||
namespace Alterator {
|
namespace Alterator {
|
||||||
Loader::Loader(QObject *p):QObject(p)
|
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 = new QQmlApplicationEngine(this);
|
||||||
engine->addImportPath("../../new_alterator/");
|
engine->addImportPath("../../new_alterator/");
|
||||||
qmlRegisterType<Alterator::newInterface>("Alterator.newInterface", 1, 0, "NewInterface");
|
qmlRegisterType<Alterator::DBusInterface>("Alterator.DBusInterface", 1, 0, "DBusInterface");
|
||||||
qmlRegisterType<Alterator::DistInfo>("Alterator.DistInfo", 1, 0, "DistInfo");
|
qmlRegisterType<Alterator::DistInfo>("Alterator.DistInfo", 1, 0, "DistInfo");
|
||||||
QString startingPage = "../resources/DistInfo.qml";
|
QString startingPage = "../resources/SystemInformation.qml";
|
||||||
past = QHash<QString, QVector<QString>>();
|
past = QHash<QString, QVector<QString>>();
|
||||||
future = QHash<QString, QVector<QString>>();
|
future = QHash<QString, QVector<QString>>();
|
||||||
widgets = QHash<QString, QObject *>();
|
widgets = QHash<QString, QObject *>();
|
||||||
|
@ -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<QVariant> args){
|
|
||||||
auto t = args[0].toString().toStdString();
|
|
||||||
const char *name = t.c_str();
|
|
||||||
interface->setProperty(name, args[1].toString());
|
|
||||||
}
|
|
||||||
void DBusCall::execute(QList<QVariant> args){
|
|
||||||
QString name = args[0].toString();
|
|
||||||
args.removeFirst();
|
|
||||||
interface->callWithArgumentList(QDBus::Block, name, args);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
#include "dbus_connector.h"
|
|
||||||
#include "dbus_property_map.h"
|
|
||||||
#include <QDBusInterface>
|
|
||||||
#include <QDBusConnection>
|
|
||||||
#include <QXmlStreamReader>
|
|
||||||
|
|
||||||
namespace Alterator{
|
|
||||||
DBusConnector::DBusConnector(QObject *parent): QObject(parent)
|
|
||||||
{
|
|
||||||
// realIfaces = QHash<QString, QDBusInterface *>();
|
|
||||||
// introspections = QHash<QString, QQmlPropertyMap *>();
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,96 +0,0 @@
|
|||||||
#include "dbus_interface.h"
|
|
||||||
#include <QXmlStreamReader>
|
|
||||||
|
|
||||||
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<QString, QVariant> res = props.call("GetAll", interface).arguments()[0].toHash();
|
|
||||||
QMutableHashIterator<QString, QVariant> i(res);
|
|
||||||
i.toFront();
|
|
||||||
while(i.hasNext()){
|
|
||||||
introspection->insert(i.key(), i.value());
|
|
||||||
i.next();
|
|
||||||
}
|
|
||||||
return introspection;
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,7 +7,7 @@ DBusPropertyMap::DBusPropertyMap(QQmlPropertyMap *derived, QObject *parent) : QQ
|
|||||||
QVariant DBusPropertyMap::updateValue(const QString &key, const QVariant &input){
|
QVariant DBusPropertyMap::updateValue(const QString &key, const QVariant &input){
|
||||||
emit(updateDBusS(key, input));
|
emit(updateDBusS(key, input));
|
||||||
auto t = parent();
|
auto t = parent();
|
||||||
newInterface *iface = qobject_cast<newInterface *>(parent()->parent());
|
DBusInterface *iface = qobject_cast<DBusInterface *>(parent()->parent());
|
||||||
if(iface->updateDBus(key, input)){
|
if(iface->updateDBus(key, input)){
|
||||||
return input;
|
return input;
|
||||||
}else{
|
}else{
|
||||||
|
@ -3,46 +3,48 @@
|
|||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
|
|
||||||
namespace Alterator {
|
namespace Alterator {
|
||||||
newInterface::newInterface(QObject *parent) : QQmlComponent(parent){
|
DBusInterface::DBusInterface(QObject *parent) : QQmlComponent(parent){
|
||||||
status = 0;
|
status = 0;
|
||||||
QQmlPropertyMap * t = new QQmlPropertyMap(this);
|
QQmlPropertyMap * t = new QQmlPropertyMap(this);
|
||||||
properties = new DBusPropertyMap(t, t);
|
properties = new DBusPropertyMap(t, t);
|
||||||
connect(this, SIGNAL(step()), this, SLOT(progress()));
|
connect(this, SIGNAL(step()), this, SLOT(progress()));
|
||||||
|
qDebug() << "constructor";
|
||||||
}
|
}
|
||||||
|
|
||||||
DBusPropertyMap* newInterface::getProperties(){return properties;}
|
DBusPropertyMap* DBusInterface::getProperties(){return properties;}
|
||||||
QString newInterface::getInitialIfaceName(){return initialIfaceName;}
|
QString DBusInterface::getInitialIfaceName(){return initialIfaceName;}
|
||||||
QString newInterface::getInitialAdress(){return initialAdress;}
|
QString DBusInterface::getInitialAdress(){return initialAdress;}
|
||||||
bool newInterface::getInitialISB(){return initialIsSessionBus;}
|
bool DBusInterface::getInitialISB(){return initialIsSessionBus;}
|
||||||
QString newInterface::getInitialServiceName(){return initialServiceName;}
|
QString DBusInterface::getInitialServiceName(){return initialServiceName;}
|
||||||
|
|
||||||
QString newInterface::getIfaceName(){return ifaceName;}
|
QString DBusInterface::getIfaceName(){return ifaceName;}
|
||||||
QString newInterface::getAdress(){return adress;}
|
QString DBusInterface::getAdress(){return adress;}
|
||||||
bool newInterface::getISB(){return isSessionBus;}
|
bool DBusInterface::getISB(){return isSessionBus;}
|
||||||
QString newInterface::getServiceName(){return serviceName;}
|
QString DBusInterface::getServiceName(){return serviceName;}
|
||||||
|
|
||||||
void newInterface::setInitialServiceName(QString s){
|
void DBusInterface::setInitialServiceName(QString s){
|
||||||
initialServiceName = s;
|
initialServiceName = s;
|
||||||
emit step();
|
emit step();
|
||||||
|
qDebug() << "set SName";
|
||||||
}
|
}
|
||||||
void newInterface::setInitialIfaceName(QString s){
|
void DBusInterface::setInitialIfaceName(QString s){
|
||||||
initialIfaceName = s;
|
initialIfaceName = s;
|
||||||
emit step();
|
emit step();
|
||||||
}
|
}
|
||||||
void newInterface::setInitialAdress(QString s){
|
void DBusInterface::setInitialAdress(QString s){
|
||||||
initialAdress = s;
|
initialAdress = s;
|
||||||
emit step();
|
emit step();
|
||||||
}
|
}
|
||||||
void newInterface::setInitialISB(bool b){
|
void DBusInterface::setInitialISB(bool b){
|
||||||
initialIsSessionBus = b;
|
initialIsSessionBus = b;
|
||||||
emit step();
|
emit step();
|
||||||
}
|
}
|
||||||
|
|
||||||
void newInterface::propertyUpdatedFromDBus(QDBusMessage mess){
|
void DBusInterface::propertyUpdatedFromDBus(QDBusMessage mess){
|
||||||
QString ifaceName = mess.arguments()[0].toString();
|
QString ifaceName = mess.arguments()[0].toString();
|
||||||
QVariantMap changedProperties = qdbus_cast<QVariantMap>( mess.arguments()[1].value<QDBusArgument>() );
|
QVariantMap changedProperties = qdbus_cast<QVariantMap>( mess.arguments()[1].value<QDBusArgument>() );
|
||||||
QStringList invalidProperties = mess.arguments()[2].toStringList();
|
QStringList invalidProperties = mess.arguments()[2].toStringList();
|
||||||
if (ifaceName != newInterface::ifaceName){
|
if (ifaceName != DBusInterface::ifaceName){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QMapIterator<QString, QVariant> i(changedProperties);
|
QMapIterator<QString, QVariant> i(changedProperties);
|
||||||
@ -59,7 +61,7 @@ void newInterface::propertyUpdatedFromDBus(QDBusMessage mess){
|
|||||||
emit(propertiesChanged(properties));
|
emit(propertiesChanged(properties));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool newInterface::updateDBus(QString key, QVariant val){
|
bool DBusInterface::updateDBus(QString key, QVariant val){
|
||||||
auto t = key.toLocal8Bit();
|
auto t = key.toLocal8Bit();
|
||||||
QDBusInterface props =
|
QDBusInterface props =
|
||||||
QDBusInterface(serviceName, adress,
|
QDBusInterface(serviceName, adress,
|
||||||
@ -75,7 +77,7 @@ bool newInterface::updateDBus(QString key, QVariant val){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void newInterface::progress(){
|
void DBusInterface::progress(){
|
||||||
status++;
|
status++;
|
||||||
if (status == 4){
|
if (status == 4){
|
||||||
ifaceName = initialIfaceName;
|
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);
|
QDBusMessage ans = realIface->callWithArgumentList(QDBus::Block, method, args);
|
||||||
if(ans.type() == QDBusMessage::ErrorMessage){
|
if(ans.type() == QDBusMessage::ErrorMessage){
|
||||||
logSignal("There is no such method \"" + method +
|
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++){
|
for(int i = 0; i < initialLog.size(); i++){
|
||||||
emit logSignal(initialLog[i]);
|
emit logSignal(initialLog[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void newInterface::dbusConnect(QString signalOnDBus, QString slotInQML){
|
void DBusInterface::dbusConnect(QString signalOnDBus, QString slotInQML){
|
||||||
const QMetaObject *const meta = metaObject();
|
const QMetaObject *const meta = metaObject();
|
||||||
int border = staticMetaObject.methodCount();
|
int border = staticMetaObject.methodCount();
|
||||||
auto t1 = meta->method(30).methodSignature();
|
auto t1 = meta->method(30).methodSignature();
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window 2.15
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
@ -19,6 +20,7 @@ ScrollView {
|
|||||||
initialIsSessionBus : false
|
initialIsSessionBus : false
|
||||||
|
|
||||||
Component.onCompleted:{
|
Component.onCompleted:{
|
||||||
|
console.log("completed")
|
||||||
logSignal.connect(window.addRecord)
|
logSignal.connect(window.addRecord)
|
||||||
completed.connect(hostname.onCompleted)
|
completed.connect(hostname.onCompleted)
|
||||||
completed()
|
completed()
|
||||||
|
289
resources/SystemInformation.qml
Normal file
289
resources/SystemInformation.qml
Normal file
@ -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}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,5 +3,6 @@
|
|||||||
<file>wiki_logo.svg</file>
|
<file>wiki_logo.svg</file>
|
||||||
<file>DistInfo.qml</file>
|
<file>DistInfo.qml</file>
|
||||||
<file>Test.qml</file>
|
<file>Test.qml</file>
|
||||||
|
<file>SystemInformation.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -2,7 +2,7 @@ import QtQuick 2.15
|
|||||||
import QtQuick.Window 2.15
|
import QtQuick.Window 2.15
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
import QtQuick.Controls.Universal 2.15
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
Window{
|
Window{
|
||||||
id: window
|
id: window
|
||||||
@ -15,11 +15,6 @@ Window{
|
|||||||
width: 600
|
width: 600
|
||||||
height: 650
|
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
|
visible: true
|
||||||
|
|
||||||
onClosing: {
|
onClosing: {
|
||||||
@ -37,11 +32,10 @@ Window{
|
|||||||
logRepeater.model++
|
logRepeater.model++
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Pane{
|
||||||
id: windowRect
|
id: windowRect
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Universal.theme === Universal.Light ? "white" : "black"
|
|
||||||
|
|
||||||
// onHeightChanged: {
|
// onHeightChanged: {
|
||||||
// openReqS("../resources/DistInfo.qml")
|
// openReqS("../resources/DistInfo.qml")
|
||||||
@ -115,8 +109,8 @@ Window{
|
|||||||
text: window.log[index]
|
text: window.log[index]
|
||||||
font.pointSize: 10
|
font.pointSize: 10
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: Universal.theme === Universal.Light ? "white" : "black"
|
color: "white"//Universal.theme === Universal.Light ? "white" : "black"
|
||||||
border.color: Universal.theme === Universal.Light ? "white" : "black"
|
border.color: "white"//Universal.theme === Universal.Light ? "white" : "black"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import QtQuick.Layouts 1.15
|
|||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
import Qt.labs.qmlmodels 1.0
|
import Qt.labs.qmlmodels 1.0
|
||||||
import QtQml 2.15
|
import QtQml 2.15
|
||||||
import QtQuick.Controls.Universal 2.15
|
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
|
|
||||||
@ -19,7 +18,6 @@ Rectangle{
|
|||||||
Layout.minimumHeight: l1.height
|
Layout.minimumHeight: l1.height
|
||||||
Layout.maximumHeight: l1.height
|
Layout.maximumHeight: l1.height
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: Universal.theme === Universal.Light ? "white" : "black"
|
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
id: l1
|
id: l1
|
||||||
|
@ -3,5 +3,6 @@
|
|||||||
<file>TextWithHeader.qml</file>
|
<file>TextWithHeader.qml</file>
|
||||||
<file>AlteratorToolBar.qml</file>
|
<file>AlteratorToolBar.qml</file>
|
||||||
<file>AlteratorWindow.qml</file>
|
<file>AlteratorWindow.qml</file>
|
||||||
|
<file>someStyle.js</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
3
shared/someStyle.js
Normal file
3
shared/someStyle.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
function func() {
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user