Mercurial > audlegacy
changeset 1176:6549a4c58e15 trunk
[svn] - grr
author | nenolod |
---|---|
date | Sun, 11 Jun 2006 20:29:00 -0700 |
parents | d03157b6b5dd |
children | 0c6168fdad36 |
files | ChangeLog Plugins/General/scrobbler/_config.h Plugins/General/scrobbler/config.h Plugins/General/scrobbler/configure.c Plugins/General/scrobbler/xmms_scrobbler.c |
diffstat | 5 files changed, 57 insertions(+), 55 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sun Jun 11 20:11:40 2006 -0700 +++ b/ChangeLog Sun Jun 11 20:29:00 2006 -0700 @@ -1,3 +1,16 @@ +2006-06-12 03:11:40 +0000 William Pitcock <nenolod@nenolod.net> + revision [1260] + prefswin_page_new(): + This commit allows third party plugins to register directly into the preferences panel. + This concept originates from Winamp3/Wasabi.Player (I always thought it was cool, myself, so here it is.) + + + Changes: Modified: + +2 -1 trunk/audacious/Makefile.in + +51 -0 trunk/audacious/prefswin.c + +2 -0 trunk/audacious/prefswin.h + + 2006-06-12 00:28:56 +0000 William Pitcock <nenolod@nenolod.net> revision [1258] - update README a bit
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/General/scrobbler/_config.h Sun Jun 11 20:29:00 2006 -0700 @@ -0,0 +1,14 @@ +#include "../../../config.h" + +#ifndef __SCROBBLER_CONFIG_H__ +#define __SCROBBLER_CONFIG_H__ + +#define DEBUG 0 +#define META_DEBUG 0 +#define SUB_DEBUG 0 +#define CLIENT "Audacious" +#define USER_AGENT "AudioScrobbler/1.1" PACKAGE_NAME "/" PACKAGE_VERSION +#define MAKE_BMP +#define ALLOW_MULTIPLE + +#endif
--- a/Plugins/General/scrobbler/config.h Sun Jun 11 20:11:40 2006 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -#include "../../../config.h" - -#ifndef __SCROBBLER_CONFIG_H__ -#define __SCROBBLER_CONFIG_H__ - -#define DEBUG 0 -#define META_DEBUG 0 -#define SUB_DEBUG 0 -#define CLIENT "Audacious" -#define USER_AGENT "AudioScrobbler/1.1" PACKAGE_NAME "/" PACKAGE_VERSION -#define MAKE_BMP -#define ALLOW_MULTIPLE - -#endif
--- 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; }
--- a/Plugins/General/scrobbler/xmms_scrobbler.c Sun Jun 11 20:11:40 2006 -0700 +++ b/Plugins/General/scrobbler/xmms_scrobbler.c Sun Jun 11 20:29:00 2006 -0700 @@ -1,10 +1,14 @@ +#include <glib.h> +#include <glib/gi18n.h> + +#include <gdk/gdkkeysyms.h> +#include <gtk/gtk.h> + #include <audacious/plugin.h> +#include <audacious/prefswin.h> #include <libaudacious/configdb.h> #include <libaudacious/beepctrl.h> -#include <glib.h> -#include <glib/gi18n.h> - #include <unistd.h> #include <stdio.h> #include <stdlib.h> @@ -45,7 +49,7 @@ NULL, init, about_show, - configure_dialog, + NULL, cleanup }; @@ -55,6 +59,9 @@ ConfigDb *cfgfile; going = 1; GError **moo = NULL; + GtkDialog *cfgdlg = create_cfgdlg(); + + prefswin_page_new(cfgdlg, "Last.FM Client", IMAGES_DIR "audioscrobbler.png"); if ((cfgfile = bmp_cfg_db_open()) != NULL) { bmp_cfg_db_get_string(cfgfile, "audioscrobbler", "username",