Mercurial > audlegacy-plugins
comparison src/scrobbler/configure.c @ 2148:5b5c450a6a37
Automated merge with ssh://hg.atheme.org//hg/audacious-plugins
author | Jonathan Schleifer <js@h3c.de> |
---|---|
date | Thu, 01 Nov 2007 15:38:07 +0100 |
parents | b8da6a0b0da2 |
children | d7c321957be8 |
comparison
equal
deleted
inserted
replaced
2147:e49d9b0ee308 | 2148:5b5c450a6a37 |
---|---|
48 const char *uid = gtk_entry_get_text(GTK_ENTRY(entry1)); | 48 const char *uid = gtk_entry_get_text(GTK_ENTRY(entry1)); |
49 const char *pwd = gtk_entry_get_text(GTK_ENTRY(entry2)); | 49 const char *pwd = gtk_entry_get_text(GTK_ENTRY(entry2)); |
50 const char *ge_uid = gtk_entry_get_text(GTK_ENTRY(ge_entry1)); | 50 const char *ge_uid = gtk_entry_get_text(GTK_ENTRY(ge_entry1)); |
51 const char *ge_pwd = gtk_entry_get_text(GTK_ENTRY(ge_entry2)); | 51 const char *ge_pwd = gtk_entry_get_text(GTK_ENTRY(ge_entry2)); |
52 | 52 |
53 if ((cfgfile = bmp_cfg_db_open())) | 53 if ((cfgfile = aud_cfg_db_open())) |
54 { | 54 { |
55 md5_state_t md5state; | 55 md5_state_t md5state; |
56 unsigned char md5pword[16], ge_md5pword[16]; | 56 unsigned char md5pword[16], ge_md5pword[16]; |
57 | 57 |
58 bmp_cfg_db_set_string(cfgfile, "audioscrobbler", "username", (char *)uid); | 58 aud_cfg_db_set_string(cfgfile, "audioscrobbler", "username", (char *)uid); |
59 bmp_cfg_db_set_string(cfgfile, "audioscrobbler", "ge_username", (char *)ge_uid); | 59 aud_cfg_db_set_string(cfgfile, "audioscrobbler", "ge_username", (char *)ge_uid); |
60 | 60 |
61 if (pwd != NULL && pwd[0] != '\0' && strlen(pwd)) | 61 if (pwd != NULL && pwd[0] != '\0' && strlen(pwd)) |
62 { | 62 { |
63 md5_init(&md5state); | 63 md5_init(&md5state); |
64 md5_append(&md5state, (unsigned const char *)pwd, strlen(pwd)); | 64 md5_append(&md5state, (unsigned const char *)pwd, strlen(pwd)); |
65 md5_finish(&md5state, md5pword); | 65 md5_finish(&md5state, md5pword); |
66 bmp_cfg_db_set_string(cfgfile, "audioscrobbler", "password", | 66 aud_cfg_db_set_string(cfgfile, "audioscrobbler", "password", |
67 hexify((char*)md5pword, sizeof(md5pword))); | 67 hexify((char*)md5pword, sizeof(md5pword))); |
68 } | 68 } |
69 | 69 |
70 if (ge_pwd != NULL && ge_pwd[0] != '\0' && strlen(ge_pwd)) | 70 if (ge_pwd != NULL && ge_pwd[0] != '\0' && strlen(ge_pwd)) |
71 { | 71 { |
72 md5_init(&md5state); | 72 md5_init(&md5state); |
73 md5_append(&md5state, (unsigned const char *)ge_pwd, strlen(ge_pwd)); | 73 md5_append(&md5state, (unsigned const char *)ge_pwd, strlen(ge_pwd)); |
74 md5_finish(&md5state, ge_md5pword); | 74 md5_finish(&md5state, ge_md5pword); |
75 bmp_cfg_db_set_string(cfgfile, "audioscrobbler", "ge_password", | 75 aud_cfg_db_set_string(cfgfile, "audioscrobbler", "ge_password", |
76 hexify((char*)ge_md5pword, sizeof(ge_md5pword))); | 76 hexify((char*)ge_md5pword, sizeof(ge_md5pword))); |
77 } | 77 } |
78 | 78 |
79 bmp_cfg_db_close(cfgfile); | 79 aud_cfg_db_close(cfgfile); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 /* Generated by glade, sorta. */ | 83 /* Generated by glade, sorta. */ |
84 GtkWidget * | 84 GtkWidget * |
195 gtk_misc_set_alignment (GTK_MISC (himage1), 1, 0.5); | 195 gtk_misc_set_alignment (GTK_MISC (himage1), 1, 0.5); |
196 | 196 |
197 gtk_entry_set_text(GTK_ENTRY(entry1), ""); | 197 gtk_entry_set_text(GTK_ENTRY(entry1), ""); |
198 gtk_entry_set_text(GTK_ENTRY(entry2), ""); | 198 gtk_entry_set_text(GTK_ENTRY(entry2), ""); |
199 | 199 |
200 if ((db = bmp_cfg_db_open())) { | 200 if ((db = aud_cfg_db_open())) { |
201 gchar *username = NULL; | 201 gchar *username = NULL; |
202 // last fm | 202 // last fm |
203 bmp_cfg_db_get_string(db, "audioscrobbler", "username", | 203 aud_cfg_db_get_string(db, "audioscrobbler", "username", |
204 &username); | 204 &username); |
205 if (username) { | 205 if (username) { |
206 gtk_entry_set_text(GTK_ENTRY(entry1), username); | 206 gtk_entry_set_text(GTK_ENTRY(entry1), username); |
207 g_free(username); | 207 g_free(username); |
208 username = NULL; | 208 username = NULL; |
209 } | 209 } |
210 // gerpok | 210 // gerpok |
211 bmp_cfg_db_get_string(db, "audioscrobbler", "ge_username", | 211 aud_cfg_db_get_string(db, "audioscrobbler", "ge_username", |
212 &username); | 212 &username); |
213 if (username) { | 213 if (username) { |
214 gtk_entry_set_text(GTK_ENTRY(ge_entry1), username); | 214 gtk_entry_set_text(GTK_ENTRY(ge_entry1), username); |
215 g_free(username); | 215 g_free(username); |
216 username = NULL; | 216 username = NULL; |
217 } | 217 } |
218 | 218 |
219 bmp_cfg_db_close(db); | 219 aud_cfg_db_close(db); |
220 } | 220 } |
221 | 221 |
222 return vbox2; | 222 return vbox2; |
223 } | 223 } |
224 | 224 |