| 151 |
151 |
| 152 return hbox; |
152 return hbox; |
| 153 } |
153 } |
| 154 |
154 |
| 155 static void |
155 static void |
| |
156 entry_set(GtkEntry *entry, gpointer data) { |
| |
157 char *key = (char*)data; |
| |
158 |
| |
159 gaim_prefs_set_string(key, gtk_entry_get_text(entry)); |
| |
160 } |
| |
161 |
| |
162 GtkWidget * |
| |
163 gaim_gtk_prefs_labeled_entry(GtkWidget *page, const gchar *title, char *key, |
| |
164 GtkSizeGroup *sg) |
| |
165 { |
| |
166 GtkWidget *hbox, *label, *entry; |
| |
167 const gchar *value; |
| |
168 |
| |
169 value = gaim_prefs_get_string(key); |
| |
170 |
| |
171 hbox = gtk_hbox_new(FALSE, 5); |
| |
172 gtk_box_pack_start(GTK_BOX(page), hbox, FALSE, FALSE, 5); |
| |
173 gtk_widget_show(hbox); |
| |
174 |
| |
175 label = gtk_label_new_with_mnemonic(title); |
| |
176 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
| |
177 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| |
178 gtk_widget_show(label); |
| |
179 |
| |
180 entry = gtk_entry_new(); |
| |
181 gtk_entry_set_text(GTK_ENTRY(entry), value); |
| |
182 gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
| |
183 g_signal_connect(G_OBJECT(entry), "changed", |
| |
184 G_CALLBACK(entry_set), (char*)key); |
| |
185 gtk_widget_show(entry); |
| |
186 |
| |
187 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
| |
188 |
| |
189 if(sg) { |
| |
190 gtk_size_group_add_widget(sg, label); |
| |
191 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
| |
192 } |
| |
193 |
| |
194 gaim_set_accessible_label(entry, label); |
| |
195 |
| |
196 return hbox; |
| |
197 } |
| |
198 |
| |
199 static void |
| 156 dropdown_set(GObject *w, const char *key) |
200 dropdown_set(GObject *w, const char *key) |
| 157 { |
201 { |
| 158 const char *str_value; |
202 const char *str_value; |
| 159 int int_value; |
203 int int_value; |
| 160 GaimPrefType type; |
204 GaimPrefType type; |