# HG changeset patch # User Luke Schierer # Date 1089832422 0 # Node ID 803e642650e1c0f46b2727f1bb02d0dac9309dab # Parent 7ca073ddf9b054ed43f0893b108bf690a336da0e [gaim-migrate @ 10356] " This patch adds support for a plugin preference representing informative text, such as a short statement regarding an option or elaborating on the available choices." --Christopher (siege) O'Brien (14:55:43) rw_grim: oh yeah, i checked out siege's patch for plugin prefs.. looks good to me.. i didn't actually test it.. but it's nothing major.. committer: Tailor Script diff -r 7ca073ddf9b0 -r 803e642650e1 src/gtkpluginpref.c --- a/src/gtkpluginpref.c Wed Jul 14 19:11:07 2004 +0000 +++ b/src/gtkpluginpref.c Wed Jul 14 19:13:42 2004 +0000 @@ -104,8 +104,7 @@ switch(gaim_plugin_pref_get_type(pref)) { case GAIM_PLUGIN_PREF_CHOICE: gtk_label = gaim_gtk_prefs_dropdown_from_list(parent, pref_label, - GAIM_PREF_INT, pref_name, - gaim_plugin_pref_get_choices(pref)); + GAIM_PREF_INT, pref_name, gaim_plugin_pref_get_choices(pref)); gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0.5); if(sg) @@ -116,11 +115,22 @@ default: gaim_plugin_pref_get_bounds(pref, &min, &max); gaim_gtk_prefs_labeled_spin_button(parent, pref_label, - pref_name, min, max, sg); + pref_name, min, max, sg); break; } } + +static void +make_info_pref(GtkWidget *parent, GaimPluginPref *pref) { + GtkWidget *gtk_label = gtk_label_new(gaim_plugin_pref_get_label(pref)); + gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0); + gtk_label_set_line_wrap(GTK_LABEL(gtk_label), TRUE); + gtk_box_pack_start(GTK_BOX(parent), gtk_label, FALSE, FALSE, 0); + gtk_widget_show(gtk_label); +} + + GtkWidget * gaim_gtk_plugin_pref_create_frame(GaimPluginPrefFrame *frame) { GaimPluginPref *pref; @@ -149,9 +159,13 @@ if(name == NULL) { if(label == NULL) continue; - - parent = gaim_gtk_make_frame(ret, label); - gtk_widget_show(parent); + + if(gaim_plugin_pref_get_type(pref) == GAIM_PLUGIN_PREF_INFO) { + make_info_pref(parent, pref); + } else { + parent = gaim_gtk_make_frame(ret, label); + gtk_widget_show(parent); + } continue; } diff -r 7ca073ddf9b0 -r 803e642650e1 src/pluginpref.h --- a/src/pluginpref.h Wed Jul 14 19:11:07 2004 +0000 +++ b/src/pluginpref.h Wed Jul 14 19:13:42 2004 +0000 @@ -31,7 +31,8 @@ typedef enum { GAIM_PLUGIN_PREF_NONE, - GAIM_PLUGIN_PREF_CHOICE + GAIM_PLUGIN_PREF_CHOICE, + GAIM_PLUGIN_PREF_INFO, /**< no-value label */ } GaimPluginPrefType; #include