Mercurial > audlegacy
comparison Plugins/General/scrobbler/configure.c @ 1176:6549a4c58e15 trunk
[svn] - grr
author | nenolod |
---|---|
date | Sun, 11 Jun 2006 20:29:00 -0700 |
parents | 99382cddf771 |
children | a9ecbf4443d3 |
comparison
equal
deleted
inserted
replaced
1175:d03157b6b5dd | 1176:6549a4c58e15 |
---|---|
69 bmp_cfg_db_set_string(cfgfile, "audioscrobbler", "password", | 69 bmp_cfg_db_set_string(cfgfile, "audioscrobbler", "password", |
70 hexify((char*)md5pword, sizeof(md5pword))); | 70 hexify((char*)md5pword, sizeof(md5pword))); |
71 } | 71 } |
72 bmp_cfg_db_close(cfgfile); | 72 bmp_cfg_db_close(cfgfile); |
73 } | 73 } |
74 | |
75 gtk_widget_destroy(GTK_WIDGET(data)); | |
76 } | |
77 | |
78 static void closewin(GtkWidget *wid __attribute__((unused)), gpointer data) | |
79 { | |
80 gtk_widget_destroy(GTK_WIDGET(data)); | |
81 } | |
82 | |
83 void | |
84 configure_dialog(void) | |
85 { | |
86 ConfigDb *db; | |
87 | |
88 cfgdlg = create_cfgdlg(); | |
89 | |
90 gtk_entry_set_text(GTK_ENTRY(entry1), ""); | |
91 gtk_entry_set_text(GTK_ENTRY(entry2), ""); | |
92 | |
93 if ((db = bmp_cfg_db_open())) { | |
94 gchar *username = NULL; | |
95 bmp_cfg_db_get_string(db, "audioscrobbler", "username", | |
96 &username); | |
97 if (username) { | |
98 gtk_entry_set_text(GTK_ENTRY(entry1), username); | |
99 g_free(username); | |
100 } | |
101 bmp_cfg_db_close(db); | |
102 } | |
103 | |
104 gtk_widget_show(GTK_WIDGET(cfgdlg)); | |
105 } | 74 } |
106 | 75 |
107 /* Generated by glade, sorta. */ | 76 /* Generated by glade, sorta. */ |
108 GtkWidget * | 77 GtkWidget * |
109 create_cfgdlg(void) | 78 create_cfgdlg(void) |
110 { | 79 { |
80 ConfigDb *db; | |
111 GtkWidget *window1; | 81 GtkWidget *window1; |
112 GtkWidget *vbox2; | 82 GtkWidget *vbox2; |
113 GtkWidget *table1; | 83 GtkWidget *table1; |
114 GtkWidget *label3; | 84 GtkWidget *label3; |
115 GtkWidget *hseparator2; | 85 GtkWidget *hseparator2; |
119 GtkWidget *hseparator1; | 89 GtkWidget *hseparator1; |
120 GtkWidget *hbuttonbox1; | 90 GtkWidget *hbuttonbox1; |
121 GtkWidget *button5; | 91 GtkWidget *button5; |
122 GtkWidget *button6; | 92 GtkWidget *button6; |
123 | 93 |
124 window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL); | 94 window1 = gtk_alignment_new (12, 12, 0, 0); |
125 gtk_container_set_border_width (GTK_CONTAINER (window1), 12); | 95 |
126 gtk_window_set_title (GTK_WINDOW (window1), _("Scrobbler Configuration")); | 96 /* gtk_container_set_border_width (GTK_CONTAINER (window1), 12); */ |
97 /* gtk_window_set_title (GTK_WINDOW (window1), _("Scrobbler Configuration")); */ | |
127 | 98 |
128 vbox2 = gtk_vbox_new (FALSE, 0); | 99 vbox2 = gtk_vbox_new (FALSE, 0); |
129 gtk_widget_show (vbox2); | 100 gtk_widget_show (vbox2); |
130 gtk_container_add (GTK_CONTAINER (window1), vbox2); | 101 gtk_container_add (GTK_CONTAINER (window1), vbox2); |
131 | 102 |
201 | 172 |
202 button6 = gtk_button_new_from_stock ("gtk-close"); | 173 button6 = gtk_button_new_from_stock ("gtk-close"); |
203 gtk_widget_show (button6); | 174 gtk_widget_show (button6); |
204 gtk_container_add (GTK_CONTAINER (hbuttonbox1), button6); | 175 gtk_container_add (GTK_CONTAINER (hbuttonbox1), button6); |
205 GTK_WIDGET_SET_FLAGS (button6, GTK_CAN_DEFAULT); | 176 GTK_WIDGET_SET_FLAGS (button6, GTK_CAN_DEFAULT); |
206 | |
207 gtk_signal_connect(GTK_OBJECT(button6), "clicked", | |
208 GTK_SIGNAL_FUNC(closewin), GTK_OBJECT(window1)); | |
209 | 177 |
210 /* Store pointers to all widgets, for use by lookup_widget(). */ | 178 /* Store pointers to all widgets, for use by lookup_widget(). */ |
211 GLADE_HOOKUP_OBJECT_NO_REF (window1, window1, "window1"); | 179 GLADE_HOOKUP_OBJECT_NO_REF (window1, window1, "window1"); |
212 GLADE_HOOKUP_OBJECT (window1, vbox2, "vbox2"); | 180 GLADE_HOOKUP_OBJECT (window1, vbox2, "vbox2"); |
213 GLADE_HOOKUP_OBJECT (window1, table1, "table1"); | 181 GLADE_HOOKUP_OBJECT (window1, table1, "table1"); |
221 GLADE_HOOKUP_OBJECT (window1, hseparator1, "hseparator1"); | 189 GLADE_HOOKUP_OBJECT (window1, hseparator1, "hseparator1"); |
222 GLADE_HOOKUP_OBJECT (window1, hbuttonbox1, "hbuttonbox1"); | 190 GLADE_HOOKUP_OBJECT (window1, hbuttonbox1, "hbuttonbox1"); |
223 GLADE_HOOKUP_OBJECT (window1, button5, "button5"); | 191 GLADE_HOOKUP_OBJECT (window1, button5, "button5"); |
224 GLADE_HOOKUP_OBJECT (window1, button6, "button6"); | 192 GLADE_HOOKUP_OBJECT (window1, button6, "button6"); |
225 | 193 |
194 gtk_entry_set_text(GTK_ENTRY(entry1), ""); | |
195 gtk_entry_set_text(GTK_ENTRY(entry2), ""); | |
196 | |
197 if ((db = bmp_cfg_db_open())) { | |
198 gchar *username = NULL; | |
199 bmp_cfg_db_get_string(db, "audioscrobbler", "username", | |
200 &username); | |
201 if (username) { | |
202 gtk_entry_set_text(GTK_ENTRY(entry1), username); | |
203 g_free(username); | |
204 } | |
205 bmp_cfg_db_close(db); | |
206 } | |
207 | |
226 return window1; | 208 return window1; |
227 } | 209 } |
228 | 210 |