Commit d9c1f19c authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

started work on a picasa web uploader

parent 5d95f363
......@@ -46,6 +46,7 @@ GSTREAMER_REQUIRED=0.10
OPENRAW_REQUIRED=0.0.8
UNIQUE_REQUIRED=1.1.2
LIBSOUP_REQUIRED=2.26
GNOME_KEYRING_REQUIRED=2.28
dnl ===========================================================================
......@@ -302,6 +303,22 @@ AC_MSG_RESULT($enable_libopenraw)
dnl ===========================================================================
AC_ARG_ENABLE([gnome-keyring],
[AS_HELP_STRING([--disable-gnome-keyring],[do not compile code that uses the gnome-keyring library])],,
[enable_gnome_keyring=yes])
if test x$enable_gnome_keyring = xyes ; then
PKG_CHECK_MODULES(GNOME_KEYRING,
[gnome-keyring-1 >= $GNOME_KEYRING_REQUIRED],
[AC_DEFINE(HAVE_GNOME_KEYRING, 1, [Have gnome-keyring])
enable_gnome_keyring=yes],
[enable_gnome_keyring=no])
fi
AC_SUBST(GNOME_KEYRING_CFLAGS)
AC_SUBST(GNOME_KEYRING_LIBS)
dnl ===========================================================================
AC_ARG_ENABLE([libsoup],
[AS_HELP_STRING([--disable-libsoup],[do not compile code that uses the libsoup library])],,
[enable_libsoup=yes])
......@@ -320,6 +337,7 @@ if test x$enable_libsoup = xyes ; then
fi
AC_SUBST(LIBSOUP_CFLAGS)
AC_SUBST(LIBSOUP_LIBS)
AM_CONDITIONAL(ENABLE_WEB_SERVICES, test "x$enable_libsoup" = xyes)
dnl ===========================================================================
......@@ -387,6 +405,9 @@ extensions/list_tools/data/ui/Makefile
extensions/photo_importer/Makefile
extensions/photo_importer/data/Makefile
extensions/photo_importer/data/ui/Makefile
extensions/picasaweb/Makefile
extensions/picasaweb/data/Makefile
extensions/picasaweb/data/ui/Makefile
extensions/pixbuf_savers/Makefile
extensions/pixbuf_savers/data/Makefile
extensions/pixbuf_savers/data/ui/Makefile
......@@ -432,4 +453,5 @@ Configuration:
GStreamer support : ${enable_gstreamer}
Use libopenraw : ${enable_libopenraw}
Web services : ${enable_libsoup}
Use GNOME Keyring : ${enable_gnome_keyring}
"
......@@ -15,6 +15,7 @@ SUBDIRS = \
jpeg_utils \
list_tools \
photo_importer \
picasaweb \
pixbuf_savers \
raw_files \
red_eye_removal \
......
if ENABLE_WEB_SERVICES
SUBDIRS = data
extensiondir = $(pkglibdir)/extensions
extension_LTLIBRARIES = libpicasaweb.la
libpicasaweb_la_SOURCES = \
actions.c \
actions.h \
callbacks.c \
callbacks.h \
dlg-export-to-picasaweb.c \
dlg-export-to-picasaweb.h \
google-connection.c \
google-connection.h \
gth-account-chooser-dialog.c \
gth-account-chooser-dialog.h \
gth-account-properties-dialog.c \
gth-account-properties-dialog.h \
main.c \
picasa-web-service.c \
picasa-web-service.h \
preferences.h
libpicasaweb_la_CPPFLAGS = $(GTHUMB_CFLAGS) $(LIBSOUP_CFLAGS) $(GNOME_KEYRING_CFLAGS) -I$(top_srcdir) -I$(top_builddir)/gthumb
libpicasaweb_la_LDFLAGS = $(EXTENSION_LIBTOOL_FLAGS)
libpicasaweb_la_LIBADD = $(GTHUMB_LIBS)
libpicasaweb_la_DEPENDENCIES = $(top_builddir)/gthumb/gthumb$(EXEEXT)
extensioninidir = $(extensiondir)
extensionini_in_files = picasaweb.extension.in.in
extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
$< > $@ )
%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
EXTRA_DIST = $(extensionini_in_files)
DISTCLEANFILES = $(extensionini_DATA)
endif
-include $(top_srcdir)/git.mk
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* GThumb
*
* Copyright (C) 2010 Free Software Foundation, Inc.
*
* 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 Street #330, Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include <glib/gi18n.h>
#include <gthumb.h>
#include "dlg-export-to-picasaweb.h"
void
gth_browser_activate_action_export_picasaweb (GtkAction *action,
GthBrowser *browser)
{
dlg_export_to_picasaweb (browser);
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* GThumb
*
* Copyright (C) 2010 Free Software Foundation, Inc.
*
* 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 Street #330, Boston, MA 02111-1307, USA.
*/
#ifndef ACTIONS_H
#define ACTIONS_H
#include <gtk/gtk.h>
#define DEFINE_ACTION(x) void x (GtkAction *action, gpointer data);
DEFINE_ACTION(gth_browser_activate_action_export_picasaweb)
#endif /* ACTIONS_H */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* GThumb
*
* Copyright (C) 2010 Free Software Foundation, Inc.
*
* 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 Street #330, Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include <glib/gi18n.h>
#include <glib-object.h>
#include <gthumb.h>
#include "actions.h"
#define BROWSER_DATA_KEY "picasaweb-browser-data"
static const char *ui_info =
"<ui>"
" <menubar name='MenuBar'>"
" <menu name='File' action='FileMenu'>"
" <menu name='Export' action='ExportMenu'>"
" <placeholder name='Web_Services'>"
" <menuitem action='File_Export_PicasaWeb'/>"
" </placeholder>"
" </menu>"
" </menu>"
" </menubar>"
"</ui>";
static GtkActionEntry action_entries[] = {
{ "File_Export_PicasaWeb", NULL,
N_("Picasa Web Album..."), NULL,
N_("Upload photos to Picasa Web Album"),
G_CALLBACK (gth_browser_activate_action_export_picasaweb) },
};
typedef struct {
GtkActionGroup *action_group;
} BrowserData;
static void
browser_data_free (BrowserData *data)
{
g_free (data);
}
void
pw__gth_browser_construct_cb (GthBrowser *browser)
{
BrowserData *data;
GError *error = NULL;
guint merge_id;
g_return_if_fail (GTH_IS_BROWSER (browser));
data = g_new0 (BrowserData, 1);
data->action_group = gtk_action_group_new ("Picasa Web Actions");
gtk_action_group_set_translation_domain (data->action_group, NULL);
gtk_action_group_add_actions (data->action_group,
action_entries,
G_N_ELEMENTS (action_entries),
browser);
gtk_ui_manager_insert_action_group (gth_browser_get_ui_manager (browser), data->action_group, 0);
merge_id = gtk_ui_manager_add_ui_from_string (gth_browser_get_ui_manager (browser), ui_info, -1, &error);
if (merge_id == 0) {
g_warning ("building ui failed: %s", error->message);
g_clear_error (&error);
}
g_object_set_data_full (G_OBJECT (browser), BROWSER_DATA_KEY, data, (GDestroyNotify) browser_data_free);
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* GThumb
*
* Copyright (C) 2010 Free Software Foundation, Inc.
*
* 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 Street #330, Boston, MA 02111-1307, USA.
*/
#ifndef CALLBACKS_H
#define CALLBACKS_H
#include <gthumb.h>
void pw__gth_browser_construct_cb (GthBrowser *browser);
#endif /* CALLBACKS_H */
SUBDIRS = ui
schemadir = @GCONF_SCHEMA_FILE_DIR@
schema_in_files = gthumb-picasaweb.schemas.in
schema_DATA = $(schema_in_files:.schemas.in=.schemas)
@INTLTOOL_SCHEMAS_RULE@
if GCONF_SCHEMAS_INSTALL
install-data-local:
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/extensions/picasaweb/data/$(schema_DATA)
endif
EXTRA_DIST = $(schema_in_files)
CLEANFILES = $(schema_DATA)
-include $(top_srcdir)/git.mk
<gconfschemafile>
<schemalist>
<schema>
<key>/schemas/apps/gthumb/ext/picasaweb/synchronize</key>
<applyto>/apps/gthumb/ext/picasaweb/synchronize</applyto>
<owner>gthumb</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
uidir = $(pkgdatadir)/ui
ui_DATA = \
export-to-picasaweb.ui \
picasaweb-account.ui
EXTRA_DIST = $(ui_DATA)
-include $(top_srcdir)/git.mk
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="export_dialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">Upload to Picasa Web Albums</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox7">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">A_ccount:</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="account_combobox">
<property name="width_request">300</property>
<property name="visible">True</property>
<property name="model">account_liststore</property>
<child>
<object class="GtkCellRendererPixbuf" id="cellrenderertext1"/>
<attributes>
<attribute name="sensitive">4</attribute>
<attribute name="icon-name">3</attribute>
</attributes>
</child>
<child>
<object class="GtkCellRendererText" id="cellrenderertext3"/>
<attributes>
<attribute name="sensitive">4</attribute>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Albums:</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="height_request">150</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="treeview1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">album_liststore</property>
<property name="headers_visible">False</property>
<property name="headers_clickable">False</property>
<property name="search_column">1</property>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="title">column</property>
<child>
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"/>
<attributes>
<attribute name="icon-name">3</attribute>
</attributes>
</child>
<child>
<object class="GtkCellRendererText" id="cellrenderertext5"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButton" id="button2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Add a new album</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area7">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="close_button">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="upload_button">
<property name="label" translatable="yes">_Upload</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">upload_image</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button1">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">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>
</object>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-6">close_button</action-widget>
<action-widget response="-5">upload_button</action-widget>
<action-widget response="-11">button1</action-widget>
</action-widgets>
</object>
<object class="GtkImage" id="upload_image">
<property name="visible">True</property>
<property name="stock">gtk-goto-top</property>
</object>
<object class="GtkListStore" id="album_liststore">
<columns>
<!-- column-name album data -->
<column type="gpointer"/>
<!-- column-name type -->
<column type="gint"/>
<!-- column-name name -->
<column type="gchararray"/>
<!-- column-name icon name -->
<column type="gchararray"/>
<!-- column-name sensitive -->
<column type="gboolean"/>
</columns>
</object>
<object class="GtkListStore" id="account_liststore">
<columns>
<!-- column-name account data -->
<column type="gpointer"/>