From d04f35ab9b827085d1cbee0bc2f7cae7787557ef Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 13 Oct 2017 16:25:18 -0400 Subject: Another checkpoint commit for Lumina 2 Almost have the QML-based desktop canvas working - still tracking down some QML syntax issues. --- src-qt5/src-cpp/RootDesktopObject.cpp | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'src-qt5/src-cpp/RootDesktopObject.cpp') diff --git a/src-qt5/src-cpp/RootDesktopObject.cpp b/src-qt5/src-cpp/RootDesktopObject.cpp index 088c88b7..e7873991 100644 --- a/src-qt5/src-cpp/RootDesktopObject.cpp +++ b/src-qt5/src-cpp/RootDesktopObject.cpp @@ -5,9 +5,13 @@ // See the LICENSE file for full details //=========================================== #include "RootDesktopObject.h" +#include +#include +#include + // === PUBLIC === -RootDesktopObject::RootDesktopObject(QObject *parent = 0){ +RootDesktopObject::RootDesktopObject(QObject *parent) : QObject(parent){ updateScreens(); //make sure the internal list is updated right away } @@ -15,14 +19,24 @@ RootDesktopObject::~RootDesktopObject(){ } -static RootDesktopObject* RootDesktopObject::instance(){ +void RootDesktopObject::RegisterType(){ + qmlRegisterType("Lumina.Backend.RootDesktopObject", 2, 0, "RootDesktopObject"); + //Also register any types that are needed by this class + ScreenObject::RegisterType(); +} + +RootDesktopObject* RootDesktopObject::instance(){ static RootDesktopObject* r_obj = new RootDesktopObject(); return r_obj; } //QML Read Functions -QList RootDesktopObject::screens(){ - return ; +QList RootDesktopObject::screens(){ + return s_objects; +} + +void RootDesktopObject::logout(){ + emit startLogout(); } // === PUBLIC SLOTS === @@ -32,7 +46,7 @@ void RootDesktopObject::updateScreens(){ for(int i=0; iname()==scrns[i]->name()){ found = true; tmp << s_objects.takeAt(j); } } if(!found){ tmp << new ScreenObject(scrns[i], this); } } @@ -41,4 +55,10 @@ void RootDesktopObject::updateScreens(){ s_objects = tmp; } +void RootDesktopObject::ChangeWallpaper(QString screen, QString value){ + for(int i=0; iname()==screen){ s_objects[i]->setBackground(value); break; } + } +} + // === PRIVATE === -- cgit