? weather.diff
Index: mythweather/weather.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythweather/mythweather/weather.cpp,v
retrieving revision 1.52
diff -u -d -r1.52 weather.cpp
--- mythweather/weather.cpp	22 Feb 2005 23:33:58 -0000	1.52
+++ mythweather/weather.cpp	23 Feb 2005 05:22:02 -0000
@@ -48,6 +48,7 @@
 
     allowkeys = true;
     wantAnimated = gContext->GetNumSetting("WeatherWantAnimated", 1);   
+    config_Animation = wantAnimated;
     weatherTimeoutInt = gContext->GetNumSetting("WeatherTimeout", 20);
     weatherTimeoutInt *= 1000;
     
@@ -71,6 +72,7 @@
     changeLoc = false;
     changeAgg = false;
     noACCID = false;
+    changeAnimation = false;
 
     wData = NULL;
     fullRect = QRect(0, 0, size().width(), size().height());
@@ -468,6 +470,12 @@
             gContext->SetSetting("WeatherAggressiveLvl", agWriter);
             setSetting("WeatherAggressiveLvl", agWriter, false);
         }
+        if (changeAnimation == true)
+        {
+            agWriter = QString("%1").arg(config_Animation);
+            gContext->SetSetting("WeatherWantAnimated", agWriter);
+            setSetting("WeatherWantAnimated", agWriter, false);
+        }
 
         config_accid = "";
 }
@@ -1136,6 +1144,7 @@
                 ltype->SetItemText(0, tr("Weather Units"));
                 ltype->SetItemText(1, tr("Location"));
                 ltype->SetItemText(2, tr("Aggressiveness"));
+                ltype->SetItemText(3, tr("Animated Radar"));
                 ltype->SetItemCurrent(0);
             }
             ltype = (UIListType *)container->GetType("mainlist");
@@ -1213,6 +1222,7 @@
         changeTemp = false;
         changeLoc = false;
         changeAgg = false;
+        changeAnimation = false;
     }
 }
 
@@ -1250,7 +1260,7 @@
         {
             curConfig--;
             if (curConfig == 0)
-                curConfig = 3;
+                curConfig = 4;
 
             LayerSet *container = theme->GetSet("setup");
             if (container)
@@ -1305,6 +1315,15 @@
                        }
                        updateAggr();
                        break;
+                case 4:
+                       if (container)
+                       {
+                           type = (UITextType *)container->GetType("help");
+                           if (type)
+                               type->SetText(tr("Use the right arrow key to enable or disable animations..."));
+                           updateAnimation();
+                        }
+                       break;
             }
         }
         else
@@ -1376,6 +1395,12 @@
         
                 updateAggr();
             }
+            if (curConfig == 4)
+            {
+                changeAnimation = true;
+                config_Animation=(config_Animation?(config_Animation=0):(config_Animation=1));
+                updateAnimation();
+            }
         }
        update(fullRect);
    }
@@ -1417,7 +1442,7 @@
         if (deepSetup == false)
         {
             curConfig++;
-            if (curConfig == 4)
+            if (curConfig == 5)
                 curConfig = 1;
    
             LayerSet *container = theme->GetSet("setup");
@@ -1473,6 +1498,15 @@
                        }
                        updateAggr();
                        break;
+                case 4:
+                       if (container)
+                       {
+                           type = (UITextType *)container->GetType("help");
+                           if (type)
+                               type->SetText(tr("Use the right arrow key to enable or disable animations..."));
+                           updateAnimation();
+                       }
+                       break;
             }
         }
         else
@@ -1543,11 +1577,38 @@
 
                 updateAggr();
            }
+           if (curConfig == 4)
+           {
+                changeAnimation = true;
+                config_Animation=(config_Animation?(config_Animation=0):(config_Animation=1));
+                updateAnimation();
+           }
         }
         update(fullRect);
    }
 }
 
+void Weather::updateAnimation()
+{
+    LayerSet *container = theme->GetSet("setup");
+    if (container)
+    {
+        UIListType *type = (UIListType *)container->GetType("mainlist");
+        if (type)
+        {
+            type->ResetList();
+            type->SetItemText(0, tr("Yes"));
+            type->SetItemText(1, tr("No"));
+            if(config_Animation)
+                type->SetItemCurrent(0);
+            else
+                type->SetItemCurrent(1);
+            type->SetActive(true);
+        }
+    }
+    wantAnimated=config_Animation;
+}
+
 void Weather::updateAggr()
 {
     LayerSet *container = theme->GetSet("setup");
@@ -1647,7 +1708,7 @@
               ltype->SetActive(false);
           }
       }
-      else
+      else if (curConfig == 1)
       {
           UIListType *ltype = NULL;
           ltype = (UIListType *)container->GetType("mainlist");
@@ -1666,6 +1727,15 @@
               ltype->SetActive(false);
           }
       }
+      else if (curConfig == 4)
+      {
+          updateAnimation();
+          ltype = (UIListType *)container->GetType("options");
+          if (ltype)
+          {
+              ltype->SetActive(false);
+          }
+      }
    }
    else if (deepSetup == true)
    {
Index: mythweather/weather.h
===================================================================
RCS file: /var/lib/mythcvs/mythweather/mythweather/weather.h,v
retrieving revision 1.21
diff -u -d -r1.21 weather.h
--- mythweather/weather.h	20 Feb 2005 21:05:26 -0000	1.21
+++ mythweather/weather.h	23 Feb 2005 05:22:02 -0000
@@ -101,8 +101,10 @@
     bool changeTemp;
     bool changeLoc;
     bool changeAgg;
+    bool changeAnimation;
     int config_Units;
     int config_Aggressiveness;
+    int config_Animation;
     int curConfig;
     int curPage;
     bool debug;
@@ -146,6 +148,7 @@
     void setWeatherIcon(QString);
     void backupCity(int);
     void updateAggr();
+    void updateAnimation();
     void showCityName();
     void setSetting(QString, QString, bool);
 
