+/**
+ * datasource_gps_get_protocol:
+ *
+ * Method to get the communication protocol of the GPS device from the widget structure
+ */
+gchar* datasource_gps_get_protocol ( gpointer user_data )
+{
+ // Uses the list of supported devices
+ gps_user_data_t *w = (gps_user_data_t *)user_data;
+ last_active = gtk_combo_box_get_active(GTK_COMBO_BOX(w->proto_b));
+ if (a_babel_device_list) {
+ gchar *protocol = ((BabelDevice*)g_list_nth_data(a_babel_device_list, last_active))->name;
+ a_settings_set_string ( VIK_SETTINGS_GPS_PROTOCOL, protocol );
+ return protocol;
+ }
+
+ return NULL;
+}
+
+/**
+ * datasource_gps_get_descriptor:
+ *
+ * Method to get the descriptor from the widget structure
+ * "Everything is a file"
+ * Could actually be normal file or a serial port
+ */
+gchar* datasource_gps_get_descriptor ( gpointer user_data )
+{
+ gps_user_data_t *w = (gps_user_data_t *)user_data;
+
+#if GTK_CHECK_VERSION (2, 24, 0)
+ gchar *descriptor = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(w->ser_b));
+#else
+ gchar *descriptor = gtk_combo_box_get_active_text(GTK_COMBO_BOX(w->ser_b));
+#endif
+ a_settings_set_string ( VIK_SETTINGS_GPS_PORT, descriptor );
+ return descriptor;
+}
+
+/**
+ * datasource_gps_get_do_tracks:
+ *
+ * Method to get the track handling behaviour from the widget structure
+ */
+gboolean datasource_gps_get_do_tracks ( gpointer user_data )
+{
+ gps_user_data_t *w = (gps_user_data_t *)user_data;
+ gboolean get_tracks = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w->get_tracks_b));
+ if ( w->direction == GPS_DOWN )
+ a_settings_set_boolean ( VIK_SETTINGS_GPS_GET_TRACKS, get_tracks );
+ return get_tracks;
+}
+
+/**
+ * datasource_gps_get_do_routes:
+ *
+ * Method to get the route handling behaviour from the widget structure
+ */
+gboolean datasource_gps_get_do_routes ( gpointer user_data )
+{
+ gps_user_data_t *w = (gps_user_data_t *)user_data;
+ gboolean get_routes = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w->get_routes_b));
+ if ( w->direction == GPS_DOWN )
+ a_settings_set_boolean ( VIK_SETTINGS_GPS_GET_ROUTES, get_routes );
+ return get_routes;
+}
+
+/**
+ * datasource_gps_get_do_waypoints:
+ *
+ * Method to get the waypoint handling behaviour from the widget structure
+ */
+gboolean datasource_gps_get_do_waypoints ( gpointer user_data )
+{
+ gps_user_data_t *w = (gps_user_data_t *)user_data;
+ gboolean get_waypoints = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w->get_waypoints_b));
+ if ( w->direction == GPS_DOWN )
+ a_settings_set_boolean ( VIK_SETTINGS_GPS_GET_WAYPOINTS, get_waypoints );
+ return get_waypoints;
+}
+
+static void datasource_gps_get_cmd_string ( gpointer user_data, gchar **babelargs, gchar **input_file, gpointer not_used )