Mercurial > audlegacy
diff 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 |
line wrap: on
line diff
--- a/Plugins/General/scrobbler/configure.c Sun Jun 11 20:11:40 2006 -0700 +++ b/Plugins/General/scrobbler/configure.c Sun Jun 11 20:29:00 2006 -0700 @@ -71,43 +71,13 @@ } bmp_cfg_db_close(cfgfile); } - - gtk_widget_destroy(GTK_WIDGET(data)); -} - -static void closewin(GtkWidget *wid __attribute__((unused)), gpointer data) -{ - gtk_widget_destroy(GTK_WIDGET(data)); -} - -void -configure_dialog(void) -{ - ConfigDb *db; - - cfgdlg = create_cfgdlg(); - - gtk_entry_set_text(GTK_ENTRY(entry1), ""); - gtk_entry_set_text(GTK_ENTRY(entry2), ""); - - if ((db = bmp_cfg_db_open())) { - gchar *username = NULL; - bmp_cfg_db_get_string(db, "audioscrobbler", "username", - &username); - if (username) { - gtk_entry_set_text(GTK_ENTRY(entry1), username); - g_free(username); - } - bmp_cfg_db_close(db); - } - - gtk_widget_show(GTK_WIDGET(cfgdlg)); } /* Generated by glade, sorta. */ GtkWidget * create_cfgdlg(void) { + ConfigDb *db; GtkWidget *window1; GtkWidget *vbox2; GtkWidget *table1; @@ -121,9 +91,10 @@ GtkWidget *button5; GtkWidget *button6; - window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_container_set_border_width (GTK_CONTAINER (window1), 12); - gtk_window_set_title (GTK_WINDOW (window1), _("Scrobbler Configuration")); + window1 = gtk_alignment_new (12, 12, 0, 0); + +/* gtk_container_set_border_width (GTK_CONTAINER (window1), 12); */ +/* gtk_window_set_title (GTK_WINDOW (window1), _("Scrobbler Configuration")); */ vbox2 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox2); @@ -204,9 +175,6 @@ gtk_container_add (GTK_CONTAINER (hbuttonbox1), button6); GTK_WIDGET_SET_FLAGS (button6, GTK_CAN_DEFAULT); - gtk_signal_connect(GTK_OBJECT(button6), "clicked", - GTK_SIGNAL_FUNC(closewin), GTK_OBJECT(window1)); - /* Store pointers to all widgets, for use by lookup_widget(). */ GLADE_HOOKUP_OBJECT_NO_REF (window1, window1, "window1"); GLADE_HOOKUP_OBJECT (window1, vbox2, "vbox2"); @@ -223,6 +191,20 @@ GLADE_HOOKUP_OBJECT (window1, button5, "button5"); GLADE_HOOKUP_OBJECT (window1, button6, "button6"); + gtk_entry_set_text(GTK_ENTRY(entry1), ""); + gtk_entry_set_text(GTK_ENTRY(entry2), ""); + + if ((db = bmp_cfg_db_open())) { + gchar *username = NULL; + bmp_cfg_db_get_string(db, "audioscrobbler", "username", + &username); + if (username) { + gtk_entry_set_text(GTK_ENTRY(entry1), username); + g_free(username); + } + bmp_cfg_db_close(db); + } + return window1; }