]> Pileus Git - aweather/commitdiff
Set set at startup
authorAndy Spencer <andy753421@gmail.com>
Fri, 12 Feb 2010 22:56:34 +0000 (22:56 +0000)
committerAndy Spencer <andy753421@gmail.com>
Fri, 12 Feb 2010 22:56:34 +0000 (22:56 +0000)
src/main.c

index 83517e11e575822de0cfd9e547c8f0f3fc68e7a4..ae5bce8a94f760637902ab57e80aafdbf1ae3b4c 100644 (file)
@@ -22,6 +22,7 @@
 #include <gis.h>
 
 #include "aweather-gui.h"
+#include "aweather-location.h"
 
 static gint log_levels = 0;
 
@@ -96,6 +97,13 @@ 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));
        gtk_main();
        return 0;