comparison src/gtkpluginpref.c @ 9529:803e642650e1

[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 <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 14 Jul 2004 19:13:42 +0000
parents 7024b595b6ae
children 4a15962c344a
comparison
equal deleted inserted replaced
9528:7ca073ddf9b0 9529:803e642650e1
102 pref_label = gaim_plugin_pref_get_label(pref); 102 pref_label = gaim_plugin_pref_get_label(pref);
103 103
104 switch(gaim_plugin_pref_get_type(pref)) { 104 switch(gaim_plugin_pref_get_type(pref)) {
105 case GAIM_PLUGIN_PREF_CHOICE: 105 case GAIM_PLUGIN_PREF_CHOICE:
106 gtk_label = gaim_gtk_prefs_dropdown_from_list(parent, pref_label, 106 gtk_label = gaim_gtk_prefs_dropdown_from_list(parent, pref_label,
107 GAIM_PREF_INT, pref_name, 107 GAIM_PREF_INT, pref_name, gaim_plugin_pref_get_choices(pref));
108 gaim_plugin_pref_get_choices(pref));
109 gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0.5); 108 gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0.5);
110 109
111 if(sg) 110 if(sg)
112 gtk_size_group_add_widget(sg, gtk_label); 111 gtk_size_group_add_widget(sg, gtk_label);
113 112
114 break; 113 break;
115 case GAIM_PLUGIN_PREF_NONE: 114 case GAIM_PLUGIN_PREF_NONE:
116 default: 115 default:
117 gaim_plugin_pref_get_bounds(pref, &min, &max); 116 gaim_plugin_pref_get_bounds(pref, &min, &max);
118 gaim_gtk_prefs_labeled_spin_button(parent, pref_label, 117 gaim_gtk_prefs_labeled_spin_button(parent, pref_label,
119 pref_name, min, max, sg); 118 pref_name, min, max, sg);
120 break; 119 break;
121 } 120 }
122 } 121 }
122
123
124 static void
125 make_info_pref(GtkWidget *parent, GaimPluginPref *pref) {
126 GtkWidget *gtk_label = gtk_label_new(gaim_plugin_pref_get_label(pref));
127 gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0);
128 gtk_label_set_line_wrap(GTK_LABEL(gtk_label), TRUE);
129 gtk_box_pack_start(GTK_BOX(parent), gtk_label, FALSE, FALSE, 0);
130 gtk_widget_show(gtk_label);
131 }
132
123 133
124 GtkWidget * 134 GtkWidget *
125 gaim_gtk_plugin_pref_create_frame(GaimPluginPrefFrame *frame) { 135 gaim_gtk_plugin_pref_create_frame(GaimPluginPrefFrame *frame) {
126 GaimPluginPref *pref; 136 GaimPluginPref *pref;
127 GtkWidget *ret, *parent; 137 GtkWidget *ret, *parent;
147 label = gaim_plugin_pref_get_label(pref); 157 label = gaim_plugin_pref_get_label(pref);
148 158
149 if(name == NULL) { 159 if(name == NULL) {
150 if(label == NULL) 160 if(label == NULL)
151 continue; 161 continue;
152 162
153 parent = gaim_gtk_make_frame(ret, label); 163 if(gaim_plugin_pref_get_type(pref) == GAIM_PLUGIN_PREF_INFO) {
154 gtk_widget_show(parent); 164 make_info_pref(parent, pref);
165 } else {
166 parent = gaim_gtk_make_frame(ret, label);
167 gtk_widget_show(parent);
168 }
155 169
156 continue; 170 continue;
157 } 171 }
158 172
159 switch(gaim_prefs_get_type(name)) { 173 switch(gaim_prefs_get_type(name)) {