diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user index 08e35eb..6ffff47 100644 --- a/CMakeLists.txt.user +++ b/CMakeLists.txt.user @@ -1,10 +1,10 @@ - + EnvironmentId - {45a71af6-65bb-4af1-a2df-6ab519c8565c} + {055df76c-eb5f-479b-9e45-f478a706e6f9} ProjectExplorer.Project.ActiveTarget @@ -77,15 +77,12 @@ true true Builtin.DefaultTidyAndClazy - 2 + 0 true - - true - @@ -94,7 +91,7 @@ Desktop Desktop Desktop - {0d1d96e7-0317-4f7a-a513-68284676b112} + {f0d093c2-ceeb-4303-9c63-b1e5c487b907} 0 0 0 @@ -107,8 +104,7 @@ -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} -DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} - /home/SMB.BASEALT.RU/kozyrevid/work/new_alterator - /home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/build + /home/yura/work/new_alterator/build @@ -142,27 +138,25 @@ false - Debug + Отладка CMakeProjectManager.CMakeBuildConfiguration Release -DCMAKE_GENERATOR:STRING=Unix Makefiles --DCMAKE_BUILD_TYPE:STRING=Debug +-DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake -DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} -DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} - /home/SMB.BASEALT.RU/kozyrevid/work/new_alterator - /home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/release + /home/yura/work/build-new_alterator-Desktop-Release all true - Сборка CMakeProjectManager.MakeStep 1 @@ -176,7 +170,6 @@ clean true - Сборка CMakeProjectManager.MakeStep 1 @@ -189,10 +182,98 @@ false - Debug2 + Выпуск CMakeProjectManager.CMakeBuildConfiguration - 2 + + RelWithDebInfo + -DCMAKE_GENERATOR:STRING=Unix Makefiles +-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} + /home/yura/work/build-new_alterator-Desktop-RelWithDebInfo + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Сборка + Сборка + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Очистка + Очистка + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release with Debug Information + CMakeProjectManager.CMakeBuildConfiguration + + + MinSizeRel + -DCMAKE_GENERATOR:STRING=Unix Makefiles +-DCMAKE_BUILD_TYPE:STRING=MinSizeRel +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} + /home/yura/work/build-new_alterator-Desktop-MinSizeRel + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Сборка + Сборка + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Очистка + Очистка + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Minimum Size Release + CMakeProjectManager.CMakeBuildConfiguration + + 4 0 @@ -221,7 +302,7 @@ true false true - /home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/build + /home/yura/work/new_alterator/build 1 diff --git a/alterator/CMakeLists.txt b/alterator/CMakeLists.txt index 2c2231c..051ed82 100644 --- a/alterator/CMakeLists.txt +++ b/alterator/CMakeLists.txt @@ -20,16 +20,10 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Quick QuickWidgets D set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/alterator_loader.cpp -# ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_connector.cpp -# ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_interface.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_property_map.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/new_interface.cpp) set(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/alterator_loader.h -# ${CMAKE_CURRENT_SOURCE_DIR}/include/dbus_connector.h -# ${CMAKE_CURRENT_SOURCE_DIR}/include/dbus_interface.h - ${CMAKE_CURRENT_SOURCE_DIR}/include/dbus_property_map.h ${CMAKE_CURRENT_SOURCE_DIR}/include/new_interface.h) set(ALTERATORLIB_VERSION 0.0.1) diff --git a/alterator/include/alterator_loader.h b/alterator/include/alterator_loader.h index 8049a73..38c0a50 100644 --- a/alterator/include/alterator_loader.h +++ b/alterator/include/alterator_loader.h @@ -8,10 +8,7 @@ #include #include #include -//#include "dbus_connector.h" -//#include "dbus_interface.h" #include "alterator_loader_config.h" -//#include "dbus_action.h" namespace Alterator{ class Loader: public QObject @@ -22,9 +19,6 @@ public: signals: void move(QString windowId, QString targetUrl); -// void ifaceReqS( QString senderId, QString shortName -// , QString service, QString path -// , QString interface, bool isSessionBus ); public slots: void openReq(QString targetUrl); @@ -32,23 +26,18 @@ public slots: void closed(QString senderId); void back(QString senderId); void forvard(QString senderId); -// void getIface(QString targetId, DBusInterface * iface); -// void collectIfaces(QString targetId, QVariant data); private: const QString windowUrl = windowURLM; void open(QString targetUrl); void justMove(QString senderId, QString targetUrl); - private slots: - void deathCertificate(QObject *that); - private: +private: QHash> past; QHash> future; QHash widgets; QHash reverse_widgets; QQmlApplicationEngine *engine; -// DBusConnector *dbus; }; } diff --git a/alterator/include/new_interface.h b/alterator/include/new_interface.h index f4252c5..7845576 100644 --- a/alterator/include/new_interface.h +++ b/alterator/include/new_interface.h @@ -38,9 +38,6 @@ class newInterface: public QQmlComponent{ // WRITE setProperties NOTIFY propertiesChanged) -// Q_PROPERTY(bool isReady READ isReady) - - // Q_ENUM(QDBus::CallMode) public: newInterface(QObject *parent = 0); ~newInterface(); @@ -95,8 +92,6 @@ private: int status; bool ready; -// DBusPropertyMap *introspectProperties(QString service, QString path, -// QString interface, bool isSessionBus); }; } diff --git a/alterator/src/alterator_loader.cpp b/alterator/src/alterator_loader.cpp index d4c612a..30c74a7 100644 --- a/alterator/src/alterator_loader.cpp +++ b/alterator/src/alterator_loader.cpp @@ -1,6 +1,5 @@ #include "../include/alterator_loader.h" -//#include "../../include/dist_info.h" -//#include "../include/dbus_connector.h" +#include "../../include/dist_info.h" #include #include #include @@ -12,38 +11,19 @@ namespace Alterator { Loader::Loader(QObject *p):QObject(p) { -// dbus = new DBusConnector(this); engine = new QQmlApplicationEngine(this); engine->addImportPath("../../new_alterator/"); qmlRegisterType("Alterator.newInterface", 1, 0, "NewInterface"); -// qmlRegisterType("Alterator.DistInfo", 1, 0, "DistInfo"); -// qmlRegisterType("Alterator.DBusConnector", 1, 0, "DBusConnector"); + qmlRegisterType("Alterator.DistInfo", 1, 0, "DistInfo"); QString startingPage = "../resources/DistInfo.qml"; past = QHash>(); future = QHash>(); widgets = QHash(); -// if(!connect(dbus, SIGNAL(giveInterface(QString, DBusInterface *)) -// , this, SLOT(getIface(QString, DBusInterface *)))){ -// qDebug() << __func__ << "failed to connect to getIface\n"; -// } else { -// qDebug() << __func__ << "getIface signal connected\n"; -// } - -// if (!connect(this, -// SIGNAL(ifaceReqS(QString, QString, QString, QString, QString, bool)), -// dbus, -// SLOT(ifaceReq(QString, QString, QString, QString, QString, bool)))) { -// fprintf(stderr, "%s: failed to connect to DBusConnector::ifaceReq\n", __func__); -// } else { -// fprintf(stderr, "%s: ifaceReqS signal connected\n", __func__); -// } open(startingPage); } void Loader::open(QString targetUrl){ QString windowId = QUuid::createUuid().toString(); -// engine->load(windowUrl); - // QObject *window = engine->rootObjects().last(); QQmlComponent *component = new QQmlComponent(engine, windowUrl, QQmlComponent::PreferSynchronous); auto t = QVariantMap(); @@ -57,20 +37,11 @@ void Loader::open(QString targetUrl){ connect(window, SIGNAL(closedS(QString)), this, SLOT(closed(QString)), Qt::QueuedConnection); connect(window, SIGNAL(backS(QString)), this, SLOT(back(QString))); connect(window, SIGNAL(forvardS(QString)), this, SLOT(forvard(QString))); -// if(!connect(window, SIGNAL(neededIfaces(QString, QVariant)), -// this, SLOT(collectIfaces(QString, QVariant)))){ -// qDebug() << __func__ << "failed to connect to collectIfaces\n"; -// } else { -// qDebug() << __func__ << "collectIfaces signal connected\n"; -// } past.insert(windowId, QVector() << targetUrl); future.insert(windowId, QVector()); widgets.insert(windowId, window); reverse_widgets.insert(window, windowId); - connect(window, SIGNAL(destroyed(QObject*)), this, SLOT(deathCertificate(QObject *))); -// QQmlContext *windowContext = new QQmlContext(engine->rootContext(), window); -// windowContext->setObjectName("windowContext"); component->completeCreate(); @@ -78,16 +49,6 @@ void Loader::open(QString targetUrl){ component->deleteLater(); } -void Loader::deathCertificate(QObject *thatWindow) { - auto iter = reverse_widgets.constFind(thatWindow); - if (iter == reverse_widgets.constEnd()) { - qDebug() << __PRETTY_FUNCTION__ << ": bogus destroyed notification\n"; - return; - } - widgets.remove(iter.value()); - qDebug()<< __PRETTY_FUNCTION__ << ": removing window '" << iter.value() << "' from widgets QHash\n"; -} - void Loader::openReq(QString targetUrl){ open(targetUrl); } @@ -110,29 +71,6 @@ void Loader::moveReq(QString senderId, QString targetUrl){ void Loader::closed(QString senderId){ past.remove(senderId); future.remove(senderId); -// QObject *window = widgets[senderId]; -// if (!window) { -// qDebug() << __func__ << ": window is NULL\n"; -// return; -// } -// if (window->parent()) { -// qDebug()<< __PRETTY_FUNCTION__ << ": window has a parent\n"; -// } - widgets.remove(senderId); -// disconnect(window, SIGNAL(openReqS(QString)), this, SLOT(openReq(QString))); -// disconnect(window, SIGNAL(moveReqS(QString, QString)), -// this, SLOT(moveReq(QString, QString))); -// disconnect(window, SIGNAL(closedS(QString)), this, SLOT(closed(QString))); -// disconnect(window, SIGNAL(backS(QString)), this, SLOT(back(QString))); -// disconnect(window, SIGNAL(forvardS(QString)), this, SLOT(forvard(QString))); -// window->deleteLater(); - /* if(widgets.isEmpty()) { - QMetaObject::invokeMethod(QCoreApplication::instance(), - "quit", - Qt::QueuedConnection); - } - */ - qDebug() << __PRETTY_FUNCTION__ << " that's all, folks\n"; } void Loader::back(QString senderId){ @@ -152,38 +90,4 @@ void Loader::forvard(QString senderId){ justMove(senderId, targetUrl); } } - -//void Loader::getIface(QString targetId, DBusInterface *iface){ - -//// QObject *window = widgets[targetId]; -//// if (!window) { -//// qDebug() << __func__<<": eek, window is NULL"; -//// return; -//// } -//// QObject *page = window->findChild("currentPageN"); -//// if(!page) { -//// qDebug() << __func__ <<": eek, page is NULL"; -//// return; -//// } -//// QQmlContext *windowContext = window->findChild("windowContext"); -//// windowContext->setContextProperty(iface->getShortName(), iface); -//// engine->rootContext()->setContextProperty("abc", "qwerty"); -//// QQmlContext *ifaceContext = new QQmlContext(windowContext, iface); -//// ifaceContext->setContextProperty("properties", iface->getProperties()); -//// window->findChild("currentPageN")->setProperty("active", true); -//// qDebug() << 1; -//} - -//void Loader::collectIfaces(QString targetId, QVariant data){ -//// QList raw = data.toList(); -//// QVariant i; -//// foreach(i, raw){ -//// QHash t = i.toHash(); -//// emit(ifaceReqS(targetId, t["shortName"].toString(), t["service"].toString(), -//// t["path"].toString(), t["interface"].toString(), t["isSessionBus"].toBool())); -//// } -//// qDebug() << 1; -//} - - } diff --git a/resources/DistInfo.qml b/resources/DistInfo.qml index 3eb5322..52161b8 100644 --- a/resources/DistInfo.qml +++ b/resources/DistInfo.qml @@ -2,8 +2,7 @@ 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.DBusConnector 1.0 +import Alterator.DistInfo 1.0 import Alterator.newInterface 1.0 import shared 1.0 @@ -22,91 +21,90 @@ ScrollView { anchors.fill: parent TextArea{text: hostname.isReady() ? hostname.properties.Chassis : ""} - // ColumnLayout{ - // id: content + ColumnLayout{ + id: content - // height: view.height + height: view.height - // DistInfo{id: back} - // DBusConnector{id: dbus} + DistInfo{id: back} - // TextWithHeader{ - // id: editionArea + TextWithHeader{ + id: editionArea - // Layout.minimumWidth: 500 - // Layout.preferredWidth: currentPage.width - // headerS: "ALT edition" - // keys: ["Kernel", "OS version", "Updated to"] - // vals: [dbus.getProperty("hostname", "KernelName").toString() + " " + - // dbus.getProperty("hostname", "KernelRelease").toString() - // , back.getInstalledOS() - // , dbus.getProperty("hostname", "OperatingSystemPrettyName").toString()] - // n: 3 - // comp: Component{ - // Image { - // sourceSize.width: 100 - // sourceSize.height: 100 - // source: "../resources/wiki_logo.svg" - // } - // } - // } + Layout.minimumWidth: 500 + Layout.preferredWidth: currentPage.width + headerS: "ALT edition" + keys: ["Kernel", "OS version", "Updated to"] + vals: [hostname.properties.KernelName + " " + + hostname.properties.KernelRelease + , back.getInstalledOS() + , hostname.properties.OperatingSystemPrettyName] + n: 3 + comp: Component{ + Image { + sourceSize.width: 100 + sourceSize.height: 100 + source: "../resources/wiki_logo.svg" + } + } + } - // TextWithHeader { - // id: systemArea + TextWithHeader { + id: systemArea - // Layout.minimumWidth: 550 - // Layout.preferredWidth: currentPage.width - // headerS: "System" - // keys: ["Chassis", "Vendor", "Device name", "Processor", "RAM", "GPU"] - // vals: [ dbus.getProperty("hostname", "Chassis").toString() - // , dbus.getProperty("hostname", "HardwareVendor").toString() - // , dbus.getProperty("hostname", "HardwareModel").toString() - // , back.getProcessor(), back.getRAM(), getSysType() ] - // n: 6 - // comp: Component{ - // Button{ - // text: 'More information' - // background: Rectangle{ - // color: "white" - // } - // } - // } + Layout.minimumWidth: 550 + Layout.preferredWidth: currentPage.width + headerS: "System" + keys: ["Chassis", "Vendor", "Device name", "Processor", "RAM", "GPU"] + vals: [ hostname.properties.Chassis, + hostname.properties.HardwareVendor, + hostname.properties.HardwareModel, + back.getProcessor(), back.getRAM(), getSysType() ] + n: 6 + comp: Component{ + Button{ + text: 'More information' + background: Rectangle{ + color: "white" + } + } + } - // function getSysType() { return "qwerty" } - // } + function getSysType() { return "qwerty" } + } - // TextWithHeader{ - // id: hostnameArea + TextWithHeader{ + id: hostnameArea - // Layout.minimumWidth: 550 - // Layout.preferredWidth: currentPage.width - // headerS: "Computer name, domain..." - // keys: ["Hostname", "Realm", "Domain role", "Workgroup"] - // vals: [dbus.getProperty("hostname", "Hostname").toString() - // , back.getRealm(), back.getRole(), back.getWorkgroup()] - // n: 4 - // comp: Component{ - // Button{ - // text: 'Domain settings' - // background: Rectangle{ - // color: "white" - // } - // } - // } - // } + Layout.minimumWidth: 550 + Layout.preferredWidth: currentPage.width + headerS: "Computer name, domain..." + keys: ["Hostname", "Realm", "Domain role", "Workgroup"] + vals: [hostname.properties.Hostname, + back.getRealm(), back.getRole(), back.getWorkgroup()] + n: 4 + comp: Component{ + Button{ + text: 'Domain settings' + background: Rectangle{ + color: "white" + } + } + } + } - // Item {Layout.fillHeight: true} + Item {Layout.fillHeight: true} - // TextArea{ - // textFormat: Text.AutoText - // text: "

Project's site: " + back.getHomeURL() + - // "
Report bugs here: " + back.getBugURL() + "

" - // onLinkActivated: Qt.openUrlExternally(link) - // selectByMouse: true - // selectByKeyboard: true - // Layout.bottomMargin: 12 - // } - // } + TextArea{ + textFormat: Text.AutoText + text: "

Project's site: " + back.getHomeURL() + + "
Report bugs here: " + back.getBugURL() + "

" + onLinkActivated: Qt.openUrlExternally(link) + selectByMouse: true + selectByKeyboard: true + Layout.bottomMargin: 12 + } + } }