From: Sean E. <sea...@us...> - 2002-09-28 21:39:48
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv20036/src Modified Files: core.h module.c prefs.c ui.h Log Message: Now you can configure your plugins. Index: core.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/core.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- core.h 28 Sep 2002 08:08:14 -0000 1.28 +++ core.h 28 Sep 2002 21:39:45 -0000 1.29 @@ -132,6 +132,7 @@ gchar path[128]; struct gaim_plugin_description desc; gchar error[128]; + void *iter; }; #ifdef GAIM_PLUGINS Index: module.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/module.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- module.c 28 Sep 2002 08:08:14 -0000 1.23 +++ module.c 28 Sep 2002 21:39:45 -0000 1.24 @@ -89,10 +89,10 @@ struct gaim_plugin *plug; char userspace[128]; char *probedirs[] = {LIBDIR, &userspace, 0}; + int l; #if GAIM_PLUGINS char *(*gaim_plugin_init)(GModule *); char *(*cfunc)(); - int l; struct gaim_plugin_description *(*desc)(); GModule *handle; #endif @@ -167,9 +167,11 @@ if (!filename || !strlen(filename)) return NULL; +#ifdef USE_PERL if (is_so_file(filename, ".pl")) { return perl_load_file(filename); } +#endif while (filename && p) { plug = (struct gaim_plugin *)p->data; Index: prefs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/prefs.c,v retrieving revision 1.255 retrieving revision 1.256 diff -u -d -r1.255 -r1.256 --- prefs.c 28 Sep 2002 08:08:14 -0000 1.255 +++ prefs.c 28 Sep 2002 21:39:45 -0000 1.256 @@ -90,8 +90,10 @@ static void apply_prefs(); struct debug_window *dw = NULL; -static GtkWidget *prefs = NULL; +GtkWidget *prefs = NULL; GtkWidget *debugbutton = NULL; +static int notebook_page = 0; +static GtkTreeIter plugin_iter; void delete_prefs(GtkWidget *asdf, void *gdsa) { int v; @@ -107,6 +109,7 @@ browser_entry = NULL; debugbutton = NULL; prefs_away_menu = NULL; + notebook_page = 0; if(sounddialog) gtk_widget_destroy(sounddialog); g_object_unref(G_OBJECT(prefs_away_store)); @@ -145,7 +148,7 @@ } -static GtkWidget *make_frame(GtkWidget *ret, char *text) { +GtkWidget *make_frame(GtkWidget *ret, char *text) { GtkWidget *vbox, *label, *hbox; char labeltext[256]; @@ -885,6 +888,8 @@ GtkTreePath *path = gtk_tree_path_new_from_string(pth); struct gaim_plugin *plug; gchar buf[1024]; + GtkWidget *(*config)(); + GdkCursor *wait = gdk_cursor_new (GDK_WATCH); gdk_window_set_cursor(prefs->window, wait); gdk_cursor_unref(wait); @@ -896,7 +901,13 @@ if (plug->type == plugin) #ifdef GAIM_PLUGINS - load_plugin(plug->path); + { + load_plugin(plug->path); + if (g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { + plug->iter = g_new0(GtkTreeIter, 1); + prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); + } + } #else {} #endif @@ -909,7 +920,14 @@ else if (plug->type == plugin) #ifdef GAIM_PLUGINS - unload_plugin(plug); + { + unload_plugin(plug); + if (plug->iter) { + gtk_tree_store_remove(GTK_TREE_STORE(prefstree), plug->iter); + g_free(plug->iter); + plug->iter = NULL; + } + } #else {} #endif @@ -1418,26 +1436,38 @@ } void prefs_notebook_init() { - int a = 0; GtkTreeIter p, c; - prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, a++); - prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, a++); - prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, a++); - prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, a++); - prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, a++); - prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, a++); - prefs_notebook_add_page(_("Chat Window"), NULL, chat_page(), &c, &p, a++); - prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p, a++); - prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, a++); - prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, a++); +#if USE_PLUGINS + GtkWidget *(*config)(); + GList *l = plugins; + struct gaim_plugin *plug; +#endif + prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); + prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); + prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); + prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); + prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); + prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, notebook_page++); + prefs_notebook_add_page(_("Chat Window"), NULL, chat_page(), &c, &p, notebook_page++); + prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p, notebook_page++); + prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); + prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); - prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, a++); - prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, a++); - prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, a++); - prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, a++); - prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, a++); + prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); + prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); + prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); + prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); + prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); #if USE_PLUGINS - prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &p, NULL, a++); + prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); + while (l) { + plug = l->data; + if (plug->type == plugin && g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { + plug->iter = g_new0(GtkTreeIter, 1); + prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); + } + l = l->next; + } #endif } Index: ui.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/ui.h,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- ui.h 26 Sep 2002 15:23:33 -0000 1.58 +++ ui.h 28 Sep 2002 21:39:45 -0000 1.59 @@ -291,6 +291,7 @@ extern GtkWidget *bgcseld; /* Globals in prefs.c */ +extern GtkWidget *prefs; extern struct debug_window *dw; extern GtkWidget *fontseld; @@ -475,6 +476,7 @@ extern void default_away_menu_init(GtkWidget *); extern void build_allow_list(); extern void build_block_list(); +extern GtkWidget *make_frame(GtkWidget *, char *); extern GtkWidget *prefs_away_list; extern GtkWidget *prefs_away_menu; extern GtkWidget *pref_fg_picture; |