changeset 30910:89311d2cfce9

propagate from branch 'im.pidgin.cpw.malu.xmpp.google_refactor' (head 9fb0b3c267d95f8e593ed5fb8fcb5fc1bd578630) to branch 'im.pidgin.pidgin' (head d7c7bb3f6eb13f17750ceb5aa22cd2bfe891d2f4)
author Marcus Lundblad <ml@update.uu.se>
date Tue, 31 Aug 2010 20:49:53 +0000
parents 25e200cb3532 (current diff) bfc08a3c9c21 (diff)
children 75460aee9279
files libpurple/protocols/jabber/google.c libpurple/protocols/jabber/google.h
diffstat 2 files changed, 59 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Aug 31 18:28:10 2010 +0000
+++ b/ChangeLog	Tue Aug 31 20:49:53 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:28:10 2010 +0000
+++ b/pidgin/plugins/vvconfig.c	Tue Aug 31 20:49:53 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,59 @@
 	return TRUE;
 }
 
+static void
+config_destroy(GtkObject *w, gpointer nul)
+{
+	purple_debug_info("vvconfig", "closing vv configuration window\n");
+	window = NULL;
+}
+
+static void
+config_close(GtkObject *w, gpointer nul)
+{
+	gtk_widget_destroy(GTK_WIDGET(window));
+}
+
+static void
+show_config(PurplePluginAction *action)
+{
+	if (!window) {
+		GtkWidget *vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER);
+		GtkWidget *hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
+		GtkWidget *config_frame = get_plugin_config_frame(NULL);
+		GtkWidget *close = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
+		
+		gtk_container_add(GTK_CONTAINER(vbox), config_frame);
+		gtk_container_add(GTK_CONTAINER(vbox), hbox);
+		window = pidgin_create_window(_("Voice/Video Settings"),
+			PIDGIN_HIG_BORDER, NULL, TRUE);
+		g_signal_connect(G_OBJECT(window), "destroy", 
+			G_CALLBACK(config_destroy), NULL);
+		g_signal_connect(G_OBJECT(close), "clicked",
+		    G_CALLBACK(config_close), NULL);
+		gtk_box_pack_end(GTK_BOX(hbox), close, FALSE, FALSE, PIDGIN_HIG_BORDER);
+		gtk_container_add(GTK_CONTAINER(window), vbox);
+		gtk_widget_show(GTK_WIDGET(close));
+		gtk_widget_show(GTK_WIDGET(vbox));
+		gtk_widget_show(GTK_WIDGET(hbox));
+	}
+	gtk_window_present(GTK_WINDOW(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 +606,7 @@
 	&ui_info,				/**< ui_info		*/
 	NULL,					/**< extra_info		*/
 	NULL,					/**< prefs_info		*/
-	NULL,					/**< actions		*/
+	actions,					/**< actions		*/
 
 	/* padding */
 	NULL,