Index: src/dsk_mgr.c
===================================================================
--- src/dsk_mgr.c	(revision 13)
+++ src/dsk_mgr.c	(working copy)
@@ -46,6 +46,8 @@
 #include <gdk/gdkpixbuf.h>
 #include <gconf/gconf-client.h>
 
+
+
 #define DAEMON_NAME "[dsk_mgr]"
 #define DEFAULT_XMLRPC_SERVER "http://192.168.0.13/rpc/myserver.php"
 
@@ -183,6 +185,43 @@
   //g_print("next=%i\n", g_slist_next(loc));
 }
 
+void gconf_key_changed_callback(GConfClient* gconf_client,
+				guint cnxn_id,
+				GConfEntry *entry,
+				gpointer user_data){
+  g_print("gconf key=%s has changed\n",entry->key);
+
+  if(strcmp(entry->key,"/apps/osso/phonehome/id")==0 && entry->value!=NULL){
+    if(entry->value->type == GCONF_VALUE_STRING){
+    g_print("Changing id with %s\n", gconf_value_get_string(entry->value));
+    g_free(xmlrpc_id);
+    xmlrpc_id=gconf_client_get_string(gconf_client, "/apps/osso/phonehome/id",
+				      NULL);
+    }
+  }
+  
+  
+  if(strcmp(entry->key,"/apps/osso/phonehome/password")==0 && entry->value!=NULL){
+    if(entry->value->type == GCONF_VALUE_STRING){
+      g_print("Changing password with %s\n", gconf_value_get_string(entry->value));
+      g_free(xmlrpc_password);
+      xmlrpc_password=gconf_client_get_string(gconf_client, "/apps/osso/phonehome/password",
+				      NULL);
+    }
+  }
+  
+  if(strcmp(entry->key,"/apps/osso/phonehome/server1")==0 && entry->value!=NULL){
+    if(entry->value->type == GCONF_VALUE_STRING){
+      g_print("Changing server with %s\n", gconf_value_get_string(entry->value));
+      g_free(xmlrpc_server);
+      xmlrpc_server=gconf_client_get_string(gconf_client, "/apps/osso/phonehome/server",
+				      NULL);
+    }
+  }
+  
+
+}
+
 void save_positions_to_file(){
   g_print("Saving stuff to file\n");
   FILE * fh;
@@ -505,9 +544,10 @@
 gboolean my_timeout(gpointer loop) {
   //static double cnt=1;
   g_print("my timeout\n");
-  GMainLoop *mloop=(GMainLoop *) loop;
+  g_print("id=%s password=%s server=%s\n",xmlrpc_id,xmlrpc_password,xmlrpc_server);
+  //GMainLoop *mloop=(GMainLoop *) loop;
 
-  g_main_loop_quit (mloop);
+  //g_main_loop_quit (mloop);
 
   //return FALSE;
   return TRUE;
@@ -835,6 +875,9 @@
   }
 
   g_print("%s:%s\n",xmlrpc_id,xmlrpc_password);
+
+
+  /*
   if(xmlrpc_id==NULL||xmlrpc_password==NULL){
     g_print("Set password and id with gconftool-2 first\n");
     g_print("gconftool-2 -t string -s '/apps/osso/phonehome/id' 'your_user_id'\n");
@@ -843,14 +886,16 @@
     
     exit(1);
   }
-
+  */
+  g_print("xmlr_rpc_server=%s\n",xmlrpc_server);
   
+  
 
 
 
 
   g_print("test gst:%i\n",init_gstreamer_stuff(&argc,&argv));
-  g_print("xmlr_rpc_server=%s\n",xmlrpc_server);
+
   //Main loop 
   mainloop = g_main_loop_new(NULL, FALSE);
   if (mainloop == NULL) {
@@ -859,6 +904,18 @@
     exit(EXIT_FAILURE);
   }  
 
+  //Gconf change callback
+  gconf_client_add_dir(gconf_client,
+                       "/apps/osso/phonehome",
+                       GCONF_CLIENT_PRELOAD_NONE,
+                       NULL);
+
+  gconf_client_notify_add(gconf_client, "/apps/osso/phonehome",
+                           gconf_key_changed_callback,
+                          NULL,
+                          NULL, NULL);
+
+
   //Network connectivity status change callback
   network_connection = con_ic_connection_new();  
   g_signal_connect(G_OBJECT(network_connection), "connection-event", 
@@ -870,9 +927,9 @@
   gps_device = g_object_new (LOCATION_TYPE_GPS_DEVICE, NULL);
   g_signal_connect (gps_device, "changed", G_CALLBACK (location_changed), (gpointer) gps_positions);
 
-  //g_timeout_add(40000,my_timeout,(gpointer) mainloop);
+  g_timeout_add(3000,my_timeout,(gpointer) mainloop);
   g_timeout_add(5*60*1000,monitor_connection,NULL);
-  fill_gps_positions_with_fake();
+  //fill_gps_positions_with_fake();
   //save_positions_to_file();
 
   //g_slist_foreach(gps_positions, show_locations, NULL);
