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

List:       kde-commits
Subject:    [kde-workspace/mart/AppletAttached] plasma/generic/applets/systemtray/plugin: expose the expanded pr
From:       Marco Martin <notmart () gmail ! com>
Date:       2014-01-31 17:26:20
Message-ID: E1W9HrA-0004oz-Vv () scm ! kde ! org
[Download RAW message or body]

Git commit 0b690ef18c7d491daf5250baaf6f9ba5e860a254 by Marco Martin.
Committed on 31/01/2014 at 17:08.
Pushed by mart into branch 'mart/AppletAttached'.

expose the expanded property

M  +3    -6    plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.cpp
 M  +8    -18   plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.cpp
 M  +1    -2    plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.h
 M  +4    -0    plasma/generic/applets/systemtray/plugin/task.cpp
M  +2    -1    plasma/generic/applets/systemtray/plugin/task.h

http://commits.kde.org/kde-workspace/0b690ef18c7d491daf5250baaf6f9ba5e860a254

diff --git a/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.cpp \
b/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.cpp \
                index 7b1c69c..1cc5919 100644
--- a/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.cpp
                
+++ b/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.cpp
 @@ -52,9 +52,9 @@ PlasmoidProtocol::~PlasmoidProtocol()
 
 void PlasmoidProtocol::init()
 {
-    Plasma::Corona *c = new Plasma::Corona();
+    Plasma::Corona *c = new Plasma::Corona(this);
 
-    m_containment = c->createContainment("invalid");
+    m_containment = c->createContainment("null");
     m_containment->setFormFactor(Plasma::Types::Horizontal);
     m_containment->init();
     Plasma::Package package = \
Plasma::PluginLoader::self()->loadPackage("Plasma/Shell"); @@ -82,10 +82,7 @@ void \
PlasmoidProtocol::init()  foreach (const KPluginInfo &info, applets) {
         KService::Ptr service = info.service();
         //HACK
-        if (/*(info.pluginName()=="org.kde.plasma.mediacontroller" ||
-            info.pluginName()=="org.kde.plasma.notifications" ||
-            info.pluginName()=="org.kde.plasma.batterymonitor")&&*/
-            !blacklist.contains(info.pluginName()) && \
service->property("X-Plasma-NotificationArea", QVariant::Bool).toBool()) { +        \
if (!blacklist.contains(info.pluginName()) && \
                service->property("X-Plasma-NotificationArea", \
                QVariant::Bool).toBool()) {
             // if we already have a plugin with this exact name in it, then check if \
it is the  // same plugin and skip it if it is indeed already listed
             if (sortedApplets.contains(info.name())) {
diff --git a/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.cpp \
b/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.cpp index \
                3339d0e..eab7482 100644
--- a/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.cpp
+++ b/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.cpp
@@ -57,7 +57,7 @@ PlasmoidTask::PlasmoidTask(QQuickItem* rootItem, const QString \
&packageName, con  
         //old syntax, because we are connecting blindly
         connect(m_taskGraphicsObject, SIGNAL(expandedChanged(bool)),
-                this, SLOT(syncExpanded(bool)));
+                this, SIGNAL(expandedChanged(bool)));
     }
 
 
@@ -107,20 +107,6 @@ void PlasmoidTask::updateStatus()
     }
 }
 
-void PlasmoidTask::expandApplet(bool expanded)
-{
-    qCDebug(SYSTEMTRAY) << "ST2P expandApplet() " << expanded;
-    if (m_taskGraphicsObject) {
-        m_taskGraphicsObject->setProperty("expanded", expanded);
-    }
-    //if (m_taskItem->isExpanded() != expanded) {
-/*    if (m_taskItem && m_taskItem->isExpanded() != expanded) {
-        qCDebug(SYSTEMTRAY) << "ST2P set plasmoid.expand = " << expanded;
-        m_taskItem->setExpanded(expanded);
-        //m_taskItem->setCollapsed();
-    }*/
-}
-
 bool PlasmoidTask::isValid() const
 {
     return m_valid && pluginInfo().isValid();
@@ -158,9 +144,9 @@ QString PlasmoidTask::taskId() const
 QQuickItem* PlasmoidTask::taskItem()
 {
     if (m_taskGraphicsObject) {
-        qWarning()<<"BBBBB"<<m_taskGraphicsObject<<m_taskGraphicsObject->property("title");
  return m_taskGraphicsObject;
     }
+    //FIXME
     return new QQuickItem();//m_taskItem;
 }
 
@@ -173,6 +159,7 @@ QQuickItem* PlasmoidTask::taskItemExpanded()
     if (m_taskGraphicsObject && \
                m_taskGraphicsObject->property("fullRepresentationItem").value<QQuickItem \
                *>()) {
         return m_taskGraphicsObject->property("fullRepresentationItem").value<QQuickItem \
*>();  }
+    //FIXME
     return new QQuickItem();//m_taskItem->defaultRepresentation();
 }
 
@@ -202,11 +189,14 @@ bool PlasmoidTask::expanded() const
     }
 }
 
