]> Pileus Git - grits/commitdiff
* Removing glade (pure gtk-builder)
authorAndy Spencer <andy753421@gmail.com>
Sat, 27 Jun 2009 01:36:39 +0000 (01:36 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sat, 27 Jun 2009 01:36:39 +0000 (01:36 +0000)
  * Actions
  * List stores
* Offline mode

15 files changed:
Makefile.am
data/Makefile.am
data/about.ui [moved from data/about.glade with 97% similarity]
data/main.glade [deleted file]
data/main.ui [new file with mode: 0644]
src/Makefile.am
src/aweather-gui.c
src/aweather-gui.h
src/aweather-view.c
src/aweather-view.h
src/data.c
src/location.c
src/main.c
src/plugin-radar.c
src/plugin-ridge.c

index 47470fb378b68ce39f695e9a8099de5c22897717..c784619758dc7ef402601f0bae245dd95090b625 100644 (file)
@@ -4,5 +4,4 @@ MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.h.in gtk-doc.make
                        configure depcomp install-sh Makefile.in missing
 
 test: all
-       ./src/aweather -d 7
-
+       (cd src && make test)
index b0e77d7c7e6f2182f9a9d409f4ab403d79d9a2f0..48ba9b05e524426a0f25e35d503ac8fd36a4cd2e 100644 (file)
@@ -1,10 +1,5 @@
 gtkbuilderdir = $(datadir)/aweather/
-dist_gtkbuilder_DATA = main.xml about.xml
+dist_gtkbuilder_DATA = main.ui about.ui
 
-.glade.xml:
-       gtk-builder-convert $< $@
-
-clean-local:
-       rm -f *.xml
 maintainer-clean-local:
        rm -f Makefile.in
similarity index 97%
rename from data/about.glade
rename to data/about.ui
index 1d249ce64404a39455b70d0d0deb3bf01ce2a635..fdc50fcfc25364dd2cb13fb9ac74da235db36c67 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Sun May 24 00:49:18 2009 -->
-<glade-interface>
-  <widget class="GtkAboutDialog" id="window">
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkAboutDialog" id="window">
     <property name="border_width">5</property>
     <property name="title" translatable="yes">About AWeather</property>
     <property name="resizable">False</property>
-    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="type_hint">dialog</property>
     <property name="has_separator">False</property>
     <property name="program_name">AWeather</property>
     <property name="version">0.1</property>
-    <property name="copyright" translatable="yes">Copyright ©2008-2008 Andy Spencer</property>
+    <property name="copyright" translatable="yes">Copyright &#xA9;2008-2008 Andy Spencer</property>
     <property name="comments" translatable="yes">A semi-advanced weather viewer</property>
     <property name="website">http://lug.rose-hulman.edu/wiki/AWeather</property>
     <property name="license" translatable="yes">                    GNU GENERAL PUBLIC LICENSE
@@ -262,20 +262,21 @@ The hypothetical commands `show w' and `show c' should show the appropriate part
     <property name="wrap_license">True</property>
     <signal name="response" handler="gtk_widget_destroy" object="window"/>
     <child internal-child="vbox">
-      <widget class="GtkVBox" id="dialog-vbox1">
+      <object class="GtkVBox" id="dialog-vbox1">
         <property name="visible">True</property>
         <property name="spacing">2</property>
         <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="dialog-action_area1">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
             <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-          </widget>
+            <property name="layout_style">end</property>
+          </object>
           <packing>
             <property name="expand">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
           </packing>
         </child>
-      </widget>
+      </object>
     </child>
-  </widget>
-</glade-interface>
+  </object>
+</interface>
diff --git a/data/main.glade b/data/main.glade
deleted file mode 100644 (file)
index 2fa73b4..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Tue May 26 01:20:09 2009 -->
-<glade-interface>
-  <widget class="GtkWindow" id="window">
-    <child>
-      <widget class="GtkVBox" id="body">
-        <property name="visible">True</property>
-        <child>
-          <widget class="GtkMenuBar" id="menu">
-            <property name="visible">True</property>
-            <child>
-              <widget class="GtkMenuItem" id="menuitem1">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">_File</property>
-                <property name="use_underline">True</property>
-                <child>
-                  <widget class="GtkMenu" id="menu1">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem1">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-new</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem2">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-open</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem3">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-save</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem4">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-save-as</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
-                        <property name="visible">True</property>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem5">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-quit</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                        <signal name="activate" handler="on_quit"/>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-              </widget>
-            </child>
-            <child>
-              <widget class="GtkMenuItem" id="menuitem2">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">_Edit</property>
-                <property name="use_underline">True</property>
-                <child>
-                  <widget class="GtkMenu" id="menu2">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem6">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-cut</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem7">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-copy</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem8">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-paste</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem9">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-delete</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-              </widget>
-            </child>
-            <child>
-              <widget class="GtkMenuItem" id="menuitem3">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">_View</property>
-                <property name="use_underline">True</property>
-                <child>
-                  <widget class="GtkMenu" id="menu4">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="zoomin_menu">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-zoom-in</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                        <signal name="activate" handler="on_zoomin"/>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="menuitem5">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-zoom-out</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                        <signal name="activate" handler="on_zoomout"/>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkSeparatorMenuItem" id="sep1">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">menuitem5</property>
-                        <property name="use_underline">True</property>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="menuitem6">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-refresh</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                        <signal name="activate" handler="on_refresh"/>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-              </widget>
-            </child>
-            <child>
-              <widget class="GtkMenuItem" id="menuitem4">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">_Help</property>
-                <property name="use_underline">True</property>
-                <child>
-                  <widget class="GtkMenu" id="menu3">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem10">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-about</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                        <signal name="activate" handler="on_about"/>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-              </widget>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="GtkToolbar" id="toolbar1">
-            <property name="visible">True</property>
-            <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
-            <child>
-              <widget class="GtkToolButton" id="zoomin_button">
-                <property name="visible">True</property>
-                <property name="stock_id">gtk-zoom-in</property>
-                <signal name="clicked" handler="on_zoomin"/>
-              </widget>
-              <packing>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkToolButton" id="zoomout_button">
-                <property name="visible">True</property>
-                <property name="stock_id">gtk-zoom-out</property>
-                <signal name="clicked" handler="on_zoomout"/>
-              </widget>
-              <packing>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkSeparatorToolItem" id="sep">
-                <property name="visible">True</property>
-              </widget>
-              <packing>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkToolButton" id="refresh_button">
-                <property name="visible">True</property>
-                <property name="use_underline">True</property>
-                <property name="stock_id">gtk-refresh</property>
-                <signal name="clicked" handler="on_refresh"/>
-              </widget>
-              <packing>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="GtkVPaned" id="vpaned1">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <child>
-              <widget class="GtkHBox" id="hbox1">
-                <property name="visible">True</property>
-                <child>
-                  <widget class="GtkDrawingArea" id="drawing">
-                    <property name="width_request">600</property>
-                    <property name="height_request">550</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="has_focus">True</property>
-                    <property name="is_focus">True</property>
-                    <property name="can_default">True</property>
-                    <property name="has_default">True</property>
-                    <property name="receives_default">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK</property>
-                    <signal name="button_press_event" handler="on_drawing_button_press"/>
-                    <signal name="key_press_event" handler="on_drawing_key_press"/>
-                    <signal name="enter_notify_event" handler="on_drawing_button_press"/>
-                  </widget>
-                </child>
-                <child>
-                  <widget class="GtkVBox" id="vbox2">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkFrame" id="frame1">
-                        <property name="visible">True</property>
-                        <property name="label_xalign">0</property>
-                        <property name="shadow_type">GTK_SHADOW_NONE</property>
-                        <child>
-                          <widget class="GtkAlignment" id="alignment1">
-                            <property name="visible">True</property>
-                            <property name="left_padding">12</property>
-                            <child>
-                              <widget class="GtkComboBox" id="site">
-                                <property name="visible">True</property>
-                                <signal name="changed" handler="on_site_changed"/>
-                              </widget>
-                            </child>
-                          </widget>
-                        </child>
-                        <child>
-                          <widget class="GtkLabel" id="label1">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">&lt;b&gt;Site&lt;/b&gt;</property>
-                            <property name="use_markup">True</property>
-                          </widget>
-                          <packing>
-                            <property name="type">label_item</property>
-                          </packing>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkFrame" id="frame2">
-                        <property name="visible">True</property>
-                        <property name="label_xalign">0</property>
-                        <property name="shadow_type">GTK_SHADOW_NONE</property>
-                        <child>
-                          <widget class="GtkAlignment" id="alignment2">
-                            <property name="visible">True</property>
-                            <property name="left_padding">12</property>
-                            <child>
-                              <widget class="GtkScrolledWindow" id="scrolledwindow1">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
-                                <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                                <property name="shadow_type">GTK_SHADOW_IN</property>
-                                <child>
-                                  <widget class="GtkTreeView" id="time">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="headers_visible">False</property>
-                                    <signal name="row_activated" handler="on_time_changed"/>
-                                  </widget>
-                                </child>
-                              </widget>
-                            </child>
-                          </widget>
-                        </child>
-                        <child>
-                          <widget class="GtkLabel" id="label2">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">&lt;b&gt;Time&lt;/b&gt;</property>
-                            <property name="use_markup">True</property>
-                          </widget>
-                          <packing>
-                            <property name="type">label_item</property>
-                          </packing>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="resize">True</property>
-                <property name="shrink">False</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkNotebook" id="tabs">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="tab_pos">GTK_POS_BOTTOM</property>
-              </widget>
-              <packing>
-                <property name="resize">False</property>
-                <property name="shrink">False</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="position">2</property>
-          </packing>
-        </child>
-      </widget>
-    </child>
-  </widget>
-</glade-interface>
diff --git a/data/main.ui b/data/main.ui
new file mode 100644 (file)
index 0000000..46126e5
--- /dev/null
@@ -0,0 +1,346 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkListStore" id="times">
+    <columns>
+      <!-- column-name time -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkTreeStore" id="sites">
+    <columns>
+      <!-- column-name label -->
+      <column type="gchararray"/>
+      <!-- column-name code -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkWindow" id="window">
+    <child>
+      <object class="GtkVBox" id="body">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkMenuBar" id="menu">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkMenuItem" id="file_item">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">_File</property>
+                <property name="use_underline">True</property>
+                <child type="submenu">
+                  <object class="GtkMenu" id="file_menu">
+                    <property name="visible">True</property>
+                    <child>
+                      <object class="GtkCheckMenuItem" id="offline_item">
+                        <property name="visible">True</property>
+                        <property name="tooltip_text" translatable="yes">Work offline</property>
+                        <property name="related_action">offline</property>
+                        <property name="use_action_appearance">True</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkSeparatorMenuItem" id="sep2">
+                        <property name="visible">True</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkImageMenuItem" id="quit_item">
+                        <property name="visible">True</property>
+                        <property name="related_action">quit</property>
+                        <property name="use_action_appearance">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkMenuItem" id="view_item">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">_View</property>
+                <property name="use_underline">True</property>
+                <child type="submenu">
+                  <object class="GtkMenu" id="view_menu">
+                    <property name="visible">True</property>
+                    <child>
+                      <object class="GtkImageMenuItem" id="zoomin_item">
+                        <property name="visible">True</property>
+                        <property name="related_action">zoomin</property>
+                        <property name="use_action_appearance">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkImageMenuItem" id="zoomout_item">
+                        <property name="visible">True</property>
+                        <property name="related_action">zoomout</property>
+                        <property name="use_action_appearance">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkSeparatorMenuItem" id="sep1">
+                        <property name="visible">True</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkImageMenuItem" id="refresh_item">
+                        <property name="visible">True</property>
+                        <property name="related_action">refresh</property>
+                        <property name="use_action_appearance">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkMenuItem" id="help_item">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">_Help</property>
+                <property name="use_underline">True</property>
+                <child type="submenu">
+                  <object class="GtkMenu" id="help_menu">
+                    <property name="visible">True</property>
+                    <child>
+                      <object class="GtkImageMenuItem" id="about_item">
+                        <property name="visible">True</property>
+                        <property name="related_action">about</property>
+                        <property name="use_action_appearance">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                        <signal name="activate" handler="on_about"/>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkToolbar" id="toolbar">
+            <property name="visible">True</property>
+            <property name="toolbar_style">icons</property>
+            <child>
+              <object class="GtkToolButton" id="zoomin_button">
+                <property name="visible">True</property>
+                <property name="related_action">zoomin</property>
+                <property name="use_action_appearance">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="zoomout_button">
+                <property name="visible">True</property>
+                <property name="related_action">zoomout</property>
+                <property name="use_action_appearance">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSeparatorToolItem" id="sep">
+                <property name="visible">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="refresh_button">
+                <property name="visible">True</property>
+                <property name="related_action">refresh</property>
+                <property name="use_action_appearance">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkVPaned" id="vpaned1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <child>
+              <object class="GtkHPaned" id="hpaned1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <child>
+                  <object class="GtkDrawingArea" id="drawing">
+                    <property name="width_request">600</property>
+                    <property name="height_request">550</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="has_focus">True</property>
+                    <property name="is_focus">True</property>
+                    <property name="can_default">True</property>
+                    <property name="has_default">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK</property>
+                    <signal name="button_press_event" handler="on_drawing_button_press"/>
+                    <signal name="key_press_event" handler="on_drawing_key_press"/>
+                    <signal name="enter_notify_event" handler="on_drawing_button_press"/>
+                  </object>
+                  <packing>
+                    <property name="resize">True</property>
+                    <property name="shrink">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkVBox" id="vbox2">
+                    <property name="visible">True</property>
+                    <property name="spacing">5</property>
+                    <child>
+                      <object class="GtkExpander" id="expander1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="expanded">True</property>
+                        <property name="use_markup">True</property>
+                        <child>
+                          <object class="GtkComboBox" id="site">
+                            <property name="visible">True</property>
+                            <property name="model">sites</property>
+                            <property name="add_tearoffs">True</property>
+                            <signal name="changed" handler="on_site_changed"/>
+                            <child>
+                              <object class="GtkCellRendererText" id="site_rend"/>
+                              <attributes>
+                                <attribute name="text">0</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label1">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">&lt;b&gt;Site&lt;/b&gt;</property>
+                            <property name="use_markup">True</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkExpander" id="expander2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="expanded">True</property>
+                        <child>
+                          <object class="GtkScrolledWindow" id="scrolledwindow1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="hscrollbar_policy">never</property>
+                            <property name="vscrollbar_policy">automatic</property>
+                            <property name="shadow_type">in</property>
+                            <child>
+                              <object class="GtkTreeView" id="time">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="model">times</property>
+                                <property name="headers_visible">False</property>
+                                <signal name="row_activated" handler="on_time_changed"/>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label2">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">&lt;b&gt;Time&lt;/b&gt;</property>
+                            <property name="use_markup">True</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="resize">False</property>
+                    <property name="shrink">True</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="resize">True</property>
+                <property name="shrink">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkNotebook" id="tabs">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tab_pos">bottom</property>
+              </object>
+              <packing>
+                <property name="resize">False</property>
+                <property name="shrink">False</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkToggleAction" id="offline">
+    <property name="label">Offline</property>
+    <signal name="toggled" handler="on_offline"/>
+  </object>
+  <object class="GtkAction" id="quit">
+    <property name="label">Quit</property>
+    <property name="stock_id">gtk-quit</property>
+    <signal name="activate" handler="on_quit"/>
+  </object>
+  <object class="GtkAction" id="zoomin">
+    <property name="label">Zoom In</property>
+    <property name="stock_id">gtk-zoom-in</property>
+    <signal name="activate" handler="on_zoomin"/>
+  </object>
+  <object class="GtkAction" id="zoomout">
+    <property name="label">Zoom Out</property>
+    <property name="stock_id">gtk-zoom-out</property>
+    <signal name="activate" handler="on_zoomout"/>
+  </object>
+  <object class="GtkAction" id="refresh">
+    <property name="label">Refresh</property>
+    <property name="stock_id">gtk-refresh</property>
+    <signal name="activate" handler="on_refresh"/>
+  </object>
+  <object class="GtkAction" id="about">
+    <property name="label">About</property>
+    <property name="stock_id">gtk-about</property>
+    <signal name="activate" handler="on_about"/>
+  </object>
+</interface>
index 645fbed0a6dff86e771f8ff4b96a167197bacaa7..f1f9329ca7bfd50d72be9df9fdbb95e22e228cbd 100644 (file)
@@ -30,7 +30,7 @@ MAINTAINERCLEANFILES = Makefile.in
        glib-genmarshal --prefix=aweather_cclosure_marshal --header $< > $@
 
 test: all
-       ./aweather -d 7
+       ./aweather -o -d 7 -s KLSX
 
 gdb: all
        gdb ./aweather
index 2e44b91d79210617054f16af24658f5316c693f4..771ff20b1745d0b03209e38d3ccf1b7bdc5f050b 100644 (file)
@@ -88,10 +88,6 @@ static void aweather_gui_class_init(AWeatherGuiClass *klass)
 /*************
  * Callbacks *
  *************/
-void on_quit(GtkMenuItem *menu, AWeatherGui *gui)
-{
-       gtk_widget_destroy(GTK_WIDGET(gui));
-}
 gboolean on_drawing_button_press(GtkWidget *widget, GdkEventButton *event, AWeatherGui *gui)
 {
        g_debug("AWeatherGui: on_drawing_button_press - Grabbing focus");
@@ -137,24 +133,51 @@ gboolean on_gui_key_press(GtkWidget *widget, GdkEventKey *event, AWeatherGui *gu
        return FALSE;
 }
 
-void on_refresh(GtkToolButton *button, AWeatherGui *gui)
+void on_quit(GtkMenuItem *menu, AWeatherGui *gui)
+{
+       gtk_widget_destroy(GTK_WIDGET(gui));
+}
+
+void on_offline(GtkToggleAction *action, AWeatherGui *gui)
 {
        AWeatherView *view = aweather_gui_get_view(gui);
-       aweather_view_refresh(view);
+       aweather_view_set_offline(view,
+               gtk_toggle_action_get_active(action));
 }
 
-void on_zoomin(GtkToolButton *button, AWeatherGui *gui)
+void on_zoomin(GtkAction *action, AWeatherGui *gui)
 {
        AWeatherView *view = aweather_gui_get_view(gui);
        aweather_view_zoom(view, 3./4);
 }
 
-void on_zoomout(GtkToolButton *button, AWeatherGui *gui)
+void on_zoomout(GtkAction *action, AWeatherGui *gui)
 {
        AWeatherView *view = aweather_gui_get_view(gui);
        aweather_view_zoom(view, 4./3);
 }
 
+void on_refresh(GtkAction *action, AWeatherGui *gui)
+{
+       AWeatherView *view = aweather_gui_get_view(gui);
+       aweather_view_refresh(view);
+}
+
+void on_about(GtkAction *action, AWeatherGui *gui)
+{
+       // TODO: use gtk_widget_hide_on_delete()
+       GError *error = NULL;
+       GtkBuilder *builder = gtk_builder_new();
+       if (!gtk_builder_add_from_file(builder, DATADIR "/aweather/about.ui", &error))
+               g_error("Failed to create gtk builder: %s", error->message);
+       gtk_builder_connect_signals(builder, NULL);
+       GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(builder, "window"));
+       gtk_window_set_transient_for(GTK_WINDOW(window),
+                       GTK_WINDOW(aweather_gui_get_widget(gui, "window")));
+       gtk_widget_show_all(window);
+       g_object_unref(builder);
+}
+
 void on_time_changed(GtkTreeView *view, GtkTreePath *path,
                GtkTreeViewColumn *column, AWeatherGui *gui)
 {
@@ -260,21 +283,6 @@ gboolean on_expose(GtkWidget *da, GdkEventExpose *event, AWeatherGui *gui)
        return FALSE;
 }
 
-void on_about(GtkMenuItem *item, AWeatherGui *gui)
-{
-       // TODO: use gtk_widget_hide_on_delete()
-       GError *error = NULL;
-       GtkBuilder *builder = gtk_builder_new();
-       if (!gtk_builder_add_from_file(builder, DATADIR "/aweather/about.xml", &error))
-               g_error("Failed to create gtk builder: %s", error->message);
-       gtk_builder_connect_signals(builder, NULL);
-       GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(builder, "window"));
-       gtk_window_set_transient_for(GTK_WINDOW(window),
-                       GTK_WINDOW(aweather_gui_get_widget(gui, "window")));
-       gtk_widget_show_all(window);
-       g_object_unref(builder);
-}
-
 void on_location_changed(AWeatherView *view,
                gdouble x, gdouble y, gdouble z, AWeatherGui *gui)
 {
@@ -285,9 +293,9 @@ void on_location_changed(AWeatherView *view,
 }
 
 /* TODO: replace the code in these with `gtk_tree_model_find' utility */
-static void update_time_widget(AWeatherView *view, char *time, AWeatherGui *gui)
+static void update_time_widget(AWeatherView *view, const char *time, AWeatherGui *gui)
 {
-       g_debug("AWeatherGui: update_time_widget");
+       g_debug("AWeatherGui: update_time_widget - time=%s", time);
        GtkTreeView  *tview = GTK_TREE_VIEW(aweather_gui_get_widget(gui, "time"));
        GtkTreeModel *model = GTK_TREE_MODEL(gtk_tree_view_get_model(tview));
        for (int i = 0; i < gtk_tree_model_iter_n_children(model, NULL); i++) {
@@ -322,6 +330,8 @@ static void update_site_widget(AWeatherView *view, char *site, AWeatherGui *gui)
                        gtk_tree_model_iter_nth_child(model, &iter2, &iter1, i);
                        char *text;
                        gtk_tree_model_get(model, &iter2, 1, &text, -1);
+                       if (text == NULL)
+                               continue;
                        if (g_str_equal(text, site)) {
                                g_signal_handlers_block_by_func(combo,
                                                G_CALLBACK(on_site_changed), gui);
@@ -349,7 +359,7 @@ static void combo_sensitive(GtkCellLayout *cell_layout, GtkCellRenderer *cell,
 static void site_setup(AWeatherGui *gui)
 {
        GtkTreeIter state, city;
-       GtkTreeStore *store = gtk_tree_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
+       GtkTreeStore *store = GTK_TREE_STORE(aweather_gui_get_object(gui, "sites"));
        for (int i = 0; cities[i].label; i++) {
                if (cities[i].type == LOCATION_STATE) {
                        gtk_tree_store_append(store, &state, NULL);
@@ -362,15 +372,10 @@ static void site_setup(AWeatherGui *gui)
                }
        }
 
-       GtkWidget       *combo    = aweather_gui_get_widget(gui, "site");
-       GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
-       gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, FALSE);
-       gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), renderer, "text", 0, NULL);
-       gtk_combo_box_set_model(GTK_COMBO_BOX(combo), GTK_TREE_MODEL(store));
-       gtk_cell_layout_set_cell_data_func(GTK_CELL_LAYOUT(combo), renderer,
-                       combo_sensitive, NULL, NULL);
-       g_object_unref(renderer);
-       g_object_unref(store);
+       GtkWidget *combo    = aweather_gui_get_widget(gui, "site");
+       GObject   *renderer = aweather_gui_get_object(gui, "site_rend");
+       gtk_cell_layout_set_cell_data_func(GTK_CELL_LAYOUT(combo),
+                       GTK_CELL_RENDERER(renderer), combo_sensitive, NULL, NULL);
 
        AWeatherView *aview = aweather_gui_get_view(gui);
        g_signal_connect(aview, "site-changed", G_CALLBACK(update_site_widget), gui);
@@ -378,14 +383,13 @@ static void site_setup(AWeatherGui *gui)
 
 static void time_setup(AWeatherGui *gui)
 {
-       GtkTreeView  *tview  = GTK_TREE_VIEW(aweather_gui_get_widget(gui, "time"));
-       GtkTreeModel *store  = GTK_TREE_MODEL(gtk_list_store_new(1, G_TYPE_STRING));
-       gtk_tree_view_set_model(tview, store);
-
-       GtkCellRenderer   *rend = gtk_cell_renderer_text_new();
-       GtkTreeViewColumn *col  = gtk_tree_view_column_new_with_attributes(
+       GtkTreeView       *tview = GTK_TREE_VIEW(aweather_gui_get_widget(gui, "time"));
+       GtkCellRenderer   *rend  = gtk_cell_renderer_text_new();
+       GtkTreeViewColumn *col   = gtk_tree_view_column_new_with_attributes(
                                        "Time", rend, "text", 0, NULL);
+
        gtk_tree_view_append_column(tview, col);
+       g_object_set(rend, "size-points", 8.0, NULL);
 
        AWeatherView *aview = aweather_gui_get_view(gui);
        g_signal_connect(aview, "time-changed", G_CALLBACK(update_time_widget), gui);
@@ -424,7 +428,7 @@ AWeatherGui *aweather_gui_new()
        self->view    = aweather_view_new();
        self->builder = gtk_builder_new();
 
-       if (!gtk_builder_add_from_file(self->builder, DATADIR "/aweather/main.xml", &error))
+       if (!gtk_builder_add_from_file(self->builder, DATADIR "/aweather/main.ui", &error))
                g_error("Failed to create gtk builder: %s", error->message);
        gtk_builder_connect_signals(self->builder, self);
        g_signal_connect(self, "key-press-event", G_CALLBACK(on_gui_key_press), self);
@@ -458,6 +462,12 @@ GtkWidget *aweather_gui_get_widget(AWeatherGui *gui, const gchar *name)
                g_error("Failed to get widget `%s'", name);
        return GTK_WIDGET(widget);
 }
+GObject *aweather_gui_get_object(AWeatherGui *gui, const gchar *name)
+{
+       g_debug("AWeatherGui: get_widget - name=%s", name);
+       g_assert(AWEATHER_IS_GUI(gui));
+       return gtk_builder_get_object(gui->builder, name);
+}
 void aweather_gui_register_plugin(AWeatherGui *gui, AWeatherPlugin *plugin)
 {
        g_debug("AWeatherGui: register_plugin");
index af5e4a8243905906778e74c44fce4653741373a5..27383b258ccc293bc12f125ac055e13a5262d25d 100644 (file)
@@ -55,6 +55,7 @@ GType aweather_gui_get_type(void);
 AWeatherGui    *aweather_gui_new();
 AWeatherView   *aweather_gui_get_view(AWeatherGui *gui);
 GtkWidget      *aweather_gui_get_widget(AWeatherGui *gui, const gchar *name);
+GObject        *aweather_gui_get_object(AWeatherGui *gui, const gchar *name);
 void            aweather_gui_register_plugin(AWeatherGui *gui, AWeatherPlugin *plugin);
 void            aweather_gui_gl_redraw(AWeatherGui *gui);
 void            aweather_gui_gl_begin(AWeatherGui *gui);
index 96f9fed976d53df91c0d97dcf729e0911967ad92..919d8f92b0ae07da941b4abe5a51d599ab386da5 100644 (file)
@@ -45,6 +45,7 @@ static void aweather_view_init(AWeatherView *self)
        g_debug("AWeatherView: init");
        /* Default values */
        self->time = g_strdup("");
+       self->offline = FALSE;
        self->site = g_strdup("");
 }
 static void aweather_view_dispose(GObject *gobject)
@@ -110,7 +111,7 @@ static void aweather_view_class_init(AWeatherViewClass *klass)
                        0,
                        NULL,
                        NULL,
-                       g_cclosure_marshal_VOID__INT,
+                       g_cclosure_marshal_VOID__STRING,
                        G_TYPE_NONE,
                        1,
                        G_TYPE_STRING);
@@ -200,6 +201,20 @@ gchar *aweather_view_get_time(AWeatherView *view)
        return view->time;
 }
 
+void aweather_view_set_offline(AWeatherView *view, gboolean offline)
+{
+       g_assert(AWEATHER_IS_VIEW(view));
+       g_debug("AWeatherView: set_offline - %d", offline);
+       view->offline = offline;
+}
+
+gboolean aweather_view_get_offline(AWeatherView *view)
+{
+       g_assert(AWEATHER_IS_VIEW(view));
+       g_debug("AWeatherView: get_offline - %d", view->offline);
+       return view->offline;
+}
+
 void aweather_view_get_location(AWeatherView *view, gdouble *x, gdouble *y, gdouble *z)
 {
        g_assert(AWEATHER_IS_VIEW(view));
index 9051d888f3cc31a18cb014ae622b58b3fd78a0eb..08d6444c9ce6f9b282e31a4d48a4cd6e3d316d16 100644 (file)
@@ -35,9 +35,10 @@ struct _AWeatherView {
        GObject parent_instance;
 
        /* instance members */
-       gchar  *time;
-       gchar  *site;
-       gdouble location[3];
+       gchar   *time;
+       gboolean offline;
+       gchar   *site;
+       gdouble  location[3];
 };
 
 struct _AWeatherViewClass {
@@ -50,9 +51,13 @@ GType aweather_view_get_type(void);
 
 /* Methods */
 AWeatherView *aweather_view_new();
+
 void aweather_view_set_time(AWeatherView *view, const gchar *time);
 gchar *aweather_view_get_time(AWeatherView *view);
 
+void aweather_view_set_offline(AWeatherView *view, gboolean offline);
+gboolean aweather_view_get_offline(AWeatherView *view);
+
 void aweather_view_get_location(AWeatherView *view, gdouble *x, gdouble *y, gdouble *z);
 void aweather_view_set_location(AWeatherView *view, gdouble  x, gdouble  y, gdouble  z);
 void aweather_view_pan         (AWeatherView *view, gdouble  x, gdouble  y, gdouble  z);
index 4b975162a7f3aec9caea403f94760d566fd9acfc..0b6293ddb6b80bf90b049393967d26afa0579656 100644 (file)
@@ -47,12 +47,10 @@ static void cache_file_cb(SoupSession *session, SoupMessage *message, gpointer _
        gchar *uri = soup_uri_to_string(soup_message_get_uri(message), FALSE);
        g_debug("data: cache_file_cb");
 
-       if (!SOUP_STATUS_IS_SUCCESSFUL(message->status_code)) {
-               g_warning("data: cache_file_cb - error copying file, status=%d\n"
-                               "\tsrc=%s\n"
-                               "\tdst=%s",
-                               message->status_code, uri, info->local);
-       } else {
+       if (message->status_code == 416) {
+               /* Range unsatisfiable, file already complete */
+               info->callback(info->local, FALSE, info->user_data);
+       } else if (SOUP_STATUS_IS_SUCCESSFUL(message->status_code)) {
                gint wrote = fwrite(message->response_body->data,  1,
                                message->response_body->length, info->fp);
                g_debug("data: status=%u wrote=%d/%lld",
@@ -60,6 +58,11 @@ static void cache_file_cb(SoupSession *session, SoupMessage *message, gpointer _
                                wrote, message->response_body->length);
                fclose(info->fp);
                info->callback(info->local, TRUE, info->user_data);
+       } else {
+               g_warning("data: cache_file_cb - error copying file, status=%d\n"
+                               "\tsrc=%s\n"
+                               "\tdst=%s",
+                               message->status_code, uri, info->local);
        }
        g_free(uri);
        g_free(info->local);
@@ -78,6 +81,8 @@ static void do_cache(gchar *uri, gchar *local, gboolean truncate, gchar *reason,
        info->user_data = user_data;
        info->local     = local;
 
+       /* TODO: move this to callback so we don't end up with 0 byte files
+        * Then change back to check for valid file after download */
        if (truncate) info->fp = fopen_p(local, "w");
        else          info->fp = fopen_p(local, "a");
        long bytes = ftell(info->fp);
index 8d25adb0dd486ce4f600bf57aca552e33402e6aa..7d8ebe5f997913e678038beb37af10ee5db0abcb 100644 (file)
 #include "location.h"
 
 city_t cities[] = {
-       {LOCATION_STATE,  NULL, "Alabama",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "BMX", "Birmingham",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MXX", "E. Alabama",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "EOX", "Fort Rucker",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MOB", "Mobile",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "HTX", "Nrn. Alabama",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Alaska",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ABC", "Bethel",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ACG", "Biorka Is.",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "APD", "Fairbanks",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "AHG", "Kenai",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "AKC", "King Salmon",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "AIH", "Middleton Is.",     {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "AEC", "Nome",              {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "APD", "Pedro Dome",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ACG", "Sitka",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Arizona",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "FSX", "Flagstaff",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "IWA", "Phoenix",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "EMX", "Tucson",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "YUX", "Yuma",              {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Arkansas",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LZK", "Little Rock",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "SRX", "W. Ark./Ft. Smith", {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "California",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "BBX", "Beale AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "EYX", "Edwards AFB",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "BHX", "Eureka",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "HNX", "Hanford",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "VTX", "Los Angeles",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DAX", "Sacramento",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "NKX", "San Diego",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MUX", "San Francisco",     {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "HNX", "San Joaquin Vly.",  {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "SOX", "Santa Ana Mtns",    {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "VBX", "Vandenberg AFB",    {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Colorado",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "FTG", "Denver/Boulder",    {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GJX", "Grand Junction",    {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "PUX", "Pueblo",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Delaware",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DOX", "Dover AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Florida",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "EVX", "Eglin AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "JAX", "Jacksonville",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "BYX", "Key West",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MLB", "Melbourne",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "AMX", "Miami",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "EVX", "NW Florida",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "TLH", "Tallahassee",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "TBW", "Tampa Bay Area",    {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Georgia",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "FFC", "Atlanta",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "VAX", "Moody AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "FFC", "Peachtree City",    {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "JGX", "Robins AFB",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Guam",              {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GUA", "Andersen AFB",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Hawaii",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "HKI", "Kauai",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "HKM", "Kohala",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "HMO", "Molokai",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "HWA", "South Shore",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Idaho",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "CBX", "Boise",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "SFX", "Pocatello",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Illinois",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ILX", "Central IL",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LOT", "Chicago",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Indiana",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "VWX", "Evansville",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "IND", "Indianapolis",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "IWX", "Nrn. Indiana",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Iowa",              {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DMX", "Des Moines",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DVN", "Quad Cities",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Kansas",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DDC", "Dodge City",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GLD", "Goodland",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "TWX", "Topeka",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ICT", "Wichita",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Kentucky",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "HPX", "Fort Cambell",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "JKL", "Jackson",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LVX", "Louisville",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "PAH", "Paducah",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Louisiana",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "POE", "Fort Polk",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LCH", "Lake Charles",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LIX", "New Orleans",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "SHV", "Shreveport",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Maine",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "CBW", "Caribou",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GYX", "Portland",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Maryland",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LWX", "Baltimore",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Massachusetts",     {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "BOX", "Boston",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Michigan",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DTX", "Detroit",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "APX", "Gaylord",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GRR", "Grand Rapids",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MQT", "Marquette",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Minnesota",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DLH", "Duluth",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MPX", "Minneapolis",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Mississippi",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GWX", "Columbus AFB",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DGX", "Jackson/Brandon",   {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Missouri",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "EAX", "Kansas City",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "SGF", "Springfield",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LSX", "St. Louis",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Montana",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "BLX", "Billings",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GGW", "Glasgow",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "TFX", "Great Falls",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MSX", "Missoula",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Nebraska",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "UEX", "Hastings",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LNX", "North Platte",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "OAX", "Omaha",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Nevada",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LRX", "Elko",              {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ESX", "Las Vegas",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "RGX", "Reno",              {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "New Jersey",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DIX", "Mt. Holly",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "New Mexico",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ABX", "Albuquerque",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "FDX", "Cannon AFB",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "HDX", "Holloman AFB",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "New York",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ENX", "Albany",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "BGM", "Binghamton",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "BUF", "Buffalo",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "TYX", "Montague",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "OKX", "New York City",     {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "OKX", "Upton",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "North Carolina",    {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "RAX", "Durham",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MHX", "Morehead City",     {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "RAX", "Raleigh",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LTX", "Wilmington",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "North Dakota",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "BIS", "Bismarck",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MVX", "Grand Forks",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MBX", "Minot AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Ohio",              {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ILN", "Cincinnati",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "CLE", "Cleveland",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ILN", "Dayton",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ILN", "Wilmington",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Oklahoma",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "FDR", "Frederick",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "TLX", "Oklahoma City",     {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "INX", "Tulsa",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "VNX", "Vance AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Oregon",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MAX", "Medford",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "PDT", "Pendleton",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "RTX", "Portland",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Pennsylvania",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DIX", "Philadelphia",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "PBZ", "Pittsburgh",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "CCX", "State College",     {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Puerto Rico",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "JUA", "Puerto Rico/V.I.",  {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "South Carolina",    {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "CLX", "Charleston",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "CAE", "Columbia",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GSP", "Greenville",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GSP", "Spartanburg",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GSP", "Greer",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "South Dakota",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ABR", "Aberdeen",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "UDX", "Rapid City",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "FSD", "Sioux falls",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Tennessee",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MRX", "Knoxville",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "NQA", "Memphis",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MRX", "Morristown",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "OHX", "Nashville",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MRX", "Tri Cities",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Texas",             {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "AMA", "Amarillo",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "EWX", "Austin",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "BRO", "Brownsville",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GRK", "Central Texas",     {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "CRP", "Corpus Christi",    {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "FWS", "Dallas",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DYX", "Dyess AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "EPZ", "El Paso",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "FWS", "Fort Worth",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "HGX", "Galveston",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "HGX", "Houston",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "DFX", "Laughlin AFB",      {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LBB", "Lubbock",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MAF", "Midland/Odessa",    {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "SJT", "San Angelo",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "EWX", "San Antonio",       {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Utah",              {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ICX", "Cedar City",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MTX", "Salt Lake City",    {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Vermont",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "CXX", "Burlington",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Virginia",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "FCX", "Blacksburg",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "AKQ", "Norfolk",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "AKQ", "Richmond",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "FCX", "Roanoke",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LWX", "Sterling",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "AKQ", "Wakefield",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Washington",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ATX", "Seattle",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "OTX", "Spokane",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ATX", "Tacoma",            {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Washington DC",     {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "LWX", "Washington",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "West Virginia",     {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "RLX", "Charleston",        {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Wisconsin",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "GRB", "Green Bay",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "ARX", "La Crosse",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "MKX", "Milwaukee",         {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_STATE,  NULL, "Wyoming",           {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "CYS", "Cheyenne",          {0, 0, 0, 0, 0, 0, 0, 0}},
-       {LOCATION_CITY,  "RIW", "Riverton",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Alabama",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KBMX", "Birmingham",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMXX", "E. Alabama",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KEOX", "Fort Rucker",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMOB", "Mobile",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KHTX", "Nrn. Alabama",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Alaska",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KABC", "Bethel",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KACG", "Biorka Is.",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAPD", "Fairbanks",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAHG", "Kenai",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAKC", "King Salmon",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAIH", "Middleton Is.",     {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAEC", "Nome",              {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAPD", "Pedro Dome",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KACG", "Sitka",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Arizona",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KFSX", "Flagstaff",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KIWA", "Phoenix",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KEMX", "Tucson",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KYUX", "Yuma",              {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Arkansas",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLZK", "Little Rock",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KSRX", "W. Ark./Ft. Smith", {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "California",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KBBX", "Beale AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KEYX", "Edwards AFB",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KBHX", "Eureka",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KHNX", "Hanford",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KVTX", "Los Angeles",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDAX", "Sacramento",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KNKX", "San Diego",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMUX", "San Francisco",     {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KHNX", "San Joaquin Vly.",  {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KSOX", "Santa Ana Mtns",    {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KVBX", "Vandenberg AFB",    {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Colorado",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KFTG", "Denver/Boulder",    {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGJX", "Grand Junction",    {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KPUX", "Pueblo",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Delaware",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDOX", "Dover AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Florida",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KEVX", "Eglin AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KJAX", "Jacksonville",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KBYX", "Key West",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMLB", "Melbourne",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAMX", "Miami",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KEVX", "NW Florida",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KTLH", "Tallahassee",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KTBW", "Tampa Bay Area",    {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Georgia",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KFFC", "Atlanta",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KVAX", "Moody AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KFFC", "Peachtree City",    {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KJGX", "Robins AFB",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Guam",              {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGUA", "Andersen AFB",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Hawaii",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KHKI", "Kauai",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KHKM", "Kohala",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KHMO", "Molokai",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KHWA", "South Shore",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Idaho",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KCBX", "Boise",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KSFX", "Pocatello",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Illinois",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KILX", "Central IL",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLOT", "Chicago",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Indiana",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KVWX", "Evansville",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KIND", "Indianapolis",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KIWX", "Nrn. Indiana",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Iowa",              {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDMX", "Des Moines",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDVN", "Quad Cities",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Kansas",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDDC", "Dodge City",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGLD", "Goodland",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KTWX", "Topeka",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KICT", "Wichita",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Kentucky",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KHPX", "Fort Cambell",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KJKL", "Jackson",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLVX", "Louisville",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KPAH", "Paducah",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Louisiana",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KPOE", "Fort Polk",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLCH", "Lake Charles",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLIX", "New Orleans",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KSHV", "Shreveport",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Maine",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KCBW", "Caribou",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGYX", "Portland",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Maryland",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLWX", "Baltimore",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Massachusetts",     {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KBOX", "Boston",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Michigan",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDTX", "Detroit",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAPX", "Gaylord",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGRR", "Grand Rapids",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMQT", "Marquette",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Minnesota",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDLH", "Duluth",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMPX", "Minneapolis",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Mississippi",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGWX", "Columbus AFB",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDGX", "Jackson/Brandon",   {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Missouri",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KEAX", "Kansas City",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KSGF", "Springfield",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLSX", "St. Louis",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Montana",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KBLX", "Billings",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGGW", "Glasgow",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KTFX", "Great Falls",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMSX", "Missoula",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Nebraska",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KUEX", "Hastings",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLNX", "North Platte",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KOAX", "Omaha",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Nevada",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLRX", "Elko",              {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KESX", "Las Vegas",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KRGX", "Reno",              {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "New Jersey",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDIX", "Mt. Holly",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "New Mexico",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KABX", "Albuquerque",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KFDX", "Cannon AFB",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KHDX", "Holloman AFB",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "New York",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KENX", "Albany",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KBGM", "Binghamton",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KBUF", "Buffalo",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KTYX", "Montague",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KOKX", "New York City",     {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KOKX", "Upton",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "North Carolina",    {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KRAX", "Durham",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMHX", "Morehead City",     {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KRAX", "Raleigh",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLTX", "Wilmington",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "North Dakota",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KBIS", "Bismarck",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMVX", "Grand Forks",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMBX", "Minot AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Ohio",              {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KILN", "Cincinnati",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KCLE", "Cleveland",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KILN", "Dayton",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KILN", "Wilmington",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Oklahoma",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KFDR", "Frederick",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KTLX", "Oklahoma City",     {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KINX", "Tulsa",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KVNX", "Vance AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Oregon",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMAX", "Medford",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KPDT", "Pendleton",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KRTX", "Portland",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Pennsylvania",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDIX", "Philadelphia",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KPBZ", "Pittsburgh",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KCCX", "State College",     {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Puerto Rico",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KJUA", "Puerto Rico/V.I.",  {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "South Carolina",    {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KCLX", "Charleston",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KCAE", "Columbia",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGSP", "Greenville",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGSP", "Spartanburg",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGSP", "Greer",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "South Dakota",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KABR", "Aberdeen",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KUDX", "Rapid City",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KFSD", "Sioux falls",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Tennessee",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMRX", "Knoxville",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KNQA", "Memphis",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMRX", "Morristown",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KOHX", "Nashville",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMRX", "Tri Cities",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Texas",             {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAMA", "Amarillo",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KEWX", "Austin",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KBRO", "Brownsville",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGRK", "Central Texas",     {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KCRP", "Corpus Christi",    {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KFWS", "Dallas",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDYX", "Dyess AFB",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KEPZ", "El Paso",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KFWS", "Fort Worth",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KHGX", "Galveston",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KHGX", "Houston",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KDFX", "Laughlin AFB",      {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLBB", "Lubbock",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMAF", "Midland/Odessa",    {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KSJT", "San Angelo",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KEWX", "San Antonio",       {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Utah",              {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KICX", "Cedar City",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMTX", "Salt Lake City",    {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Vermont",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KCXX", "Burlington",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Virginia",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KFCX", "Blacksburg",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAKQ", "Norfolk",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAKQ", "Richmond",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KFCX", "Roanoke",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLWX", "Sterling",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KAKQ", "Wakefield",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Washington",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KATX", "Seattle",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KOTX", "Spokane",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KATX", "Tacoma",            {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Washington DC",     {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KLWX", "Washington",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "West Virginia",     {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KRLX", "Charleston",        {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Wisconsin",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KGRB", "Green Bay",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KARX", "La Crosse",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KMKX", "Milwaukee",         {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_STATE, NULL,   "Wyoming",           {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KCYS", "Cheyenne",          {0, 0, 0, 0, 0, 0, 0, 0}},
+       {LOCATION_CITY,  "KRIW", "Riverton",          {0, 0, 0, 0, 0, 0, 0, 0}},
        {0,               NULL,  NULL,               {0, 0, 0, 0, 0, 0, 0, 0}},
 };
index 546628330471e2a377397ac3b13d3e515893691b..67df7a6a3a3703c981b6d043c71ad87e3df9309e 100644 (file)
@@ -46,14 +46,16 @@ static gboolean on_map(AWeatherGui *gui, GdkEvent *event, gchar *site)
 int main(int argc, char *argv[])
 {
        /* Arguments */
-       gint     opt_debug = 6;
-       gchar   *opt_site  = "IND";
-       gboolean opt_auto  = FALSE;
+       gint     opt_debug   = 6;
+       gchar   *opt_site    = "KIND";
+       gboolean opt_auto    = FALSE;
+       gboolean opt_offline = FALSE;
        GOptionEntry entries[] = {
-               //long    short flg type                 location    description                 arg desc
-               {"debug", 'd',  0,  G_OPTION_ARG_INT,    &opt_debug, "Change default log level", "[1-7]"},
-               {"site",  's',  0,  G_OPTION_ARG_STRING, &opt_site,  "Set initial site",         NULL},
-               {"auto",  'a',  0,  G_OPTION_ARG_NONE,   &opt_auto,  "Auto update radar (todo)", NULL},
+               //long      short flg type                 location      description                 arg desc
+               {"debug",   'd',  0,  G_OPTION_ARG_INT,    &opt_debug,   "Change default log level", "[1-7]"},
+               {"site",    's',  0,  G_OPTION_ARG_STRING, &opt_site,    "Set initial site",         NULL},
+               {"offline", 'o',  0,  G_OPTION_ARG_NONE,   &opt_offline, "Run in offline mode",      NULL},
+               {"auto",    'a',  0,  G_OPTION_ARG_NONE,   &opt_auto,    "Auto update radar (todo)", NULL},
                {NULL}
        };
 
@@ -76,6 +78,7 @@ int main(int argc, char *argv[])
        /* Set up AWeather */
        AWeatherGui  *gui  = aweather_gui_new();
        AWeatherView *view = aweather_gui_get_view(gui);
+       aweather_view_set_offline(view, opt_offline);
        g_signal_connect(gui, "map-event", G_CALLBACK(on_map), opt_site);
 
        /* Load plugins */
index 30f58168ad54093c44308d330861628a81b181dc..e5e56b68f288b7e4eae1a2ea27ad530df9b7b2fa 100644 (file)
@@ -250,44 +250,69 @@ static void load_radar(AWeatherRadar *self, gchar *radar_file)
        load_radar_gui(self, radar);
 }
 
-static void update_times(AWeatherRadar *self, char *site, char **last_time)
+static void update_times(AWeatherRadar *self, AWeatherView *view, char *site, char **last_time)
 {
-       char *list_uri = g_strdup_printf(
-                       "http://mesonet.agron.iastate.edu/data/nexrd2/raw/K%s/dir.list",
-                       site);
-       GFile *list    = g_file_new_for_uri(list_uri);
-       g_free(list_uri);
-
-       gchar *data;
-       gsize length;
-       GError *error = NULL;
-       g_file_load_contents(list, NULL, &data, &length, NULL, &error);
-       g_object_unref(list);
-       if (error) {
-               g_warning("Error loading list for %s: %s", site, error->message);
-               g_error_free(error);
-               return;
+       GList *times = NULL;
+       if (aweather_view_get_offline(view)) {
+               gchar *path = g_build_filename(g_get_user_cache_dir(), PACKAGE, "nexrd2", "raw", site, NULL);
+               GDir *dir = g_dir_open(path, 0, NULL);
+               if (dir) {
+                       const gchar *name;
+                       while ((name = g_dir_read_name(dir))) {
+                               times = g_list_prepend(times, g_strdup(name));
+                       }
+                       g_dir_close(dir);
+               }
+               g_free(path);
+       } else {
+               gchar *data;
+               gsize length;
+               GError *error = NULL;
+
+               char *list_uri = g_strdup_printf("http://mesonet.agron.iastate.edu/data/nexrd2/raw/%s/dir.list", site);
+               GFile *list = g_file_new_for_uri(list_uri);
+               g_file_load_contents(list, NULL, &data, &length, NULL, &error);
+               if (error) {
+                       g_warning("Error loading list for %s: %s", site, error->message);
+                       g_error_free(error);
+               } else {
+                       gchar **lines = g_strsplit(data, "\n", -1);
+                       for (int i = 0; lines[i] && lines[i][0]; i++) {
+                               char **parts = g_strsplit(lines[i], " ", 2);
+                               times = g_list_prepend(times, parts[1]);
+                               g_strfreev(parts);
+                       }
+                       g_strfreev(lines);
+                       g_free(data);
+               }
+
+               g_free(list_uri);
+               g_object_unref(list);
        }
-       gchar **lines = g_strsplit(data, "\n", -1);
+
+       GRegex *regex = g_regex_new("^[A-Z]{4}_([0-9]{8}_[0-9]{4})$", 0, 0, NULL); // KLSX_20090622_2113
+       GMatchInfo *info;
+
        GtkTreeView  *tview  = GTK_TREE_VIEW(aweather_gui_get_widget(self->gui, "time"));
        GtkListStore *lstore = GTK_LIST_STORE(gtk_tree_view_get_model(tview));
        gtk_list_store_clear(lstore);
        GtkTreeIter iter;
-       for (int i = 0; lines[i] && lines[i][0]; i++) {
-               // format: `841907 KABR_20090510_0159'
-               //g_message("\tadding %p [%s]", lines[i], lines[i]);
-               char **parts = g_strsplit(lines[i], " ", 2);
-               char *time = parts[1]+5;
-               gtk_list_store_insert(lstore, &iter, 0);
-               gtk_list_store_set(lstore, &iter, 0, time, -1);
-               g_strfreev(parts);
+       times = g_list_reverse(times);
+       for (GList *cur = times; cur; cur = cur->next) {
+               g_message("trying time %s", (gchar*)cur->data);
+               if (g_regex_match(regex, cur->data, 0, &info)) {
+                       gchar *time = g_match_info_fetch(info, 1);
+                       g_message("adding time %s", (gchar*)cur->data);
+                       gtk_list_store_insert(lstore, &iter, 0);
+                       gtk_list_store_set(lstore, &iter, 0, time, -1);
+                       if (last_time)
+                               *last_time = time;
+               }
        }
 
-       if (last_time)
-               gtk_tree_model_get(GTK_TREE_MODEL(lstore), &iter, 0, last_time, -1);
-
-       g_free(data);
-       g_strfreev(lines);
+       g_regex_unref(regex);
+       g_list_foreach(times, (GFunc)g_free, NULL);
+       g_list_free(times);
 }
 
 /*****************
@@ -356,14 +381,14 @@ static void on_sweep_clicked(GtkRadioButton *button, gpointer _self)
        load_sweep   (self, g_object_get_data(G_OBJECT(button), "sweep"));
 }
 
-static void on_time_changed(AWeatherView *view, char *time, gpointer _self)
+static void on_time_changed(AWeatherView *view, const char *time, gpointer _self)
 {
        AWeatherRadar *self = AWEATHER_RADAR(_self);
-       g_debug("AWeatherRadar: on_time_changed - setting time");
+       g_debug("AWeatherRadar: on_time_changed - setting time=%s", time);
        // format: http://mesonet.agron.iastate.edu/data/nexrd2/raw/KABR/KABR_20090510_0323
        char *site = aweather_view_get_site(view);
        char *base = "http://mesonet.agron.iastate.edu/data/";
-       char *path = g_strdup_printf("nexrd2/raw/K%s/K%s_%s", site, site, time);
+       char *path = g_strdup_printf("nexrd2/raw/%s/%s_%s", site, site, time);
 
        /* Clear out children */
        GtkWidget *child = gtk_bin_get_child(GTK_BIN(self->config_body));
@@ -379,7 +404,10 @@ static void on_time_changed(AWeatherView *view, char *time, gpointer _self)
        aweather_gui_gl_redraw(self->gui);
 
        /* Start loading the new radar */
-       cache_file(base, path, AWEATHER_UPDATE, cached_cb, self);
+       if (aweather_view_get_offline(view)) 
+               cache_file(base, path, AWEATHER_ONCE, cached_cb, self);
+       else 
+               cache_file(base, path, AWEATHER_UPDATE, cached_cb, self);
        g_free(path);
 }
 
@@ -388,7 +416,7 @@ static void on_site_changed(AWeatherView *view, char *site, gpointer _self)
        AWeatherRadar *self = AWEATHER_RADAR(_self);
        g_debug("AWeatherRadar: on_site_changed - Loading wsr88d list for %s", site);
        char *time = NULL;
-       update_times(self, site, &time);
+       update_times(self, view, site, &time);
        aweather_view_set_time(view, time);
 
        g_free(time);
@@ -399,7 +427,7 @@ static void on_refresh(AWeatherView *view, gpointer _self)
        AWeatherRadar *self = AWEATHER_RADAR(_self);
        char *site = aweather_view_get_site(view);
        char *time = NULL;
-       update_times(self, site, &time);
+       update_times(self, view, site, &time);
        aweather_view_set_time(view, time);
        g_free(time);
 }
index 388ee7405c73ba6d32b27267611d9858a249fe63..8dcdac559a5da58b1570cfa99d7e046b5a79a433 100644 (file)
@@ -113,9 +113,12 @@ void load_texture(AWeatherRidge *self, layer_t *layer, gchar *filename)
        aweather_gui_gl_begin(self->gui);
 
        /* Load image */
-       GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
-       if (!pixbuf)
+       GError *error = NULL;
+       GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename, &error);
+       if (!pixbuf || error) {
                g_warning("Failed to load texture: %s", filename);
+               return;
+       }
        guchar    *pixels = gdk_pixbuf_get_pixels(pixbuf);
        int        width  = gdk_pixbuf_get_width(pixbuf);
        int        height = gdk_pixbuf_get_height(pixbuf);
@@ -170,11 +173,12 @@ static void on_site_changed(AWeatherView *view, gchar *site, AWeatherRidge *self
        g_debug("AWeatherRidge: on_site_changed - site=%s", site);
        for (int i = 0; i < LAYER_COUNT; i++) {
                gchar *base = "http://radar.weather.gov/ridge/";
-               gchar *path  = g_strdup_printf(layers[i].fmt, site);
+               gchar *path  = g_strdup_printf(layers[i].fmt, site+1);
                cached_t *udata = g_malloc(sizeof(cached_t));
                udata->self  = self;
                udata->layer = &layers[i];
                cache_file(base, path, AWEATHER_ONCE, cached_cb, udata);
+               //cache_file(base, path, AWEATHER_UPDATE, cached_cb, udata);
                g_free(path);
        }
 }