Bug 177021 - tooltips for lock/logout applet
Summary: tooltips for lock/logout applet
Status: CLOSED FIXED
Alias: None
Product: plasma4
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Unspecified
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-05 23:17 UTC by David Palacio
Modified: 2009-12-09 19:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Palacio 2008-12-05 23:17:05 UTC
Version:            (using Devel)
Installed from:    Compiled sources

Needs better strings.

Index: lockout.cpp                                                      
===================================================================     
--- lockout.cpp (revisión: 893043)                                      
+++ lockout.cpp (copia de trabajo)                                      
@@ -20,7 +20,8 @@                                                       
 #include "lockout.h"                                                   
                                                                        
 // Plasma                                                              
-#include <Plasma/IconWidget>                                           
+// #include <Plasma/IconWidget>                                        
+#include <Plasma/ToolTipManager>                                       
                                                                        
 // Qt                                                                  
 #include <QtGui/QWidget> // QWIDGETSIZE_MAX                            
@@ -55,13 +56,13 @@                                                     
     m_layout->setContentsMargins(0,0,0,0);                             
     m_layout->setSpacing(0);                                           
                                                                        
-    Plasma::IconWidget *icon_lock = new Plasma::IconWidget(KIcon("system-lock-screen"), "", this);
-    m_layout->addItem(icon_lock);
-    connect(icon_lock, SIGNAL(clicked()), this, SLOT(clickLock()));
+    m_icon_lock = new Plasma::IconWidget(KIcon("system-lock-screen"), "", this);
+    m_layout->addItem(m_icon_lock);
+    connect(m_icon_lock, SIGNAL(clicked()), this, SLOT(clickLock()));
 #ifndef Q_OS_WIN
-    Plasma::IconWidget *icon_logout = new Plasma::IconWidget(KIcon("system-shutdown"), "", this);
-    m_layout->addItem(icon_logout);
-    connect(icon_logout, SIGNAL(clicked()), this, SLOT(clickLogout()));
+    m_icon_logout = new Plasma::IconWidget(KIcon("system-shutdown"), "", this);
+    m_layout->addItem(m_icon_logout);
+    connect(m_icon_logout, SIGNAL(clicked()), this, SLOT(clickLogout()));
 #endif
 }

@@ -118,6 +119,11 @@
     if (constraints & Plasma::FormFactorConstraint ||
         constraints & Plasma::SizeConstraint) {
         checkLayout();
+        Plasma::ToolTipContent lockData(i18n("lock"), i18n("generic lock"), m_icon_lock->icon());
+        Plasma::ToolTipManager::self()->setContent(m_icon_lock, lockData);
+        Plasma::ToolTipContent logoutData(i18n("logout"), i18n("generic logout"), m_icon_logout->icon());
+        Plasma::ToolTipManager::self()->setContent(m_icon_logout, logoutData);
+
     }
 }

Index: lockout.h
===================================================================
--- lockout.h   (revisión: 893043)
+++ lockout.h   (copia de trabajo)
@@ -21,6 +21,7 @@
 #define LOCKOUT_H

 #include <Plasma/Applet>
+#include <Plasma/IconWidget>

 class QGraphicsLinearLayout;

@@ -41,6 +42,8 @@
     private:
         QGraphicsLinearLayout *m_layout;
         void checkLayout();
+        Plasma::IconWidget *m_icon_lock;
+        Plasma::IconWidget *m_icon_logout;
 };

 K_EXPORT_PLASMA_APPLET(lockout, LockOut)
Comment 1 Konstantinos Smanis 2009-02-13 18:55:40 UTC
Implemented in revision 925637 (http://websvn.kde.org/?view=rev&revision=925637).
Someone mark it as FIXED (I am not empowered enough).