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

List:       kde-commits
Subject:    [kde-workspace] plasma/generic/applets/devicenotifier/package/contents/ui: Port to tooltip
From:       David Edmundson <kde () davidedmundson ! co ! uk>
Date:       2014-02-10 17:32:19
Message-ID: E1WCuiR-000444-74 () scm ! kde ! org
[Download RAW message or body]

Git commit 6ccec6653e75bdbed624e63516a06213b989d7dc by David Edmundson.
Committed on 10/02/2014 at 17:28.
Pushed by davidedmundson into branch 'master'.

Port to tooltip to attached Plasmoid object methods

M  +4    -17   plasma/generic/applets/devicenotifier/package/contents/ui/devicenotifier.qml


http://commits.kde.org/kde-workspace/6ccec6653e75bdbed624e63516a06213b989d7dc

diff --git a/plasma/generic/applets/devicenotifier/package/contents/ui/devicenotifier.qml \
b/plasma/generic/applets/devicenotifier/package/contents/ui/devicenotifier.qml index \
                30a992a..e867791 100644
--- a/plasma/generic/applets/devicenotifier/package/contents/ui/devicenotifier.qml
+++ b/plasma/generic/applets/devicenotifier/package/contents/ui/devicenotifier.qml
@@ -37,6 +37,10 @@ Item {
         popupEventSlot(plasmoid.expanded);
     }
 
+    Plasmoid.icon: !sdSource.last ? "device-notifier" : \
sdSource.data[sdSource.last]["Icon"] +    Plasmoid.toolTipMainText: !sdSource.last ? \
i18n("No devices available") : i18n("Most recent device") +    \
Plasmoid.toolTipSubText: !sdSource.last ? "" : \
sdSource.data[sdSource.last]["Description"] +
     function popupEventSlot(popped) {
         if (!popped) {
             // reset the property that lets us remember if an item was clicked
@@ -97,7 +101,6 @@ Item {
                 if (devicesType == "all" ||
                     (devicesType == "removable" && data[last] && \
                data[last]["Removable"] == true) ||
                     (devicesType == "nonRemovable" && data[last] && \
                data[last]["Removable"] == false)) {
-                    updateTooltip();
                     if (expand) {
                         expandDevice(last)
                     }
@@ -129,7 +132,6 @@ Item {
         if (sdSource.connectedSources.count == 0) {
             plasmoid.status = PlasmaCore.Types.PassiveStatus;
         }
-        updateTooltip()
     }
 
     function configChanged()
@@ -165,20 +167,6 @@ Item {
         popupIconTimer.restart()
     }
 
-    function updateTooltip()
-    {
-        var tooltip = new Object
-        if (notifierDialog.count == 0) {
-            tooltip["image"] = "device-notifier"
-            tooltip["mainText"] = i18n("No devices available")
-        } else if (sdSource.last != "") {
-            tooltip["image"] = sdSource.data[sdSource.last]["Icon"]
-            tooltip["mainText"] = i18n("Most recent device")
-            tooltip["subText"] = sdSource.data[sdSource.last]["Description"]
-        }
-        //plasmoid.popupIconToolTip = tooltip // FIXME
-    }
-
     function isMounted (udi) {
         var types = sdSource.data[udi]["Device Types"];
         if (types.indexOf("Storage Access")>=0) {
@@ -286,7 +274,6 @@ Item {
 
                 onCountChanged: {
                     if (count == 0) {
-                        updateTooltip();
                         passiveTimer.restart()
                     } else {
                         passiveTimer.stop()


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

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