aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2018-01-02 22:18:34 +0000
committerWeblate <noreply@weblate.org>2018-01-02 22:18:34 +0000
commit4bf6d3f38634dbb517055444a22d824d6eba99d8 (patch)
treebbe3e3e511f37222cdd9db145bde2f41a35e1260 /src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp
parentTranslated using Weblate (Danish) (diff)
parentMerge remote-tracking branch 'origin/master' (diff)
downloadlumina-4bf6d3f38634dbb517055444a22d824d6eba99d8.tar.gz
lumina-4bf6d3f38634dbb517055444a22d824d6eba99d8.tar.bz2
lumina-4bf6d3f38634dbb517055444a22d824d6eba99d8.zip
Merge remote-tracking branch 'origin/master'
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