aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-DE/SettingsMenu.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-01-04 16:44:55 -0500
committerKen Moore <ken@ixsystems.com>2017-01-04 16:44:55 -0500
commit25b2e77aa2395ba9143683a5ce1a27b99ee7a211 (patch)
treebbd732bb72689b9b46dfc619d3d0e1748f7e435b /src-qt5/core/lumina-desktop-unified/src-DE/SettingsMenu.cpp
parentTag version 1.2.1 on the master branch in preparation for new changes from th... (diff)
downloadlumina-25b2e77aa2395ba9143683a5ce1a27b99ee7a211.tar.gz
lumina-25b2e77aa2395ba9143683a5ce1a27b99ee7a211.tar.bz2
lumina-25b2e77aa2395ba9143683a5ce1a27b99ee7a211.zip
Create a new "lumina-desktop-unified" core subproject (DO NOT USE)
This is just a staging area for the merging of the desktop, window manager, etc.. into a single unified application. It is highly fragmented right now and will not build *AT ALL* for a while.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-DE/SettingsMenu.cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-DE/SettingsMenu.cpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-DE/SettingsMenu.cpp b/src-qt5/core/lumina-desktop-unified/src-DE/SettingsMenu.cpp
new file mode 100644
index 00000000..58208931
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/src-DE/SettingsMenu.cpp
@@ -0,0 +1,67 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2014, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+#include "SettingsMenu.h"
+#include "LSession.h"
+
+#include <LuminaOS.h>
+
+SettingsMenu::SettingsMenu() : QMenu(){
+ this->setObjectName("SettingsMenu");
+ connect(this, SIGNAL(triggered(QAction*)), this, SLOT(runApp(QAction*)) );
+ connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(UpdateMenu()) );
+ connect(QApplication::instance(), SIGNAL(IconThemeChanged()), this, SLOT(UpdateMenu()) );
+ QTimer::singleShot(100, this, SLOT(UpdateMenu()) );
+}
+
+SettingsMenu::~SettingsMenu(){
+
+}
+
+void SettingsMenu::UpdateMenu(){
+ //Change the title/icon to account for locale/icon changes
+ this->setTitle( tr("Preferences") );
+ this->setIcon( LXDG::findIcon("configure","") );
+ this->clear();
+ //Now setup the possible configuration options
+ QAction *act = new QAction(LXDG::findIcon("preferences-desktop-screensaver",""), tr("Screensaver"), this);
+ act->setWhatsThis("xscreensaver-demo");
+ this->addAction(act);
+ act = new QAction( LXDG::findIcon("preferences-desktop-wallpaper",""), tr("Wallpaper"), this);
+ act->setWhatsThis("lumina-config --page wallpaper");
+ this->addAction(act);
+ act = new QAction( LXDG::findIcon("preferences-other",""), tr("Display"), this);
+ act->setWhatsThis("lumina-xconfig");
+ this->addAction(act);
+ act = new QAction( LXDG::findIcon("preferences-desktop",""), tr("All Desktop Settings"), this);
+ act->setWhatsThis("lumina-config");
+ this->addAction(act);
+ this->addSeparator();
+ /*QString qtconfig = LOS::QtConfigShortcut();
+ if(QFile::exists(qtconfig) && !qtconfig.isEmpty()){
+ act = new QAction( LXDG::findIcon("preferences-desktop-theme",""), tr("Window Theme"), this);
+ act->setWhatsThis(qtconfig);
+ this->addAction(act);
+ }*/
+ QString CONTROLPANEL = LOS::ControlPanelShortcut();
+ if(QFile::exists(CONTROLPANEL) && !CONTROLPANEL.isEmpty()){
+ //Now load the info
+ XDGDesktop cpan(CONTROLPANEL);
+ if(cpan.isValid()){
+ act = new QAction( LXDG::findIcon(cpan.icon,""), tr("Control Panel"), this);
+ act->setWhatsThis("lumina-open \""+CONTROLPANEL+"\"");
+ this->addAction(act);
+ }
+ }
+ act = new QAction( LXDG::findIcon("lumina",""), tr("About Lumina"), this);
+ act->setWhatsThis("lumina-info");
+ this->addAction(act);
+}
+
+
+void SettingsMenu::runApp(QAction* act){
+ LSession::LaunchApplication(act->whatsThis());
+}
bgstack15