[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-workspace/plasma/sreich/sal-qml] plasma/netbook/containments/sal: create a launcher,
From:       Shaun Reich <shaun.reich () kdemail ! net>
Date:       2012-04-02 15:04:31
Message-ID: 20120402150431.59835A60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 1f787fd986db886ad5978d47246433a75cb635ba by Shaun Reich.
Committed on 31/03/2012 at 01:43.
Pushed by sreich into branch 'plasma/sreich/sal-qml'.

create a launcher, sallauncher plasmoid which launches salviewer

it's in a similar fashion to lancelot

M  +1    -0    plasma/netbook/containments/sal/CMakeLists.txt
A  +13   -0    plasma/netbook/containments/sal/applet/CMakeLists.txt
A  +23   -0    plasma/netbook/containments/sal/applet/plasma-applet-sallauncher.desktop
 A  +66   -0    plasma/netbook/containments/sal/applet/sallauncher.cpp     [License: \
GPL (v2+)] A  +59   -0    plasma/netbook/containments/sal/applet/sallauncher.h     \
[License: GPL (v2+)] M  +9    -7    \
plasma/netbook/containments/sal/shell/fullview.cpp M  +1    -1    \
plasma/netbook/containments/sal/shell/fullview.h

http://commits.kde.org/kde-workspace/1f787fd986db886ad5978d47246433a75cb635ba

