| 162 |
162 |
| 163 /****************************************************************************** |
163 /****************************************************************************** |
| 164 * Preference Callbacks |
164 * Preference Callbacks |
| 165 *****************************************************************************/ |
165 *****************************************************************************/ |
| 166 static void |
166 static void |
| 167 pidgin_action_group_show_buddy_icons_callback(const gchar *name, |
|
| 168 PurplePrefType type, |
|
| 169 gconstpointer value, |
|
| 170 gpointer data) |
|
| 171 { |
|
| 172 PidginActionGroup *group = PIDGIN_ACTION_GROUP(data); |
|
| 173 |
|
| 174 pidgin_action_group_bool_pref_handler(group, |
|
| 175 PIDGIN_ACTION_SHOW_BUDDY_ICONS, |
|
| 176 (gboolean)GPOINTER_TO_INT(value)); |
|
| 177 } |
|
| 178 |
|
| 179 static void |
|
| 180 pidgin_action_group_show_empty_groups_callback(const gchar *name, |
167 pidgin_action_group_show_empty_groups_callback(const gchar *name, |
| 181 PurplePrefType type, |
168 PurplePrefType type, |
| 182 gconstpointer value, |
169 gconstpointer value, |
| 183 gpointer data) |
170 gpointer data) |
| 184 { |
171 { |
| 243 |
230 |
| 244 /****************************************************************************** |
231 /****************************************************************************** |
| 245 * Action Callbacks |
232 * Action Callbacks |
| 246 *****************************************************************************/ |
233 *****************************************************************************/ |
| 247 static void |
234 static void |
| 248 pidgin_action_group_show_buddy_icons(GSimpleAction *action, GVariant *value, |
|
| 249 gpointer data) |
|
| 250 { |
|
| 251 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons", |
|
| 252 g_variant_get_boolean(value)); |
|
| 253 } |
|
| 254 |
|
| 255 static void |
|
| 256 pidgin_action_group_show_empty_groups(GSimpleAction *action, GVariant *value, |
235 pidgin_action_group_show_empty_groups(GSimpleAction *action, GVariant *value, |
| 257 gpointer data) |
236 gpointer data) |
| 258 { |
237 { |
| 259 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups", |
238 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups", |
| 260 g_variant_get_boolean(value)); |
239 g_variant_get_boolean(value)); |
| 303 |
282 |
| 304 static void |
283 static void |
| 305 pidgin_action_group_init(PidginActionGroup *group) { |
284 pidgin_action_group_init(PidginActionGroup *group) { |
| 306 GActionEntry entries[] = { |
285 GActionEntry entries[] = { |
| 307 { |
286 { |
| 308 .name = PIDGIN_ACTION_SHOW_BUDDY_ICONS, |
|
| 309 .state = "false", |
|
| 310 .change_state = pidgin_action_group_show_buddy_icons, |
|
| 311 }, { |
|
| 312 .name = PIDGIN_ACTION_SHOW_EMPTY_GROUPS, |
287 .name = PIDGIN_ACTION_SHOW_EMPTY_GROUPS, |
| 313 .state = "false", |
288 .state = "false", |
| 314 .change_state = pidgin_action_group_show_empty_groups, |
289 .change_state = pidgin_action_group_show_empty_groups, |
| 315 }, { |
290 }, { |
| 316 .name = PIDGIN_ACTION_SHOW_IDLE_TIMES, |
291 .name = PIDGIN_ACTION_SHOW_IDLE_TIMES, |
| 336 G_N_ELEMENTS(entries), NULL); |
311 G_N_ELEMENTS(entries), NULL); |
| 337 |
312 |
| 338 /* now add some handlers for preference changes and set actions to the |
313 /* now add some handlers for preference changes and set actions to the |
| 339 * correct value. |
314 * correct value. |
| 340 */ |
315 */ |
| 341 pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_BUDDY_ICONS, |
|
| 342 PIDGIN_PREFS_ROOT "/blist/show_buddy_icons", |
|
| 343 pidgin_action_group_show_buddy_icons_callback); |
|
| 344 pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_EMPTY_GROUPS, |
316 pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_EMPTY_GROUPS, |
| 345 PIDGIN_PREFS_ROOT "/blist/show_empty_groups", |
317 PIDGIN_PREFS_ROOT "/blist/show_empty_groups", |
| 346 pidgin_action_group_show_empty_groups_callback); |
318 pidgin_action_group_show_empty_groups_callback); |
| 347 pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_IDLE_TIMES, |
319 pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_IDLE_TIMES, |
| 348 PIDGIN_PREFS_ROOT "/blist/show_idle_time", |
320 PIDGIN_PREFS_ROOT "/blist/show_idle_time", |