Commit 22414e79 authored by Paolo Bacchilega's avatar Paolo Bacchilega

Merge branch 'flicker'

parents adb6db47 f46520c4
......@@ -432,6 +432,9 @@ extensions/file_tools/Makefile
extensions/file_tools/data/Makefile
extensions/file_tools/data/ui/Makefile
extensions/file_viewer/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
......
......@@ -9,7 +9,9 @@ icons_DATA = \
file-catalog.png \
file-library.png \
file-search.png \
flickr.png \
histogram.png \
picasaweb.png \
tool-adjust-colors.png \
tool-crop.png \
tool-desaturate.png \
......
......@@ -11,6 +11,7 @@ SUBDIRS = \
file_manager \
file_tools \
file_viewer \
flicker \
gstreamer_utils \
gstreamer_tools \
image_print \
......
......@@ -691,6 +691,28 @@ get_display_name (GFile *file,
}
static char *
get_edit_name (GFile *file,
const char *name,
GthDateTime *date_time)
{
GString *display_name;
char *basename;
display_name = g_string_new ("");
basename = g_file_get_basename (file);
if ((basename == NULL) || (strcmp (basename, "/") == 0)) {
g_string_append (display_name, _("Catalogs"));
}
else {
if (name != NULL)
g_string_append (display_name, name);
}
return g_string_free (display_name, FALSE);
}
static void
update_standard_attributes (GFile *file,
GFileInfo *info,
......@@ -698,6 +720,7 @@ update_standard_attributes (GFile *file,
GthDateTime *date_time)
{
char *display_name;
char *edit_name;
if (gth_datetime_valid (date_time)) {
char *sort_order_s;
......@@ -711,8 +734,16 @@ update_standard_attributes (GFile *file,
g_file_info_set_sort_order (info, 99999999);
display_name = get_display_name (file, name, date_time);
if (display_name != NULL)
if (display_name != NULL) {
g_file_info_set_display_name (info, display_name);
g_free (display_name);
}
edit_name = get_edit_name (file, name, date_time);
if (edit_name != NULL) {
g_file_info_set_edit_name (info, edit_name);
g_free (edit_name);
}
}
......@@ -973,6 +1004,7 @@ gth_catalog_update_standard_attributes (GFile *file,
GFileInfo *info)
{
char *display_name = NULL;
char *edit_name = NULL;
char *basename;
basename = g_file_get_basename (file);
......@@ -1015,12 +1047,17 @@ gth_catalog_update_standard_attributes (GFile *file,
gth_datetime_free (date_time);
g_free (name);
}
else
else {
display_name = g_strdup (_("Catalogs"));
edit_name = g_strdup (_("Catalogs"));
}
if (display_name != NULL)
g_file_info_set_display_name (info, display_name);
if (edit_name != NULL)
g_file_info_set_edit_name (info, edit_name);
g_free (edit_name);
g_free (display_name);
g_free (basename);
}
......
if ENABLE_WEB_SERVICES
SUBDIRS = data
extensiondir = $(pkglibdir)/extensions
extension_LTLIBRARIES = libflicker.la
libflicker_la_SOURCES = \
actions.c \
actions.h \
callbacks.c \
callbacks.h \
dlg-export-to-flickr.c \
dlg-export-to-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-connection.c \
flickr-connection.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) -I$(top_srcdir) -I$(top_builddir)/gthumb
libflicker_la_LDFLAGS = $(EXTENSION_LIBTOOL_FLAGS)
libflicker_la_LIBADD = $(GTHUMB_LIBS) $(LIBSOUP_LIBS)
libflicker_la_DEPENDENCIES = $(top_builddir)/gthumb/gthumb$(EXEEXT)
extensioninidir = $(extensiondir)
extensionini_in_files = flicker.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-flickr.h"
void
gth_browser_activate_action_export_flicker (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 (browser, file_list);
_g_object_list_unref (file_list);
_gtk_tree_path_list_free (items);
}
/* -*- 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_flicker)
#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 "flicker-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_Flicker'/>"
" </placeholder>"
" </menu>"
" </menu>"
" </menubar>"
"</ui>";
static GtkActionEntry action_entries[] = {
{ "File_Export_Flicker", "flickr",
N_("_Flickr..."), NULL,
N_("Upload photos to Flickr"),
G_CALLBACK (gth_browser_activate_action_export_flicker) },
};
typedef struct {
GtkActionGroup *action_group;
} BrowserData;
static void
browser_data_free (BrowserData *data)
{
g_free (data);
}
void
fl__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 ("Flicker 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 fl__gth_browser_construct_cb (GthBrowser *browser);
#endif /* CALLBACKS_H */
SUBDIRS = ui
-include $(top_srcdir)/git.mk
uidir = $(pkgdatadir)/ui
ui_DATA = \
export-to-flickr.ui \
flicker-account-chooser.ui \
flicker-account-manager.ui \
flicker-ask-authorization.ui \
flicker-complete-authorization.ui \
flicker-export-completed.ui
EXTRA_DIST = $(ui_DATA)
-include $(top_srcdir)/git.mk
This diff is collapsed.
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkVBox" id="account_chooser">
<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="hbox3">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label1">
<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="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
</object>
<object class="GtkListStore" id="account_liststore">
<columns>
<!-- column-name account -->
<column type="GObject"/>
<!-- column-name name -->
<column type="gchararray"/>
</columns>
</object>
</interface>
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkListStore" id="accounts_liststore">
<columns>
<!-- column-name data -->
<column type="GObject"/>
<!-- column-name username -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkVBox" id="account_manager">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">A_ccounts:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">account_treeview</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<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="account_treeview">
<property name="width_request">300</property>
<property name="height_request">150</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">accounts_liststore</property>
<property name="headers_visible">False</property>
<property name="headers_clickable">False</property>
<property name="reorderable">True</property>
<property name="search_column">1</property>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<child>
<object class="GtkCellRendererText" id="account_cellrenderertext"/>
<attributes>
<attribute name="text">1</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>
<property name="spacing">6</property>
<child>
<object class="GtkButton" id="delete_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="stock">gtk-delete</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>
</interface>
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkMessageDialog" id="ask_authorization_messagedialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">Upload to Flickr</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="type_hint">normal</property>
<property name="skip_taskbar_hint">True</property>
<property name="message_type">other</property>
<property name="text" translatable="yes">gthumb requires your authorization to upload the photos to Flickr</property>
<property name="secondary_text" translatable="yes">Click 'Authorize' to open your web browser and authorize gthumb to upload photos to Flickr. When you're finished, return to this window to complete the authorization.</property>
<property name="image">icon_image</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="cancel_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="authorize_button">
<property name="label" translatable="yes">_Authorize...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">button_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>
</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">cancel_button</action-widget>
<action-widget response="-5">authorize_button</action-widget>
</action-widgets>
</object>
<object class="GtkImage" id="button_image">
<property name="visible">True</property>
<property name="stock">gtk-dialog-authentication</property>
</object>
<object class="GtkImage" id="icon_image">
<property name="visible">True</property>
<property name="yalign">0</property>
<property name="stock">gtk-dialog-authentication</property>
<property name="icon-size">6</property>
</object>
</interface>
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkMessageDialog" id="complete_authorization_messagedialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">Upload to Flickr</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="type_hint">normal</property>
<property name="skip_taskbar_hint">True</property>
<property name="message_type">other</property>
<property name="text" translatable="yes">Return to this window when you have finished the authorization process on Flickr.com</property>
<property name="secondary_text" translatable="yes">Once you're done, click the 'Continue' button below.</property>
<property name="image">icon_image1</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox4">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area4">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="cancel_button1">
<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>
<property name="xalign">0.50999999046325684</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="complete_button">
<property name="label" translatable="yes">C_ontinue</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">button_image1</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>
</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">cancel_button1</action-widget>
<action-widget response="-5">complete_button</action-widget>
</action-widgets>
</object>
<object class="GtkImage" id="icon_image1">
<property name="visible">True</property>
<property name="yalign">0</property>
<property name="stock">gtk-dialog-authentication</property>
<property name="icon-size">6</property>
</object>
<object class="GtkImage" id="button_image1">
<property name="visible">True</property>
<property name="stock">gtk-dialog-authentication</property>
</object>
</interface>