]> git.street.me.uk Git - andy/viking.git/blobdiff - src/main.c
Start to make compression code more reuseable.
[andy/viking.git] / src / main.c
index ab353b57adf720bbfdbd824573f95f06f8889f90..25a9bac8ea2d9659705af00b303ec785b56f82c9 100644 (file)
@@ -34,6 +34,8 @@
 #include "viklayer_defaults.h"
 #include "globals.h"
 #include "vikmapslayer.h"
+#include "vikrouting.h"
+#include "util.h"
 
 #ifdef VIK_CONFIG_GEOCACHES
 void a_datasource_gc_init();
@@ -119,7 +121,9 @@ int main( int argc, char *argv[] )
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
 
+#if ! GLIB_CHECK_VERSION (2, 32, 0)
   g_thread_init ( NULL );
+#endif
   gdk_threads_init ();
 
   gui_initialized = gtk_init_with_args (&argc, &argv, "files+", entries, NULL, &error);
@@ -160,6 +164,10 @@ 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 ();
 
   a_vik_preferences_init ();
@@ -182,14 +190,22 @@ int main( int argc, char *argv[] )
   a_datasource_gc_init();
 #endif
 
+  vik_routing_prefs_init();
+
   /* 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
+  set_auto_features_on_first_run ();
+
   /* Create the first window */
   first_window = vik_window_new_window();
 
-  gdk_threads_enter ();
+  check_latest_version ( GTK_WINDOW(first_window) );
+
   while ( ++i < argc ) {
     if ( strcmp(argv[i],"--") == 0 && !dashdash_already )
       dashdash_already = TRUE; /* hack to open '-' */
@@ -207,6 +223,8 @@ int main( int argc, char *argv[] )
     }
   }
 
+  vik_window_new_window_finish ( first_window );
+
   gtk_main ();
   gdk_threads_leave ();
 
@@ -217,6 +235,7 @@ int main( int argc, char *argv[] )
   a_dems_uninit ();
   a_layer_defaults_uninit ();
   a_preferences_uninit ();
+  a_settings_uninit ();
 
   curl_download_uninit();