| 213 pidgin_plugins_menu_remove_plugin_actions(PIDGIN_PLUGINS_MENU(data), |
211 pidgin_plugins_menu_remove_plugin_actions(PIDGIN_PLUGINS_MENU(data), |
| 214 plugin); |
212 plugin); |
| 215 } |
213 } |
| 216 |
214 |
| 217 /****************************************************************************** |
215 /****************************************************************************** |
| 218 * Static Actions |
|
| 219 *****************************************************************************/ |
|
| 220 static void |
|
| 221 pidgin_plugins_menu_show_manager(GSimpleAction *action, GVariant *parameter, |
|
| 222 gpointer data) |
|
| 223 { |
|
| 224 GtkWidget *dialog = pidgin_plugins_dialog_new(); |
|
| 225 |
|
| 226 /* fixme? */ |
|
| 227 #if 0 |
|
| 228 gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window)); |
|
| 229 #endif |
|
| 230 |
|
| 231 gtk_widget_show_all(dialog); |
|
| 232 } |
|
| 233 |
|
| 234 /****************************************************************************** |
|
| 235 * GObject Implementation |
216 * GObject Implementation |
| 236 *****************************************************************************/ |
217 *****************************************************************************/ |
| 237 G_DEFINE_TYPE(PidginPluginsMenu, pidgin_plugins_menu, GTK_TYPE_MENU) |
218 G_DEFINE_TYPE(PidginPluginsMenu, pidgin_plugins_menu, GTK_TYPE_MENU) |
| 238 |
219 |
| 239 static void |
220 static void |
| 240 pidgin_plugins_menu_init(PidginPluginsMenu *menu) { |
221 pidgin_plugins_menu_init(PidginPluginsMenu *menu) { |
| 241 GActionEntry actions[] = { |
|
| 242 { |
|
| 243 .name = "manager", |
|
| 244 .activate = pidgin_plugins_menu_show_manager, |
|
| 245 } |
|
| 246 }; |
|
| 247 gpointer handle; |
222 gpointer handle; |
| 248 |
223 |
| 249 /* initialize our template */ |
224 /* initialize our template */ |
| 250 gtk_widget_init_template(GTK_WIDGET(menu)); |
225 gtk_widget_init_template(GTK_WIDGET(menu)); |
| 251 |
226 |
| 252 /* create our internal action group and assign it to ourself */ |
227 /* create our internal action group and assign it to ourself */ |
| 253 menu->action_group = g_simple_action_group_new(); |
228 menu->action_group = g_simple_action_group_new(); |
| 254 g_action_map_add_action_entries(G_ACTION_MAP(menu->action_group), actions, |
|
| 255 G_N_ELEMENTS(actions), NULL); |
|
| 256 gtk_widget_insert_action_group(GTK_WIDGET(menu), |
229 gtk_widget_insert_action_group(GTK_WIDGET(menu), |
| 257 PIDGIN_PLUGINS_MENU_ACTION_PREFIX, |
230 PIDGIN_PLUGINS_MENU_ACTION_PREFIX, |
| 258 G_ACTION_GROUP(menu->action_group)); |
231 G_ACTION_GROUP(menu->action_group)); |
| 259 |
232 |
| 260 /* create our storage for the items */ |
233 /* create our storage for the items */ |