-void PlasmoidTask::syncExpanded(bool expanded)
+void PlasmoidTask::setExpanded(bool expanded)
 {
-    emit expandedChanged(expanded);
+    if (m_taskGraphicsObject) {
+        m_taskGraphicsObject->setProperty("expanded", expanded);
+    }
 }
 
+
 }
 
 #include "plasmoidtask.moc"
diff --git a/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.h \
b/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.h index \
                90b81b1..c809611 100644
--- a/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.h
+++ b/plasma/generic/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.h
@@ -68,13 +68,13 @@ public:
     virtual bool isWidget() const;
     virtual TaskType type() const { return TypePlasmoid; };
     virtual bool expanded() const;
+    virtual void setExpanded(bool expanded);
 
     QString iconName() const { return m_iconName; }
     KPluginInfo pluginInfo() const;
     QString shortcut() const { return m_shortcut; }
     void    setShortcut(QString text);
 
-    Q_INVOKABLE void expandApplet(bool expanded);
     Q_INVOKABLE void setLocation(Plasma::Types::Location loc);
 
 Q_SIGNALS:
@@ -85,7 +85,6 @@ Q_SIGNALS:
 
 private Q_SLOTS:
     void syncStatus(QString status);
-    void syncExpanded(bool expanded);
 
 private:
     void updateStatus();
diff --git a/plasma/generic/applets/systemtray/plugin/task.cpp \
b/plasma/generic/applets/systemtray/plugin/task.cpp index 8d89239..1f8e3ca 100644
--- a/plasma/generic/applets/systemtray/plugin/task.cpp
+++ b/plasma/generic/applets/systemtray/plugin/task.cpp
@@ -122,6 +122,10 @@ bool Task::expanded() const
     return false;
 }
 
+void Task::setExpanded(bool expanded)
+{
+}
+
 QQuickItem* Task::taskItem() const
 {
     return 0;
diff --git a/plasma/generic/applets/systemtray/plugin/task.h \
b/plasma/generic/applets/systemtray/plugin/task.h index 4a52859..68dcd12 100644
--- a/plasma/generic/applets/systemtray/plugin/task.h
+++ b/plasma/generic/applets/systemtray/plugin/task.h
@@ -53,7 +53,7 @@ class Task : public QObject
     Q_PROPERTY(Status status READ status NOTIFY changedStatus)
     Q_PROPERTY(QString name READ name NOTIFY changedName)
     Q_PROPERTY(Category category READ category NOTIFY changedCategory)
-    Q_PROPERTY(bool expanded READ expanded NOTIFY expandedChanged)
+    Q_PROPERTY(bool expanded READ expanded WRITE setExpanded NOTIFY expandedChanged)
 
 public:
     enum Status {
@@ -160,6 +160,7 @@ public:
     Status status() const;
 
     virtual bool expanded() const;
+    virtual void setExpanded(bool expanded);
 
     /**
      * This function must always return type of task (an integer value). This value \
must always be


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

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