]> git.street.me.uk Git - andy/viking.git/blobdiff - src/main.c
Store cursor info directly into tool struct
[andy/viking.git] / src / main.c
index ad4bcabb0e1ceee32a38ca85e0a287c6f6b10d13..b8ccaf2f1bcb2272ae18d1e14e02e0b55b45a432 100644 (file)
  *
  */
 
+#ifdef HAVE_CONFIG
+#include "config.h"
+#endif /* HAVE_CONFIG */
+
 #include "viking.h"
 #include "icons/viking_icon.png_h"
 #include "mapcache.h"
 #include "background.h"
 #include "dems.h"
 #include "curl_download.h"
+#include "preferences.h"
+
+#ifdef VIK_CONFIG_GEOCACHES
+void a_datasource_gc_init();
+#endif
 
 #include <stdlib.h>
 #include <string.h>
 
 #include <glib/gprintf.h>
+#include <glib/gi18n.h>
 
 #include "modules.h"
 
@@ -83,8 +93,12 @@ static void open_window ( VikWindow *vw, const gchar **files )
     }
 }
 
+/* Options */
+static gboolean version = FALSE;
+
 static GOptionEntry entries[] = 
 {
+  { "version", 'v', 0, G_OPTION_ARG_NONE, &version, N_("Show version"), NULL },
   { NULL }
 };
 
@@ -96,6 +110,10 @@ int main( int argc, char *argv[] )
   int i = 0;
   GError *error = NULL;
   gboolean gui_initialized;
+       
+  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);  
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+  textdomain (GETTEXT_PACKAGE);
 
   g_thread_init ( NULL );
   gdk_threads_init ();
@@ -119,6 +137,12 @@ int main( int argc, char *argv[] )
     }
     return EXIT_FAILURE;
   }
+   
+  if (version)
+  {
+    g_printf ("%s %s, Copyright (c) 2003-2007 Evan Battaglia\n", PACKAGE_NAME, PACKAGE_VERSION);
+    return EXIT_SUCCESS;
+  }
 
   curl_download_init();
 
@@ -127,6 +151,11 @@ int main( int argc, char *argv[] )
 
   a_mapcache_init ();
   a_background_init ();
+  a_preferences_init ();
+
+#ifdef VIK_CONFIG_GEOCACHES
+  a_datasource_gc_init();
+#endif
 
   /* Set the icon */
   main_icon = gdk_pixbuf_from_pixdata(&viking_icon, FALSE, NULL);
@@ -148,6 +177,7 @@ int main( int argc, char *argv[] )
 
   a_mapcache_uninit ();
   a_dems_uninit ();
+  a_preferences_uninit ();
 
   return 0;
 }