Bug 108427

Summary: tooltip contains no usefull information at all
Product: [Unmaintained] kweather-kde3 Reporter: Matthias Kempka <lists>
Component: generalAssignee: geiseri
Status: RESOLVED FIXED    
Severity: wishlist CC: Stefan.Borggraefe
Priority: NOR    
Version: 2.1   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Matthias Kempka 2005-07-02 10:45:23 UTC
Version:           2.1 (using KDE KDE 3.4.0)
Installed from:    Unlisted Binary Package
OS:                Linux

This report might look similar to bug 62055, but imo the point is different. The null-information of the tooltip is a usability bug.

The applet displays some information. When I move my mouse over an applet I want some more information. The information I get from the kweather tooltip is "click here to see the detailed weather report..". That's no information at all. Every user knows that applets may be clicked -- if not nothing will happen when they try, and try they will anyway.
I think the tooltip is a place where the informations from the detailed report should be shown without making me to click. This does not make the detailed window useless as this is a nicer and more permanent way to present the information. But as a power user I don't want to open a new window for every little bit of information that could be retrieved a much faster way.

btw, I love the applet :-)
Comment 1 richlv 2005-10-03 15:05:29 UTC
hmm. in 3.4.2 kweather shows in tooltip temperature, wind and air pressure
Comment 2 Stefan Borggraefe 2006-01-22 17:27:10 UTC
In KDE 3.5.0 the kweather applet doesn't have any tooltip. At least with my Debian Sid installation.

I also like the idea proposed in comment 0.
Comment 3 Martin Koller 2006-12-25 23:26:56 UTC
SVN commit 616506 by mkoller:

BUG: 97107
BUG: 134426
BUG: 108427

Display weather data even if station needs maintenance
Patch included from Sok Ann Yap sokann@gmail.com

Make the tooltip more informative by showing station name
and more data



 M  +56 -31    dockwidget.cpp  
 M  +3 -6      metar_parser.cpp  
 M  +6 -10     reportview.cpp  
 M  +1 -4      weatherlib.cpp  


--- branches/KDE/3.5/kdetoys/kweather/dockwidget.cpp #616505:616506
@@ -41,7 +41,8 @@
     setBackgroundOrigin( AncestorOrigin );
 }
 