diff --git a/plasma/netbook/containments/sal/CMakeLists.txt \
b/plasma/netbook/containments/sal/CMakeLists.txt index 4a02ca4..8e3a082 100644
--- a/plasma/netbook/containments/sal/CMakeLists.txt
+++ b/plasma/netbook/containments/sal/CMakeLists.txt
@@ -8,5 +8,6 @@ install(DIRECTORY package/
 
 install(FILES package/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME \
plasma-applet-sal.desktop)  
+add_subdirectory(applet)
 add_subdirectory(shell)
 add_subdirectory(model)
diff --git a/plasma/netbook/containments/sal/applet/CMakeLists.txt \
b/plasma/netbook/containments/sal/applet/CMakeLists.txt new file mode 100644
index 0000000..f1cd8a7
--- /dev/null
+++ b/plasma/netbook/containments/sal/applet/CMakeLists.txt
@@ -0,0 +1,13 @@
+project(sallauncher)
+
+set(sallauncher_SRCS sallauncher.cpp)
+
+kde4_add_plugin(plasma_applet_sallauncher ${sallauncher_SRCS})
+
+target_link_libraries(plasma_applet_sallauncher ${KDE4_PLASMA_LIBS} \
${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${KDE4_PHONON_LIBS} ) +
+install(TARGETS plasma_applet_sallauncher
+        DESTINATION ${PLUGIN_INSTALL_DIR})
+
+install(FILES plasma-applet-sallauncher.desktop
+        DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/plasma/netbook/containments/sal/applet/plasma-applet-sallauncher.desktop \
b/plasma/netbook/containments/sal/applet/plasma-applet-sallauncher.desktop new file \
mode 100644 index 0000000..e6bb786
--- /dev/null
+++ b/plasma/netbook/containments/sal/applet/plasma-applet-sallauncher.desktop
@@ -0,0 +1,23 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Sal Launcher
+
+Comment=A launcher to display Search & Launch fullscreen
+
+Type=Service
+ServiceTypes=Plasma/Applet
+Icon=kde
+
+X-KDE-Library=plasma_applet_sallauncher
+X-KDE-PluginInfo-Author=Shaun M. Reich
+X-KDE-PluginInfo-Email=shaun.reich@blue-systems.com
+X-KDE-PluginInfo-Name=sallauncher
+X-KDE-PluginInfo-Version=1.0
+X-KDE-PluginInfo-Website=
+X-KDE-PluginInfo-Category=
+X-KDE-PluginInfo-Depends=
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true
+
+X-Plasma-Requires-FileDialog=Unused
+X-Plasma-Requires-LaunchApp=Unused
diff --git a/plasma/netbook/containments/sal/applet/sallauncher.cpp \
b/plasma/netbook/containments/sal/applet/sallauncher.cpp new file mode 100644
index 0000000..23f4934
--- /dev/null
+++ b/plasma/netbook/containments/sal/applet/sallauncher.cpp
@@ -0,0 +1,66 @@
+/***************************************************************************
+ *   Copyright (C) 2012 by Shaun Reich <shaun.reich@blue-systems.com>           *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
+ ***************************************************************************/
+
+#include "sallauncher.h"
+#include <QtCore/QSizeF>
+#include <QtGui/QPainter>
+#include <QtGui/QDesktopWidget>
+#include <QtGui/QGraphicsScene>
+#include <QtGui/QGraphicsSceneMouseEvent>
+#include <QtGui/QGraphicsLinearLayout>
+
+#include <Plasma/PushButton>
+#include <Plasma/IconWidget>
+
+#include <KSharedConfig>
+#include <KLocale>
+#include <KStandardDirs>
+#include <KIO/NetAccess>
+#include <KMessageBox>
+#include <KToolInvocation>
+#include <KRun>
+
+SalLauncher::SalLauncher(QObject * parent, const QVariantList & args)
+    : Plasma::Applet(parent, args),
+      m_icon(0)
+{
+    setHasConfigurationInterface(true);
+//    resize(contentSizeHint());
+}
+
+void SalLauncher::init()
+{
+    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(this);
+
+    m_icon = new Plasma::IconWidget(this);
+    m_icon->setIcon("kde");
+
+    connect(m_icon, SIGNAL(clicked()), this, SLOT(iconClicked()));
+
+    layout->addItem(m_icon);
+}
+
+void SalLauncher::iconClicked()
+{
+    kDebug() << "ICON CLICKED!";
+//    KToolInvocation::startServiceByDesktopPath
+    KRun::runCommand("salviewer", 0);
+}
+
+#include "sallauncher.moc"
diff --git a/plasma/netbook/containments/sal/applet/sallauncher.h \
b/plasma/netbook/containments/sal/applet/sallauncher.h new file mode 100644
index 0000000..ea0da7b
--- /dev/null
+++ b/plasma/netbook/containments/sal/applet/sallauncher.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ *   Copyright (C) 2012 by Shaun Reich <shaun.reich@blue-systems.com>           *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
+ ***************************************************************************/
+
+#ifndef SALLAUNCHER_H
+#define SALLAUNCHER_H
+
+#include <QtCore/QBasicTimer>
+#include <QtCore/QTime>
+#include <QtGui/QVector2D>
+#include <KConfigDialog>
+
+#include <Plasma/Applet>
+#include <Plasma/Svg>
+
+#include <Phonon/MediaObject>
+#include <Phonon/Path>
+#include <Phonon/AudioOutput>
+#include <Phonon/Global>
+
+namespace Plasma {
+    class IconWidget;
+}
+
+class QGraphicsSceneMouseEvent;
+class QSizeF;
+
+class SalLauncher : public Plasma::Applet
+{
+    Q_OBJECT
+public:
+    SalLauncher(QObject * parent, const QVariantList & args);
+
+    void init();
+
+private Q_SLOTS:
+    void iconClicked();
+
+private:
+    Plasma::IconWidget *m_icon;
+};
+
+K_EXPORT_PLASMA_APPLET (sallauncher, SalLauncher)
+#endif
diff --git a/plasma/netbook/containments/sal/shell/fullview.cpp \
b/plasma/netbook/containments/sal/shell/fullview.cpp index ad6dad5..4aae753 100644
--- a/plasma/netbook/containments/sal/shell/fullview.cpp
+++ b/plasma/netbook/containments/sal/shell/fullview.cpp
@@ -127,10 +127,12 @@ void FullView::focusOutEvent ( QFocusEvent* event )
 
 FullView::~FullView()
 {
+    kDebug() << "DTOR HIT";
 //    storeCurrentApplet();
 }
 
-void FullView::keyPressEvent (QKeyEvent *event)
+
+void FullView::keyPressEvent(QKeyEvent *event)
 {
     if (event->key() == Qt::Key_Escape) {
 //        hide();
@@ -139,6 +141,11 @@ void FullView::keyPressEvent (QKeyEvent *event)
 
 }
 
+void FullView::closeEvent(QCloseEvent *event)
+{
+    kDebug() << "CLOSE EVENT";
+}
+
 void FullView::addApplet(const QString &name, const QString &containment,
                          const QString& wallpaper, const QVariantList &args)
 {
@@ -314,6 +321,7 @@ void FullView::plasmoidAccessFinished(Plasma::AccessAppletJob \
*job)  
 void FullView::appletRemoved(Plasma::Applet *applet)
 {
+    kDebug()  << "APPLETREMOVED";
     if (m_applet == applet) {
         m_applet = 0;
         if (!checkShotTimer()) {
@@ -378,12 +386,6 @@ void FullView::resizeEvent(QResizeEvent *event)
     }
 }
 
-void FullView::closeEvent(QCloseEvent *event)
-{
-    Q_UNUSED(event)
-//    qApp->quit();
-}
-
 void FullView::appletTransformedItself()
 {
     resize(m_applet->size().toSize());
diff --git a/plasma/netbook/containments/sal/shell/fullview.h \
b/plasma/netbook/containments/sal/shell/fullview.h index b94cb57..ec584a4 100644
--- a/plasma/netbook/containments/sal/shell/fullview.h
+++ b/plasma/netbook/containments/sal/shell/fullview.h
@@ -57,12 +57,12 @@ protected:
     void showEvent(QShowEvent *event);
     virtual void focusOutEvent(QFocusEvent *event);
     virtual void keyPressEvent(QKeyEvent *event);
+    virtual void closeEvent(QCloseEvent *event);
 
 private Q_SLOTS:
     void appletTransformedItself();
     void sceneRectChanged(const QRectF &rect);
     void resizeEvent(QResizeEvent *event);
-    void closeEvent(QCloseEvent *event);
     void appletRemoved(Plasma::Applet *applet);
     void plasmoidAccessFinished(Plasma::AccessAppletJob *job);
     void screenshotPlasmoid();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic