]> git.street.me.uk Git - andy/viking.git/blobdiff - src/main.c
Enable Cache conversion in the Python tool viking-cache.py
[andy/viking.git] / src / main.c
index 323e293610037ca3cf806441014a5d610c45154c..1eec76e0cff2b23e4b30616df2dd825b932d8e5c 100644 (file)
@@ -35,7 +35,9 @@
 #include "globals.h"
 #include "vikmapslayer.h"
 #include "vikrouting.h"
+#include "vikutils.h"
 #include "util.h"
+#include "toolbar.h"
 
 #ifdef VIK_CONFIG_GEOCACHES
 void a_datasource_gc_init();
@@ -164,6 +166,9 @@ int main( int argc, char *argv[] )
   XSetErrorHandler(myXErrorHandler);
 #endif
 
+  // Discover if this is the very first run
+  a_vik_very_first_run ();
+
   a_settings_init ();
   a_preferences_init ();
 
@@ -187,18 +192,25 @@ int main( int argc, char *argv[] )
   a_datasource_gc_init();
 #endif
 
+  a_toolbar_init();
   vik_routing_prefs_init();
 
+  if ( a_vik_get_time_ref_frame() == VIK_TIME_REF_WORLD )
+    vu_setup_lat_lon_tz_lookup();
+
   /* Set the icon */
   main_icon = gdk_pixbuf_from_pixdata(&viking_pixbuf, FALSE, NULL);
   gtk_window_set_default_icon(main_icon);
 
   gdk_threads_enter ();
 
+  // Ask for confirmation of default settings on first run
+  vu_set_auto_features_on_first_run ();
+
   /* Create the first window */
   first_window = vik_window_new_window();
 
-  check_latest_version ( GTK_WINDOW(first_window) );
+  vu_check_latest_version ( GTK_WINDOW(first_window) );
 
   while ( ++i < argc ) {
     if ( strcmp(argv[i],"--") == 0 && !dashdash_already )
@@ -217,11 +229,13 @@ int main( int argc, char *argv[] )
     }
   }
 
+  vik_window_new_window_finish ( first_window );
+
   gtk_main ();
   gdk_threads_leave ();
 
   a_babel_uninit ();
-
+  a_toolbar_uninit ();
   a_background_uninit ();
   a_mapcache_uninit ();
   a_dems_uninit ();
@@ -231,5 +245,10 @@ int main( int argc, char *argv[] )
 
   curl_download_uninit();
 
+  vu_finalize_lat_lon_tz_lookup ();
+
+  // Clean up any temporary files
+  util_remove_all_in_deletion_list ();
+
   return 0;
 }