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

Splitted the flickr and 23 uploaders in two separate extensions

parent 74867797
......@@ -601,6 +601,7 @@ data/ui/Makefile
help/Makefile
m4/Makefile
extensions/Makefile
extensions/23hq/Makefile
extensions/bookmarks/Makefile
extensions/bookmarks/data/Makefile
extensions/bookmarks/data/ui/Makefile
......@@ -644,9 +645,10 @@ extensions/file_viewer/Makefile
extensions/find_duplicates/Makefile
extensions/find_duplicates/data/Makefile
extensions/find_duplicates/data/ui/Makefile
extensions/flicker_utils/Makefile
extensions/flicker_utils/data/Makefile
extensions/flicker_utils/data/ui/Makefile
extensions/flicker/Makefile
extensions/flicker/data/Makefile
extensions/flicker/data/ui/Makefile
extensions/gstreamer_tools/Makefile
extensions/gstreamer_tools/data/Makefile
extensions/gstreamer_tools/data/ui/Makefile
......
[Extension]
_Name=23
_Description=Upload images to 23hq.com
Authors=gthumb development team
Copyright=Copyright © 2011 The Free Software Foundation, Inc.
Version=%VERSION%
Icon=site-twentythree
Category=Exporter
[Loader]
Type=module
File=%LIBRARY%
Requires=importer;export_tools;flicker_utils
if ENABLE_WEB_SERVICES
extensiondir = $(pkglibdir)/extensions
extension_LTLIBRARIES = lib23hq.la
lib23hq_la_SOURCES = \
actions.c \
actions.h \
callbacks.c \
callbacks.h \
main.c
lib23hq_la_CFLAGS = $(GTHUMB_CFLAGS) $(LIBSOUP_CFLAGS) $(GNOME_KEYRING_CFLAGS) -I$(top_srcdir) -I$(top_builddir)/gthumb
lib23hq_la_LDFLAGS = $(EXTENSION_LIBTOOL_FLAGS)
lib23hq_la_LIBADD = $(GTHUMB_LIBS) $(LIBSOUP_LIBS) $(GNOME_KEYRING_LIBS) ../importer/libimporter.la ../export_tools/libexport_tools.la ../flicker_utils/libflicker_utils.la
lib23hq_la_DEPENDENCIES = $(top_builddir)/gthumb/gthumb$(EXEEXT)
extensioninidir = $(extensiondir)
extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
DISTCLEANFILES = $(extensionini_DATA)
endif
extensionini_in_files = 23hq.extension.in.in
@GTHUMB_EXTENSION_IN_RULE@
@GTHUMB_EXTENSION_RULE@
EXTRA_DIST = $(extensionini_in_files)
-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, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <glib/gi18n.h>
#include <gthumb.h>
#include <extensions/flicker_utils/dlg-export-to-flickr.h>
#include <extensions/flicker_utils/dlg-import-from-flickr.h>
#include <extensions/flicker_utils/flickr-types.h>
static FlickrServer www_23hq_com = {
"23",
"http://www.23hq.com",
"http://www.23hq.com/services/auth/",
"http://www.23hq.com/services/rest",
"http://www.23hq.com/services/upload/",
"www.23hq.com",
"8960706ee7f4151e893b11837e9c24ce",
"1ff8d1e45c873423",
TRUE
};
void
gth_browser_activate_action_export_23 (GtkAction *action,
GthBrowser *browser)
{
GList *items;
GList *file_list;
items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
file_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
if (file_list == NULL)
file_list = gth_file_store_get_visibles (gth_browser_get_file_store (browser));
dlg_export_to_flickr (&www_23hq_com, browser, file_list);
_g_object_list_unref (file_list);
_gtk_tree_path_list_free (items);
}
void
gth_browser_activate_action_import_23 (GtkAction *action,
GthBrowser *browser)
{
dlg_import_from_flickr (&www_23hq_com, 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, see <http://www.gnu.org/licenses/>.
*/
#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_23)
DEFINE_ACTION(gth_browser_activate_action_import_23)
#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, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <glib/gi18n.h>
#include <glib-object.h>
#include <gthumb.h>
#include "actions.h"
#define BROWSER_DATA_KEY "23hq-browser-data"
static const char *ui_info =
"<ui>"
" <menubar name='MenuBar'>"
" <menu name='File' action='FileMenu'>"
" <menu name='Import' action='ImportMenu'>"
" <placeholder name='Web_Services'>"
" <menuitem action='File_Import_23'/>"
" </placeholder>"
" </menu>"
" <menu name='Export' action='ExportMenu'>"
" <placeholder name='Web_Services'>"
" <menuitem action='File_Export_23'/>"
" </placeholder>"
" </menu>"
" </menu>"
" </menubar>"
" <popup name='ExportPopup'>"
" <placeholder name='Web_Services'>"
" <menuitem action='File_Export_23'/>"
" </placeholder>"
" </popup>"
"</ui>";
static GtkActionEntry action_entries[] = {
{ "File_Import_23", "site-twentythree",
N_("_23..."), NULL,
N_("Download photos from 23"),
G_CALLBACK (gth_browser_activate_action_import_23) },
{ "File_Export_23", "site-twentythree",
N_("_23..."), NULL,
N_("Upload photos to 23"),
G_CALLBACK (gth_browser_activate_action_export_23) },
};
typedef struct {
GtkActionGroup *action_group;
} BrowserData;
static void
browser_data_free (BrowserData *data)
{
g_free (data);
}
void
tt__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 ("23HQ 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);
}
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (gtk_ui_manager_get_widget (gth_browser_get_ui_manager (browser), "/MenuBar/File/Import/Web_Services/File_Import_23")), TRUE);
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (gtk_ui_manager_get_widget (gth_browser_get_ui_manager (browser), "/MenuBar/File/Export/Web_Services/File_Export_23")), TRUE);
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (gtk_ui_manager_get_widget (gth_browser_get_ui_manager (browser), "/ExportPopup/Web_Services/File_Export_23")), TRUE);
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, see <http://www.gnu.org/licenses/>.
*/
#ifndef CALLBACKS_H
#define CALLBACKS_H
#include <gthumb.h>
void tt__gth_browser_construct_cb (GthBrowser *browser);
#endif /* CALLBACKS_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, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <gtk/gtk.h>
#include <gthumb.h>
#include "callbacks.h"
G_MODULE_EXPORT void
gthumb_extension_activate (void)
{
gth_hook_add_callback ("gth-browser-construct", 10, G_CALLBACK (tt__gth_browser_construct_cb), NULL);
}
G_MODULE_EXPORT void
gthumb_extension_deactivate (void)
{
}
G_MODULE_EXPORT gboolean
gthumb_extension_is_configurable (void)
{
return FALSE;
}
G_MODULE_EXPORT void
gthumb_extension_configure (GtkWindow *parent)
{
}
FLICKR_EXPORTERS = \
23hq \
flicker \
$(NULL)
EXPORTERS = \
export_tools \
burn_disc \
contact_sheet \
facebook \
flicker \
flicker_utils \
$(FLICKR_EXPORTERS) \
photobucket \
picasaweb \
webalbums \
......
......@@ -4,7 +4,7 @@ _Description=Upload images to Facebook
Authors=gthumb development team
Copyright=Copyright © 2010 The Free Software Foundation, Inc.
Version=%VERSION%
Icon=facebook
Icon=site-facebook
Category=Exporter
[Loader]
......
if ENABLE_WEB_SERVICES
SUBDIRS = data
extensiondir = $(pkglibdir)/extensions
extension_LTLIBRARIES = libflicker.la
......@@ -10,34 +8,11 @@ libflicker_la_SOURCES = \
actions.h \
callbacks.c \
callbacks.h \
dlg-export-to-flickr.c \
dlg-export-to-flickr.h \
dlg-import-from-flickr.c \
dlg-import-from-flickr.h \
flickr-account.c \
flickr-account.h \
flickr-account-chooser-dialog.c \
flickr-account-chooser-dialog.h \
flickr-account-manager-dialog.c \
flickr-account-manager-dialog.h \
flickr-authentication.c \
flickr-authentication.h \
flickr-connection.c \
flickr-connection.h \
flickr-photo.c \
flickr-photo.h \
flickr-photoset.c \
flickr-photoset.h \
flickr-service.c \
flickr-service.h \
flickr-types.h \
flickr-user.c \
flickr-user.h \
main.c
libflicker_la_CFLAGS = $(GTHUMB_CFLAGS) $(LIBSOUP_CFLAGS) $(GNOME_KEYRING_CFLAGS) -I$(top_srcdir) -I$(top_builddir)/gthumb
libflicker_la_LDFLAGS = $(EXTENSION_LIBTOOL_FLAGS)
libflicker_la_LIBADD = $(GTHUMB_LIBS) $(LIBSOUP_LIBS) $(GNOME_KEYRING_LIBS) ../importer/libimporter.la ../export_tools/libexport_tools.la
libflicker_la_LIBADD = $(GTHUMB_LIBS) $(LIBSOUP_LIBS) $(GNOME_KEYRING_LIBS) ../importer/libimporter.la ../export_tools/libexport_tools.la ../flicker_utils/libflicker_utils.la
libflicker_la_DEPENDENCIES = $(top_builddir)/gthumb/gthumb$(EXEEXT)
extensioninidir = $(extensiondir)
......
......@@ -23,9 +23,9 @@
#include <config.h>
#include <glib/gi18n.h>
#include <gthumb.h>
#include "dlg-export-to-flickr.h"
#include "dlg-import-from-flickr.h"
#include "flickr-types.h"
#include <extensions/flicker_utils/dlg-export-to-flickr.h>
#include <extensions/flicker_utils/dlg-import-from-flickr.h>
#include <extensions/flicker_utils/flickr-types.h>
static FlickrServer www_flickr_com = {
......@@ -41,19 +41,6 @@ static FlickrServer www_flickr_com = {
};
static FlickrServer www_23hq_com = {
"23",
"http://www.23hq.com",
"http://www.23hq.com/services/auth/",
"http://www.23hq.com/services/rest",
"http://www.23hq.com/services/upload/",
"www.23hq.com",
"8960706ee7f4151e893b11837e9c24ce",
"1ff8d1e45c873423",
TRUE
};
void
gth_browser_activate_action_export_flicker (GtkAction *action,
GthBrowser *browser)
......@@ -78,29 +65,3 @@ gth_browser_activate_action_import_flicker (GtkAction *action,
{
dlg_import_from_flickr (&www_flickr_com, browser);
}
void
gth_browser_activate_action_export_23 (GtkAction *action,
GthBrowser *browser)
{
GList *items;
GList *file_list;
items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
file_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
if (file_list == NULL)
file_list = gth_file_store_get_visibles (gth_browser_get_file_store (browser));
dlg_export_to_flickr (&www_23hq_com, browser, file_list);
_g_object_list_unref (file_list);
_gtk_tree_path_list_free (items);
}
void
gth_browser_activate_action_import_23 (GtkAction *action,
GthBrowser *browser)
{
dlg_import_from_flickr (&www_23hq_com, browser);
}
......@@ -28,7 +28,5 @@
DEFINE_ACTION(gth_browser_activate_action_export_flicker)
DEFINE_ACTION(gth_browser_activate_action_import_flicker)
DEFINE_ACTION(gth_browser_activate_action_export_23)
DEFINE_ACTION(gth_browser_activate_action_import_23)
#endif /* ACTIONS_H */
......@@ -37,13 +37,11 @@ static const char *ui_info =
" <menu name='Import' action='ImportMenu'>"
" <placeholder name='Web_Services'>"
" <menuitem action='File_Import_Flicker'/>"
" <menuitem action='File_Import_23'/>"
" </placeholder>"
" </menu>"
" <menu name='Export' action='ExportMenu'>"
" <placeholder name='Web_Services'>"
" <menuitem action='File_Export_Flicker'/>"
" <menuitem action='File_Export_23'/>"
" </placeholder>"
" </menu>"
" </menu>"
......@@ -51,7 +49,6 @@ static const char *ui_info =
" <popup name='ExportPopup'>"
" <placeholder name='Web_Services'>"
" <menuitem action='File_Export_Flicker'/>"
" <menuitem action='File_Export_23'/>"
" </placeholder>"
" </popup>"
"</ui>";
......@@ -66,14 +63,6 @@ static GtkActionEntry action_entries[] = {
N_("_Flickr..."), NULL,
N_("Upload photos to Flickr"),
G_CALLBACK (gth_browser_activate_action_export_flicker) },
{ "File_Import_23", "site-twentythree",
N_("_23..."), NULL,
N_("Download photos from 23"),
G_CALLBACK (gth_browser_activate_action_import_23) },
{ "File_Export_23", "site-twentythree",
N_("_23..."), NULL,
N_("Upload photos to 23"),
G_CALLBACK (gth_browser_activate_action_export_23) },
};
......@@ -118,9 +107,5 @@ fl__gth_browser_construct_cb (GthBrowser *browser)
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (gtk_ui_manager_get_widget (gth_browser_get_ui_manager (browser), "/MenuBar/File/Export/Web_Services/File_Export_Flicker")), TRUE);
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (gtk_ui_manager_get_widget (gth_browser_get_ui_manager (browser), "/ExportPopup/Web_Services/File_Export_Flicker")), TRUE);
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (gtk_ui_manager_get_widget (gth_browser_get_ui_manager (browser), "/MenuBar/File/Import/Web_Services/File_Import_23")), TRUE);
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (gtk_ui_manager_get_widget (gth_browser_get_ui_manager (browser), "/MenuBar/File/Export/Web_Services/File_Export_23")), TRUE);
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (gtk_ui_manager_get_widget (gth_browser_get_ui_manager (browser), "/ExportPopup/Web_Services/File_Export_23")), TRUE);
g_object_set_data_full (G_OBJECT (browser), BROWSER_DATA_KEY, data, (GDestroyNotify) browser_data_free);
}
......@@ -4,10 +4,10 @@ _Description=Upload images to Flickr
Authors=gthumb development team
Copyright=Copyright © 2010 The Free Software Foundation, Inc.
Version=%VERSION%
Icon=flickr
Icon=site-flickr
Category=Exporter
[Loader]
Type=module
File=%LIBRARY%
Requires=importer;export_tools
Requires=importer;export_tools;flicker_utils
if ENABLE_WEB_SERVICES
SUBDIRS = data
extensiondir = $(pkglibdir)/extensions
extension_LTLIBRARIES = libflicker_utils.la
libflicker_utils_la_SOURCES = \
dlg-export-to-flickr.c \
dlg-export-to-flickr.h \
dlg-import-from-flickr.c \
dlg-import-from-flickr.h \
flickr-account.c \
flickr-account.h \
flickr-account-chooser-dialog.c \
flickr-account-chooser-dialog.h \
flickr-account-manager-dialog.c \
flickr-account-manager-dialog.h \
flickr-authentication.c \
flickr-authentication.h \
flickr-connection.c \
flickr-connection.h \
flickr-photo.c \
flickr-photo.h \
flickr-photoset.c \
flickr-photoset.h \
flickr-service.c \
flickr-service.h \
flickr-types.h \
flickr-user.c \
flickr-user.h \
main.c
libflicker_utils_la_CFLAGS = $(GTHUMB_CFLAGS) $(LIBSOUP_CFLAGS) $(GNOME_KEYRING_CFLAGS) -I$(top_srcdir) -I$(top_builddir)/gthumb
libflicker_utils_la_LDFLAGS = $(EXTENSION_LIBTOOL_FLAGS)
libflicker_utils_la_LIBADD = $(GTHUMB_LIBS) $(LIBSOUP_LIBS) $(GNOME_KEYRING_LIBS) ../importer/libimporter.la ../export_tools/libexport_tools.la
libflicker_utils_la_DEPENDENCIES = $(top_builddir)/gthumb/gthumb$(EXEEXT)
extensioninidir = $(extensiondir)
extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
DISTCLEANFILES = $(extensionini_DATA)
endif
extensionini_in_files = flicker_utils.extension.in.in
@GTHUMB_EXTENSION_IN_RULE@
@GTHUMB_EXTENSION_RULE@
EXTRA_DIST = $(extensionini_in_files)
-include $(top_srcdir)/git.mk