Bug 101955 - Allow the user to disable 'The network is unavailable' passive dialog.
Summary: Allow the user to disable 'The network is unavailable' passive dialog.
Status: RESOLVED FIXED
Alias: None
Product: kweather-kde3
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: geiseri
URL:
Keywords:
: 102927 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-20 04:35 UTC by Kurt Hindenburg
Modified: 2007-02-24 13:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Old patch to disable passive popup (14.19 KB, patch)
2005-03-30 06:21 UTC, Kurt Hindenburg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Hindenburg 2005-03-20 04:35:55 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

There should a way to disable the passive popups all together.  When the network is down and I'm watching fullscreen TV, it is very annoying...

At one time I had some experimental code that fixed this; I'll see if I can find it.
Comment 1 Kurt Hindenburg 2005-03-30 06:21:17 UTC
Created attachment 10421 [details]
Old patch to disable passive popup

It doesn't apply cleanly anymore.  I may end up working on this.  It is that or
quit using KWeather... the popup are annoying when watching TV or playing
games... ;_(
Comment 2 Christoph Dwertmann 2005-06-23 22:35:35 UTC
This is embarrassing when presenting slides. Please include an option to turn it of or fully remove this "feature". Thanks!
Comment 3 Christian Loose 2005-06-24 09:43:57 UTC
*** Bug 102927 has been marked as a duplicate of this bug. ***
Comment 4 Jakob Petsovits 2005-06-24 11:32:50 UTC
Sorry for duplicating, don't know how I could miss this report. I've transferred my votes, and it would still be a good thing if the popups go away. I'd prefer using kweather's own display area to show network errors.
Comment 5 Bram Schoenmakers 2005-08-23 15:38:38 UTC
David Faure made a step in the right direction. A popup is shown once when no network is detected, instead of every x minutes.
Comment 6 Tucker Sylvestro 2007-01-08 08:00:48 UTC
I've stopped using kweather because of this (after using it more than a year).  Doing *anything* other than popping up a window is fine, even just showing the question mark.  When my computer can't access the network I know it, I don't need kweather to tell me that.
Comment 7 Martin Koller 2007-02-24 13:22:34 UTC
SVN commit 636839 by mkoller:

BUG: 101955

Don't show a passive popup when the network is unreachable, as we already
show this situation by the "dunno" icon and now also mention it in the
tooltip


 M  +5 -2      dockwidget.cpp  
 M  +0 -1      dockwidget.h  
 M  +10 -6     reportview.cpp  
 M  +9 -6      weatherlib.cpp  


--- branches/KDE/3.5/kdetoys/kweather/dockwidget.cpp #636838:636839
@@ -99,9 +99,12 @@
 
         tip += "<h3><center><nobr>" +
                m_weatherService->stationName( m_locationCode ) + " (" +
-               m_weatherService->stationCountry( m_locationCode ) + ")</nobr></center></h3><br>";
+               m_weatherService->stationCountry( m_locationCode ) + ")</nobr></center></h3>";
 
-        tip += QString("<table>"
+        if ( m_weatherService->currentIconString( m_locationCode ) == "dunno" )  // no data
+            tip += "<center><nobr>" + i18n("The network is currently offline...") + "</nobr></center>";
+
+        tip += QString("<br><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>"
 
--- branches/KDE/3.5/kdetoys/kweather/dockwidget.h #636838:636839
@@ -55,7 +55,6 @@
 private:
     void initDock();
     void updateFont();
-    DCOPReply callDCOP( const QString &name );
 
     int m_mode;
     QString m_locationCode;
--- branches/KDE/3.5/kdetoys/kweather/reportview.cpp #636838:636839
@@ -122,12 +122,16 @@
     .arg(bgColor).arg(textColor).arg(textColor).arg(textColor).arg(textColor) +    
     QString("</style><title></title></head><body dir=\"%1\">").arg( QApplication::reverseLayout()?"rtl":"ltr") + 
     "<div class=\"headerTitle\"><b>" + i18n( "Weather Report - %1 - %2" ).arg( locationName ).arg( countryName ) +        
-    "</b></div>\n" +    
-    QString("<div class=\"headerMsg\"><b>" + i18n( "Last updated on %1" ) + "</b></div>\n"
-    "<table><tr><td width=\"60\" style=\"text-align: center; border: dotted %2 1px;\">"
-    "<img width=\"64\" height=\"64\" src=\"%3\" /></td>"
-    "<td style=\"vertical-align: top\">%4</td></tr>")
-    .arg(date).arg(bgColor).arg(KURL(icon).url()).arg(weatherText) +
+    "</b></div>\n";
+
+    if ( ! date.isEmpty() )
+      contents += "<div class=\"headerMsg\"><b>" + i18n( "Last updated on %1" ).arg(date) + "</b></div>\n";
+
+    contents += QString(
+    "<table><tr><td width=\"60\" style=\"text-align: center; border: dotted %1 1px;\">"
+    "<img width=\"64\" height=\"64\" src=\"%2\" /></td>"
+    "<td style=\"vertical-align: top\">%3</td></tr>")
+    .arg(bgColor).arg(KURL(icon).url()).arg(weatherText) +
     "</table><table>" +
     QString("<tr><th style=\"text-align: right\">" + i18n( "Temperature:" )
     + "</th><td>%1</td>"
--- branches/KDE/3.5/kdetoys/kweather/weatherlib.cpp #636838:636839
@@ -102,9 +102,7 @@
 		    && !hostDown)
 		{
 			hostDown= true;
-			// should not bother after this point
-			KPassivePopup::message( i18n("KWeather Error!"),
-				i18n("The network is unavailable for use."),  0L,"error" );
+      // no need to show a passive popup here, as below all stations will show "dunno" icon
 		}
 	}
 	// Find the job
@@ -285,9 +283,14 @@
 QString WeatherLib::date(const QString &stationID){
 	Data *d = findData(stationID);
 
-	QDateTime gmtDateTime(d->wi.qsDate, d->wi.qsTime);
-	QDateTime localDateTime = gmtDateTime.addSecs(KRFCDate::localUTCOffset() * 60);
-	return KGlobal::locale()->formatDateTime(localDateTime, false, false);
+  if ( ! d->wi.qsDate.isValid() )
+    return "";
+  else
+  {
+    QDateTime gmtDateTime(d->wi.qsDate, d->wi.qsTime);
+    QDateTime localDateTime = gmtDateTime.addSecs(KRFCDate::localUTCOffset() * 60);
+    return KGlobal::locale()->formatDateTime(localDateTime, false, false);
+  }
 }
 
 /** Returns the current cover */