aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/panel-plugins
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2020-05-04 09:59:13 -0400
committerKen Moore <moorekou@gmail.com>2020-05-04 10:00:26 -0400
commitf747ac87e16ae16343bcc6c40327eca92cffca07 (patch)
tree9ab2dd1b66f091780960f645f9f786ea496bd406 /src-qt5/core/lumina-desktop/panel-plugins
parentMerge pull request #725 from JohnBlood/patch-1 (diff)
downloadlumina-f747ac87e16ae16343bcc6c40327eca92cffca07.tar.gz
lumina-f747ac87e16ae16343bcc6c40327eca92cffca07.tar.bz2
lumina-f747ac87e16ae16343bcc6c40327eca92cffca07.zip
Get the screensaver system up and running.
The lockscreen prompt is disabled at the moment while testing some input detection mechanisms (unlock button just always works without verifying password)
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp3
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp2
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp32
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp16
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.h7
5 files changed, 30 insertions, 30 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
index 57c17d47..38f5246f 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
@@ -578,7 +578,8 @@ void StartMenu::on_tool_launch_deskinfo_clicked(){
//Logout Buttons
void StartMenu::on_tool_lock_clicked(){
//QProcess::startDetached("xscreensaver-command -lock");
- LaunchItem("xscreensaver-command -lock",false);
+ QTimer::singleShot(30,LSession::handle(), SLOT(LockScreen()) );
+ //LaunchItem("xscreensaver-command -lock",false);
}
void StartMenu::on_tool_logout_clicked(){
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp
index acb27135..c1cf2907 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp
@@ -23,7 +23,7 @@ LUserButtonPlugin::LUserButtonPlugin(QWidget *parent, QString id, bool horizonta
mact = new QWidgetAction(this);
mact->setDefaultWidget(usermenu);
menu->addAction(mact);
-
+
button->setMenu(menu);
connect(menu, SIGNAL(aboutToHide()), this, SLOT(updateButtonVisuals()) );
//Setup the global shortcut handling for opening the start menu
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp b/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
index 8d7dab7a..dc89525c 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
@@ -33,7 +33,7 @@ UserItemWidget::UserItemWidget(QWidget *parent, QString itemPath, QString type,
name->setText( tr("Go Back") );
}else{
icon->setPixmap( LXDG::findIcon("folder","").pixmap(32,32) );
- name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, TEXTCUTOFF) );
+ name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, TEXTCUTOFF) );
}
}else{
actButton->setVisible(false);
@@ -46,7 +46,7 @@ UserItemWidget::UserItemWidget(QWidget *parent, QString itemPath, QString type,
}else{
icon->setPixmap( LXDG::findMimeIcon(itemPath.section("/",-1)).pixmap(32,32) );
}
- name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, TEXTCUTOFF) );
+ name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, TEXTCUTOFF) );
}
icon->setWhatsThis(itemPath);
if(!goback){ this->setWhatsThis(name->text()); }
@@ -77,7 +77,7 @@ UserItemWidget::UserItemWidget(QWidget *parent, XDGDesktop *item) : QFrame(paren
}
//Now fill it appropriately
icon->setPixmap( LXDG::findIcon(item->icon,"preferences-system-windows-actions").pixmap(32,32) );
- name->setText( this->fontMetrics().elidedText(item->name, Qt::ElideRight, TEXTCUTOFF) );
+ name->setText( this->fontMetrics().elidedText(item->name, Qt::ElideRight, TEXTCUTOFF) );
this->setWhatsThis(name->text());
icon->setWhatsThis(item->filePath);
//Now setup the buttons appropriately
@@ -85,7 +85,7 @@ UserItemWidget::UserItemWidget(QWidget *parent, XDGDesktop *item) : QFrame(paren
setupActions(item);
}
-UserItemWidget::~UserItemWidget(){
+UserItemWidget::~UserItemWidget(){
delete button;
delete icon;
delete name;
@@ -98,7 +98,7 @@ void UserItemWidget::createWidget(){
menuopen = false;
menureset = new QTimer(this);
menureset->setSingleShot(true);
- menureset->setInterval(1000); //1 second
+ menureset->setInterval(1000); //1 second
this->setContentsMargins(0,0,0,0);
button = new QToolButton(this);
button->setIconSize( QSize(14,14) );
@@ -125,7 +125,7 @@ void UserItemWidget::createWidget(){
void UserItemWidget::setupButton(bool disable){
//if(isDirectory){ qDebug() << "Directory Entry:" << isShortcut << linkPath << icon->whatsThis(); }
-
+
if(disable){
button->setVisible(false);
}else if(isShortcut && !linkPath.isEmpty()){ //Favorite Item - can always remove this
@@ -141,7 +141,7 @@ void UserItemWidget::setupButton(bool disable){
}else if(!isShortcut){// if( !QFile::exists( QDir::homePath()+"/Desktop/"+icon->whatsThis().section("/",-1) ) && !LUtils::isFavorite(icon->whatsThis() ) ){
//This file does not have a shortcut yet -- allow the user to add it
button->setWhatsThis("add");
- button->setIcon( LXDG::findIcon("bookmark-toolbar","") );
+ button->setIcon( LXDG::findIcon("bookmark-toolbar","") );
button->setToolTip(tr("Create Shortcut"));
connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()) );
}else{
@@ -161,7 +161,7 @@ void UserItemWidget::setupActions(XDGDesktop *app){
QAction *act = new QAction(LXDG::findIcon(app->actions[i].icon, app->icon), app->actions[i].name, this);
act->setToolTip(app->actions[i].ID);
act->setWhatsThis(app->actions[i].ID);
- actButton->menu()->addAction(act);
+ actButton->menu()->addAction(act);
}
connect(actButton->menu(), SIGNAL(triggered(QAction*)), this, SLOT(actionClicked(QAction*)) );
connect(actButton->menu(), SIGNAL(aboutToShow()), this, SLOT(actionMenuOpen()) );
@@ -171,22 +171,22 @@ void UserItemWidget::setupActions(XDGDesktop *app){
void UserItemWidget::buttonClicked(){
button->setVisible(false);
- if(button->whatsThis()=="add"){
+ if(button->whatsThis()=="add"){
LDesktopUtils::addFavorite(icon->whatsThis());
//QFile::link(icon->whatsThis(), QDir::homePath()+"/.lumina/favorites/"+icon->whatsThis().section("/",-1) );
- emit NewShortcut();
- }else if(button->whatsThis()=="remove"){
- if(linkPath.isEmpty()){
+ emit NewShortcut();
+ }else if(button->whatsThis()=="remove"){
+ if(linkPath.isEmpty()){
//This is a desktop file
if(isDirectory){
QProcess::startDetached("rm -r \""+icon->whatsThis()+"\"");
}else{
- QFile::remove(icon->whatsThis());
- }
+ QFile::remove(icon->whatsThis());
+ }
//Don't emit the RemovedShortcut signal here - the automatic ~/Desktop watcher will see the change when finished
- }else{
+ }else{
LDesktopUtils::removeFavorite(icon->whatsThis()); //This is a favorite
- emit RemovedShortcut();
+ emit RemovedShortcut();
}
}
}
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp b/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
index a0ba8996..9fdc7169 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
@@ -15,7 +15,7 @@ UserWidget::UserWidget(QWidget* parent) : QTabWidget(parent), ui(new Ui::UserWid
if(parent!=0){ parent->setMouseTracking(true); }
this->setMouseTracking(true);
sysapps = LSession::handle()->applicationMenu()->currentAppHash(); //get the raw info
-
+
//Connect the signals/slots
connect(ui->tool_desktopsettings, SIGNAL(clicked()), this, SLOT(openDeskSettings()) );
connect(ui->tool_config_screensaver, SIGNAL(clicked()), this, SLOT(openScreenSaverConfig()) );
@@ -28,13 +28,13 @@ UserWidget::UserWidget(QWidget* parent) : QTabWidget(parent), ui(new Ui::UserWid
connect(ui->tool_home_browse, SIGNAL(clicked()), this, SLOT(slotOpenDir()) );
connect(ui->tool_home_search, SIGNAL(clicked()), this, SLOT(slotOpenSearch()) );
connect(ui->tool_config_about, SIGNAL(clicked()), this, SLOT(openLuminaInfo()) );
-
+
//Setup the special buttons
connect(ui->tool_app_store, SIGNAL(clicked()), this, SLOT(openStore()) );
connect(ui->tool_controlpanel, SIGNAL(clicked()), this, SLOT(openControlPanel()) );
//connect(ui->tool_qtconfig, SIGNAL(clicked()), this, SLOT(openQtConfig()) );
-
- lastUpdate = QDateTime(); //make sure it refreshes
+
+ lastUpdate = QDateTime(); //make sure it refreshes
connect(LSession::handle()->applicationMenu(), SIGNAL(AppMenuUpdated()), this, SLOT(UpdateMenu()) );
connect(QApplication::instance(), SIGNAL(DesktopFilesChanged()), this, SLOT(updateFavItems()) );
@@ -68,7 +68,7 @@ void UserWidget::SortScrollArea(QScrollArea *area){
for(int i=0; i<lay->count(); i++){
items << lay->itemAt(i)->widget()->whatsThis().toLower();
}
-
+
items.sort();
//qDebug() << " - Sorted Items:" << items;
for(int i=0; i<items.length(); i++){
@@ -84,7 +84,7 @@ void UserWidget::SortScrollArea(QScrollArea *area){
}
}
}
-
+
}
QIcon UserWidget::rotateIcon(QIcon ico){
@@ -119,13 +119,13 @@ void UserWidget::UpdateAll(){
ui->tool_fav_dirs->setIcon( LXDG::findIcon("folder","") );
ui->tool_fav_files->setIcon( LXDG::findIcon("document-multiple","") );
ui->tool_desktopsettings->setIcon( LXDG::findIcon("preferences-desktop","") );
- ui->tool_config_screensaver->setIcon( LXDG::findIcon("preferences-desktop-screensaver","") );
+ ui->tool_config_screensaver->setIcon( LXDG::findIcon("preferences-desktop-screensaver","") );
ui->tool_config_screensettings->setIcon( LXDG::findIcon("preferences-other","") );
ui->tool_home_gohome->setIcon( LXDG::findIcon("go-home","") );
ui->tool_home_browse->setIcon( LXDG::findIcon("document-open","") );
ui->tool_home_search->setIcon( LXDG::findIcon("system-search","") );
ui->tool_config_about->setIcon( LXDG::findIcon("lumina","") );
-
+
//Setup the special buttons
QString APPSTORE = LOS::AppStoreShortcut();
if(QFile::exists(APPSTORE) && !APPSTORE.isEmpty()){
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.h b/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.h
index 8b03c489..c112ac0f 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.h
+++ b/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.h
@@ -24,8 +24,6 @@
#include <LuminaOS.h>
#include "UserItemWidget.h"
-#define SSAVER QString("xscreensaver-demo")
-
namespace Ui{
class UserWidget;
};
@@ -81,7 +79,8 @@ private slots:
LaunchItem("lumina-config", false);
}
void openScreenSaverConfig(){
- LaunchItem(SSAVER, false);
+ LaunchItem("lumina-config",false);
+ //LaunchItem(SSAVER, false);
}
void openScreenConfig(){
LaunchItem("lumina-xconfig",false);
@@ -89,7 +88,7 @@ private slots:
void openLuminaInfo(){
LaunchItem("lumina-info",false);
}
-
+
protected:
void mouseMoveEvent( QMouseEvent *event);
bgstack15