aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-12-21 09:47:39 -0500
committerKen Moore <ken@ixsystems.com>2017-12-21 09:47:39 -0500
commit6fa4f14708a67c57d7b6753c4e933df2e6b2f583 (patch)
treee867e7fc3c61535b1c74d956556cc31c630a5ead /src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp
parentTurn of some stdout messages within the Qt theme plugin. (diff)
parentMerge branch 'master' of https://github.com/trueos/lumina (diff)
downloadlumina-6fa4f14708a67c57d7b6753c4e933df2e6b2f583.tar.gz
lumina-6fa4f14708a67c57d7b6753c4e933df2e6b2f583.tar.bz2
lumina-6fa4f14708a67c57d7b6753c4e933df2e6b2f583.zip
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp
index 4c1d6189..82622403 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp
@@ -13,7 +13,12 @@ ScreenObject::ScreenObject(QScreen *scrn, QObject *parent) : QObject(parent){
}
void ScreenObject::RegisterType(){
+ static bool done = false;
+ if(done){ return; }
+ done=true;
qmlRegisterType<ScreenObject>("Lumina.Backend.ScreenObject",2,0, "ScreenObject");
+ //Also register any types that are needed by this class
+ PanelObject::RegisterType();
}
QString ScreenObject::name(){ return bg_screen->name(); }
@@ -29,3 +34,24 @@ void ScreenObject::setBackground(QString fileOrColor){
emit backgroundChanged();
}
}
+
+void ScreenObject::setPanels(QList<PanelObject*> list){
+ panel_objects = list;
+ emit panelsChanged();
+}
+
+//QML Read Functions
+QStringList ScreenObject::panels(){
+ //qDebug() << "Request Panels:" << panel_objects.length();
+ QStringList names;
+ for(int i=0; i<panel_objects.length(); i++){ names << panel_objects[i]->name(); }
+ return names;
+}
+
+PanelObject* ScreenObject::panel(QString id){
+ //qDebug() << "Got Panel Request:" << id;
+ for(int i=0; i<panel_objects.length(); i++){
+ if(panel_objects[i]->name()==id){ return panel_objects[i]; }
+ }
+ return 0;
+}
bgstack15