diff options
author | Ken Moore <ken@ixsystems.com> | 2017-07-11 16:30:45 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-07-11 16:30:45 -0400 |
commit | 575533f902657faa7f2a3b8b889b1da90458a57f (patch) | |
tree | 30c9c052634060e31ca397c8e3fbd88e4c05a4d3 /src-qt5/core | |
parent | Added more key support for Lumina 2.0 (diff) | |
download | lumina-575533f902657faa7f2a3b8b889b1da90458a57f.tar.gz lumina-575533f902657faa7f2a3b8b889b1da90458a57f.tar.bz2 lumina-575533f902657faa7f2a3b8b889b1da90458a57f.zip |
Get the keyboard shortcut for "LockScreen" (case-insensitive) working, and fix some connection warnings.
Diffstat (limited to 'src-qt5/core')
5 files changed, 16 insertions, 13 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/LSession.cpp b/src-qt5/core/lumina-desktop-unified/LSession.cpp index 2155a8b7..8ab1b303 100644 --- a/src-qt5/core/lumina-desktop-unified/LSession.cpp +++ b/src-qt5/core/lumina-desktop-unified/LSession.cpp @@ -29,6 +29,7 @@ LSession::LSession(int &argc, char ** argv) : LSingleApplication(argc, argv, "lu //Initialize the global objects to null pointers qRegisterMetaType< Qt::Key >("Qt::Key"); qRegisterMetaType< NativeWindow::Property >("NativeWindow::Property"); + qRegisterMetaType< QList< NativeWindow::Property > >("QList<NativeWindow::Property>"); mediaObj = 0; //private object used for playing login/logout chimes if(this->isPrimaryProcess()){ @@ -222,6 +223,7 @@ void LSession::setupGlobalConnections(){ connect(Lumina::SHORTCUTS, SIGNAL(StartLogout()), this, SLOT(StartLogout()) ); connect(Lumina::SHORTCUTS, SIGNAL(StartReboot()), this, SLOT(StartReboot()) ); connect(Lumina::SHORTCUTS, SIGNAL(StartShutdown()), this, SLOT(StartShutdown()) ); + connect(Lumina::SHORTCUTS, SIGNAL(LockSession()), Lumina::SS, SLOT(LockScreenNow()) ); //Root window connections connect(Lumina::ROOTWIN, SIGNAL(RegisterVirtualRoot(WId)), Lumina::NWS, SLOT(RegisterVirtualRoot(WId)) ); diff --git a/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.cpp b/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.cpp index 1b78da21..3d50112c 100644 --- a/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.cpp @@ -139,11 +139,11 @@ QString LShortcutEvents::keylistToString(){ void LShortcutEvents::evaluateShortcutAction(QString action){ qDebug() << "Found Shortcut Action:" << action; evaluated = true; - if(action.startsWith("Exec=")){ - emit LaunchApplication(action.section("=",1,-1)); + if(action.startsWith("Exec:")){ + emit LaunchApplication(action.section(":",1,-1)); return; - }else if(action.startsWith("Launch=")){ - emit LaunchStandardApplication(action.section("=",1,-1)); + }else if(action.startsWith("Launch:")){ + emit LaunchStandardApplication(action.section(":",1,-1)); } //Specific Internal actions action = action.toLower(); @@ -152,6 +152,7 @@ void LShortcutEvents::evaluateShortcutAction(QString action){ else if(action=="reboot"){ emit StartReboot(); } else if(action=="shutdown"){ emit StartShutdown(); } else if(action=="show_leave_options"){ emit OpenLeaveDialog(); } + else if(action=="lockscreen"){ emit LockSession(); } } diff --git a/src-qt5/core/lumina-desktop-unified/src-screensaver/LScreenSaver.cpp b/src-qt5/core/lumina-desktop-unified/src-screensaver/LScreenSaver.cpp index 9f280a47..bfcfa54d 100644 --- a/src-qt5/core/lumina-desktop-unified/src-screensaver/LScreenSaver.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/LScreenSaver.cpp @@ -8,7 +8,7 @@ #include <QScreen> #include <QApplication> -#define DEBUG 1 +#define DEBUG 0 LScreenSaver::LScreenSaver() : QWidget(0,Qt::BypassWindowManagerHint | Qt::WindowStaysOnTopHint){ starttimer = new QTimer(this); 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 943fe0a1..b31ef793 100644 --- a/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp @@ -25,7 +25,7 @@ SSBaseWidget::SSBaseWidget(QWidget *parent, QSettings *set) : QWidget(parent){ SSBaseWidget::~SSBaseWidget(){ if(ANIM!=0){ this->stopPainting(); } } - + void SSBaseWidget::setPlugin(QString plug){ plug = plug.toLower(); if(validPlugs.contains(plug) || plug=="random"){ plugType = plug; } @@ -38,12 +38,12 @@ void SSBaseWidget::setPlugin(QString plug){ void SSBaseWidget::startPainting(){ cplug = plugType; //free up any old animation instance - if(ANIM!=0){ + if(ANIM!=0){ ANIM->stop(); ANIM->clear(); - delete ANIM; ANIM = 0; - } + delete ANIM; ANIM = 0; + } //If a random plugin - grab one of the known plugins - if(cplug=="random"){ + if(cplug=="random"){ QStringList valid = BaseAnimGroup::KnownAnimations(); valid.removeAll("none"); //they want a screensaver - remove the "none" option from the valid list if(valid.isEmpty()){ cplug = "none"; } //no known plugins @@ -67,9 +67,9 @@ void SSBaseWidget::startPainting(){ } //Now start the animation(s) if(ANIM!=0){ - if(ANIM->animationCount()>0){ + if(ANIM->animationCount()>0){ if(DEBUG){ qDebug() << " - Starting SS Plugin:" << cplug << ANIM->animationCount() << ANIM->duration() << ANIM->loopCount(); } - ANIM->start(); + ANIM->start(); } } } diff --git a/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/BaseAnimGroup.cpp b/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/BaseAnimGroup.cpp index cda9797b..017eaf9f 100644 --- a/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/BaseAnimGroup.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/BaseAnimGroup.cpp @@ -31,5 +31,5 @@ BaseAnimGroup* BaseAnimGroup::NewAnimation(QString type, QWidget *parent, QSetti } QStringList BaseAnimGroup::KnownAnimations(){ - return (QStringList() << "text"); + return (QStringList() << "fireflies" << "grav" << "text"); } |