changeset 30903:1bf7346e5d57

media: Added a plugin action menu for the voice and video settings plugin.
author Marcus Lundblad <ml@update.uu.se>
date Tue, 31 Aug 2010 19:38:00 +0000
parents 195d034b6cfe
children bfc08a3c9c21
files ChangeLog pidgin/plugins/vvconfig.c
diffstat 2 files changed, 41 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Aug 31 18:26:04 2010 +0000
+++ b/ChangeLog	Tue Aug 31 19:38:00 2010 +0000
@@ -15,6 +15,8 @@
 	* Remap the "Set User Mood" shortcut to Control-D, which does not
 	  conflict with the previous shortcut for Get Buddy Info on the
 	  selected buddy.
+	* Add a plugin action menu (unter Tools) for the Voice and Video Settings
+	  plugin.
 
 	Finch:
 	* Add support for drop-down account options (like the SILC cipher
--- a/pidgin/plugins/vvconfig.c	Tue Aug 31 18:26:04 2010 +0000
+++ b/pidgin/plugins/vvconfig.c	Tue Aug 31 19:38:00 2010 +0000
@@ -28,6 +28,9 @@
 
 #include <gst/interfaces/propertyprobe.h>
 
+/* container window for showing a stand-alone configurator */
+static GtkWidget *window = NULL;
+
 static PurpleMediaElementInfo *old_video_src = NULL, *old_video_sink = NULL,
 		*old_audio_src = NULL, *old_audio_sink = NULL;
 
@@ -502,6 +505,41 @@
 	return TRUE;
 }
 
+static void
+config_destroy(GtkObject *w, gpointer nul)
+{
+	purple_debug_info("vvconfig", "closing vv configuration window\n");
+	window = NULL;
+}
+
+static void
+show_config(PurplePluginAction *action)
+{
+	if (!window) {
+		GtkWidget *config_frame = get_plugin_config_frame(NULL);
+		window = pidgin_create_window(_("Voice and Video Settings"),
+			PIDGIN_HIG_BORDER, NULL, TRUE);
+		g_signal_connect(G_OBJECT(window), "destroy", 
+			G_CALLBACK(config_destroy), NULL);
+		gtk_container_add(GTK_CONTAINER(window), config_frame);
+	}
+	gtk_window_present(window);
+}
+		
+		
+static GList *
+actions(PurplePlugin *plugin, gpointer context)
+{
+	GList *l = NULL;
+	PurplePluginAction *act = NULL;
+
+	act = purple_plugin_action_new(_("Voice and Video Settings"),
+		show_config);
+	l = g_list_append(l, act);
+
+	return l;
+}
+
 static gboolean
 plugin_unload(PurplePlugin *plugin)
 {
@@ -550,7 +588,7 @@
 	&ui_info,				/**< ui_info		*/
 	NULL,					/**< extra_info		*/
 	NULL,					/**< prefs_info		*/
-	NULL,					/**< actions		*/
+	actions,					/**< actions		*/
 
 	/* padding */
 	NULL,