+/**
+ *
+ */
+void osm_login_widgets (GtkWidget *user_entry, GtkWidget *password_entry)
+{
+ if (!user_entry || !password_entry)
+ return;
+
+ const gchar *default_user = get_default_user();
+ const gchar *pref_user = a_preferences_get(VIKING_OSM_TRACES_PARAMS_NAMESPACE "username")->s;
+ const gchar *pref_password = a_preferences_get(VIKING_OSM_TRACES_PARAMS_NAMESPACE "password")->s;
+
+ if (osm_user != NULL && osm_user[0] != '\0')
+ gtk_entry_set_text(GTK_ENTRY(user_entry), osm_user);
+ else if (pref_user != NULL && pref_user[0] != '\0')
+ gtk_entry_set_text(GTK_ENTRY(user_entry), pref_user);
+ else if (default_user != NULL)
+ gtk_entry_set_text(GTK_ENTRY(user_entry), default_user);
+
+ if (osm_password != NULL && osm_password[0] != '\0')
+ gtk_entry_set_text(GTK_ENTRY(password_entry), osm_password);
+ else if (pref_password != NULL)
+ gtk_entry_set_text(GTK_ENTRY(password_entry), pref_password);
+ /* This is a password -> invisible */
+ gtk_entry_set_visibility(GTK_ENTRY(password_entry), FALSE);
+}
+