-dockwidget::~dockwidget(){
+dockwidget::~dockwidget()
+{
     delete m_weatherService;
 }
 
@@ -77,51 +78,74 @@
 
 void dockwidget::showWeather()
 {
-    QString tip;
+    QString tip = "<qt>";
 
     QString temp     = "?";
     QString wind     = "?";
     QString pressure = "?";
 
-    if ( !m_locationCode.isEmpty() && m_weatherService->stationNeedsMaintenance( m_locationCode ) )
+    if ( !m_locationCode.isEmpty() )
     {
-        tip = i18n("Station reports that it needs maintenance\n"
-                   "Please try again later");
-    }
-    else
-    {
-        if ( !m_locationCode.isEmpty() )
-        {
-            temp     = m_weatherService->temperature( m_locationCode );
-            wind     = m_weatherService->wind( m_locationCode );
-            pressure = m_weatherService->pressure( m_locationCode );
-        }
+        temp     = m_weatherService->temperature( m_locationCode );
+        wind     = m_weatherService->wind( m_locationCode );
+        pressure = m_weatherService->pressure( m_locationCode );
 
-        if (m_mode != ShowAll)
-        {
-            tip = i18n("Temperature: ") + temp;
-            tip += i18n("\nWind: ") + wind;
-            tip += i18n("\nAir pressure: ") + pressure;
-        }
+        QString dewPoint    = m_weatherService->dewPoint( m_locationCode);
+        QString relHumidity = m_weatherService->relativeHumidity( m_locationCode );
+        QString heatIndex   = m_weatherService->heatIndex( m_locationCode );
+        QString windChill   = m_weatherService->windChill( m_locationCode );
+        QString sunRiseTime = m_weatherService->sunRiseTime( m_locationCode );
+        QString sunSetTime  = m_weatherService->sunSetTime( m_locationCode );
+
+        tip += "<h3><center><nobr>" +
+               m_weatherService->stationName( m_locationCode ) + " (" +
+               m_weatherService->stationCountry( m_locationCode ) + ")</nobr></center></h3><br>";
+
+        tip += QString("<table>"
+                "<tr><th><nobr>" + i18n( "Temperature:"   ) + "</nobr></th><td><nobr>%1</nobr></td>"
+                    "<th><nobr>" + i18n( "Dew Point:"     ) + "</nobr></th><td><nobr>%2</nobr></td></nobr></tr>"
+
+                "<tr><th><nobr>" + i18n( "Air Pressure:"  ) + "</nobr></th><td><nobr>%3</nobr></td>"
+                    "<th><nobr>" + i18n( "Rel. Humidity:" ) + "</nobr></th><td><nobr>%4</nobr></td></nobr></tr>"
+
+                "<tr><th><nobr>" + i18n( "Wind Speed:"    ) + "</nobr></th><td><nobr>%5</nobr></td>")
+                .arg(temp).arg(dewPoint).arg(pressure).arg(relHumidity).arg(wind);
+
+        if ( !heatIndex.isEmpty() )
+            tip += QString("<th><nobr>" + i18n( "Heat Index:" ) + "</nobr></th><td><nobr>%1</nobr></td>").arg(heatIndex);
+        else if ( !windChill.isEmpty() )
+            tip += QString("<th><nobr>" + i18n( "Wind Chill:" ) + "</nobr></th><td><nobr>%1</nobr></td>").arg(windChill);
         else
+            tip += "<td>&nbsp;</td><td>&nbsp;</td>";
+        tip += "</tr>";
+
+        tip += QString("<tr><th><nobr>" + i18n( "Sunrise:" ) + "</nobr></th><td><nobr>%1</nobr></td>" +
+                           "<th><nobr>" + i18n( "Sunset:"  ) + "</nobr></th><td><nobr>%2</nobr></td>")
+                 .arg(sunRiseTime).arg(sunSetTime);
+
+        tip += "</tr></table>";
+
+        if ( m_weatherService->stationNeedsMaintenance( m_locationCode ) )
         {
-            tip = i18n("Click here to see\nthe detailed weather report...");
+            tip += "<br>" + i18n("Station reports that it needs maintenance\n"
+                                 "Please try again later");
         }
     }
+    else
+    {
+        tip += i18n("Temperature: ") + temp + "<br>";
+        tip += i18n("\nWind: ") + wind + "<br>";
+        tip += i18n("\nAir pressure: ") + pressure + "<br>";
+    }
 
+    tip += "</qt>";
+
     // On null or empty location code, or if the station needs maintenance, this will return the dunno icon.
     QPixmap icon = m_weatherService->icon( m_locationCode );
 
-    if ( ! m_locationCode.isEmpty() )
-    {
-        tip = m_weatherService->stationName( m_locationCode ) + "\n" +
-              m_weatherService->stationCountry( m_locationCode ) + "\n" +
-              tip;
-    }
+    QToolTip::remove(this);
+    QToolTip::add(this, tip);
 
-    QToolTip::remove(m_button);
-    QToolTip::add(m_button, tip);
-
     kdDebug(12004) << "show weather: " << endl;
     kdDebug(12004) << "location: " << m_locationCode << endl;
     kdDebug(12004) << "temp,wind,pressure: " << temp << " " << wind << " " << pressure << endl;
@@ -134,7 +158,8 @@
     m_button->setPixmap( icon );
 }
 
-void dockwidget::initDock(){
+void dockwidget::initDock()
+{
     kdDebug(12004) << "Init dockwidget " << endl;
 
     m_button= new WeatherButton(this,"m_button");
--- branches/KDE/3.5/kdetoys/kweather/metar_parser.cpp #616505:616506
@@ -135,12 +135,9 @@
 		}
 	}
 
-	if (!weatherInfo.stationNeedsMaintenance)
-	{
-		calcTemperatureVariables();
-		calcWindChill();
-		calcCurrentIcon();
-	}
+	calcTemperatureVariables();
+	calcWindChill();
+	calcCurrentIcon();
 	
 	return weatherInfo;
 }
--- branches/KDE/3.5/kdetoys/kweather/reportview.cpp #616505:616506
@@ -100,18 +100,14 @@
     if ( m_weatherService->stationNeedsMaintenance( m_locationCode ) )
     {
         weatherText += "<li>" + i18n( "Station reports that it needs maintenance" ) + " \n";
-        weatherText += "<li>" + i18n( "Please try a different one" ) + " \n";
     }
-    else
-    {
-        for (QStringList::const_iterator it = cover.begin();
-                it != cover.end(); ++it)
-            weatherText += "<li>" + *it + "\n";
+    for (QStringList::const_iterator it = cover.begin();
+            it != cover.end(); ++it)
+        weatherText += "<li>" + *it + "\n";
 
-        for (QStringList::const_iterator it = weather.begin();
-                it != weather.end(); ++it)
-            weatherText += "<li>" + *it + "\n";
-    }
+    for (QStringList::const_iterator it = weather.begin();
+            it != weather.end(); ++it)
+        weatherText += "<li>" + *it + "\n";
 
     weatherText += "</ul>\n";
 
--- branches/KDE/3.5/kdetoys/kweather/weatherlib.cpp #616505:616506
@@ -276,10 +276,7 @@
 	if ( !stationID.isEmpty() )
 	{
 		Data *d = findData(stationID);
-		if (!d->wi.stationNeedsMaintenance)
-		{
-			result = d->wi.theWeather;
-		}
+		result = d->wi.theWeather;
 	}
 	
 	return result;