/dev/twasilczyk/screenshot: 9f1d8958dc60: screencap: disable, wh...

Tomasz Wasilczyk twasilczyk at pidgin.im
Tue Apr 29 14:04:08 EDT 2014


Changeset: 9f1d8958dc60b487104e8bc315ddc8824942787d
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-29 20:03 +0200
Branch:	 default
URL: https://hg.pidgin.im/dev/twasilczyk/screenshot/rev/9f1d8958dc60

Description:

screencap: disable, when prpl doesn't support inline images

diffstat:

 pidgin/plugins/screencap.c |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (39 lines):

diff --git a/pidgin/plugins/screencap.c b/pidgin/plugins/screencap.c
--- a/pidgin/plugins/screencap.c
+++ b/pidgin/plugins/screencap.c
@@ -17,7 +17,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
  */
 
-/* TODO: disable, when prpl doesn't support inline images */
 /* TODO: add "Insert screenshot" to the Conversation window menu */
 /* TODO: add a possibility to change brush color */
 
@@ -636,6 +635,15 @@ scrncap_do_screenshot(GtkAction *action,
  ******************************************************************************/
 
 static void
+scrncap_conversation_update(PidginWebView *webview,
+	PidginWebViewButtons buttons, gpointer _action)
+{
+	GtkAction *action = GTK_ACTION(_action);
+
+	gtk_action_set_sensitive(action, buttons & PIDGIN_WEBVIEW_IMAGE);
+}
+
+static void
 scrncap_conversation_init(PidginConversation *gtkconv)
 {
 	PidginWebView *webview;
@@ -716,6 +724,11 @@ scrncap_conversation_init(PidginConversa
 		pos = 0;
 	}
 
+	g_signal_connect_object(G_OBJECT(webview), "allowed-formats-updated",
+		G_CALLBACK(scrncap_conversation_update), action, 0);
+	scrncap_conversation_update(webview,
+		pidgin_webview_get_format_functions(webview), action);
+
 	scrncap_btn_lean = gtk_action_create_menu_item(action);
 	scrncap_conv_set_data(gtkconv, "scrncap-btn-lean", scrncap_btn_lean);
 	gtk_menu_shell_insert(GTK_MENU_SHELL(wide_menu),



More information about the Commits mailing list