Fri, 05 Mar 2021 03:31:29 -0600
Create a PidginAvatar widget.
This does everything the existing code does, but trying to integrate right now
is kind of difficult. The plan is to use this in a new PidginInfoPane I have
started, but that change got very large so I just packed it into the end of
the existing info pane.
The only things that are not implement right now, are making menu items
insensitive and that's because we need to figure out a better want to handle
custom avatars for users.
Testing Done:
Ran locally.
Reviewed at https://reviews.imfreedom.org/r/528/
|
40363
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * pidgin |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * source distribution. |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * This program is free software; you can redistribute it and/or modify |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * it under the terms of the GNU General Public License as published by |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * the Free Software Foundation; either version 2 of the License, or |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * (at your option) any later version. |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * This program is distributed in the hope that it will be useful, |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * GNU General Public License for more details. |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * along with this program; if not, write to the Free Software |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #include "pidginactiongroup.h" |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | |
|
40364
55483ee6710f
Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40363
diff
changeset
|
25 | #include <purple.h> |
|
55483ee6710f
Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40363
diff
changeset
|
26 | |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40444
diff
changeset
|
27 | #include "pidgincore.h" |
|
40363
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | struct _PidginActionGroup { |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | GSimpleActionGroup parent; |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | }; |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | /****************************************************************************** |
|
40366
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
34 | * Helpers |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
35 | *****************************************************************************/ |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
36 | |
|
40368
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
37 | /*< private > |
|
40366
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
38 | * pidgin_action_group_bool_pref_handler: |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
39 | * @group: The #PidginActionGroup instance. |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
40 | * @action_name: The name of the action to update. |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
41 | * @value: The value of the preference. |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
42 | * |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
43 | * Changes the state of the action named @action_name to match @value. |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
44 | * |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
45 | * This function is meant to be called from a #PurplePrefCallback function as |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
46 | * there isn't a good way to have a #PurplePrefCallback with multiple items in |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
47 | * the data parameter without leaking them forever. |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
48 | */ |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
49 | static void |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
50 | pidgin_action_group_bool_pref_handler(PidginActionGroup *group, |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
51 | const gchar *action_name, |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
52 | gboolean value) |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
53 | { |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
54 | GAction *action = NULL; |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
55 | |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
56 | action = g_action_map_lookup_action(G_ACTION_MAP(group), action_name); |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
57 | if(action != NULL) { |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
58 | g_simple_action_set_state(G_SIMPLE_ACTION(action), |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
59 | g_variant_new_boolean(value)); |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
60 | } |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
61 | } |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
62 | |
|
40368
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
63 | /*< private > |
|
40366
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
64 | * pidgin_action_group_setup_bool: |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
65 | * @group: The #PidginActionGroup instance. |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
66 | * @action_name: The name of the action to setup. |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
67 | * @pref_name: The name of the preference that @action_name is tied to. |
|
40388
3f2e9e346f6f
Fix a bunch of stuff that was found in review.
Gary Kramlich <grim@reaperworld.com>
parents:
40385
diff
changeset
|
68 | * @callback: (scope notified): A #PurplePrefCallback to call when the |
|
3f2e9e346f6f
Fix a bunch of stuff that was found in review.
Gary Kramlich <grim@reaperworld.com>
parents:
40385
diff
changeset
|
69 | * preference is changed. |
|
40366
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
70 | * |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
71 | * Initializes the boolean action named @action_name to the value of @pref_name |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
72 | * and setups up a preference change callback to @callback to maintain the |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
73 | * state of the action. |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
74 | */ |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
75 | static void |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
76 | pidgin_action_group_setup_bool(PidginActionGroup *group, |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
77 | const gchar *action_name, |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
78 | const gchar *pref_name, |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
79 | PurplePrefCallback callback) |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
80 | { |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
81 | GAction *action = NULL; |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
82 | gboolean value = FALSE; |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
83 | |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
84 | /* find the action, if we can't find it, bail */ |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
85 | action = g_action_map_lookup_action(G_ACTION_MAP(group), action_name); |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
86 | g_return_if_fail(action != NULL); |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
87 | |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
88 | /* get the value of the preference */ |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
89 | value = purple_prefs_get_bool(pref_name); |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
90 | |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
91 | /* change the state of the action to match the preference value. */ |
|
40367
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
92 | g_simple_action_set_state(G_SIMPLE_ACTION(action), |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
93 | g_variant_new_boolean(value)); |
|
40366
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
94 | |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
95 | /* finally add a preference callback to update the state based on the |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
96 | * preference. |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
97 | */ |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
98 | purple_prefs_connect_callback(group, pref_name, callback, group); |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
99 | } |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
100 | |
|
40368
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
101 | /*< private > |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
102 | * pidgin_action_group_string_pref_handler: |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
103 | * @group: The #PidginActionGroup instance. |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
104 | * @action_name: The name of the action to update. |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
105 | * @value: The value of the preference. |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
106 | * |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
107 | * Changes the state of the action named @action_name to match @value. |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
108 | * |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
109 | * This function is meant to be called from a #PurplePrefCallback function as |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
110 | * there isn't a good way to have a #PurplePrefCallback with multiple items in |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
111 | * the data parameter without leaking them forever. |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
112 | */ |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
113 | static void |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
114 | pidgin_action_group_string_pref_handler(PidginActionGroup *group, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
115 | const gchar *action_name, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
116 | const gchar *value) |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
117 | { |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
118 | GAction *action = NULL; |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
119 | |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
120 | action = g_action_map_lookup_action(G_ACTION_MAP(group), action_name); |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
121 | if(action != NULL) { |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
122 | g_simple_action_set_state(G_SIMPLE_ACTION(action), |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
123 | g_variant_new_string(value)); |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
124 | } |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
125 | } |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
126 | |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
127 | /*< private > |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
128 | * pidgin_action_group_setup_string: |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
129 | * @group: The #PidginActionGroup instance. |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
130 | * @action_name: The name of the action to setup. |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
131 | * @pref_name: The name of the preference that @action_name is tied to. |
|
40388
3f2e9e346f6f
Fix a bunch of stuff that was found in review.
Gary Kramlich <grim@reaperworld.com>
parents:
40385
diff
changeset
|
132 | * @callback: (scope notified): A #PurplePrefCallback to call when the |
|
3f2e9e346f6f
Fix a bunch of stuff that was found in review.
Gary Kramlich <grim@reaperworld.com>
parents:
40385
diff
changeset
|
133 | * preference is changed. |
|
40368
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
134 | * |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
135 | * Initializes the string action named @action_name to the value of @pref_name |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
136 | * and setups up a preference change callback to @callback to maintain the |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
137 | * state of the action. |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
138 | */ |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
139 | static void |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
140 | pidgin_action_group_setup_string(PidginActionGroup *group, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
141 | const gchar *action_name, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
142 | const gchar *pref_name, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
143 | PurplePrefCallback callback) |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
144 | { |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
145 | GAction *action = NULL; |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
146 | const gchar *value = NULL; |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
147 | |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
148 | /* find the action, if we can't find it, bail */ |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
149 | action = g_action_map_lookup_action(G_ACTION_MAP(group), action_name); |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
150 | g_return_if_fail(action != NULL); |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
151 | |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
152 | /* change the state of the action to match the preference value. */ |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
153 | value = purple_prefs_get_string(pref_name); |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
154 | g_simple_action_set_state(G_SIMPLE_ACTION(action), |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
155 | g_variant_new_string(value)); |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
156 | |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
157 | /* finally add a preference callback to update the state based on the |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
158 | * preference. |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
159 | */ |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
160 | purple_prefs_connect_callback(group, pref_name, callback, group); |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
161 | } |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
162 | |
|
40366
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
163 | /****************************************************************************** |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
164 | * Preference Callbacks |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
165 | *****************************************************************************/ |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
166 | static void |
|
40367
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
167 | pidgin_action_group_show_buddy_icons_callback(const gchar *name, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
168 | PurplePrefType type, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
169 | gconstpointer value, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
170 | gpointer data) |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
171 | { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
172 | PidginActionGroup *group = PIDGIN_ACTION_GROUP(data); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
173 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
174 | pidgin_action_group_bool_pref_handler(group, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
175 | PIDGIN_ACTION_SHOW_BUDDY_ICONS, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
176 | (gboolean)GPOINTER_TO_INT(value)); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
177 | } |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
178 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
179 | static void |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
180 | pidgin_action_group_show_empty_groups_callback(const gchar *name, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
181 | PurplePrefType type, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
182 | gconstpointer value, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
183 | gpointer data) |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
184 | { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
185 | PidginActionGroup *group = PIDGIN_ACTION_GROUP(data); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
186 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
187 | pidgin_action_group_bool_pref_handler(group, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
188 | PIDGIN_ACTION_SHOW_EMPTY_GROUPS, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
189 | (gboolean)GPOINTER_TO_INT(value)); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
190 | } |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
191 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
192 | static void |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
193 | pidgin_action_group_show_idle_times_callback(const gchar *name, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
194 | PurplePrefType type, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
195 | gconstpointer value, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
196 | gpointer data) |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
197 | { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
198 | PidginActionGroup *group = PIDGIN_ACTION_GROUP(data); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
199 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
200 | pidgin_action_group_bool_pref_handler(group, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
201 | PIDGIN_ACTION_SHOW_IDLE_TIMES, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
202 | (gboolean)GPOINTER_TO_INT(value)); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
203 | } |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
204 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
205 | static void |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
206 | pidgin_action_group_show_offline_buddies_callback(const gchar *name, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
207 | PurplePrefType type, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
208 | gconstpointer value, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
209 | gpointer data) |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
210 | { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
211 | PidginActionGroup *group = PIDGIN_ACTION_GROUP(data); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
212 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
213 | pidgin_action_group_bool_pref_handler(group, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
214 | PIDGIN_ACTION_SHOW_OFFLINE_BUDDIES, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
215 | (gboolean)GPOINTER_TO_INT(value)); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
216 | } |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
217 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
218 | static void |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
219 | pidgin_action_group_show_protocol_icons_callback(const gchar *name, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
220 | PurplePrefType type, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
221 | gconstpointer value, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
222 | gpointer data) |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
223 | { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
224 | PidginActionGroup *group = PIDGIN_ACTION_GROUP(data); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
225 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
226 | pidgin_action_group_bool_pref_handler(group, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
227 | PIDGIN_ACTION_SHOW_PROTOCOL_ICONS, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
228 | (gboolean)GPOINTER_TO_INT(value)); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
229 | } |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
230 | |
|
40368
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
231 | static void |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
232 | pidgin_action_group_sort_method_callback(const gchar *name, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
233 | PurplePrefType type, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
234 | gconstpointer value, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
235 | gpointer data) |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
236 | { |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
237 | PidginActionGroup *group = PIDGIN_ACTION_GROUP(data); |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
238 | |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
239 | pidgin_action_group_string_pref_handler(group, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
240 | PIDGIN_ACTION_SORT_METHOD, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
241 | value); |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
242 | } |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
243 | |
|
40366
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
244 | /****************************************************************************** |
|
40363
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
245 | * Action Callbacks |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
246 | *****************************************************************************/ |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
247 | static void |
|
40367
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
248 | pidgin_action_group_show_buddy_icons(GSimpleAction *action, GVariant *value, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
249 | gpointer data) |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
250 | { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
251 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
252 | g_variant_get_boolean(value)); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
253 | } |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
254 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
255 | static void |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
256 | pidgin_action_group_show_empty_groups(GSimpleAction *action, GVariant *value, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
257 | gpointer data) |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
258 | { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
259 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
260 | g_variant_get_boolean(value)); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
261 | } |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
262 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
263 | static void |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
264 | pidgin_action_group_show_idle_times(GSimpleAction *action, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
265 | GVariant *value, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
266 | gpointer data) |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
267 | { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
268 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
269 | g_variant_get_boolean(value)); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
270 | } |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
271 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
272 | static void |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
273 | pidgin_action_group_show_offline_buddies(GSimpleAction *action, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
274 | GVariant *value, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
275 | gpointer data) |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
276 | { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
277 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
278 | g_variant_get_boolean(value)); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
279 | } |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
280 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
281 | static void |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
282 | pidgin_action_group_show_protocol_icons(GSimpleAction *action, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
283 | GVariant *value, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
284 | gpointer data) |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
285 | { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
286 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
287 | g_variant_get_boolean(value)); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
288 | } |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
289 | |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
290 | static void |
|
40368
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
291 | pidgin_action_group_sort_method(GSimpleAction *action, GVariant *value, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
292 | gpointer data) |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
293 | { |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
294 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/blist/sort_type", |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
295 | g_variant_get_string(value, NULL)); |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
296 | } |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
297 | |
|
40363
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
298 | /****************************************************************************** |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
299 | * GObject Implementation |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
300 | *****************************************************************************/ |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
301 | G_DEFINE_TYPE(PidginActionGroup, pidgin_action_group, |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
302 | G_TYPE_SIMPLE_ACTION_GROUP) |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
303 | |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
304 | static void |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
305 | pidgin_action_group_init(PidginActionGroup *group) { |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
306 | GActionEntry entries[] = { |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
307 | { |
|
40367
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
308 | .name = PIDGIN_ACTION_SHOW_BUDDY_ICONS, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
309 | .state = "false", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
310 | .change_state = pidgin_action_group_show_buddy_icons, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
311 | }, { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
312 | .name = PIDGIN_ACTION_SHOW_EMPTY_GROUPS, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
313 | .state = "false", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
314 | .change_state = pidgin_action_group_show_empty_groups, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
315 | }, { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
316 | .name = PIDGIN_ACTION_SHOW_IDLE_TIMES, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
317 | .state = "false", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
318 | .change_state = pidgin_action_group_show_idle_times, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
319 | }, { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
320 | .name = PIDGIN_ACTION_SHOW_OFFLINE_BUDDIES, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
321 | .state = "false", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
322 | .change_state = pidgin_action_group_show_offline_buddies, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
323 | }, { |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
324 | .name = PIDGIN_ACTION_SHOW_PROTOCOL_ICONS, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
325 | .state = "false", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
326 | .change_state = pidgin_action_group_show_protocol_icons, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
327 | }, { |
|
40368
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
328 | .name = PIDGIN_ACTION_SORT_METHOD, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
329 | .parameter_type = "s", |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
330 | .state = "'none'", |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
331 | .change_state = pidgin_action_group_sort_method, |
|
40363
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
332 | }, |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
333 | }; |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
334 | |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
335 | g_action_map_add_action_entries(G_ACTION_MAP(group), entries, |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
336 | G_N_ELEMENTS(entries), NULL); |
|
40366
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
337 | |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
338 | /* now add some handlers for preference changes and set actions to the |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
339 | * correct value. |
|
5c78f6c9a36b
Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents:
40364
diff
changeset
|
340 | */ |
|
40367
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
341 | pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_BUDDY_ICONS, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
342 | PIDGIN_PREFS_ROOT "/blist/show_buddy_icons", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
343 | pidgin_action_group_show_buddy_icons_callback); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
344 | pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_EMPTY_GROUPS, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
345 | PIDGIN_PREFS_ROOT "/blist/show_empty_groups", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
346 | pidgin_action_group_show_empty_groups_callback); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
347 | pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_IDLE_TIMES, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
348 | PIDGIN_PREFS_ROOT "/blist/show_idle_time", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
349 | pidgin_action_group_show_idle_times_callback); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
350 | pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_OFFLINE_BUDDIES, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
351 | PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
352 | pidgin_action_group_show_offline_buddies_callback); |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
353 | pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_PROTOCOL_ICONS, |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
354 | PIDGIN_PREFS_ROOT "/blist/show_protocol_icons", |
|
3bd059ab9eb4
Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents:
40366
diff
changeset
|
355 | pidgin_action_group_show_protocol_icons_callback); |
|
40368
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
356 | |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
357 | pidgin_action_group_setup_string(group, PIDGIN_ACTION_SORT_METHOD, |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
358 | PIDGIN_PREFS_ROOT "/blist/sort_type", |
|
cb9a81e8845a
Port the sort-method items to GMenu and GAction and display in the new menubar
Gary Kramlich <grim@reaperworld.com>
parents:
40367
diff
changeset
|
359 | pidgin_action_group_sort_method_callback); |
|
40363
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
360 | }; |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
361 | |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
362 | static void |
|
40370
74c0f140048d
Use the new online and offline signals to manage the state of actions in PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40368
diff
changeset
|
363 | pidgin_action_group_finalize(GObject *obj) { |
|
74c0f140048d
Use the new online and offline signals to manage the state of actions in PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40368
diff
changeset
|
364 | purple_signals_disconnect_by_handle(obj); |
|
74c0f140048d
Use the new online and offline signals to manage the state of actions in PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40368
diff
changeset
|
365 | |
|
74c0f140048d
Use the new online and offline signals to manage the state of actions in PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40368
diff
changeset
|
366 | G_OBJECT_CLASS(pidgin_action_group_parent_class)->finalize(obj); |
|
74c0f140048d
Use the new online and offline signals to manage the state of actions in PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40368
diff
changeset
|
367 | } |
|
74c0f140048d
Use the new online and offline signals to manage the state of actions in PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40368
diff
changeset
|
368 | |
|
74c0f140048d
Use the new online and offline signals to manage the state of actions in PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40368
diff
changeset
|
369 | static void |
|
40363
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
370 | pidgin_action_group_class_init(PidginActionGroupClass *klass) { |
|
40370
74c0f140048d
Use the new online and offline signals to manage the state of actions in PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40368
diff
changeset
|
371 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
74c0f140048d
Use the new online and offline signals to manage the state of actions in PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40368
diff
changeset
|
372 | |
|
74c0f140048d
Use the new online and offline signals to manage the state of actions in PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40368
diff
changeset
|
373 | obj_class->finalize = pidgin_action_group_finalize; |
|
40363
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
374 | } |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
375 | |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
376 | /****************************************************************************** |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
377 | * Public API |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
378 | *****************************************************************************/ |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
379 | GSimpleActionGroup * |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
380 | pidgin_action_group_new(void) { |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
381 | return G_SIMPLE_ACTION_GROUP(g_object_new(PIDGIN_TYPE_ACTION_GROUP, NULL)); |
|
c8b010d1d430
Start to migrate the buddy list from GtkActionEntry and UiManager to GActionEntry and a custom widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
382 | } |
|
40370
74c0f140048d
Use the new online and offline signals to manage the state of actions in PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents:
40368
diff
changeset
|
383 |