Thu, 06 Feb 2014 20:47:29 +0530
Update doc labels for renamed functions
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* pidgin |
| 8713 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8713 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
| 6 | * | |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16254
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 8713 | 20 | */ |
| 21 | #ifdef HAVE_CONFIG_H | |
| 22 | # include <config.h> | |
| 23 | #endif | |
| 24 | ||
| 25 | #include "debug.h" | |
| 26 | #include "internal.h" | |
| 27 | #include "pluginpref.h" | |
| 28 | #include "prefs.h" | |
| 29 | ||
| 30 | #include "gtkpluginpref.h" | |
| 31 | #include "gtkprefs.h" | |
| 32 | #include "gtkutils.h" | |
|
33199
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
33 | #include "gtkwebview.h" |
| 8713 | 34 | |
| 35 | static gboolean | |
| 36 | entry_cb(GtkWidget *entry, gpointer data) { | |
| 37 | char *pref = data; | |
| 38 | ||
| 15884 | 39 | purple_prefs_set_string(pref, gtk_entry_get_text(GTK_ENTRY(entry))); |
| 8713 | 40 | |
| 41 | return FALSE; | |
| 42 | } | |
| 43 | ||
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
44 | |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
45 | static void |
|
33199
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
46 | webview_cb(GtkWebView *webview, gpointer data) |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
47 | { |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
48 | char *pref; |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
49 | char *text; |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
50 | |
|
33199
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
51 | pref = g_object_get_data(G_OBJECT(webview), "pref-key"); |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
52 | g_return_if_fail(pref); |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
53 | |
|
33199
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
54 | text = gtk_webview_get_body_html(webview); |
| 15884 | 55 | purple_prefs_set_string(pref, text); |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
56 | g_free(text); |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
57 | } |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
58 | |
| 8713 | 59 | static void |
| 15884 | 60 | make_string_pref(GtkWidget *parent, PurplePluginPref *pref, GtkSizeGroup *sg) { |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
61 | GtkWidget *box, *gtk_label, *entry; |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
62 | const gchar *pref_name; |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
63 | const gchar *pref_label; |
| 15884 | 64 | PurpleStringFormatType format; |
| 8713 | 65 | |
| 15884 | 66 | pref_name = purple_plugin_pref_get_name(pref); |
| 67 | pref_label = purple_plugin_pref_get_label(pref); | |
| 68 | format = purple_plugin_pref_get_format_type(pref); | |
| 8713 | 69 | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
34274
diff
changeset
|
70 | switch(purple_plugin_pref_get_pref_type(pref)) { |
| 15884 | 71 | case PURPLE_PLUGIN_PREF_CHOICE: |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
72 | gtk_label = pidgin_prefs_dropdown_from_list(parent, pref_label, |
| 15884 | 73 | PURPLE_PREF_STRING, pref_name, |
| 74 | purple_plugin_pref_get_choices(pref)); | |
| 8713 | 75 | gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0.5); |
| 76 | ||
| 77 | if(sg) | |
| 78 | gtk_size_group_add_widget(sg, gtk_label); | |
| 79 | ||
| 80 | break; | |
| 15884 | 81 | case PURPLE_PLUGIN_PREF_NONE: |
| 8713 | 82 | default: |
| 15884 | 83 | if (format == PURPLE_STRING_FORMAT_TYPE_NONE) |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
84 | { |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
85 | entry = gtk_entry_new(); |
| 15884 | 86 | gtk_entry_set_text(GTK_ENTRY(entry), purple_prefs_get_string(pref_name)); |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
87 | gtk_entry_set_max_length(GTK_ENTRY(entry), |
| 15884 | 88 | purple_plugin_pref_get_max_length(pref)); |
| 89 | if (purple_plugin_pref_get_masked(pref)) | |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
90 | { |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
91 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
92 | } |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
93 | g_signal_connect(G_OBJECT(entry), "changed", |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
94 | G_CALLBACK(entry_cb), |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
95 | (gpointer)pref_name); |
|
22139
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
96 | pidgin_add_widget_to_vbox(GTK_BOX(parent), pref_label, sg, entry, TRUE, NULL); |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
97 | } |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
98 | else |
|
11986
21d2ab6421a7
[gaim-migrate @ 14279]
Mark Doliner <markdoliner@pidgin.im>
parents:
11243
diff
changeset
|
99 | { |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
100 | GtkWidget *hbox; |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
101 | GtkWidget *spacer; |
|
33199
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
102 | GtkWidget *webview; |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
103 | GtkWidget *frame; |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
104 | |
|
22139
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
105 | box = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
106 | |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
107 | gtk_widget_show(box); |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
108 | gtk_box_pack_start(GTK_BOX(parent), box, FALSE, FALSE, 0); |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
109 | |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
110 | gtk_label = gtk_label_new_with_mnemonic(pref_label); |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
111 | gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0.5); |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
112 | gtk_widget_show(gtk_label); |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
113 | gtk_box_pack_start(GTK_BOX(box), gtk_label, FALSE, FALSE, 0); |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
114 | |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
115 | if(sg) |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
116 | gtk_size_group_add_widget(sg, gtk_label); |
|
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
20289
diff
changeset
|
117 | |
| 15882 | 118 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
119 | gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
120 | gtk_widget_show(hbox); |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
121 | |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
122 | spacer = gtk_label_new(" "); |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
123 | gtk_box_pack_start(GTK_BOX(hbox), spacer, FALSE, FALSE, 0); |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
124 | gtk_widget_show(spacer); |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
125 | |
|
34274
9169710b5af5
Hide GtkWebViewToolbar stuff within the GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33683
diff
changeset
|
126 | if ((format & PURPLE_STRING_FORMAT_TYPE_HTML) != 0) { |
|
9169710b5af5
Hide GtkWebViewToolbar stuff within the GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33683
diff
changeset
|
127 | frame = pidgin_create_webview(TRUE, &webview, NULL); |
|
9169710b5af5
Hide GtkWebViewToolbar stuff within the GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33683
diff
changeset
|
128 | } else { |
|
9169710b5af5
Hide GtkWebViewToolbar stuff within the GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33683
diff
changeset
|
129 | frame = pidgin_create_webview(FALSE, &webview, NULL); |
|
33252
abcaf61b570d
Disable formatting if the pluginpref doesn't allow HTML.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33199
diff
changeset
|
130 | gtk_webview_set_format_functions(GTK_WEBVIEW(webview), 0); |
|
abcaf61b570d
Disable formatting if the pluginpref doesn't allow HTML.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33199
diff
changeset
|
131 | } |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
132 | |
|
33199
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
133 | if (format & PURPLE_STRING_FORMAT_TYPE_MULTILINE) { |
|
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
134 | gchar *tmp = purple_strreplace(purple_prefs_get_string(pref_name), "\n", "<br>"); |
|
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
135 | gtk_webview_append_html(GTK_WEBVIEW(webview), tmp); |
|
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
136 | g_free(tmp); |
|
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
137 | } else |
|
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
138 | gtk_webview_append_html(GTK_WEBVIEW(webview), purple_prefs_get_string(pref_name)); |
|
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
139 | gtk_label_set_mnemonic_widget(GTK_LABEL(gtk_label), webview); |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11986
diff
changeset
|
140 | gtk_widget_show_all(frame); |
|
33199
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
141 | g_object_set_data(G_OBJECT(webview), "pref-key", (gpointer)pref_name); |
|
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
142 | g_signal_connect(G_OBJECT(webview), "changed", |
|
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
143 | G_CALLBACK(webview_cb), NULL); |
|
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
144 | g_signal_connect(G_OBJECT(webview), "format-toggled", |
|
e82a9f0fa7ec
Convert plugin prefs to GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
145 | G_CALLBACK(webview_cb), NULL); |
| 14937 | 146 | gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 0); |
|
11986
21d2ab6421a7
[gaim-migrate @ 14279]
Mark Doliner <markdoliner@pidgin.im>
parents:
11243
diff
changeset
|
147 | } |
| 8713 | 148 | |
| 149 | break; | |
| 150 | } | |
| 151 | } | |
| 152 | ||
| 153 | static void | |
| 15884 | 154 | make_int_pref(GtkWidget *parent, PurplePluginPref *pref, GtkSizeGroup *sg) { |
| 8713 | 155 | GtkWidget *gtk_label; |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
156 | const gchar *pref_name; |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12794
diff
changeset
|
157 | const gchar *pref_label; |
| 8713 | 158 | gint max, min; |
| 159 | ||
| 15884 | 160 | pref_name = purple_plugin_pref_get_name(pref); |
| 161 | pref_label = purple_plugin_pref_get_label(pref); | |
| 8713 | 162 | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
34274
diff
changeset
|
163 | switch(purple_plugin_pref_get_pref_type(pref)) { |
| 15884 | 164 | case PURPLE_PLUGIN_PREF_CHOICE: |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
165 | gtk_label = pidgin_prefs_dropdown_from_list(parent, pref_label, |
| 15884 | 166 | PURPLE_PREF_INT, pref_name, purple_plugin_pref_get_choices(pref)); |
| 8713 | 167 | gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0.5); |
| 168 | ||
| 169 | if(sg) | |
| 170 | gtk_size_group_add_widget(sg, gtk_label); | |
| 171 | ||
| 172 | break; | |
| 15884 | 173 | case PURPLE_PLUGIN_PREF_NONE: |
| 8713 | 174 | default: |
| 15884 | 175 | purple_plugin_pref_get_bounds(pref, &min, &max); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
176 | pidgin_prefs_labeled_spin_button(parent, pref_label, |
|
9529
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
177 | pref_name, min, max, sg); |
| 8713 | 178 | break; |
| 179 | } | |
| 180 | } | |
| 181 | ||
|
9529
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
182 | |
|
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
183 | static void |
| 15884 | 184 | make_info_pref(GtkWidget *parent, PurplePluginPref *pref) { |
| 185 | GtkWidget *gtk_label = gtk_label_new(purple_plugin_pref_get_label(pref)); | |
|
9529
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
186 | gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0); |
|
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
187 | gtk_label_set_line_wrap(GTK_LABEL(gtk_label), TRUE); |
|
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
188 | gtk_box_pack_start(GTK_BOX(parent), gtk_label, FALSE, FALSE, 0); |
|
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
189 | gtk_widget_show(gtk_label); |
|
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
190 | } |
|
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
191 | |
|
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
192 | |
| 8713 | 193 | GtkWidget * |
| 15884 | 194 | pidgin_plugin_pref_create_frame(PurplePluginPrefFrame *frame) { |
| 8713 | 195 | GtkWidget *ret, *parent; |
| 196 | GtkSizeGroup *sg; | |
| 197 | GList *pp; | |
| 198 | ||
| 199 | g_return_val_if_fail(frame, NULL); | |
| 200 | ||
| 201 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 202 | ||
| 203 | parent = ret = gtk_vbox_new(FALSE, 16); | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33141
diff
changeset
|
204 | #if !GTK_CHECK_VERSION(3,0,0) |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33141
diff
changeset
|
205 | gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33141
diff
changeset
|
206 | #endif |
| 8713 | 207 | gtk_widget_show(ret); |
| 208 | ||
| 15884 | 209 | for(pp = purple_plugin_pref_frame_get_prefs(frame); |
| 8713 | 210 | pp != NULL; |
| 211 | pp = pp->next) | |
| 212 | { | |
| 15884 | 213 | PurplePluginPref *pref = (PurplePluginPref *)pp->data; |
| 8713 | 214 | |
| 15884 | 215 | const char *name = purple_plugin_pref_get_name(pref); |
| 216 | const char *label = purple_plugin_pref_get_label(pref); | |
| 8713 | 217 | |
| 218 | if(name == NULL) { | |
| 219 | if(label == NULL) | |
| 220 | continue; | |
|
9529
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
221 | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
34274
diff
changeset
|
222 | if(purple_plugin_pref_get_pref_type(pref) == PURPLE_PLUGIN_PREF_INFO) { |
|
9529
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
223 | make_info_pref(parent, pref); |
|
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
224 | } else { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
225 | parent = pidgin_make_frame(ret, label); |
|
9529
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
226 | gtk_widget_show(parent); |
|
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
8713
diff
changeset
|
227 | } |
| 8713 | 228 | |
| 229 | continue; | |
| 230 | } | |
| 231 | ||
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
34274
diff
changeset
|
232 | switch(purple_prefs_get_pref_type(name)) { |
| 15884 | 233 | case PURPLE_PREF_BOOLEAN: |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
234 | pidgin_prefs_checkbox(label, name, parent); |
| 8713 | 235 | break; |
| 15884 | 236 | case PURPLE_PREF_INT: |
| 8713 | 237 | make_int_pref(parent, pref, sg); |
| 238 | break; | |
| 15884 | 239 | case PURPLE_PREF_STRING: |
| 8713 | 240 | make_string_pref(parent, pref, sg); |
| 241 | break; | |
| 242 | default: | |
| 243 | break; | |
| 244 | } | |
| 245 | } | |
| 246 | ||
|
20289
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
247 | g_object_unref(sg); |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
248 | |
| 8713 | 249 | return ret; |
| 250 | } |