aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins/userbutton/UserWidget.h
diff options
context:
space:
mode:
Diffstat (limited to 'lumina-desktop/panel-plugins/userbutton/UserWidget.h')
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserWidget.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.h b/lumina-desktop/panel-plugins/userbutton/UserWidget.h
new file mode 100644
index 00000000..5bc737a1
--- /dev/null
+++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.h
@@ -0,0 +1,82 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2014, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+// This panel plugin allows the user to quickly access user favorites and applications
+//===========================================
+#ifndef _LUMINA_PANEL_USER_BUTTON_WIDGET_H
+#define _LUMINA_PANEL_USER_BUTTON_WIDGET_H
+
+#include <QWidget>
+#include <QString>
+#include <QList>
+#include <QHash>
+#include <QVBoxLayout>
+#include <QScrollArea>
+
+#include <LuminaXDG.h>
+
+#include "UserItemWidget.h"
+
+#define APPSTORE QString("/usr/local/share/applications/softmanager.desktop")
+#define CONTROLPANEL QString("/usr/local/share/applications/pccontrol.desktop")
+#define QTCONFIG QString("/usr/local/bin/qtconfig-qt4")
+#define SSAVER QString("xscreensaver-demo")
+
+namespace Ui{
+ class UserWidget;
+};
+
+class UserWidget : public QWidget{
+ Q_OBJECT
+public:
+ UserWidget(QWidget *parent=0);
+ ~UserWidget();
+
+ void UpdateMenu();
+
+private:
+ Ui::UserWidget *ui;
+ QHash<QString, QList<XDGDesktop> > *sysapps;
+ int cfav; //current favorite category
+ void ClearScrollArea(QScrollArea *area);
+
+private slots:
+ void LaunchItem(QString cmd);
+
+ //Favorites Tab
+ void FavChanged(); //for ensuring radio-button-like behaviour
+ void updateFavItems();
+
+ //Apps Tab
+ void updateAppCategories();
+ void updateApps();
+
+ //Home Tab
+ void updateHome();
+
+ //Slots for the special buttons
+ void openStore(){
+ LaunchItem("lumina-open \""+APPSTORE+"\"");
+ }
+ void openControlPanel(){
+ LaunchItem("lumina-open \""+CONTROLPANEL+"\"");
+ }
+ void openDeskSettings(){
+ LaunchItem("lumina-config");
+ }
+ void openQtConfig(){
+ LaunchItem(QTCONFIG);
+ }
+ void openScreenSaverConfig(){
+ LaunchItem(SSAVER);
+ }
+
+signals:
+ void CloseMenu();
+
+};
+
+#endif \ No newline at end of file
bgstack15