]> Pileus Git - aweather/blobdiff - src/main.c
Set set at startup
[aweather] / src / main.c
index be6ff8b762473c50829f16b64096db9dd416c298..ae5bce8a94f760637902ab57e80aafdbf1ae3b4c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
+ * Copyright (C) 2009-2010 Andy Spencer <andy753421@gmail.com>
  * 
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <gtk/gtk.h>
 #include <gtk/gtkgl.h>
 
-#include <gis/gis.h>
+#include <gis.h>
 
 #include "aweather-gui.h"
+#include "aweather-location.h"
 
 static gint log_levels = 0;
 
@@ -96,8 +97,14 @@ int main(int argc, char *argv[])
        GObject *action = aweather_gui_get_object(gui, "prefs_general_log");
        g_signal_connect(action, "changed", G_CALLBACK(on_log_level_changed), NULL);
 
+       /* set locaiton */
+       for (city_t *city = cities; city->type; city++)
+               if (city->type == LOCATION_CITY && g_str_equal(city->code, site)) {
+                       gis_viewer_set_location(gui->viewer, city->lat, city->lon, EARTH_R/20);
+                       break;
+               }
+
        gtk_widget_show_all(GTK_WIDGET(gui));
-       gis_viewer_set_site(gui->viewer, site);
        gtk_main();
        return 0;
 }