aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-12-27 22:24:48 +0000
committerWeblate <noreply@weblate.org>2017-12-27 22:24:48 +0000
commit107851adab5f573e331150847b48f499edbcfbb9 (patch)
tree28aac1799650b0c51530130817e63e4c6381127a /src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp
parentTranslated using Weblate (Danish) (diff)
parentShifted from a custom QWidget to a subclass of QGraphicalView and connected i... (diff)
downloadlumina-107851adab5f573e331150847b48f499edbcfbb9.tar.gz
lumina-107851adab5f573e331150847b48f499edbcfbb9.tar.bz2
lumina-107851adab5f573e331150847b48f499edbcfbb9.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp
index 60cf56c3..5750ac2d 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp
@@ -21,6 +21,9 @@ RootDesktopObject::~RootDesktopObject(){
}
void RootDesktopObject::RegisterType(){
+ static bool done = false;
+ if(done){ return; }
+ done=true;
qmlRegisterType<RootDesktopObject>("Lumina.Backend.RootDesktopObject", 2, 0, "RootDesktopObject");
//Also register any types that are needed by this class
ScreenObject::RegisterType();
@@ -47,6 +50,47 @@ ScreenObject* RootDesktopObject::screen(QString id){
return 0;
}
+QStringList RootDesktopObject::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* RootDesktopObject::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;
+}
+
+QStringList RootDesktopObject::windows(){
+ //qDebug() << "Request Panels:" << panel_objects.length();
+ QStringList names;
+ for(int i=0; i<window_objects.length(); i++){ names << QString::number(window_objects[i]->id()); }
+ return names;
+}
+
+NativeWindow* RootDesktopObject::window(QString id){
+ //qDebug() << "Got Panel Request:" << id;
+ WId chk = id.toInt(); //numerical ID's in this case
+ for(int i=0; i<window_objects.length(); i++){
+ if(window_objects[i]->id()==chk){ return window_objects[i]; }
+ }
+ return 0;
+}
+
+void RootDesktopObject::setPanels(QList<PanelObject*> list){
+ panel_objects = list;
+ emit panelsChanged();
+}
+
+void RootDesktopObject::setWindows(QList<NativeWindow*> list){
+ window_objects = list;
+ emit windowsChanged();
+}
+
void RootDesktopObject::logout(){
emit startLogout();
}
@@ -85,4 +129,5 @@ void RootDesktopObject::ChangeWallpaper(QString screen, QString value){
}
}
+
// === PRIVATE ===
bgstack15