diff options
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified')
10 files changed, 39 insertions, 29 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/defaults/desktop/screensaver.conf b/src-qt5/core/lumina-desktop-unified/defaults/desktop/screensaver.conf index 89f4e488..b4bfec59 100644 --- a/src-qt5/core/lumina-desktop-unified/defaults/desktop/screensaver.conf +++ b/src-qt5/core/lumina-desktop-unified/defaults/desktop/screensaver.conf @@ -1,3 +1,3 @@ [General] -default_plugin="fireflies" -plugin_VGA-0="fireflies" +default_plugin="random" +plugin_VGA-0="random" diff --git a/src-qt5/core/lumina-desktop-unified/global-includes.h b/src-qt5/core/lumina-desktop-unified/global-includes.h index 91604362..40987ad4 100644 --- a/src-qt5/core/lumina-desktop-unified/global-includes.h +++ b/src-qt5/core/lumina-desktop-unified/global-includes.h @@ -78,6 +78,7 @@ #include <NativeEventFilter.h> #include <XDGMime.h> #include <LIconCache.h> +#include <LFileInfo.h> //Setup any global defines (no classes or global objects: use "global-objects.h" for that) 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 9842712e..60cf56c3 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 @@ -32,8 +32,19 @@ RootDesktopObject* RootDesktopObject::instance(){ } //QML Read Functions -QList<ScreenObject*> RootDesktopObject::screens(){ - return s_objects; +QStringList RootDesktopObject::screens(){ + qDebug() << "Request Screens:" << s_objects.length(); + QStringList names; + for(int i=0; i<s_objects.length(); i++){ names << s_objects[i]->name(); } + return names; +} + +ScreenObject* RootDesktopObject::screen(QString id){ + qDebug() << "Got Screen Request:" << id; + for(int i=0; i<s_objects.length(); i++){ + if(s_objects[i]->name()==id){ return s_objects[i]; } + } + return 0; } void RootDesktopObject::logout(){ diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h index dd7c7ab3..ba586701 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h @@ -16,7 +16,7 @@ class RootDesktopObject : public QObject{ Q_OBJECT //Define all the QML Properties here (interface between QML and the C++ methods below) - Q_PROPERTY( QList<ScreenObject*> screens READ screens NOTIFY screensChanged) + Q_PROPERTY( QStringList screens READ screens NOTIFY screensChanged) public: //main contructor/destructor @@ -29,7 +29,8 @@ public: static RootDesktopObject* instance(); //QML Read Functions - QList<ScreenObject*> screens(); + QStringList screens(); + Q_INVOKABLE ScreenObject* screen(QString id); //QML Access Functions Q_INVOKABLE void logout(); diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/ContextMenu.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/ContextMenu.qml index e5bac0b5..4ab8e156 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/ContextMenu.qml +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/ContextMenu.qml @@ -6,15 +6,15 @@ //=========================================== import QtQuick 2.2 import QtQuick.Window 2.2 -import QtQuick.Controls 2.0 +import QtQuick.Controls 1 import Lumina.Backend.RootDesktopObject 2.0 Menu { id: contextMenu - closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside MenuItem { text: "Lock Screen" + iconName: "system-lock-screen" onTriggered: { RootObject.lockscreen() } @@ -22,13 +22,7 @@ Menu { MenuItem { text: "Logout" - //iconName: "system-log-out" - indicator: Image{ - asynchronous: true - //autoTransform: true - //source: "image://theme/system-logout" - source: "file:///usr/local/share/icons/material-design-light/scalable/actions/system-log-out.svg" - } + iconName: "system-log-out" onTriggered: { RootObject.logout() } diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/RootDesktop.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/RootDesktop.qml index a1a9164f..e0381e23 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/RootDesktop.qml +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/RootDesktop.qml @@ -17,7 +17,7 @@ //=========================================== import QtQuick 2.2 import QtQuick.Window 2.2 -import QtQuick.Controls 2.0 +import QtQuick.Controls 1 import "." as QML @@ -33,9 +33,10 @@ Rectangle { anchors.fill: rootCanvas acceptedButtons: Qt.RightButton onClicked: { - contextMenu.x = mouseX + /*contextMenu.x = mouseX contextMenu.y = mouseY - contextMenu.open() + contextMenu.open() */ + contextMenu.popup() } onPositionChanged: { RootObject.mousePositionChanged() @@ -43,14 +44,13 @@ Rectangle { } //Create the context menu itself - QML.ContextMenu { id: contextMenu } + QML.ContextMenu { id: contextMenu } //Setup the wallpapers Repeater{ model: RootObject.screens QML.WallpaperImage{ - //console.log( modelData.name() ) - object: modelData + screen_id: modelData z: 0+index } } diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/WallpaperImage.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/WallpaperImage.qml index 4d39b0b8..1b44963f 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/WallpaperImage.qml +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/WallpaperImage.qml @@ -6,13 +6,14 @@ //=========================================== import QtQuick 2.2 import QtQuick.Window 2.2 -import QtQuick.Controls 2.0 +import QtQuick.Controls 1 import Lumina.Backend.ScreenObject 2.0 AnimatedImage { //C++ backend object - property ScreenObject object + property string screen_id + property ScreenObject object: RootObject.screen(screen_id) //Normal geometries/placements asynchronous: true diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.pri b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.pri index 99905253..fed18e02 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.pri +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.pri @@ -1,7 +1,8 @@ #Show the QML files to lupdate for translation purposes - not for the actual build lupdate_only{ SOURCES *= $${PWD}/RootDesktop.qml \ - $${PWD}/ContextMenu.qml + $${PWD}/ContextMenu.qml \ + $${PWD}/WallpaperImage.qml } RESOURCES *= $${PWD}/src-qml.qrc diff --git a/src-qt5/core/lumina-desktop-unified/src-screensaver/LLockScreen.cpp b/src-qt5/core/lumina-desktop-unified/src-screensaver/LLockScreen.cpp index b791ffd2..2cfd0f4a 100644 --- a/src-qt5/core/lumina-desktop-unified/src-screensaver/LLockScreen.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/LLockScreen.cpp @@ -83,12 +83,13 @@ void LLockScreen::TryUnlock(){ bool ok = false; if( TF->open() ){ QTextStream in(TF); - in << pass; - in.flush(); //make sure we push it to the file **right now** since we need to keep the file open - ok = (LUtils::runCmd("lumina-checkpass", QStringList() << "-f" << TF->fileName() ) == 0); + in << pass.toUtf8()+"\0"; //make sure it is null-terminated TF->close(); + //qDebug() << "Trying to unlock session:" << TF->fileName() << LUtils::readFile(TF->fileName()); + //qDebug() << "UserName:" << getlogin(); + LUtils::runCommand(ok, "lumina-checkpass",QStringList() << "-f" << TF->fileName() ); } - delete TF; + delete TF; //ensure the temporary file is removed **right now** for security purposes if(ok){ emit ScreenUnlocked(); this->setEnabled(true); diff --git a/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp b/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp index 122307b3..7c098887 100644 --- a/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp @@ -7,7 +7,7 @@ #include "SSBaseWidget.h" -#define DEBUG 1 +#define DEBUG 0 // ======== // PUBLIC |