* [gentoo-commits] dev/nirbheek:master commit in: gnome-extra/gnome-utils/files/, gnome-extra/gnome-utils/
@ 2012-02-18 14:43 Nirbheek Chauhan
0 siblings, 0 replies; 4+ messages in thread
From: Nirbheek Chauhan @ 2012-02-18 14:43 UTC (permalink / raw
To: gentoo-commits
commit: d40e38a7fc4a5e4531bfa0acf638e570a2d70f48
Author: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 18 14:43:00 2012 +0000
Commit: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
CommitDate: Sat Feb 18 14:43:00 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/nirbheek.git;a=commit;h=d40e38a7
gnome-extra/gnome-utils: add a patch to upload screenshots to imgur
---
| 3 +
...eature-uploading-screenshots-to-imgur.com.patch | 398 ++++++++++++++++++++
| 76 ++++
3 files changed, 477 insertions(+), 0 deletions(-)
--git a/gnome-extra/gnome-utils/Manifest b/gnome-extra/gnome-utils/Manifest
new file mode 100644
index 0000000..da0096c
--- /dev/null
+++ b/gnome-extra/gnome-utils/Manifest
@@ -0,0 +1,3 @@
+AUX 0001-New-feature-uploading-screenshots-to-imgur.com.patch 13173 RMD160 0fbbce42e9d3c95ac57be4fb41e4b866c9321e11 SHA1 9a9a309b08a7ac5e2b6fabcfb62153bf2e43e4e3 SHA256 0b0ac89f3cc8cd5cfde6686b0f51ee6d922ed6d48ad9ea3fd709b3a2e706f01f
+DIST gnome-utils-3.2.1.tar.xz 7273572 RMD160 a0e34b7057c0b77b58f7310ec8a8a3af238071bd SHA1 2f837a420ea73ad1a1cab56656b450e704f2faab SHA256 3ac1942dbf4d9d394e2fcc5f30a4480b1b1e5d44ee0c2d4f61689f4a221ba328
+EBUILD gnome-utils-3.2.1.ebuild 2095 RMD160 20f9254a7db4e63e6e79fe8c5480d51c99d3d11b SHA1 ba6c630ddb8552e976234c371bd7060c5bf3b466 SHA256 7ae9c7a83af42c259f3f81c8415e763dca9d0804caaa06babeb87ed0645be934
diff --git a/gnome-extra/gnome-utils/files/0001-New-feature-uploading-screenshots-to-imgur.com.patch b/gnome-extra/gnome-utils/files/0001-New-feature-uploading-screenshots-to-imgur.com.patch
new file mode 100644
index 0000000..7fb0ec7
--- /dev/null
+++ b/gnome-extra/gnome-utils/files/0001-New-feature-uploading-screenshots-to-imgur.com.patch
@@ -0,0 +1,398 @@
+From 2cc75e214336b858a6e634bb109592dc712f9cd7 Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek@gentoo.org>
+Date: Sat, 18 Feb 2012 20:03:53 +0530
+Subject: [PATCH] New feature: uploading screenshots to imgur.com
+
+---
+ configure.ac | 9 ++
+ gnome-screenshot/Makefile.am | 6 ++
+ gnome-screenshot/gnome-screenshot.c | 12 +++
+ gnome-screenshot/gnome-screenshot.ui | 18 ++++
+ gnome-screenshot/screenshot-dialog.c | 11 ---
+ gnome-screenshot/screenshot-dialog.h | 12 +++
+ gnome-screenshot/screenshot-share.c | 155 ++++++++++++++++++++++++++++++++++
+ gnome-screenshot/screenshot-share.h | 32 +++++++
+ 8 files changed, 244 insertions(+), 11 deletions(-)
+ create mode 100644 gnome-screenshot/screenshot-share.c
+ create mode 100644 gnome-screenshot/screenshot-share.h
+
+diff --git a/configure.ac b/configure.ac
+index d75bbe2..93b54f0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -142,6 +142,15 @@ AS_IF([test "x$GCONFTOOL" = "xno"],
+ [AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])]
+ )
+
++# gnome-screenshot checks
++PKG_CHECK_MODULES([LIBSOUP], [libsoup-2.4])
++AC_SUBST(LIBSOUP_CFLAGS)
++AC_SUBST(LIBSOUP_LIBS)
++
++PKG_CHECK_MODULES([JSON_GLIB], [json-glib-1.0 >= 0.14])
++AC_SUBST(JSON_GLIB_CFLAGS)
++AC_SUBST(JSON_GLIB_LIBS)
++
+ # Baobab checks
+ PKG_CHECK_MODULES([LIBGTOP], [libgtop-2.0 >= $LIBGTOP_REQUIRED])
+ AC_SUBST(LIBGTOP_CFLAGS)
+diff --git a/gnome-screenshot/Makefile.am b/gnome-screenshot/Makefile.am
+index d9a11c7..3be0074 100644
+--- a/gnome-screenshot/Makefile.am
++++ b/gnome-screenshot/Makefile.am
+@@ -28,6 +28,8 @@ gnome_screenshot_SOURCES = \
+ screenshot-interactive-dialog.h \
+ screenshot-shadow.c \
+ screenshot-shadow.h \
++ screenshot-share.c \
++ screenshot-share.h \
+ screenshot-utils.c \
+ screenshot-utils.h \
+ $(NULL)
+@@ -36,6 +38,8 @@ gnome_screenshot_CFLAGS = \
+ $(GLIB_CFLAGS) \
+ $(GIO_CFLAGS) \
+ $(LIBCANBERRA_GTK_CFLAGS) \
++ $(LIBSOUP_CFLAGS) \
++ $(JSON_GLIB_CFLAGS) \
+ $(GTHREAD_CFLAGS) \
+ $(GTK_CFLAGS) \
+ $(NULL)
+@@ -47,6 +51,8 @@ gnome_screenshot_LDADD = \
+ $(GLIB_LIBS) \
+ $(GIO_LIBS) \
+ $(LIBCANBERRA_GTK_LIBS) \
++ $(LIBSOUP_LIBS) \
++ $(JSON_GLIB_LIBS) \
+ $(GTHREAD_LIBS) \
+ $(GTK_LIBS) \
+ -lm \
+diff --git a/gnome-screenshot/gnome-screenshot.c b/gnome-screenshot/gnome-screenshot.c
+index 3390914..714b2d1 100644
+--- a/gnome-screenshot/gnome-screenshot.c
++++ b/gnome-screenshot/gnome-screenshot.c
+@@ -1,4 +1,5 @@
+ /* gnome-screenshot.c - Take a screenshot of the desktop
++ * vim: set sts=2 sw=2 et :
+ *
+ * Copyright (C) 2001 Jonathan Blandford <jrb@alum.mit.edu>
+ * Copyright (C) 2006 Emmanuele Bassi <ebassi@gnome.org>
+@@ -47,6 +48,7 @@
+ #include "screenshot-filename-builder.h"
+ #include "screenshot-interactive-dialog.h"
+ #include "screenshot-shadow.h"
++#include "screenshot-share.h"
+ #include "screenshot-utils.h"
+ #include "screenshot-dialog.h"
+ #include "cheese-flash.h"
+@@ -260,6 +262,13 @@ screenshot_save_to_clipboard (void)
+ }
+
+ static void
++screenshot_upload (ScreenshotDialog *dialog)
++{
++ /* TODO: Add libsocialweb support and convert 'upload' to 'share' everywhere */
++ screenshot_upload_imgur (dialog);
++}
++
++static void
+ screenshot_dialog_response_cb (GtkDialog *d,
+ gint response_id,
+ ScreenshotDialog *dialog)
+@@ -275,6 +284,9 @@ screenshot_dialog_response_cb (GtkDialog *d,
+ case SCREENSHOT_RESPONSE_COPY:
+ screenshot_save_to_clipboard ();
+ break;
++ case SCREENSHOT_RESPONSE_UPLOAD:
++ screenshot_upload (dialog);
++ break;
+ default:
+ gtk_widget_destroy (GTK_WIDGET (d));
+ gtk_main_quit ();
+diff --git a/gnome-screenshot/gnome-screenshot.ui b/gnome-screenshot/gnome-screenshot.ui
+index 62f1265..6ce9612 100644
+--- a/gnome-screenshot/gnome-screenshot.ui
++++ b/gnome-screenshot/gnome-screenshot.ui
+@@ -42,6 +42,23 @@
+ </packing>
+ </child>
+ <child>
++ <object class="GtkButton" id="upload_button">
++ <property name="visible">True</property>
++ <property name="can_default">True</property>
++ <property name="can_focus">True</property>
++ <property name="use_underline">True</property>
++ <property name="label" translatable="yes">_Upload</property>
++ <property name="relief">GTK_RELIEF_NORMAL</property>
++ <property name="focus_on_click">True</property>
++ </object>
++ <packing>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ <property name="position">1</property>
++ <property name="secondary">True</property>
++ </packing>
++ </child>
++ <child>
+ <object class="GtkButton" id="cancel_button">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+@@ -241,6 +258,7 @@
+ <action-widget response="-6">cancel_button</action-widget>
+ <action-widget response="-5">ok_button</action-widget>
+ <action-widget response="1">copy_button</action-widget>
++ <action-widget response="2">upload_button</action-widget>
+ </action-widgets>
+ </object>
+ </interface>
+diff --git a/gnome-screenshot/screenshot-dialog.c b/gnome-screenshot/screenshot-dialog.c
+index d6d954d..6cb8bba 100644
+--- a/gnome-screenshot/screenshot-dialog.c
++++ b/gnome-screenshot/screenshot-dialog.c
+@@ -36,17 +36,6 @@ static GtkTargetEntry drag_types[] =
+ { "image/png", 0, TYPE_IMAGE_PNG },
+ };
+
+-struct ScreenshotDialog
+-{
+- GtkBuilder *ui;
+- GdkPixbuf *screenshot;
+- GdkPixbuf *preview_image;
+- GtkWidget *save_widget;
+- GtkWidget *filename_entry;
+- gint drag_x;
+- gint drag_y;
+-};
+-
+ static void
+ on_preview_draw (GtkWidget *drawing_area,
+ cairo_t *cr,
+diff --git a/gnome-screenshot/screenshot-dialog.h b/gnome-screenshot/screenshot-dialog.h
+index 7741198..8f2cff7 100644
+--- a/gnome-screenshot/screenshot-dialog.h
++++ b/gnome-screenshot/screenshot-dialog.h
+@@ -22,10 +22,22 @@
+
+ #include <gtk/gtk.h>
+
++struct ScreenshotDialog
++{
++ GtkBuilder *ui;
++ GdkPixbuf *screenshot;
++ GdkPixbuf *preview_image;
++ GtkWidget *save_widget;
++ GtkWidget *filename_entry;
++ gint drag_x;
++ gint drag_y;
++};
++
+ typedef struct ScreenshotDialog ScreenshotDialog;
+
+ /* Keep in sync with the value defined in the UI file */
+ #define SCREENSHOT_RESPONSE_COPY 1
++#define SCREENSHOT_RESPONSE_UPLOAD 2
+
+ ScreenshotDialog *screenshot_dialog_new (GdkPixbuf *screenshot,
+ char *initial_uri);
+diff --git a/gnome-screenshot/screenshot-share.c b/gnome-screenshot/screenshot-share.c
+new file mode 100644
+index 0000000..2442cfa
+--- /dev/null
++++ b/gnome-screenshot/screenshot-share.c
+@@ -0,0 +1,155 @@
++/* screenshot-share.c - online screenshot sharing
++ * vim: set sts=2 sw=2 et :
++ *
++ * Copyright (C) 2012 Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public
++ * License along with this program; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ */
++
++#include <glib.h>
++#include <gtk/gtk.h>
++#include <libsoup/soup.h>
++#include <json-glib/json-glib.h>
++#include <gdk-pixbuf/gdk-pixbuf.h>
++
++#include "gnome-screenshot.h"
++#include "screenshot-share.h"
++#include "screenshot-dialog.h"
++
++#define IMGUR_API_KEY "b3625162d3418ac51a9ee805b1840452"
++#define IMGUR_UPLOAD_URI "http://api.imgur.com/1/upload.json"
++
++static void imgur_response_cb (SoupSession *session,
++ SoupMessage *msg,
++ gpointer user_data);
++
++static void imgur_wrote_data_cb (SoupMessage *msg,
++ SoupBuffer *chunk,
++ gpointer user_data);
++
++static void screenshot_display_uris (gchar *image_uri,
++ gchar *delete_uri);
++
++
++void
++screenshot_upload_imgur (ScreenshotDialog *dialog)
++{
++ GtkButton *button;
++ SoupSession *session;
++ SoupMessage *msg;
++ gchar *temp;
++ gchar *image_data;
++ gsize image_size;
++ GError *tmp_error;
++
++ tmp_error = NULL;
++ if (!gdk_pixbuf_save_to_buffer (GDK_PIXBUF (dialog->screenshot),
++ &image_data, &image_size,
++ "png", &tmp_error, NULL))
++ goto out;
++
++ button = GTK_BUTTON (gtk_builder_get_object (dialog->ui, "upload_button"));
++
++ temp = g_base64_encode (image_data, image_size);
++ session = soup_session_async_new ();
++ msg = soup_form_request_new (SOUP_METHOD_POST, IMGUR_UPLOAD_URI,
++ "key", IMGUR_API_KEY,
++ "image", temp, NULL);
++ g_signal_connect (msg, "wrote-body-data",
++ G_CALLBACK (imgur_wrote_data_cb),
++ (gpointer)button);
++ soup_session_queue_message (session, msg, imgur_response_cb, NULL);
++ g_free (temp);
++
++out:
++ g_free (image_data);
++}
++
++static void
++imgur_response_cb (SoupSession *session,
++ SoupMessage *msg,
++ gpointer user_data)
++{
++ JsonParser *parser = NULL;
++ JsonNode *node = NULL;
++ GMainLoop *loop;
++ GError *error = NULL;
++ gchar *response;
++ gchar *image_uri;
++ gchar *delete_uri;
++
++ response = g_strdup (msg->response_body->data);
++ if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) {
++ g_debug ("Got an error from imgur:\n%s\n", response);
++ goto out;
++ }
++
++ parser = json_parser_new ();
++ json_parser_load_from_data (parser, response, -1, &error);
++ if (error)
++ goto out;
++
++ node = json_path_query ("$.rsp.image.imgur_page", json_parser_get_root (parser), &error);
++ if (!node || error)
++ goto out;
++ image_uri = json_node_dup_string (json_array_get_element (json_node_get_array (node), 0));
++ json_node_free (node);
++
++ node = json_path_query ("$.rsp.image.delete_page", json_parser_get_root (parser), &error);
++ if (!node || error)
++ goto out;
++ delete_uri = json_node_dup_string (json_array_get_element (json_node_get_array (node), 0));
++ json_node_free (node);
++
++ screenshot_display_uris (image_uri, delete_uri);
++ g_free (image_uri);
++ g_free (delete_uri);
++
++out:
++ if (error)
++ g_error_free (error);
++ g_free (response);
++ g_object_unref (parser);
++}
++
++static void
++imgur_wrote_data_cb (SoupMessage *msg,
++ SoupBuffer *chunk,
++ gpointer user_data)
++{
++ gchar *upload_percent;
++ static int total_sent;
++ int percent;
++
++ total_sent += (float) chunk->length;
++ percent = (int)nearbyint(100*((float)total_sent) / msg->request_body->length);
++ upload_percent = g_strdup_printf ("Uploading... %i%%", percent);
++
++ gtk_button_set_label (GTK_BUTTON (user_data), upload_percent);
++
++ /* Upload finished? Reset the counter. */
++ if (total_sent == msg->request_body->length)
++ total_sent = 0;
++
++ g_free (upload_percent);
++}
++
++static void
++screenshot_display_uris (gchar *image_uri,
++ gchar *delete_uri)
++{
++ g_app_info_launch_default_for_uri (image_uri, NULL, NULL);
++ g_app_info_launch_default_for_uri (delete_uri, NULL, NULL);
++}
+diff --git a/gnome-screenshot/screenshot-share.h b/gnome-screenshot/screenshot-share.h
+new file mode 100644
+index 0000000..6d39220
+--- /dev/null
++++ b/gnome-screenshot/screenshot-share.h
+@@ -0,0 +1,32 @@
++/* screenshot-share.h - online screenshot sharing
++ * vim: set sts=2 sw=2 et :
++ *
++ * Copyright (C) 2012 Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public
++ * License along with this program; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ */
++
++#ifndef __SCREENSHOT_SHARE_H__
++#define __SCREENSHOT_SHARE_H__
++
++#include "screenshot-dialog.h"
++
++G_BEGIN_DECLS
++
++void screenshot_upload_imgur (ScreenshotDialog *dialog);
++
++G_END_DECLS
++
++#endif /* __SCREENSHOT_SHARE_H__ */
+--
+1.7.3.4
+
--git a/gnome-extra/gnome-utils/gnome-utils-3.2.1.ebuild b/gnome-extra/gnome-utils/gnome-utils-3.2.1.ebuild
new file mode 100644
index 0000000..1f7c7cb
--- /dev/null
+++ b/gnome-extra/gnome-utils/gnome-utils-3.2.1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/gnome-extra/gnome-utils/gnome-utils-3.2.1.ebuild,v 1.2 2011/12/05 11:29:40 pacho Exp $
+
+EAPI="4"
+GCONF_DEBUG="yes"
+GNOME2_LA_PUNT="yes"
+
+inherit gnome2
+
+DESCRIPTION="Utilities for the Gnome desktop"
+HOMEPAGE="http://www.gnome.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="doc ipv6 test"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux"
+
+# libcanberra 0.26-r2 is needed for gtk+:3 fixes
+COMMON_DEPEND=">=dev-libs/glib-2.29.14:2
+ >=x11-libs/gtk+-3.0.3:3
+ >=gnome-base/gconf-2:2
+ >=gnome-base/gsettings-desktop-schemas-0.1.0
+ >=gnome-base/libgtop-2.12:2
+ >=media-libs/libcanberra-0.26-r2[gtk3]
+ x11-libs/libXext
+ x11-libs/libX11"
+
+DEPEND="${COMMON_DEPEND}
+ x11-proto/xextproto
+ app-text/scrollkeeper
+ >=dev-util/intltool-0.40
+ >=dev-util/pkgconfig-0.9
+ doc? ( >=dev-util/gtk-doc-1.10 )"
+
+# file collisions with g-c-c
+# nautilus is used via dbus
+RDEPEND="${COMMON_DEPEND}
+ >=gnome-base/nautilus-3.0.0
+ !<gnome-base/gnome-control-center-2.90"
+
+pkg_setup() {
+ if ! use debug; then
+ G2CONF="${G2CONF} --enable-debug=minimum"
+ fi
+
+ G2CONF="${G2CONF}
+ $(use_enable ipv6)
+ --enable-zlib
+ --disable-maintainer-flags
+ --disable-static
+ --disable-schemas-install
+ --disable-schemas-compile
+ --disable-scrollkeeper"
+ DOCS="AUTHORS ChangeLog NEWS README THANKS"
+}
+
+src_prepare() {
+ gnome2_src_prepare
+
+ # Remove idiotic -D.*DISABLE_DEPRECATED cflags
+ # This method is kinda prone to breakage. Recheck carefully with next bump.
+ # bug 339074
+ find . -iname 'Makefile.am' -exec \
+ sed -e '/-D[A-Z_]*DISABLE_DEPRECATED/d' -i {} + || die "sed 1 failed"
+ # Do Makefile.in after Makefile.am to avoid automake maintainer-mode
+ find . -iname 'Makefile.in' -exec \
+ sed -e '/-D[A-Z_]*DISABLE_DEPRECATED/d' -i {} + || die "sed 1 failed"
+
+ if ! use test ; then
+ sed -e 's/ tests//' -i logview/Makefile.{am,in} || die "sed 2 failed"
+ fi
+
+ # New feature, upload screenshots to imgur!
+ epatch "${FILESDIR}"/*.patch
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] dev/nirbheek:master commit in: gnome-extra/gnome-utils/files/, gnome-extra/gnome-utils/
@ 2012-02-18 15:41 Nirbheek Chauhan
0 siblings, 0 replies; 4+ messages in thread
From: Nirbheek Chauhan @ 2012-02-18 15:41 UTC (permalink / raw
To: gentoo-commits
commit: 8145c99e22a4068e58ebbc878e9e2bceacf2f770
Author: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 18 15:05:18 2012 +0000
Commit: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
CommitDate: Sat Feb 18 15:41:32 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/nirbheek.git;a=commit;h=8145c99e
Brown-paper-bag fix
Just because it's your own damn overlay doesn't mean you
don't test shit before pushing.
---
| 4 +-
... => gnome-utils-3.2.1-upload-screenshots.patch} | 175 ++++++++------------
| 12 +-
3 files changed, 84 insertions(+), 107 deletions(-)
--git a/gnome-extra/gnome-utils/Manifest b/gnome-extra/gnome-utils/Manifest
index da0096c..5631d47 100644
--- a/gnome-extra/gnome-utils/Manifest
+++ b/gnome-extra/gnome-utils/Manifest
@@ -1,3 +1,3 @@
-AUX 0001-New-feature-uploading-screenshots-to-imgur.com.patch 13173 RMD160 0fbbce42e9d3c95ac57be4fb41e4b866c9321e11 SHA1 9a9a309b08a7ac5e2b6fabcfb62153bf2e43e4e3 SHA256 0b0ac89f3cc8cd5cfde6686b0f51ee6d922ed6d48ad9ea3fd709b3a2e706f01f
+AUX gnome-utils-3.2.1-upload-screenshots.patch 13009 RMD160 8121d8052f98f8f285555ff9f16da7e113cd0968 SHA1 5a23536030b04725caa4a1ac45f98ae9f9531090 SHA256 13807ea2e9ae6cb7228a57d9100dfa803d3ba29f7c17428464e8375af54f1d12
DIST gnome-utils-3.2.1.tar.xz 7273572 RMD160 a0e34b7057c0b77b58f7310ec8a8a3af238071bd SHA1 2f837a420ea73ad1a1cab56656b450e704f2faab SHA256 3ac1942dbf4d9d394e2fcc5f30a4480b1b1e5d44ee0c2d4f61689f4a221ba328
-EBUILD gnome-utils-3.2.1.ebuild 2095 RMD160 20f9254a7db4e63e6e79fe8c5480d51c99d3d11b SHA1 ba6c630ddb8552e976234c371bd7060c5bf3b466 SHA256 7ae9c7a83af42c259f3f81c8415e763dca9d0804caaa06babeb87ed0645be934
+EBUILD gnome-utils-3.2.1.ebuild 2297 RMD160 a435cfdf9a8d269c2f6c713eac0ed4f300714245 SHA1 9f44b9dbfccb55331430463f03763c21e53d57e9 SHA256 a1f628eb2d10e1925292f4fcc6babadcd3b16565f63df8b2bcb2295e9a146f7d
diff --git a/gnome-extra/gnome-utils/files/0001-New-feature-uploading-screenshots-to-imgur.com.patch b/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch
similarity index 75%
rename from gnome-extra/gnome-utils/files/0001-New-feature-uploading-screenshots-to-imgur.com.patch
rename to gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch
index 7fb0ec7..4267108 100644
--- a/gnome-extra/gnome-utils/files/0001-New-feature-uploading-screenshots-to-imgur.com.patch
+++ b/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch
@@ -1,26 +1,7 @@
-From 2cc75e214336b858a6e634bb109592dc712f9cd7 Mon Sep 17 00:00:00 2001
-From: Nirbheek Chauhan <nirbheek@gentoo.org>
-Date: Sat, 18 Feb 2012 20:03:53 +0530
-Subject: [PATCH] New feature: uploading screenshots to imgur.com
-
----
- configure.ac | 9 ++
- gnome-screenshot/Makefile.am | 6 ++
- gnome-screenshot/gnome-screenshot.c | 12 +++
- gnome-screenshot/gnome-screenshot.ui | 18 ++++
- gnome-screenshot/screenshot-dialog.c | 11 ---
- gnome-screenshot/screenshot-dialog.h | 12 +++
- gnome-screenshot/screenshot-share.c | 155 ++++++++++++++++++++++++++++++++++
- gnome-screenshot/screenshot-share.h | 32 +++++++
- 8 files changed, 244 insertions(+), 11 deletions(-)
- create mode 100644 gnome-screenshot/screenshot-share.c
- create mode 100644 gnome-screenshot/screenshot-share.h
-
-diff --git a/configure.ac b/configure.ac
-index d75bbe2..93b54f0 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -142,6 +142,15 @@ AS_IF([test "x$GCONFTOOL" = "xno"],
+diff -Naur gnome-utils-3.2.1//configure.ac gnome-utils-3.2.1.new//configure.ac
+--- gnome-utils-3.2.1//configure.ac 2011-10-17 19:44:53.000000000 +0530
++++ gnome-utils-3.2.1.new//configure.ac 2012-02-18 20:23:01.776675767 +0530
+@@ -142,6 +142,15 @@
[AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])]
)
@@ -36,56 +17,24 @@ index d75bbe2..93b54f0 100644
# Baobab checks
PKG_CHECK_MODULES([LIBGTOP], [libgtop-2.0 >= $LIBGTOP_REQUIRED])
AC_SUBST(LIBGTOP_CFLAGS)
-diff --git a/gnome-screenshot/Makefile.am b/gnome-screenshot/Makefile.am
-index d9a11c7..3be0074 100644
---- a/gnome-screenshot/Makefile.am
-+++ b/gnome-screenshot/Makefile.am
-@@ -28,6 +28,8 @@ gnome_screenshot_SOURCES = \
- screenshot-interactive-dialog.h \
- screenshot-shadow.c \
- screenshot-shadow.h \
-+ screenshot-share.c \
-+ screenshot-share.h \
- screenshot-utils.c \
- screenshot-utils.h \
- $(NULL)
-@@ -36,6 +38,8 @@ gnome_screenshot_CFLAGS = \
- $(GLIB_CFLAGS) \
- $(GIO_CFLAGS) \
- $(LIBCANBERRA_GTK_CFLAGS) \
-+ $(LIBSOUP_CFLAGS) \
-+ $(JSON_GLIB_CFLAGS) \
- $(GTHREAD_CFLAGS) \
- $(GTK_CFLAGS) \
- $(NULL)
-@@ -47,6 +51,8 @@ gnome_screenshot_LDADD = \
- $(GLIB_LIBS) \
- $(GIO_LIBS) \
- $(LIBCANBERRA_GTK_LIBS) \
-+ $(LIBSOUP_LIBS) \
-+ $(JSON_GLIB_LIBS) \
- $(GTHREAD_LIBS) \
- $(GTK_LIBS) \
- -lm \
-diff --git a/gnome-screenshot/gnome-screenshot.c b/gnome-screenshot/gnome-screenshot.c
-index 3390914..714b2d1 100644
---- a/gnome-screenshot/gnome-screenshot.c
-+++ b/gnome-screenshot/gnome-screenshot.c
+diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.c gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.c
+--- gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.c 2011-10-17 19:40:18.000000000 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.c 2012-02-18 20:29:34.978650924 +0530
@@ -1,4 +1,5 @@
/* gnome-screenshot.c - Take a screenshot of the desktop
+ * vim: set sts=2 sw=2 et :
*
* Copyright (C) 2001 Jonathan Blandford <jrb@alum.mit.edu>
* Copyright (C) 2006 Emmanuele Bassi <ebassi@gnome.org>
-@@ -47,6 +48,7 @@
- #include "screenshot-filename-builder.h"
- #include "screenshot-interactive-dialog.h"
+@@ -42,6 +43,7 @@
+ #include <canberra-gtk.h>
+
#include "screenshot-shadow.h"
+#include "screenshot-share.h"
#include "screenshot-utils.h"
+ #include "screenshot-save.h"
#include "screenshot-dialog.h"
- #include "cheese-flash.h"
-@@ -260,6 +262,13 @@ screenshot_save_to_clipboard (void)
+@@ -722,6 +724,13 @@
}
static void
@@ -99,20 +48,20 @@ index 3390914..714b2d1 100644
screenshot_dialog_response_cb (GtkDialog *d,
gint response_id,
ScreenshotDialog *dialog)
-@@ -275,6 +284,9 @@ screenshot_dialog_response_cb (GtkDialog *d,
- case SCREENSHOT_RESPONSE_COPY:
- screenshot_save_to_clipboard ();
- break;
-+ case SCREENSHOT_RESPONSE_UPLOAD:
+@@ -745,6 +754,10 @@
+ try_to_save (dialog);
+ }
+ }
++ else if (response_id == SCREENSHOT_RESPONSE_UPLOAD)
++ {
+ screenshot_upload (dialog);
-+ break;
- default:
- gtk_widget_destroy (GTK_WIDGET (d));
- gtk_main_quit ();
-diff --git a/gnome-screenshot/gnome-screenshot.ui b/gnome-screenshot/gnome-screenshot.ui
-index 62f1265..6ce9612 100644
---- a/gnome-screenshot/gnome-screenshot.ui
-+++ b/gnome-screenshot/gnome-screenshot.ui
++ }
+ else if (response_id == SCREENSHOT_RESPONSE_COPY)
+ {
+ GtkClipboard *clipboard;
+diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.ui gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.ui
+--- gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.ui 2011-09-28 02:57:36.000000000 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.ui 2012-02-18 20:23:01.779675766 +0530
@@ -42,6 +42,23 @@
</packing>
</child>
@@ -145,12 +94,41 @@ index 62f1265..6ce9612 100644
</action-widgets>
</object>
</interface>
-diff --git a/gnome-screenshot/screenshot-dialog.c b/gnome-screenshot/screenshot-dialog.c
-index d6d954d..6cb8bba 100644
---- a/gnome-screenshot/screenshot-dialog.c
-+++ b/gnome-screenshot/screenshot-dialog.c
-@@ -36,17 +36,6 @@ static GtkTargetEntry drag_types[] =
- { "image/png", 0, TYPE_IMAGE_PNG },
+diff -Naur gnome-utils-3.2.1//gnome-screenshot/Makefile.am gnome-utils-3.2.1.new//gnome-screenshot/Makefile.am
+--- gnome-utils-3.2.1//gnome-screenshot/Makefile.am 2011-10-17 19:35:06.000000000 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/Makefile.am 2012-02-18 20:23:01.777675767 +0530
+@@ -19,6 +19,8 @@
+ screenshot-dialog.h \
+ screenshot-shadow.c \
+ screenshot-shadow.h \
++ screenshot-share.c \
++ screenshot-share.h \
+ screenshot-utils.c \
+ screenshot-utils.h \
+ screenshot-save.c \
+@@ -29,6 +31,8 @@
+ $(GLIB_CFLAGS) \
+ $(GIO_CFLAGS) \
+ $(LIBCANBERRA_GTK_CFLAGS) \
++ $(LIBSOUP_CFLAGS) \
++ $(JSON_GLIB_CFLAGS) \
+ $(GTHREAD_CFLAGS) \
+ $(GTK_CFLAGS) \
+ $(NULL)
+@@ -40,6 +44,8 @@
+ $(GLIB_LIBS) \
+ $(GIO_LIBS) \
+ $(LIBCANBERRA_GTK_LIBS) \
++ $(LIBSOUP_LIBS) \
++ $(JSON_GLIB_LIBS) \
+ $(GTHREAD_LIBS) \
+ $(GTK_LIBS) \
+ -lm \
+diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.c gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.c
+--- gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.c 2011-10-17 19:35:06.000000000 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.c 2012-02-18 20:23:01.779675766 +0530
+@@ -39,17 +39,6 @@
+ { "text/uri-list", 0, TYPE_TEXT_URI_LIST },
};
-struct ScreenshotDialog
@@ -167,10 +145,9 @@ index d6d954d..6cb8bba 100644
static void
on_preview_draw (GtkWidget *drawing_area,
cairo_t *cr,
-diff --git a/gnome-screenshot/screenshot-dialog.h b/gnome-screenshot/screenshot-dialog.h
-index 7741198..8f2cff7 100644
---- a/gnome-screenshot/screenshot-dialog.h
-+++ b/gnome-screenshot/screenshot-dialog.h
+diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.h gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.h
+--- gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.h 2011-10-17 19:35:06.000000000 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.h 2012-02-18 20:23:01.780675765 +0530
@@ -22,10 +22,22 @@
#include <gtk/gtk.h>
@@ -193,13 +170,11 @@ index 7741198..8f2cff7 100644
+#define SCREENSHOT_RESPONSE_UPLOAD 2
ScreenshotDialog *screenshot_dialog_new (GdkPixbuf *screenshot,
- char *initial_uri);
-diff --git a/gnome-screenshot/screenshot-share.c b/gnome-screenshot/screenshot-share.c
-new file mode 100644
-index 0000000..2442cfa
---- /dev/null
-+++ b/gnome-screenshot/screenshot-share.c
-@@ -0,0 +1,155 @@
+ char *initial_uri,
+diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.c
+--- gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c 1970-01-01 05:30:00.000000000 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.c 2012-02-18 20:23:01.780675765 +0530
+@@ -0,0 +1,156 @@
+/* screenshot-share.c - online screenshot sharing
+ * vim: set sts=2 sw=2 et :
+ *
@@ -220,13 +195,14 @@ index 0000000..2442cfa
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ */
+
++#include <math.h>
++
+#include <glib.h>
+#include <gtk/gtk.h>
+#include <libsoup/soup.h>
+#include <json-glib/json-glib.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
-+#include "gnome-screenshot.h"
+#include "screenshot-share.h"
+#include "screenshot-dialog.h"
+
@@ -355,11 +331,9 @@ index 0000000..2442cfa
+ g_app_info_launch_default_for_uri (image_uri, NULL, NULL);
+ g_app_info_launch_default_for_uri (delete_uri, NULL, NULL);
+}
-diff --git a/gnome-screenshot/screenshot-share.h b/gnome-screenshot/screenshot-share.h
-new file mode 100644
-index 0000000..6d39220
---- /dev/null
-+++ b/gnome-screenshot/screenshot-share.h
+diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.h gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.h
+--- gnome-utils-3.2.1//gnome-screenshot/screenshot-share.h 1970-01-01 05:30:00.000000000 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.h 2012-02-18 20:23:01.780675765 +0530
@@ -0,0 +1,32 @@
+/* screenshot-share.h - online screenshot sharing
+ * vim: set sts=2 sw=2 et :
@@ -393,6 +367,3 @@ index 0000000..6d39220
+G_END_DECLS
+
+#endif /* __SCREENSHOT_SHARE_H__ */
---
-1.7.3.4
-
--git a/gnome-extra/gnome-utils/gnome-utils-3.2.1.ebuild b/gnome-extra/gnome-utils/gnome-utils-3.2.1.ebuild
index 1f7c7cb..3c4eb9a 100644
--- a/gnome-extra/gnome-utils/gnome-utils-3.2.1.ebuild
+++ b/gnome-extra/gnome-utils/gnome-utils-3.2.1.ebuild
@@ -6,7 +6,7 @@ EAPI="4"
GCONF_DEBUG="yes"
GNOME2_LA_PUNT="yes"
-inherit gnome2
+inherit autotools gnome2
DESCRIPTION="Utilities for the Gnome desktop"
HOMEPAGE="http://www.gnome.org/"
@@ -22,7 +22,9 @@ COMMON_DEPEND=">=dev-libs/glib-2.29.14:2
>=gnome-base/gconf-2:2
>=gnome-base/gsettings-desktop-schemas-0.1.0
>=gnome-base/libgtop-2.12:2
+ >=dev-libs/json-glib-0.14
>=media-libs/libcanberra-0.26-r2[gtk3]
+ net-libs/libsoup:2.4
x11-libs/libXext
x11-libs/libX11"
@@ -56,13 +58,14 @@ pkg_setup() {
}
src_prepare() {
- gnome2_src_prepare
-
# Remove idiotic -D.*DISABLE_DEPRECATED cflags
# This method is kinda prone to breakage. Recheck carefully with next bump.
# bug 339074
find . -iname 'Makefile.am' -exec \
sed -e '/-D[A-Z_]*DISABLE_DEPRECATED/d' -i {} + || die "sed 1 failed"
+ # The above sed breaks this am fil:
+ sed -e 's/\(INCLUDES.*\)\\/\1/' \
+ -i gsearchtool/libgnomeui-deprecated/Makefile.am || die
# Do Makefile.in after Makefile.am to avoid automake maintainer-mode
find . -iname 'Makefile.in' -exec \
sed -e '/-D[A-Z_]*DISABLE_DEPRECATED/d' -i {} + || die "sed 1 failed"
@@ -73,4 +76,7 @@ src_prepare() {
# New feature, upload screenshots to imgur!
epatch "${FILESDIR}"/*.patch
+
+ eautoreconf
+ gnome2_src_prepare
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] dev/nirbheek:master commit in: gnome-extra/gnome-utils/files/, gnome-extra/gnome-utils/
@ 2012-02-19 22:16 Nirbheek Chauhan
0 siblings, 0 replies; 4+ messages in thread
From: Nirbheek Chauhan @ 2012-02-19 22:16 UTC (permalink / raw
To: gentoo-commits
commit: 9b958cb3244f6100d2916226f47ca64f1b684f9b
Author: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 19 22:15:39 2012 +0000
Commit: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
CommitDate: Sun Feb 19 22:15:46 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/nirbheek.git;a=commit;h=9b958cb3
gnome-extra/gnome-utils: new, improved screenshot uploading patch!
---
| 2 +-
.../gnome-utils-3.2.1-upload-screenshots.patch | 301 ++++++++++++++++----
2 files changed, 241 insertions(+), 62 deletions(-)
--git a/gnome-extra/gnome-utils/Manifest b/gnome-extra/gnome-utils/Manifest
index 5631d47..ede1c53 100644
--- a/gnome-extra/gnome-utils/Manifest
+++ b/gnome-extra/gnome-utils/Manifest
@@ -1,3 +1,3 @@
-AUX gnome-utils-3.2.1-upload-screenshots.patch 13009 RMD160 8121d8052f98f8f285555ff9f16da7e113cd0968 SHA1 5a23536030b04725caa4a1ac45f98ae9f9531090 SHA256 13807ea2e9ae6cb7228a57d9100dfa803d3ba29f7c17428464e8375af54f1d12
+AUX gnome-utils-3.2.1-upload-screenshots.patch 19253 RMD160 3713b8f89e33cf16a762207e0c8e89e13a6bbc46 SHA1 0784b31d200d41b94e7c5799e49bece71a57a2ad SHA256 47bd5d67ee2160d09831acf91351e33eb8b5f1a3055c88e9fe9609e3e1465cba
DIST gnome-utils-3.2.1.tar.xz 7273572 RMD160 a0e34b7057c0b77b58f7310ec8a8a3af238071bd SHA1 2f837a420ea73ad1a1cab56656b450e704f2faab SHA256 3ac1942dbf4d9d394e2fcc5f30a4480b1b1e5d44ee0c2d4f61689f4a221ba328
EBUILD gnome-utils-3.2.1.ebuild 2297 RMD160 a435cfdf9a8d269c2f6c713eac0ed4f300714245 SHA1 9f44b9dbfccb55331430463f03763c21e53d57e9 SHA256 a1f628eb2d10e1925292f4fcc6babadcd3b16565f63df8b2bcb2295e9a146f7d
diff --git a/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch b/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch
index 4267108..46b187a 100644
--- a/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch
+++ b/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch
@@ -1,6 +1,6 @@
diff -Naur gnome-utils-3.2.1//configure.ac gnome-utils-3.2.1.new//configure.ac
--- gnome-utils-3.2.1//configure.ac 2011-10-17 19:44:53.000000000 +0530
-+++ gnome-utils-3.2.1.new//configure.ac 2012-02-18 20:23:01.776675767 +0530
++++ gnome-utils-3.2.1.new//configure.ac 2012-02-20 03:37:08.072570280 +0530
@@ -142,6 +142,15 @@
[AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])]
)
@@ -19,7 +19,7 @@ diff -Naur gnome-utils-3.2.1//configure.ac gnome-utils-3.2.1.new//configure.ac
AC_SUBST(LIBGTOP_CFLAGS)
diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.c gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.c
--- gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.c 2011-10-17 19:40:18.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.c 2012-02-18 20:29:34.978650924 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.c 2012-02-20 03:37:08.073570286 +0530
@@ -1,4 +1,5 @@
/* gnome-screenshot.c - Take a screenshot of the desktop
+ * vim: set sts=2 sw=2 et :
@@ -61,11 +61,15 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.c gnome-utils-3.
GtkClipboard *clipboard;
diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.ui gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.ui
--- gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.ui 2011-09-28 02:57:36.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.ui 2012-02-18 20:23:01.779675766 +0530
-@@ -42,6 +42,23 @@
- </packing>
- </child>
- <child>
++++ gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.ui 2012-02-20 03:37:20.952569474 +0530
+@@ -39,6 +39,39 @@
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ <property name="secondary">True</property>
++ <property name="non_homogeneous">True</property>
++ </packing>
++ </child>
++ <child>
+ <object class="GtkButton" id="upload_button">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
@@ -74,19 +78,55 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.ui gnome-utils-3
+ <property name="label" translatable="yes">_Upload</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
++ <property name="width_request">75</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ <property name="secondary">True</property>
++ <property name="non_homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
- <object class="GtkButton" id="cancel_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
-@@ -241,6 +258,7 @@
++ <object class="GtkProgressBar" id="upload_progress">
++ <property name="visible">False</property>
++ <property name="can_default">False</property>
++ <property name="no_show_all">True</property>
++ </object>
++ <packing>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ <property name="position">2</property>
++ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <child>
+@@ -50,7 +83,11 @@
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
++ <property name="width_request">75</property>
+ </object>
++ <packing>
++ <property name="non_homogeneous">True</property>
++ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="ok_button">
+@@ -62,7 +99,11 @@
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
++ <property name="width_request">75</property>
+ </object>
++ <packing>
++ <property name="non_homogeneous">True</property>
++ </packing>
+ </child>
+ </object>
+ <packing>
+@@ -241,6 +282,7 @@
<action-widget response="-6">cancel_button</action-widget>
<action-widget response="-5">ok_button</action-widget>
<action-widget response="1">copy_button</action-widget>
@@ -96,7 +136,7 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.ui gnome-utils-3
</interface>
diff -Naur gnome-utils-3.2.1//gnome-screenshot/Makefile.am gnome-utils-3.2.1.new//gnome-screenshot/Makefile.am
--- gnome-utils-3.2.1//gnome-screenshot/Makefile.am 2011-10-17 19:35:06.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/Makefile.am 2012-02-18 20:23:01.777675767 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/Makefile.am 2012-02-20 03:37:08.077570288 +0530
@@ -19,6 +19,8 @@
screenshot-dialog.h \
screenshot-shadow.c \
@@ -126,7 +166,7 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/Makefile.am gnome-utils-3.2.1.new
-lm \
diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.c gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.c
--- gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.c 2011-10-17 19:35:06.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.c 2012-02-18 20:23:01.779675766 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.c 2012-02-20 03:37:08.077570288 +0530
@@ -39,17 +39,6 @@
{ "text/uri-list", 0, TYPE_TEXT_URI_LIST },
};
@@ -147,7 +187,7 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.c gnome-utils-3
cairo_t *cr,
diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.h gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.h
--- gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.h 2011-10-17 19:35:06.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.h 2012-02-18 20:23:01.780675765 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.h 2012-02-20 03:37:08.078570287 +0530
@@ -22,10 +22,22 @@
#include <gtk/gtk.h>
@@ -173,8 +213,8 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.h gnome-utils-3
char *initial_uri,
diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.c
--- gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c 1970-01-01 05:30:00.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.c 2012-02-18 20:23:01.780675765 +0530
-@@ -0,0 +1,156 @@
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.c 2012-02-20 03:37:25.214569203 +0530
+@@ -0,0 +1,284 @@
+/* screenshot-share.c - online screenshot sharing
+ * vim: set sts=2 sw=2 et :
+ *
@@ -199,6 +239,7 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+
+#include <glib.h>
+#include <gtk/gtk.h>
++#include <glib/gi18n.h>
+#include <libsoup/soup.h>
+#include <json-glib/json-glib.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
@@ -206,49 +247,94 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+#include "screenshot-share.h"
+#include "screenshot-dialog.h"
+
++/* API key is taken from http://imgur.com/tools/imgurbash.sh
++ * Presumably they're fine with FOSS applications using this key
++ * TODO: They're cool guys, ask them! */
+#define IMGUR_API_KEY "b3625162d3418ac51a9ee805b1840452"
++/* We use v1 of the API because v2 is in beta */
+#define IMGUR_UPLOAD_URI "http://api.imgur.com/1/upload.json"
+
-+static void imgur_response_cb (SoupSession *session,
-+ SoupMessage *msg,
-+ gpointer user_data);
++/* The two states for the upload button */
++#define BUTTON_TEXT_UPLOAD "_Upload"
++#define BUTTON_TEXT_PAUSE "Pa_use"
++
++/* Function prototypes */
++static void message_completed_cb (SoupSession *session,
++ SoupMessage *msg,
++ gpointer user_data);
++
++static void wrote_data_cb (SoupMessage *msg,
++ SoupBuffer *chunk,
++ gpointer user_data);
++
++static void request_started_cb (SoupSession *session,
++ SoupMessage *msg,
++ SoupSocket *socket,
++ gpointer user_data);
+
-+static void imgur_wrote_data_cb (SoupMessage *msg,
-+ SoupBuffer *chunk,
-+ gpointer user_data);
++static void toggle_request_cb (GtkButton *widget,
++ gpointer user_data);
++
++static void screenshot_uploaded_cb (SoupMessage *msg,
++ gpointer user_data);
++
++static void imgur_response_cb (SoupMessage *msg);
++
++static void reset_upload_button (ScreenshotSoupContext *context);
+
+static void screenshot_display_uris (gchar *image_uri,
+ gchar *delete_uri);
+
++/* Global variables */
++static gboolean uploading = FALSE;
+
++/* Upload the given screenshot to imgur.com */
+void
+screenshot_upload_imgur (ScreenshotDialog *dialog)
+{
-+ GtkButton *button;
++ ScreenshotSoupContext *context;
+ SoupSession *session;
+ SoupMessage *msg;
++ GtkButton *button;
++ GtkProgressBar *progress_bar;
+ gchar *temp;
+ gchar *image_data;
+ gsize image_size;
-+ GError *tmp_error;
+
-+ tmp_error = NULL;
++ /* Are we already uploading? Then just return. */
++ if (uploading)
++ return;
++ uploading = TRUE;
++
+ if (!gdk_pixbuf_save_to_buffer (GDK_PIXBUF (dialog->screenshot),
+ &image_data, &image_size,
-+ "png", &tmp_error, NULL))
++ "png", NULL, NULL))
+ goto out;
+
+ button = GTK_BUTTON (gtk_builder_get_object (dialog->ui, "upload_button"));
++ progress_bar = GTK_PROGRESS_BAR (gtk_builder_get_object (dialog->ui, "upload_progress"));
+
+ temp = g_base64_encode (image_data, image_size);
+ session = soup_session_async_new ();
+ msg = soup_form_request_new (SOUP_METHOD_POST, IMGUR_UPLOAD_URI,
+ "key", IMGUR_API_KEY,
+ "image", temp, NULL);
++
++ context = g_new0 (ScreenshotSoupContext, 1);
++ context->session = session;
++ context->msg = msg;
++ context->upload_button = button;
++ context->upload_progress = progress_bar;
++
++ g_signal_connect (session, "request-started",
++ G_CALLBACK (request_started_cb),
++ (gpointer)context);
++
+ g_signal_connect (msg, "wrote-body-data",
-+ G_CALLBACK (imgur_wrote_data_cb),
-+ (gpointer)button);
-+ soup_session_queue_message (session, msg, imgur_response_cb, NULL);
++ G_CALLBACK (wrote_data_cb),
++ (gpointer)progress_bar);
++
++ soup_session_queue_message (session, msg, message_completed_cb, (gpointer)context);
+ g_free (temp);
+
+out:
@@ -256,23 +342,126 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+}
+
+static void
-+imgur_response_cb (SoupSession *session,
-+ SoupMessage *msg,
-+ gpointer user_data)
++reset_upload_button (ScreenshotSoupContext *context)
++{
++ g_signal_handlers_disconnect_by_func (G_OBJECT (context->upload_button),
++ G_CALLBACK (toggle_request_cb),
++ (gpointer)context);
++
++ gtk_widget_set_visible (GTK_WIDGET (context->upload_progress), FALSE);
++ gtk_button_set_label (context->upload_button, _(BUTTON_TEXT_UPLOAD));
++}
++
++/* Handle SoupMessage completion
++ *
++ * TODO: handle HTTP errors properly
++ * Right now we just reset the upload button upon *all* message completion
++ * We should probably display an error so the user knows the upload failed
++ */
++static void
++message_completed_cb (SoupSession *session,
++ SoupMessage *msg,
++ gpointer user_data)
++{
++ reset_upload_button ((ScreenshotSoupContext*)user_data);
++ uploading = FALSE;
++
++ switch (msg->status_code) {
++ case SOUP_STATUS_OK:
++ screenshot_uploaded_cb (msg, user_data);
++ break;
++ case SOUP_STATUS_CANCELLED:
++ g_debug ("User cancelled upload!\n");
++ break;
++ default:
++ if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
++ g_warning ("Got an error from imgur:\n%s\n", msg->request_body->data);
++ break;
++ }
++}
++
++/* Request successfully started, start the progress bar */
++static void
++request_started_cb (SoupSession *session,
++ SoupMessage *msg,
++ SoupSocket *socket,
++ gpointer user_data)
++{
++ ScreenshotSoupContext *context = user_data;
++
++ gtk_button_set_label (GTK_BUTTON (context->upload_button), _(BUTTON_TEXT_PAUSE));
++
++ g_signal_connect (G_OBJECT (context->upload_button),
++ "clicked",
++ G_CALLBACK (toggle_request_cb),
++ user_data);
++}
++
++/* Pause/Unpause the screenshot upload. Not MT-safe */
++static void
++toggle_request_cb (GtkButton *widget,
++ gpointer user_data)
++{
++ ScreenshotSoupContext *context = user_data;
++ static gboolean paused;
++
++ if (paused) {
++ soup_session_unpause_message (context->session,
++ context->msg);
++ gtk_button_set_label (context->upload_button, _(BUTTON_TEXT_PAUSE));
++ paused = FALSE;
++ } else {
++ soup_session_pause_message (context->session,
++ context->msg);
++ gtk_button_set_label (context->upload_button, _(BUTTON_TEXT_UPLOAD));
++ paused = TRUE;
++ }
++}
++
++/* Update the progress bar */
++static void
++wrote_data_cb (SoupMessage *msg,
++ SoupBuffer *chunk,
++ gpointer user_data)
++{
++ static int total_sent;
++ float fraction;
++
++ if (!gtk_widget_get_visible (GTK_WIDGET (user_data)))
++ gtk_widget_set_visible (GTK_WIDGET (user_data), TRUE);
++
++ total_sent += chunk->length;
++ fraction = ((float)total_sent) / msg->request_body->length;
++ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (user_data), fraction);
++
++ /* Upload finished? Reset the counter. */
++ if (total_sent == msg->request_body->length)
++ total_sent = 0;
++}
++
++static void
++screenshot_uploaded_cb (SoupMessage *msg,
++ gpointer user_data)
++{
++ imgur_response_cb (msg);
++}
++
++/* Process the screenshot upload response from imgur.com
++ *
++ * Also opens the image and delete links for the uploaded image
++ * in the default http:// handler
++ * */
++static void
++imgur_response_cb (SoupMessage *msg)
+{
+ JsonParser *parser = NULL;
+ JsonNode *node = NULL;
-+ GMainLoop *loop;
+ GError *error = NULL;
+ gchar *response;
+ gchar *image_uri;
+ gchar *delete_uri;
+
+ response = g_strdup (msg->response_body->data);
-+ if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) {
-+ g_debug ("Got an error from imgur:\n%s\n", response);
-+ goto out;
-+ }
+
+ parser = json_parser_new ();
+ json_parser_load_from_data (parser, response, -1, &error);
@@ -292,6 +481,7 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+ json_node_free (node);
+
+ screenshot_display_uris (image_uri, delete_uri);
++
+ g_free (image_uri);
+ g_free (delete_uri);
+
@@ -303,28 +493,6 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+}
+
+static void
-+imgur_wrote_data_cb (SoupMessage *msg,
-+ SoupBuffer *chunk,
-+ gpointer user_data)
-+{
-+ gchar *upload_percent;
-+ static int total_sent;
-+ int percent;
-+
-+ total_sent += (float) chunk->length;
-+ percent = (int)nearbyint(100*((float)total_sent) / msg->request_body->length);
-+ upload_percent = g_strdup_printf ("Uploading... %i%%", percent);
-+
-+ gtk_button_set_label (GTK_BUTTON (user_data), upload_percent);
-+
-+ /* Upload finished? Reset the counter. */
-+ if (total_sent == msg->request_body->length)
-+ total_sent = 0;
-+
-+ g_free (upload_percent);
-+}
-+
-+static void
+screenshot_display_uris (gchar *image_uri,
+ gchar *delete_uri)
+{
@@ -333,8 +501,8 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+}
diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.h gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.h
--- gnome-utils-3.2.1//gnome-screenshot/screenshot-share.h 1970-01-01 05:30:00.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.h 2012-02-18 20:23:01.780675765 +0530
-@@ -0,0 +1,32 @@
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.h 2012-02-20 03:37:25.214569203 +0530
+@@ -0,0 +1,43 @@
+/* screenshot-share.h - online screenshot sharing
+ * vim: set sts=2 sw=2 et :
+ *
@@ -358,8 +526,19 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.h gnome-utils-3.
+#ifndef __SCREENSHOT_SHARE_H__
+#define __SCREENSHOT_SHARE_H__
+
++#include <libsoup/soup.h>
++
+#include "screenshot-dialog.h"
+
++struct ScreenshotSoupContext {
++ SoupSession *session;
++ SoupMessage *msg;
++ GtkButton *upload_button;
++ GtkProgressBar *upload_progress;
++};
++
++typedef struct ScreenshotSoupContext ScreenshotSoupContext;
++
+G_BEGIN_DECLS
+
+void screenshot_upload_imgur (ScreenshotDialog *dialog);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] dev/nirbheek:master commit in: gnome-extra/gnome-utils/files/, gnome-extra/gnome-utils/
@ 2012-02-20 18:03 Nirbheek Chauhan
0 siblings, 0 replies; 4+ messages in thread
From: Nirbheek Chauhan @ 2012-02-20 18:03 UTC (permalink / raw
To: gentoo-commits
commit: f339209a2690ae402cbf1504ce91da1c4c32f3a7
Author: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 20 18:02:43 2012 +0000
Commit: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
CommitDate: Mon Feb 20 18:02:47 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/nirbheek.git;a=commit;h=f339209a
gnome-extra/gnome-utils: more patch updates
https://bugzilla.gnome.org/show_bug.cgi?id=407128
---
| 3 +-
.../gnome-utils-3.2.1-screenshot-preview.patch | 37 +++
.../gnome-utils-3.2.1-upload-screenshots.patch | 234 +++++++++++++++-----
3 files changed, 217 insertions(+), 57 deletions(-)
--git a/gnome-extra/gnome-utils/Manifest b/gnome-extra/gnome-utils/Manifest
index ede1c53..914d37b 100644
--- a/gnome-extra/gnome-utils/Manifest
+++ b/gnome-extra/gnome-utils/Manifest
@@ -1,3 +1,4 @@
-AUX gnome-utils-3.2.1-upload-screenshots.patch 19253 RMD160 3713b8f89e33cf16a762207e0c8e89e13a6bbc46 SHA1 0784b31d200d41b94e7c5799e49bece71a57a2ad SHA256 47bd5d67ee2160d09831acf91351e33eb8b5f1a3055c88e9fe9609e3e1465cba
+AUX gnome-utils-3.2.1-screenshot-preview.patch 1401 RMD160 fee06242211fa4c8220aad739d96bec8834107d6 SHA1 4d696daceac48066a4bbec03e6c6096e6469ebd3 SHA256 1286a9022b28875f46210395efdaa5d16879cbcc3d067db128680cc98bc34145
+AUX gnome-utils-3.2.1-upload-screenshots.patch 26583 RMD160 2c1312c3993a43750db7124b225bd862a710d05a SHA1 5e5e17d8842f56425be02aeaf27483ed86619f48 SHA256 8f1c8eadcaa0bada3a932093854f2c060f620ecac903d0ad701487a06f529b46
DIST gnome-utils-3.2.1.tar.xz 7273572 RMD160 a0e34b7057c0b77b58f7310ec8a8a3af238071bd SHA1 2f837a420ea73ad1a1cab56656b450e704f2faab SHA256 3ac1942dbf4d9d394e2fcc5f30a4480b1b1e5d44ee0c2d4f61689f4a221ba328
EBUILD gnome-utils-3.2.1.ebuild 2297 RMD160 a435cfdf9a8d269c2f6c713eac0ed4f300714245 SHA1 9f44b9dbfccb55331430463f03763c21e53d57e9 SHA256 a1f628eb2d10e1925292f4fcc6babadcd3b16565f63df8b2bcb2295e9a146f7d
diff --git a/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-screenshot-preview.patch b/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-screenshot-preview.patch
new file mode 100644
index 0000000..64821c1
--- /dev/null
+++ b/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-screenshot-preview.patch
@@ -0,0 +1,37 @@
+From a604bdb3234acf2d397a492c90bda39b09e5106f Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek@gentoo.org>
+Date: Mon, 20 Feb 2012 17:33:25 +0530
+Subject: [PATCH] Always use the same size for the screenshot preview area
+
+* Avoids widget-jumping while interacting with the dialog box
+---
+ gnome-screenshot/screenshot-dialog.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gnome-screenshot/screenshot-dialog.c b/gnome-screenshot/screenshot-dialog.c
+index 6cb8bba..3a6b7a7 100644
+--- a/gnome-screenshot/screenshot-dialog.c
++++ b/gnome-screenshot/screenshot-dialog.c
+@@ -188,8 +188,8 @@ screenshot_dialog_new (GdkPixbuf *screenshot,
+
+ gtk_builder_set_translation_domain (dialog->ui, GETTEXT_PACKAGE);
+
+- width = gdk_pixbuf_get_width (screenshot);
+- height = gdk_pixbuf_get_height (screenshot);
++ width = gdk_screen_get_width (gdk_screen_get_default ());
++ height = gdk_screen_get_height (gdk_screen_get_default ());
+
+ width /= 5;
+ height /= 5;
+@@ -209,7 +209,7 @@ screenshot_dialog_new (GdkPixbuf *screenshot,
+ g_free (current_folder);
+
+ gtk_widget_set_size_request (preview_darea, width, height);
+- gtk_aspect_frame_set (GTK_ASPECT_FRAME (aspect_frame), 0.0, 0.5,
++ gtk_aspect_frame_set (GTK_ASPECT_FRAME (aspect_frame), 0.5, 0.5,
+ gdk_pixbuf_get_width (screenshot)/
+ (gfloat) gdk_pixbuf_get_height (screenshot),
+ FALSE);
+--
+1.7.3.4
+
diff --git a/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch b/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch
index 46b187a..d4e5af8 100644
--- a/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch
+++ b/gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch
@@ -1,6 +1,6 @@
diff -Naur gnome-utils-3.2.1//configure.ac gnome-utils-3.2.1.new//configure.ac
--- gnome-utils-3.2.1//configure.ac 2011-10-17 19:44:53.000000000 +0530
-+++ gnome-utils-3.2.1.new//configure.ac 2012-02-20 03:37:08.072570280 +0530
++++ gnome-utils-3.2.1.new//configure.ac 2012-02-20 22:09:55.858351232 +0530
@@ -142,6 +142,15 @@
[AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])]
)
@@ -19,7 +19,7 @@ diff -Naur gnome-utils-3.2.1//configure.ac gnome-utils-3.2.1.new//configure.ac
AC_SUBST(LIBGTOP_CFLAGS)
diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.c gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.c
--- gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.c 2011-10-17 19:40:18.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.c 2012-02-20 03:37:08.073570286 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.c 2012-02-20 22:09:55.858351232 +0530
@@ -1,4 +1,5 @@
/* gnome-screenshot.c - Take a screenshot of the desktop
+ * vim: set sts=2 sw=2 et :
@@ -61,7 +61,7 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.c gnome-utils-3.
GtkClipboard *clipboard;
diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.ui gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.ui
--- gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.ui 2011-09-28 02:57:36.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.ui 2012-02-20 03:37:20.952569474 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/gnome-screenshot.ui 2012-02-20 22:10:09.389350376 +0530
@@ -39,6 +39,39 @@
<property name="fill">False</property>
<property name="position">0</property>
@@ -126,7 +126,117 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.ui gnome-utils-3
</child>
</object>
<packing>
-@@ -241,6 +282,7 @@
+@@ -123,7 +164,7 @@
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+- <property name="n_rows">2</property>
++ <property name="n_rows">4</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+@@ -176,6 +217,54 @@
+ </packing>
+ </child>
+ <child>
++ <object class="GtkLabel" id="image_link_label">
++ <property name="visible">False</property>
++ <property name="label" translatable="yes">_Image link:</property>
++ <property name="use_underline">True</property>
++ <property name="use_markup">False</property>
++ <property name="justify">GTK_JUSTIFY_LEFT</property>
++ <property name="wrap">False</property>
++ <property name="selectable">False</property>
++ <property name="xalign">0</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ <property name="no-show-all">True</property>
++ </object>
++ <packing>
++ <property name="left_attach">0</property>
++ <property name="right_attach">1</property>
++ <property name="top_attach">2</property>
++ <property name="bottom_attach">3</property>
++ <property name="x_options">fill</property>
++ <property name="y_options"/>
++ </packing>
++ </child>
++ <child>
++ <object class="GtkLabel" id="delete_link_label">
++ <property name="visible">False</property>
++ <property name="label" translatable="yes">_Delete link:</property>
++ <property name="use_underline">True</property>
++ <property name="use_markup">False</property>
++ <property name="justify">GTK_JUSTIFY_LEFT</property>
++ <property name="wrap">False</property>
++ <property name="selectable">False</property>
++ <property name="xalign">0</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ <property name="no-show-all">True</property>
++ </object>
++ <packing>
++ <property name="left_attach">0</property>
++ <property name="right_attach">1</property>
++ <property name="top_attach">3</property>
++ <property name="bottom_attach">4</property>
++ <property name="x_options">fill</property>
++ <property name="y_options"/>
++ </packing>
++ </child>
++ <child>
+ <object class="GtkEntry" id="filename_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+@@ -186,7 +275,7 @@
+ <property name="has_frame">True</property>
+ <property name="invisible_char" translatable="yes">*</property>
+ <property name="activates_default">True</property>
+- <property name="width_chars">32</property>
++ <property name="width_chars">36</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+@@ -214,6 +303,36 @@
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
++ <child>
++ <object class="GtkLinkButton" id="image_link">
++ <property name="visible">False</property>
++ <property name="can_focus">True</property>
++ <property name="xalign">0</property>
++ <property name="no-show-all">True</property>
++ </object>
++ <packing>
++ <property name="left_attach">1</property>
++ <property name="right_attach">2</property>
++ <property name="top_attach">2</property>
++ <property name="bottom_attach">3</property>
++ <property name="y_options"/>
++ </packing>
++ </child>
++ <child>
++ <object class="GtkLinkButton" id="delete_link">
++ <property name="visible">False</property>
++ <property name="can_focus">True</property>
++ <property name="xalign">0</property>
++ <property name="no-show-all">True</property>
++ </object>
++ <packing>
++ <property name="left_attach">1</property>
++ <property name="right_attach">2</property>
++ <property name="top_attach">3</property>
++ <property name="bottom_attach">4</property>
++ <property name="y_options"/>
++ </packing>
++ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+@@ -241,6 +360,7 @@
<action-widget response="-6">cancel_button</action-widget>
<action-widget response="-5">ok_button</action-widget>
<action-widget response="1">copy_button</action-widget>
@@ -136,7 +246,7 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/gnome-screenshot.ui gnome-utils-3
</interface>
diff -Naur gnome-utils-3.2.1//gnome-screenshot/Makefile.am gnome-utils-3.2.1.new//gnome-screenshot/Makefile.am
--- gnome-utils-3.2.1//gnome-screenshot/Makefile.am 2011-10-17 19:35:06.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/Makefile.am 2012-02-20 03:37:08.077570288 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/Makefile.am 2012-02-20 22:09:55.859351232 +0530
@@ -19,6 +19,8 @@
screenshot-dialog.h \
screenshot-shadow.c \
@@ -166,7 +276,7 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/Makefile.am gnome-utils-3.2.1.new
-lm \
diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.c gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.c
--- gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.c 2011-10-17 19:35:06.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.c 2012-02-20 03:37:08.077570288 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.c 2012-02-20 22:09:55.860351232 +0530
@@ -39,17 +39,6 @@
{ "text/uri-list", 0, TYPE_TEXT_URI_LIST },
};
@@ -187,7 +297,7 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.c gnome-utils-3
cairo_t *cr,
diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.h gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.h
--- gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.h 2011-10-17 19:35:06.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.h 2012-02-20 03:37:08.078570287 +0530
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-dialog.h 2012-02-20 22:09:55.860351232 +0530
@@ -22,10 +22,22 @@
#include <gtk/gtk.h>
@@ -213,8 +323,8 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-dialog.h gnome-utils-3
char *initial_uri,
diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.c
--- gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c 1970-01-01 05:30:00.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.c 2012-02-20 03:37:25.214569203 +0530
-@@ -0,0 +1,284 @@
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.c 2012-02-20 22:10:17.441349867 +0530
+@@ -0,0 +1,292 @@
+/* screenshot-share.c - online screenshot sharing
+ * vim: set sts=2 sw=2 et :
+ *
@@ -278,12 +388,14 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+static void screenshot_uploaded_cb (SoupMessage *msg,
+ gpointer user_data);
+
-+static void imgur_response_cb (SoupMessage *msg);
++static void imgur_response_cb (SoupMessage *msg,
++ gpointer user_data);
+
-+static void reset_upload_button (ScreenshotSoupContext *context);
++static void reset_upload_button (gpointer user_data);
+
-+static void screenshot_display_uris (gchar *image_uri,
-+ gchar *delete_uri);
++static void screenshot_display_uris (gchar *image_uri,
++ gchar *delete_uri,
++ gpointer user_data);
+
+/* Global variables */
+static gboolean uploading = FALSE;
@@ -293,10 +405,6 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+screenshot_upload_imgur (ScreenshotDialog *dialog)
+{
+ ScreenshotSoupContext *context;
-+ SoupSession *session;
-+ SoupMessage *msg;
-+ GtkButton *button;
-+ GtkProgressBar *progress_bar;
+ gchar *temp;
+ gchar *image_data;
+ gsize image_size;
@@ -309,44 +417,45 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+ if (!gdk_pixbuf_save_to_buffer (GDK_PIXBUF (dialog->screenshot),
+ &image_data, &image_size,
+ "png", NULL, NULL))
-+ goto out;
-+
-+ button = GTK_BUTTON (gtk_builder_get_object (dialog->ui, "upload_button"));
-+ progress_bar = GTK_PROGRESS_BAR (gtk_builder_get_object (dialog->ui, "upload_progress"));
++ return;
+
+ temp = g_base64_encode (image_data, image_size);
-+ session = soup_session_async_new ();
-+ msg = soup_form_request_new (SOUP_METHOD_POST, IMGUR_UPLOAD_URI,
-+ "key", IMGUR_API_KEY,
-+ "image", temp, NULL);
+
+ context = g_new0 (ScreenshotSoupContext, 1);
-+ context->session = session;
-+ context->msg = msg;
-+ context->upload_button = button;
-+ context->upload_progress = progress_bar;
+
-+ g_signal_connect (session, "request-started",
++ context->upload_button = GTK_BUTTON (gtk_builder_get_object (dialog->ui, "upload_button"));
++ context->upload_progress = GTK_PROGRESS_BAR (gtk_builder_get_object (dialog->ui, "upload_progress"));
++ context->image_link_label = GTK_LABEL (gtk_builder_get_object (dialog->ui, "image_link_label"));
++ context->delete_link_label = GTK_LABEL (gtk_builder_get_object (dialog->ui, "delete_link_label"));
++ context->image_link = GTK_LINK_BUTTON (gtk_builder_get_object (dialog->ui, "image_link"));
++ context->delete_link = GTK_LINK_BUTTON (gtk_builder_get_object (dialog->ui, "delete_link"));
++
++ context->session = soup_session_async_new ();
++ context->msg = soup_form_request_new (SOUP_METHOD_POST, IMGUR_UPLOAD_URI,
++ "key", IMGUR_API_KEY,
++ "image", temp, NULL);
++
++ g_signal_connect (context->session, "request-started",
+ G_CALLBACK (request_started_cb),
+ (gpointer)context);
+
-+ g_signal_connect (msg, "wrote-body-data",
++ g_signal_connect (context->msg, "wrote-body-data",
+ G_CALLBACK (wrote_data_cb),
-+ (gpointer)progress_bar);
++ (gpointer)context);
+
-+ soup_session_queue_message (session, msg, message_completed_cb, (gpointer)context);
++ soup_session_queue_message (context->session, context->msg,
++ message_completed_cb, (gpointer)context);
+ g_free (temp);
-+
-+out:
+ g_free (image_data);
+}
+
+static void
-+reset_upload_button (ScreenshotSoupContext *context)
++reset_upload_button (gpointer user_data)
+{
++ ScreenshotSoupContext *context = user_data;
+ g_signal_handlers_disconnect_by_func (G_OBJECT (context->upload_button),
+ G_CALLBACK (toggle_request_cb),
-+ (gpointer)context);
++ user_data);
+
+ gtk_widget_set_visible (GTK_WIDGET (context->upload_progress), FALSE);
+ gtk_button_set_label (context->upload_button, _(BUTTON_TEXT_UPLOAD));
@@ -363,7 +472,7 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+ SoupMessage *msg,
+ gpointer user_data)
+{
-+ reset_upload_button ((ScreenshotSoupContext*)user_data);
++ reset_upload_button (user_data);
+ uploading = FALSE;
+
+ switch (msg->status_code) {
@@ -418,21 +527,22 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+ }
+}
+
-+/* Update the progress bar */
++/* Update the upload progress bar */
+static void
+wrote_data_cb (SoupMessage *msg,
+ SoupBuffer *chunk,
+ gpointer user_data)
+{
++ ScreenshotSoupContext *context = user_data;
+ static int total_sent;
+ float fraction;
+
-+ if (!gtk_widget_get_visible (GTK_WIDGET (user_data)))
-+ gtk_widget_set_visible (GTK_WIDGET (user_data), TRUE);
++ if (!gtk_widget_get_visible (GTK_WIDGET (context->upload_progress)))
++ gtk_widget_set_visible (GTK_WIDGET (context->upload_progress), TRUE);
+
+ total_sent += chunk->length;
+ fraction = ((float)total_sent) / msg->request_body->length;
-+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (user_data), fraction);
++ gtk_progress_bar_set_fraction (context->upload_progress, fraction);
+
+ /* Upload finished? Reset the counter. */
+ if (total_sent == msg->request_body->length)
@@ -443,16 +553,16 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+screenshot_uploaded_cb (SoupMessage *msg,
+ gpointer user_data)
+{
-+ imgur_response_cb (msg);
++ imgur_response_cb (msg, user_data);
+}
+
+/* Process the screenshot upload response from imgur.com
+ *
-+ * Also opens the image and delete links for the uploaded image
-+ * in the default http:// handler
++ * Also displays the image link and image delete link in the dialog box
+ * */
+static void
-+imgur_response_cb (SoupMessage *msg)
++imgur_response_cb (SoupMessage *msg,
++ gpointer user_data)
+{
+ JsonParser *parser = NULL;
+ JsonNode *node = NULL;
@@ -480,10 +590,7 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+ delete_uri = json_node_dup_string (json_array_get_element (json_node_get_array (node), 0));
+ json_node_free (node);
+
-+ screenshot_display_uris (image_uri, delete_uri);
-+
-+ g_free (image_uri);
-+ g_free (delete_uri);
++ screenshot_display_uris (image_uri, delete_uri, user_data);
+
+out:
+ if (error)
@@ -492,17 +599,28 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.c gnome-utils-3.
+ g_object_unref (parser);
+}
+
++/* Displays the image link and image delete link in the dialog box */
+static void
-+screenshot_display_uris (gchar *image_uri,
-+ gchar *delete_uri)
++screenshot_display_uris (gchar *image_uri,
++ gchar *delete_uri,
++ gpointer user_data)
+{
-+ g_app_info_launch_default_for_uri (image_uri, NULL, NULL);
-+ g_app_info_launch_default_for_uri (delete_uri, NULL, NULL);
++ ScreenshotSoupContext *context = user_data;
++
++ gtk_button_set_label (GTK_BUTTON (context->image_link), image_uri);
++ gtk_button_set_label (GTK_BUTTON (context->delete_link), delete_uri);
++ gtk_link_button_set_uri (context->image_link, image_uri);
++ gtk_link_button_set_uri (context->delete_link, delete_uri);
++
++ gtk_widget_set_visible (GTK_WIDGET (context->image_link_label), TRUE);
++ gtk_widget_set_visible (GTK_WIDGET (context->delete_link_label), TRUE);
++ gtk_widget_set_visible (GTK_WIDGET (context->image_link), TRUE);
++ gtk_widget_set_visible (GTK_WIDGET (context->delete_link), TRUE);
+}
diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.h gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.h
--- gnome-utils-3.2.1//gnome-screenshot/screenshot-share.h 1970-01-01 05:30:00.000000000 +0530
-+++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.h 2012-02-20 03:37:25.214569203 +0530
-@@ -0,0 +1,43 @@
++++ gnome-utils-3.2.1.new//gnome-screenshot/screenshot-share.h 2012-02-20 22:10:17.441349867 +0530
+@@ -0,0 +1,47 @@
+/* screenshot-share.h - online screenshot sharing
+ * vim: set sts=2 sw=2 et :
+ *
@@ -535,6 +653,10 @@ diff -Naur gnome-utils-3.2.1//gnome-screenshot/screenshot-share.h gnome-utils-3.
+ SoupMessage *msg;
+ GtkButton *upload_button;
+ GtkProgressBar *upload_progress;
++ GtkLabel *image_link_label;
++ GtkLabel *delete_link_label;
++ GtkLinkButton *image_link;
++ GtkLinkButton *delete_link;
+};
+
+typedef struct ScreenshotSoupContext ScreenshotSoupContext;
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-20 18:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-19 22:16 [gentoo-commits] dev/nirbheek:master commit in: gnome-extra/gnome-utils/files/, gnome-extra/gnome-utils/ Nirbheek Chauhan
-- strict thread matches above, loose matches on Subject: below --
2012-02-20 18:03 Nirbheek Chauhan
2012-02-18 15:41 Nirbheek Chauhan
2012-02-18 14:43 Nirbheek Chauhan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox