pidgin/pidginactiongroup.c

Tue, 31 Mar 2020 00:59:49 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 31 Mar 2020 00:59:49 -0500
changeset 40370
74c0f140048d
parent 40368
cb9a81e8845a
child 40371
0773c993abd8
permissions
-rw-r--r--

Use the new online and offline signals to manage the state of actions in PidginActionGroup

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
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
27 #include "internal.h"
40364
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
28
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
29 #include "pidgin/gtkaccount.h"
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
30 #include "pidgin/gtkdialogs.h"
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
31 #include "pidgin/gtkpounce.h"
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
32 #include "pidgin/gtkprefs.h"
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
33 #include "pidgin/gtkprivacy.h"
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
34 #include "pidgin/gtkroomlist.h"
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
35 #include "pidgin/gtksmiley-manager.h"
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
36 #include "pidgin/gtkxfer.h"
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
37 #include "pidgin/pidginabout.h"
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
38 #include "pidgin/pidginlog.h"
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
39 #include "pidgin/pidginpluginsdialog.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
40
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
41 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
42 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
43 };
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
44
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
45 /******************************************************************************
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
46 * Globals
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
47 *****************************************************************************/
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
48
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
49 /**< private >
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
50 * online_actions:
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
51 *
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
52 * This list keeps track of which actions should only be enabled while online.
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
53 */
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
54 static const gchar *pidgin_action_group_online_actions[] = {
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
55 PIDGIN_ACTION_NEW_MESSAGE,
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
56 // PIDGIN_ACTION_JOIN_CHAT,
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
57 PIDGIN_ACTION_GET_USER_INFO,
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
58 // PIDGIN_ACTION_ADD_BUDDY,
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
59 // PIDGIN_ACTION_ADD_CHAT,
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
60 PIDGIN_ACTION_ADD_GROUP,
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
61 PIDGIN_ACTION_PRIVACY,
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
62 };
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
63
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
64 /******************************************************************************
40366
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
65 * Helpers
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
66 *****************************************************************************/
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
67
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
68 /*< private >
40366
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
69 * 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
70 * @group: The #PidginActionGroup instance.
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
71 * @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
72 * @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
73 *
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
74 * 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
75 *
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
76 * 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
77 * 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
78 * 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
79 */
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
80 static void
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
81 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
82 const gchar *action_name,
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
83 gboolean value)
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
84 {
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
85 GAction *action = NULL;
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
86
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
87 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
88 if(action != NULL) {
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
89 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
90 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
91 }
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
92 }
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
93
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
94 /*< private >
40366
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
95 * 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
96 * @group: The #PidginActionGroup instance.
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
97 * @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
98 * @pref_name: The name of the preference that @action_name is tied to.
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
99 * @callback: (scope call): A #PurplePrefCallback to call when the preference
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
100 * is changed.
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
101 *
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
102 * 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
103 * 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
104 * state of the action.
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
105 */
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
106 static void
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
107 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
108 const gchar *action_name,
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
109 const gchar *pref_name,
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
110 PurplePrefCallback callback)
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
111 {
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
112 GAction *action = NULL;
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
113 gboolean value = FALSE;
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
114
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
115 /* 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
116 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
117 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
118
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
119 /* 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
120 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
121
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
122 /* 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
123 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
124 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
125
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
126 /* 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
127 * preference.
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
128 */
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
129 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
130 }
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
131
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
132 /*< 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
133 * 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
134 * @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
135 * @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
136 * @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
137 *
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 * 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
139 *
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 * 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
141 * 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
142 * 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
143 */
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 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
145 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
146 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
147 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
148 {
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 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
150
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 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
152 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
153 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
154 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
155 }
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
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 /*< 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
159 * 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
160 * @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
161 * @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
162 * @pref_name: The name of the preference that @action_name is tied to.
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
163 * @callback: (scope call): A #PurplePrefCallback to call when 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
164 * is changed.
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
165 *
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
166 * 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
167 * 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
168 * 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
169 */
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
170 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
171 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
172 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
173 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
174 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
175 {
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
176 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
177 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
178
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
179 /* 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
180 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
181 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
182
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
183 /* 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
184 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
185 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
186 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
187
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
188 /* 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
189 * 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
190 */
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
191 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
192 }
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
193
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
194 /**< private >
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
195 * pidgin_action_group_online_actions_set_enable:
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
196 * @group: The #PidginActionGroup instance.
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
197 * @enabled: %TRUE to enable the actions, %FALSE to disable them.
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
198 *
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
199 * Enables/disables the actions that require being online to use.
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
200 */
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
201 static void
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
202 pidgin_action_group_online_actions_set_enable(PidginActionGroup *group,
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
203 gboolean enabled)
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
204 {
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
205 gint i = 0;
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
206
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
207 for(i = 0; i < G_N_ELEMENTS(pidgin_action_group_online_actions); i++) {
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
208 GAction *action = NULL;
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
209 const gchar *name = pidgin_action_group_online_actions[i];
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
210
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
211 action = g_action_map_lookup_action(G_ACTION_MAP(group), name);
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
212
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
213 if(action != NULL) {
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
214 g_simple_action_set_enabled(G_SIMPLE_ACTION(action), enabled);
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
215 } else {
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
216 g_warning("Failed to find action named %s", name);
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
217 }
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
218 }
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
219 }
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
220
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
221 /******************************************************************************
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
222 * Purple Signal Callbacks
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
223 *****************************************************************************/
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
224 static void
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
225 pidgin_action_group_online_cb(gpointer data) {
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
226 pidgin_action_group_online_actions_set_enable(PIDGIN_ACTION_GROUP(data),
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
227 TRUE);
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
228 }
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
229
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
230 static void
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
231 pidgin_action_group_offline_cb(gpointer data) {
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
232 pidgin_action_group_online_actions_set_enable(PIDGIN_ACTION_GROUP(data),
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
233 TRUE);
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
234 }
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
235
40366
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
236 /******************************************************************************
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
237 * Preference Callbacks
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
238 *****************************************************************************/
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
239 static void
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
240 pidgin_action_group_mute_sounds_callback(const gchar *name,
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
241 PurplePrefType type,
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
242 gconstpointer value,
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
243 gpointer data)
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
244 {
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
245 PidginActionGroup *group = PIDGIN_ACTION_GROUP(data);
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
246
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
247 pidgin_action_group_bool_pref_handler(group, PIDGIN_ACTION_MUTE_SOUNDS,
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
248 (gboolean)GPOINTER_TO_INT(value));
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
249 }
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
250
40367
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
251 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
252 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
253 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
254 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
255 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
256 {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
257 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
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 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
260 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
261 (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
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
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
264 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
265 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
266 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
267 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
268 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
269 {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
270 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
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 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
273 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
274 (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
275 }
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 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
278 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
279 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
280 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
281 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
282 {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
283 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
284
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
285 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
286 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
287 (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
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
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
291 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
292 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
293 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
294 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
295 {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
296 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
297
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
298 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
299 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
300 (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
301 }
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
302
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
303 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
304 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
305 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
306 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
307 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
308 {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
309 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
310
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
311 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
312 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
313 (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
314 }
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
315
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
316 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
317 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
318 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
319 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
320 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
321 {
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
322 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
323
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
324 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
325 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
326 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
327 }
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
40366
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
329 /******************************************************************************
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
330 * 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
331 *****************************************************************************/
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 static void
40364
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
333 pidgin_action_group_about(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
334 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
335 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
336 GtkWidget *about = pidgin_about_dialog_new();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
337
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
338 /* fix me? */
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
339 #if 0
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
340 gtk_window_set_transient_for(GTK_WINDOW(about), GTK_WINDOW(window));
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
341 #endif
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
342
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
343 gtk_widget_show_all(about);
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
344 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
345
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
346 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
347 pidgin_action_group_add_group(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
348 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
349 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
350 purple_blist_request_add_group();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
351 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
352
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
353 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
354 pidgin_action_group_buddy_pounces(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
355 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
356 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
357 pidgin_pounces_manager_show();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
358 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
359
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
360 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
361 pidgin_action_group_custom_smiley(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
362 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
363 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
364 pidgin_smiley_manager_show();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
365 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
366
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
367 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
368 pidgin_action_group_debug(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
369 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
370 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
371 gboolean old = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled");
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
372 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", !old);
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
373 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
374
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
375 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
376 pidgin_action_group_file_transfers(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
377 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
378 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
379 pidgin_xfer_dialog_show(NULL);
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
380 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
381
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
382 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
383 pidgin_action_group_get_user_info(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
384 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
385 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
386 pidgin_dialogs_info();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
387 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
388
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
389 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
390 pidgin_action_group_manage_accounts(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
391 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
392 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
393 pidgin_accounts_window_show();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
394 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
395
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
396 static void
40366
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
397 pidgin_action_group_mute_sounds(GSimpleAction *action, GVariant *value,
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
398 gpointer data)
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
399 {
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
400 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute",
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
401 g_variant_get_boolean(value));
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
402 }
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
403
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
404 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
405 pidgin_action_group_new_message(GSimpleAction *simple, GVariant *parameter,
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
406 gpointer data)
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
407 {
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
408 pidgin_dialogs_im();
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
409 }
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
410
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
411 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
412 pidgin_action_group_online_help(GSimpleAction *simple, GVariant *parameter,
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
413 gpointer data)
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
414 {
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
415 purple_notify_uri(NULL, PURPLE_WEBSITE "documentation");
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
416 }
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
417
40364
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
418 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
419 pidgin_action_group_plugins(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
420 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
421 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
422 GtkWidget *dialog = pidgin_plugins_dialog_new();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
423
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
424 /* fixme? */
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
425 #if 0
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
426 gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window));
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
427 #endif
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
428
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
429 gtk_widget_show_all(dialog);
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
430 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
431
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
432 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
433 pidgin_action_group_preferences(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
434 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
435 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
436 pidgin_prefs_show();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
437 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
438
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
439 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
440 pidgin_action_group_privacy(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
441 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
442 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
443 pidgin_privacy_dialog_show();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
444 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
445
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
446 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
447 pidgin_action_group_quit(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
448 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
449 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
450 purple_core_quit();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
451 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
452
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
453 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
454 pidgin_action_group_room_list(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
455 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
456 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
457 pidgin_roomlist_dialog_show();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
458 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
459
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
460 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
461 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
462 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
463 {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
464 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
465 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
466 }
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
467
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
468 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
469 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
470 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
471 {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
472 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
473 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
474 }
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
475
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
476 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
477 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
478 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
479 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
480 {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
481 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
482 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
483 }
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
484
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
485 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
486 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
487 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
488 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
489 {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
490 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
491 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
492 }
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
493
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
494 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
495 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
496 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
497 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
498 {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
499 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
500 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
501 }
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
502
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
503 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
504 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
505 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
506 {
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
507 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
508 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
509 }
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
510
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
511 static void
40364
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
512 pidgin_action_group_system_log(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
513 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
514 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
515 pidgin_syslog_show();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
516 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
517
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
518 static void
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
519 pidgin_action_group_view_user_log(GSimpleAction *simple, GVariant *parameter,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
520 gpointer data)
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
521 {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
522 pidgin_dialogs_log();
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
523 }
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
524
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
525 /******************************************************************************
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
526 * 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
527 *****************************************************************************/
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
528 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
529 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
530
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
531 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
532 pidgin_action_group_init(PidginActionGroup *group) {
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
533 gpointer connections_handle = NULL;
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
534 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
535 {
40364
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
536 .name = PIDGIN_ACTION_ABOUT,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
537 .activate = pidgin_action_group_about,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
538 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
539 .name = PIDGIN_ACTION_ADD_GROUP,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
540 .activate = pidgin_action_group_add_group,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
541 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
542 .name = PIDGIN_ACTION_BUDDY_POUNCES,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
543 .activate = pidgin_action_group_buddy_pounces,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
544 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
545 .name = PIDGIN_ACTION_CUSTOM_SMILEY,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
546 .activate = pidgin_action_group_custom_smiley,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
547 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
548 .name = PIDGIN_ACTION_DEBUG,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
549 .activate = pidgin_action_group_debug,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
550 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
551 .name = PIDGIN_ACTION_FILE_TRANSFERS,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
552 .activate = pidgin_action_group_file_transfers,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
553 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
554 .name = PIDGIN_ACTION_GET_USER_INFO,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
555 .activate = pidgin_action_group_get_user_info,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
556 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
557 .name = PIDGIN_ACTION_MANAGE_ACCOUNTS,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
558 .activate = pidgin_action_group_manage_accounts,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
559 }, {
40366
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
560 .name = PIDGIN_ACTION_MUTE_SOUNDS,
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
561 .state = "false",
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
562 .change_state = pidgin_action_group_mute_sounds,
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
563 }, {
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
564 .name = PIDGIN_ACTION_NEW_MESSAGE,
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
565 .activate = pidgin_action_group_new_message,
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
566 }, {
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
567 .name = PIDGIN_ACTION_ONLINE_HELP,
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
568 .activate = pidgin_action_group_online_help,
40364
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
569 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
570 .name = PIDGIN_ACTION_PLUGINS,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
571 .activate = pidgin_action_group_plugins,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
572 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
573 .name = PIDGIN_ACTION_PREFERENCES,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
574 .activate = pidgin_action_group_preferences,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
575 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
576 .name = PIDGIN_ACTION_PRIVACY,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
577 .activate = pidgin_action_group_privacy,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
578 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
579 .name = PIDGIN_ACTION_QUIT,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
580 .activate = pidgin_action_group_quit,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
581 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
582 .name = PIDGIN_ACTION_ROOM_LIST,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
583 .activate = pidgin_action_group_room_list,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
584 }, {
40367
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
585 .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
586 .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
587 .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
588 }, {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
589 .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
590 .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
591 .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
592 }, {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
593 .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
594 .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
595 .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
596 }, {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
597 .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
598 .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
599 .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
600 }, {
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
601 .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
602 .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
603 .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
604 }, {
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
605 .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
606 .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
607 .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
608 .change_state = pidgin_action_group_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
609 }, {
40364
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
610 .name = PIDGIN_ACTION_SYSTEM_LOG,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
611 .activate = pidgin_action_group_system_log,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
612 }, {
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
613 .name = PIDGIN_ACTION_VIEW_USER_LOG,
55483ee6710f Migrate the rest of the static menu items to the new PidginActionGroup
Gary Kramlich <grim@reaperworld.com>
parents: 40363
diff changeset
614 .activate = pidgin_action_group_view_user_log,
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
615 },
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
616 };
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
617
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
618 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
619 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
620
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
621 /* 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
622 * correct value.
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
623 */
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
624 pidgin_action_group_setup_bool(group, PIDGIN_ACTION_MUTE_SOUNDS,
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
625 PIDGIN_PREFS_ROOT "/sound/mute",
5c78f6c9a36b Implement mute sounds to prove out the action state code
Gary Kramlich <grim@reaperworld.com>
parents: 40364
diff changeset
626 pidgin_action_group_mute_sounds_callback);
40367
3bd059ab9eb4 Finish porting the rest of the toggle actions to the new menubar widget
Gary Kramlich <grim@reaperworld.com>
parents: 40366
diff changeset
627 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
628 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
629 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
630 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
631 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
632 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
633 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
634 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
635 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
636 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
637 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
638 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
639 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
640 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
641 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
642
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
643 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
644 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
645 pidgin_action_group_sort_method_callback);
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
646
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
647 /* assume we are offline and disable all of the actions that require us to
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
648 * be online.
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
649 */
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
650 pidgin_action_group_online_actions_set_enable(group, FALSE);
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
651
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
652 /* connect to the online and offline signals in purple connections. This
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
653 * is used to toggle states of actions that require being online.
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
654 */
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
655 connections_handle = purple_connections_get_handle();
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
656 purple_signal_connect(connections_handle, "online", group,
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
657 PURPLE_CALLBACK(pidgin_action_group_online_cb),
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
658 group);
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
659 purple_signal_connect(connections_handle, "offline", group,
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
660 PURPLE_CALLBACK(pidgin_action_group_offline_cb),
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
661 group);
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
662 };
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
663
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
664 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
665 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
666 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
667
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
668 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
669 }
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
670
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
671 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
672 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
673 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
674
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
675 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
676 }
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
677
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
678 /******************************************************************************
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
679 * 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
680 *****************************************************************************/
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
681 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
682 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
683 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
684 }
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
685

mercurial