diff options
Diffstat (limited to 'lumina-desktop/panel-plugins/systemstart/LStartButton.h')
-rw-r--r-- | lumina-desktop/panel-plugins/systemstart/LStartButton.h | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/lumina-desktop/panel-plugins/systemstart/LStartButton.h b/lumina-desktop/panel-plugins/systemstart/LStartButton.h index 6a9cdaba..33c48bbf 100644 --- a/lumina-desktop/panel-plugins/systemstart/LStartButton.h +++ b/lumina-desktop/panel-plugins/systemstart/LStartButton.h @@ -16,7 +16,7 @@ #include <QToolButton> #include <QString> #include <QWidget> - +#include <QMenu> // Lumina-desktop includes //#include "../../Globals.h" @@ -27,6 +27,34 @@ #include "StartMenu.h" +//Simple Tool Button For QuickLaunch Items +class LQuickLaunchButton : public QToolButton{ + Q_OBJECT +signals: + void Launch(QString); + void Remove(QString); + +private slots: + void rmentry(){ + emit Remove(this->whatsThis()); + } + void launchentry(){ + emit Launch(this->whatsThis()); + } + +public: + LQuickLaunchButton(QString path, QWidget* parent = 0) : QToolButton(parent){ + this->setWhatsThis(path); + this->setMenu(new QMenu(this)); + this->setContextMenuPolicy(Qt::CustomContextMenu); + this->menu()->addAction( LXDG::findIcon("edit-delete",""), tr("Remove from Quicklaunch"), this, SLOT(rmentry()) ); + connect(this, SIGNAL(clicked()), this, SLOT(launchentry()) ); + connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showMenu()) ); + } + ~LQuickLaunchButton(){} + +}; + // PANEL PLUGIN BUTTON class LStartButtonPlugin : public LPPlugin{ Q_OBJECT @@ -40,7 +68,7 @@ private: QWidgetAction *mact; StartMenu *startmenu; QToolButton *button; - QList<QToolButton*> QUICKL; + QList<LQuickLaunchButton*> QUICKL; private slots: void openMenu(); @@ -49,7 +77,8 @@ private slots: void updateButtonVisuals(); void updateQuickLaunch(QStringList); - void LaunchQuick(QAction*); + void LaunchQuick(QString); + void RemoveQuick(QString); public slots: void OrientationChange(){ |