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

List:       kde-commits
Subject:    playground/base/plasma/applets/presence
From:       Abner Silva <abner.silva () kdemail ! net>
Date:       2009-08-06 20:15:37
Message-ID: 1249589737.502467.22871.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1008066 by abnerf:

Added plasmoid's tooltip.
Showing: global presence, account name and account presence status.

 M  +16 -0     presence.cpp  


--- trunk/playground/base/plasma/applets/presence/presence.cpp #1008065:1008066
@@ -30,6 +30,8 @@
 #include <Plasma/Service>
 #include <Plasma/Extender>
 #include <Plasma/ExtenderItem>
+#include <Plasma/ToolTipContent>
+#include <Plasma/ToolTipManager>
 
 // Kde
 #include <KColorScheme>
@@ -81,6 +83,8 @@
         initExtenderItem(item);
     }
 
+    updateMasterPresence();
+
     // Set up the data engine
     m_engine = dataEngine("presence");
 
@@ -208,6 +212,8 @@
     QString accountMessage;
     bool sameMessage = false;
 
+    QString toolTipContent;
+
     // Next, we work out the overall presence status.
     int accountsOffline = 0;
     int accountsAvailable = 0;
@@ -266,6 +272,9 @@
 
         sameMessage = (accountMessage == account->presenceMessage());
         accountMessage = account->presenceMessage();
+
+        toolTipContent += i18n("%1: <b><i>%2</i></b><br/>",
+                account->name(), status_type);
     }
 
     // Chose a master presence state from this.
@@ -292,10 +301,17 @@
         popupIcon = "user-online";
     }
 
+    // Update popup icon
     setPopupIcon(popupIcon);
 
+    // Set presence msg
     if (sameMessage)
         m_global->setPresenceMessage(accountMessage);
+
+    // Update tooltip message
+    Plasma::ToolTipManager::self()->setContent(this,
+            Plasma::ToolTipContent(i18n("Presence Status"),
+            toolTipContent, this->popupIcon()));
 }
 
 void PresenceApplet::onPresenceChanged(const QString &presence,
[prev in list] [next in list] [prev in thread] [next in thread] 

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