Mercurial > pidgin.yaz
changeset 3565:154c4a9d9b6d
[gaim-migrate @ 3660]
Now you can configure your plugins.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sat, 28 Sep 2002 21:39:45 +0000 |
parents | 83a54877f1ae |
children | 1496be1c345c |
files | plugins/chatlist.c plugins/notify.c plugins/simple.c plugins/spellchk.c src/core.h src/module.c src/prefs.c src/ui.h |
diffstat | 8 files changed, 129 insertions(+), 245 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/chatlist.c Sat Sep 28 17:46:10 2002 +0000 +++ b/plugins/chatlist.c Sat Sep 28 21:39:45 2002 +0000 @@ -293,75 +293,40 @@ parent = NULL; } -void gaim_plugin_config() +GtkWidget *gaim_plugin_config_gtk() { - GtkWidget *vbox; - GtkWidget *frame; - GtkWidget *box; - GtkWidget *table; - GtkWidget *rem_button, *add_button, *ref_button; + GtkWidget *ret, *vbox; GtkWidget *list1, *list2; - GtkWidget *label; GtkWidget *sw1, *sw2; - GtkWidget *item; - GtkWidget *hbox; - GtkWidget *button; - GList *crs = chat_rooms; + GtkWidget *ref_button, *add_button, *rem_button; + GtkWidget *table, *label; + struct chat_room *cr = NULL; GList *items = NULL; - struct chat_room *cr; - - if (parent) { - gtk_widget_show(parent); - return; - } - + GList *crs = chat_rooms; + if (cp) - g_free(cp); - cp = g_new0(struct chat_page, 1); + g_free(cp); + cp = g_new0(struct chat_page, 1); - parent = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_widget_set_usize(parent, 300, 400); - gtk_window_set_title(GTK_WINDOW(parent), "Chat Rooms"); - gtk_window_set_wmclass(GTK_WINDOW(parent), "chatlist", "Gaim"); - gtk_widget_realize(parent); - gtk_signal_connect(GTK_OBJECT(parent), "destroy", - GTK_SIGNAL_FUNC(parent_destroy), NULL); - - vbox = gtk_vbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(parent), vbox); - gtk_widget_show(vbox); - hbox = gtk_hbox_new(FALSE, 0); - gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); - gtk_widget_show(hbox); - - button = picture_button(parent, _("Close"), cancel_xpm); - gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); - gtk_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC(parent_destroy), NULL); + ret = gtk_vbox_new(FALSE, 18); + gtk_container_set_border_width (GTK_CONTAINER (ret), 12); - frame = gtk_frame_new(_("Chat Rooms")); - gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 5); - gtk_widget_show(frame); - - box = gtk_vbox_new(FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(box), 5); - gtk_container_add(GTK_CONTAINER(frame), box); - gtk_widget_show(box); + vbox = make_frame(ret, _("Chat Rooms")); table = gtk_table_new(4, 2, FALSE); gtk_widget_show(table); - gtk_box_pack_start(GTK_BOX(box), table, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0); list1 = gtk_list_new(); list2 = gtk_list_new(); sw1 = gtk_scrolled_window_new(NULL, NULL); sw2 = gtk_scrolled_window_new(NULL, NULL); - ref_button = picture_button(parent, _("Refresh"), refresh_xpm); - add_button = picture_button(parent, _("Add"), gnome_add_xpm); - rem_button = picture_button(parent, _("Remove"), gnome_remove_xpm); + ref_button = picture_button(prefs, _("Refresh"), refresh_xpm); + add_button = picture_button(prefs, _("Add"), gnome_add_xpm); + rem_button = picture_button(prefs, _("Remove"), gnome_remove_xpm); gtk_widget_show(list1); gtk_widget_show(sw1); gtk_widget_show(list2); @@ -370,11 +335,6 @@ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw1), list1); gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), list2); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw1), - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - cp->list1 = list1; cp->list2 = list2; @@ -382,8 +342,6 @@ gtk_signal_connect(GTK_OBJECT(rem_button), "clicked", GTK_SIGNAL_FUNC(remove_chat), cp); gtk_signal_connect(GTK_OBJECT(add_button), "clicked", GTK_SIGNAL_FUNC(add_chat), cp); - - label = gtk_label_new(_("List of available chats")); gtk_widget_show(label); @@ -423,8 +381,8 @@ } gtk_list_append_items(GTK_LIST(list2), items); - - gtk_widget_show(parent); + gtk_widget_show_all(ret); + return ret; } static void handle_signon(struct gaim_connection *gc)
--- a/plugins/notify.c Sat Sep 28 17:46:10 2002 +0000 +++ b/plugins/notify.c Sat Sep 28 21:39:45 2002 +0000 @@ -41,9 +41,7 @@ */ GtkWidget *really_evil_hack; /* GHashTable *hash = NULL; */ -GtkWidget *Dialog = NULL; -GtkWidget *Click, *Focus, *Type, *InFocus; -GtkWidget *String, *Count, *Quote, *Urgent, *Entry; +GtkWidget *Entry; gchar *title_string = "(*) "; /* predefine some functions, less warnings */ @@ -321,51 +319,6 @@ method ^= METHOD_COUNT; } -void setup_buttons() { - if (choice & NOTIFY_FOCUS) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Focus), TRUE); - else - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Click), TRUE); - if (choice & NOTIFY_TYPE) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Type), TRUE); - else - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Type), FALSE); - - if (method & METHOD_STRING) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(String), TRUE); - else - gtk_widget_set_sensitive(Entry, FALSE); - - if (method & METHOD_QUOTE) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Quote), TRUE); - - if (method & METHOD_URGENT) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Urgent), TRUE); - - if (choice & NOTIFY_IN_FOCUS) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(InFocus), TRUE); - - if (method & METHOD_COUNT) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Count), TRUE); - - return; -} - -void close_dialog(GtkWidget *widget, gpointer data) { - gint option = GPOINTER_TO_INT(data); - - if (option > 0) { - title_string = g_strdup(gtk_entry_get_text(GTK_ENTRY(Entry))); - save_notify_prefs(); - } - else if (option < 0) - load_notify_prefs(); - - if (Dialog) - gtk_widget_destroy(Dialog); - Dialog = NULL; -} - char *gaim_plugin_init(GModule *hndl) { handle = hndl; @@ -425,112 +378,57 @@ " where you have not responded to a message yet."; } -void gaim_plugin_config() { - GtkWidget *dialog_vbox; - GtkWidget *button, *label; - GtkWidget *box, *box2, *box3, *box4, *frame; - - if (Dialog) - return; - - /* main config dialog */ - Dialog = gtk_dialog_new(); - gtk_window_set_title(GTK_WINDOW(Dialog), "Notify plugin configuration"); - gtk_window_set_policy(GTK_WINDOW(Dialog), FALSE, FALSE, TRUE); - gtk_signal_connect(GTK_OBJECT(Dialog), "destroy", GTK_SIGNAL_FUNC(close_dialog), GINT_TO_POINTER(-1)); - - dialog_vbox = GTK_DIALOG(Dialog)->vbox; - - /* Ok and Cancel buttons */ - box = gtk_hbox_new(FALSE, 8); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(Dialog)->action_area), box); - - button = gtk_button_new_with_label(_("Cancel")); - gtk_box_pack_end(GTK_BOX(box), button, FALSE, FALSE, 0); - gtk_widget_set_usize(button, 80, -2); - gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(close_dialog), GINT_TO_POINTER(0)); - - button = gtk_button_new_with_label(_("Ok")); - gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0); - gtk_widget_set_usize(button, 80, -2); - gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(close_dialog), GINT_TO_POINTER(1)); - - /* warning label */ - label = gtk_label_new(_("Changes in notification removal options take effect only on new conversation windows")); - gtk_box_pack_start(GTK_BOX(dialog_vbox), label, FALSE, FALSE, 1); +GtkWidget *gaim_plugin_config_gtk() { + GtkWidget *ret; + GtkWidget *vbox, *hbox; + GtkWidget *toggle; + ret = gtk_vbox_new(FALSE, 18); + gtk_container_set_border_width (GTK_CONTAINER (ret), 12); - /* main hbox */ - box = gtk_hbox_new(FALSE, 0); - gtk_box_pack_start(GTK_BOX(dialog_vbox), box, FALSE, FALSE, 0); - - box4 = gtk_vbox_new(FALSE, 0); - gtk_box_pack_start(GTK_BOX(box), box4, FALSE, FALSE, 0); - - /* un-notify choices */ - frame = gtk_frame_new(_("Remove notification when:")); - gtk_box_pack_start(GTK_BOX(box4), frame, FALSE, FALSE, 0); - - box2 = gtk_vbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(frame), box2); - - Focus = gtk_radio_button_new_with_label(NULL, _("Conversation window gains focus.")); - gtk_box_pack_start(GTK_BOX(box2), Focus, FALSE, FALSE, 2); - - Click = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(Focus), _("Conversation window gets clicked.")); - gtk_box_pack_start(GTK_BOX(box2), Click, FALSE, FALSE, 2); - - Type = gtk_check_button_new_with_label(_("Type in conversation window")); - gtk_box_pack_start(GTK_BOX(box2), Type, FALSE, FALSE, 2); - - /* notification method choices */ - /* do I need/want any other notification methods? */ - frame = gtk_frame_new(_("Notification method:")); - gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 0); - - box2 = gtk_vbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(frame), box2); - - box3 = gtk_hbox_new(FALSE, 0); - gtk_box_pack_start(GTK_BOX(box2), box3, FALSE, FALSE, 0); - - String = gtk_check_button_new_with_label(_("Insert string into window title:")); - gtk_box_pack_start(GTK_BOX(box3), String, FALSE, FALSE, 0); - + vbox = make_frame(ret, _("Notification Methods")); + hbox = gtk_hbox_new(FALSE, 18); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + toggle = gtk_check_button_new_with_mnemonic(_("Prepend _string into window title:")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), method & METHOD_STRING); + gtk_signal_connect(GTK_OBJECT(toggle), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(2)); + gtk_box_pack_start(GTK_BOX(hbox), toggle, FALSE, FALSE, 0); Entry = gtk_entry_new_with_max_length(7); - gtk_box_pack_start(GTK_BOX(box3), Entry, FALSE, FALSE, 0); + gtk_widget_set_sensitive(GTK_WIDGET(Entry), method & METHOD_STRING); + gtk_box_pack_start(GTK_BOX(hbox), Entry, FALSE, FALSE, 0); gtk_entry_set_text(GTK_ENTRY(Entry), title_string); - Quote = gtk_check_button_new_with_label(_("Quote window title.")); - gtk_box_pack_start(GTK_BOX(box2), Quote, FALSE, FALSE, 0); - - Urgent = gtk_check_button_new_with_label(_("Send URGENT to window manager.")); - gtk_box_pack_start(GTK_BOX(box2), Urgent, FALSE, FALSE, 0); + toggle = gtk_check_button_new_with_mnemonic(_("_Quote window title.")); + gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), method & METHOD_QUOTE); + gtk_signal_connect(GTK_OBJECT(toggle), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(3)); - label = gtk_label_new(_("Function oddly with tabs:")); - gtk_box_pack_start(GTK_BOX(box2), label, FALSE, FALSE, 0); - - Count = gtk_check_button_new_with_label(_("Insert count of new messages into window title")); - gtk_box_pack_start(GTK_BOX(box2), Count, FALSE, FALSE, 0); - - /* general options */ - frame = gtk_frame_new(_("General Options")); - gtk_box_pack_start(GTK_BOX(box4), frame, FALSE, FALSE, 0); + toggle = gtk_check_button_new_with_mnemonic(_("Set Window Manager \"_URGENT\" Hint")); + gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), method & METHOD_URGENT); + gtk_signal_connect(GTK_OBJECT(toggle), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(4)); + + toggle = gtk_check_button_new_with_mnemonic(_("Insert _count of new messages into window title")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), method & METHOD_COUNT); + gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); + gtk_signal_connect(GTK_OBJECT(toggle), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(6)); - box = gtk_vbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(frame), box); - - InFocus = gtk_check_button_new_with_label(_("Notify even when window is in focus")); - gtk_box_pack_start(GTK_BOX(box), InFocus, FALSE, FALSE, 0); + toggle = gtk_check_button_new_with_mnemonic(_("_Notify even if conversation is in focus.")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), choice & NOTIFY_IN_FOCUS); + gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); + gtk_signal_connect(GTK_OBJECT(toggle), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(5)); - /* setup buttons, then attach signals */ - setup_buttons(); - gtk_signal_connect(GTK_OBJECT(Focus), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(0)); - gtk_signal_connect(GTK_OBJECT(Type), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(1)); - gtk_signal_connect(GTK_OBJECT(String), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(2)); - gtk_signal_connect(GTK_OBJECT(Quote), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(3)); - gtk_signal_connect(GTK_OBJECT(Urgent), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(4)); - gtk_signal_connect(GTK_OBJECT(InFocus), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(5)); - gtk_signal_connect(GTK_OBJECT(Count), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(6)); + /*--------------*/ + vbox = make_frame(ret, _("Notification Removal")); + toggle = gtk_check_button_new_with_mnemonic(_("Remove when conversation window gains _focus.")); + gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), choice & NOTIFY_FOCUS); + gtk_signal_connect(GTK_OBJECT(toggle), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(0)); - gtk_widget_show_all(Dialog); + toggle = gtk_check_button_new_with_mnemonic(_("Remove when _typing in conversation window")); + gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), choice & NOTIFY_TYPE); + gtk_signal_connect(GTK_OBJECT(toggle), "toggled", GTK_SIGNAL_FUNC(options), GINT_TO_POINTER(1)); + + gtk_widget_show_all(ret); + return ret; }
--- a/plugins/simple.c Sat Sep 28 17:46:10 2002 +0000 +++ b/plugins/simple.c Sat Sep 28 21:39:45 2002 +0000 @@ -16,10 +16,6 @@ handle = NULL; } -void gaim_plugin_config() { - printf("configuring plugin.\n"); -} - struct gaim_plugin_description desc; struct gaim_plugin_description *gaim_plugin_desc() { desc.api_version = PLUGIN_API_VERSION;
--- a/plugins/spellchk.c Sat Sep 28 17:46:10 2002 +0000 +++ b/plugins/spellchk.c Sat Sep 28 21:39:45 2002 +0000 @@ -358,22 +358,18 @@ } } -void gaim_plugin_config() { - GtkWidget *win; - GtkWidget *vbox; +GtkWidget *gaim_plugin_config_gtk() { + GtkWidget *ret, *vbox, *win; GtkWidget *hbox; GtkWidget *button; GList *w = words; struct replace_words *r; char *pair[2] = {"Replace", "With"}; + + ret = gtk_vbox_new(FALSE, 18); + gtk_container_set_border_width (GTK_CONTAINER (ret), 12); - if (configwin) return; - GAIM_DIALOG(configwin); - gtk_widget_set_usize(configwin, 450, 250); - gtk_window_set_title(GTK_WINDOW(configwin), "Spell Check Config"); - gtk_signal_connect(GTK_OBJECT(configwin), "destroy", GTK_SIGNAL_FUNC(close_config), NULL); - - vbox = gtk_vbox_new(0, 2); + vbox = make_frame(ret, _("Text Replacements")); gtk_container_set_border_width(GTK_CONTAINER(vbox), 4); gtk_container_add(GTK_CONTAINER(configwin), vbox); gtk_widget_show (vbox); @@ -452,5 +448,6 @@ w = w->next; } - gtk_widget_show(configwin); + gtk_widget_show_all(ret); + return ret; }
--- a/src/core.h Sat Sep 28 17:46:10 2002 +0000 +++ b/src/core.h Sat Sep 28 21:39:45 2002 +0000 @@ -132,6 +132,7 @@ gchar path[128]; struct gaim_plugin_description desc; gchar error[128]; + void *iter; }; #ifdef GAIM_PLUGINS
--- a/src/module.c Sat Sep 28 17:46:10 2002 +0000 +++ b/src/module.c Sat Sep 28 21:39:45 2002 +0000 @@ -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;
--- a/src/prefs.c Sat Sep 28 17:46:10 2002 +0000 +++ b/src/prefs.c Sat Sep 28 21:39:45 2002 +0000 @@ -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 }
--- a/src/ui.h Sat Sep 28 17:46:10 2002 +0000 +++ b/src/ui.h Sat Sep 28 21:39:45 2002 +0000 @@ -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;