Commit 652a8495 authored by Michael J. Chudobiak's avatar Michael J. Chudobiak

First attempt at a gvfs-based photo importer - bug 583796

parent 310d2231
trunk, since last 2.10.x
Major Distro-Related Changes:
* gThumb now imports photos using the libgphoto2 backend for gvfs.
It is no longer necessary to unmount any gvfs/libgphoto2 mounts
under ~/.gvfs beforing importing. The import process may be
invoked using:
gthumb --import-photos
or
gthumb --import-photos /path/to/device/mount
If no path is given as an argument, gThumb will scan all folders
under /media and ~/.gvfs/gphoto2*, looking for "dcim" or "DCIM"
sub-folders.
UI Changes:
* Make the cropping dialog more intuitive. Bug #408342.
......
......@@ -100,8 +100,8 @@ Compiling
If the libtiff library is present you can save images in TIFF
format.
If the libgphoto2 library version >= 2.1.3 is present you can import
photos from your camera.
If the libgphoto2 backend for gvfs you can import photos from your
camera.
If the libopenraw library version >= 0.0.4 is present you can view
RAW photo thumbnails.
......
......@@ -31,7 +31,6 @@ LIBGNOMECANVAS_REQUIRED=2.6.0
GIO_REQUIRED=2.16.1
GNOME_VFS_REQUIRED=2.6.0
LIBGLADE_REQUIRED=2.4.0
LIBGPHOTO_REQUIRED=2.1.3
BONOBO_REQUIRED=2.6.0
LIBOPENRAW_REQUIRED=0.0.4
EXIV2_REQUIRED=0.18
......@@ -46,7 +45,6 @@ AC_SUBST(LIBGNOMECANVAS_REQUIRED)
AC_SUBST(GIO_REQUIRED)
AC_SUBST(GNOME_VFS_REQUIRED)
AC_SUBST(LIBGLADE_REQUIRED)
AC_SUBST(LIBGPHOTO_REQUIRED)
AC_SUBST(BONOBO_REQUIRED)
AC_SUBST(LIBOPENRAW_REQUIRED)
AC_SUBST(EXIV2_REQUIRED)
......@@ -136,21 +134,6 @@ fi
AC_SUBST(XTEST_LIBS)
#
# Checks for libgphoto2
#
AC_ARG_ENABLE([gphoto2],
[AC_HELP_STRING([--disable-gphoto2],[disable support for libgphoto2])],,
[enable_gphoto2=yes])
HAVE_GPHOTO2=no
if test x$enable_gphoto2 = xyes ; then
PKG_CHECK_MODULES(GPHOTO, libgphoto2 >= $LIBGPHOTO_REQUIRED,
[AC_DEFINE(HAVE_LIBGPHOTO, 1, [Define to 1 to enable libgphoto2 support])
HAVE_GPHOTO2=yes],
[HAVE_GPHOTO2=no])
fi
#
# Checks for libopenraw
#
......@@ -362,7 +345,6 @@ Configuration:
Have XRender: ${HAVE_RENDER}
Have XTest: ${have_xtest}
Have libtiff: ${HAVE_TIFF}
Have libgphoto: ${HAVE_GPHOTO2}
Have libopenraw: ${HAVE_LIBOPENRAW}
Have gstreamer: ${HAVE_GSTREAMER}
Use Mac OS X menu: ${HAVE_MACOSMENU}
......
......@@ -154,83 +154,6 @@
<property name="homogeneous">False</property>
<property name="spacing">24</property>
<child>
<widget class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkButton" id="select_model_button">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Select a camera model</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<child>
<widget class="GtkImage" id="progress_camera_image">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="camera_model_label">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">No camera detected</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="i_commands_table">
<property name="visible">True</property>
......@@ -743,282 +666,4 @@
</child>
</widget>
<widget class="GtkDialog" id="camera_model_dialog">
<property name="border_width">6</property>
<property name="title" translatable="yes">Camera Model</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">True</property>
<property name="default_width">450</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="cm_refresh_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-refresh</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-6</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="cm_helpbutton">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-help</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-11</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="cm_cancelbutton">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-6</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="cm_okbutton">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<widget class="GtkLabel" id="label15">
<property name="visible">True</property>
<property name="label" translatable="yes">_Port:</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<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"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label14">
<property name="visible">True</property>
<property name="label" translatable="yes">_Model:</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</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">scrolledwindow1</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow1">
<property name="height_request">200</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="cm_model_treeview">
<property name="height_request">100</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox4">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkComboBox" id="cm_port_combobox">
<property name="visible">True</property>
<property name="items" translatable="yes"></property>
<property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<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="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox5">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="cm_manual_selection_checkbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">C_hoose from the catalog</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>
......@@ -3,7 +3,7 @@ _Name=gThumb Photo Import Tool
_GenericName=Photo Import Tool
_Comment=Import the photos on your camera card
Categories=GNOME;GTK;Graphics;Viewer;RasterGraphics;2DGraphics;Photography;
Exec=sh -c 'gvfs-mount -u ~/.gvfs/gphoto2*; exec gthumb --import-photos'
Exec=gthumb --import-photos %U
Icon=gthumb
MimeType=x-content/image-dcf;x-content/image-picturecd;
NoDisplay=true
......
......@@ -33,6 +33,7 @@
#include "gfile-utils.h"
#include "file-data.h"
#include "file-utils.h"
#include "gtk-utils.h"
/*
......@@ -859,3 +860,14 @@ gfile_output_stream_write_line (GFileOutputStream *ostream,
return (n1 == -1 || n2 == -1 ? -1 : n1 + n2);
}
void
gfile_list_free (GList *list)
{
if (list == NULL)
return;
g_list_foreach (list, (GFunc) g_object_unref, NULL);
g_list_free (list);
}
......@@ -84,6 +84,7 @@ GFile * gfile_get_home_dir (void);
GFile * gfile_get_tmp_dir (void);
GFile * gfile_get_temp_dir_name (void);
gboolean gfile_dir_remove_recursive (GFile *dir);
gboolean gfile_path_list_new (GFile *gfile,
GList **files,
GList **dirs);
......@@ -111,4 +112,7 @@ gssize gfile_output_stream_write (GFileOutputStream *ostream,
GError **error,
const char *str);
/* lists */
void gfile_list_free (GList *list);
#endif /* GFILE_UTILS_H */
......@@ -8,7 +8,7 @@ module GNOME {
oneway void open_browser (in string uri);
oneway void open_viewer (in string uri);
oneway void load_image (in string uri);
oneway void import_photos ();
oneway void import_photos (in string uri);
};
};
......
This diff is collapsed.
......@@ -25,6 +25,6 @@
#include "gth-browser.h"
void dlg_photo_importer (GthBrowser *browser);
void dlg_photo_importer (GthBrowser *browser, const char *uri);
#endif /* DLG_PHOTO_IMPORTER_H */
......@@ -33,6 +33,7 @@
#include "gth-viewer.h"
#include "gth-browser-actions-callbacks.h"
#include "main.h"
#include "dlg-photo-importer.h"
#ifdef HAVE_GDKX
#include <gdk/gdkx.h>
......@@ -160,9 +161,11 @@ impl_gth_application_load_image (PortableServer_Servant _servant,
static void
impl_gth_application_import_photos (PortableServer_Servant _servant,
const CORBA_char *uri,
CORBA_Environment *ev)
{
gth_browser_activate_action_file_camera_import (NULL, NULL);
dlg_photo_importer (NULL, uri);
}
......
......@@ -126,9 +126,7 @@ void
gth_browser_activate_action_file_camera_import (GtkAction *action,
GthBrowser *browser)
{
#ifdef HAVE_LIBGPHOTO
dlg_photo_importer (browser);
#endif /*HAVE_LIBGPHOTO */
dlg_photo_importer (browser, NULL);
}
......
......@@ -6962,12 +6962,6 @@ gth_browser_construct (GthBrowser *browser,
/**/
#ifndef HAVE_LIBGPHOTO
set_action_sensitive (browser, "File_CameraImport", FALSE);
#endif /* HAVE_LIBGPHOTO */
/**/
priv->sidebar_width = eel_gconf_get_integer (PREF_UI_SIDEBAR_SIZE, DEF_SIDEBAR_SIZE);
gtk_paned_set_position (GTK_PANED (paned1), eel_gconf_get_integer (PREF_UI_SIDEBAR_SIZE, DEF_SIDEBAR_SIZE));
gtk_paned_set_position (GTK_PANED (paned2), eel_gconf_get_integer (PREF_UI_SIDEBAR_CONTENT_SIZE, DEF_SIDEBAR_CONT_SIZE));
......
......@@ -30,6 +30,7 @@
#include "catalog.h"
#include "comments.h"
#include "main.h"
#include "dlg-photo-importer.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "gconf-utils.h"
......@@ -635,10 +636,15 @@ prepare_app (void)
}
if (ImportPhotos) {
const char *import_dir = NULL;
if (dir_urls)
import_dir = (char *) dir_urls->data;
if (use_factory)
GNOME_GThumb_Application_import_photos (app, &env);
GNOME_GThumb_Application_import_photos (app, import_dir, &env);
else
gth_browser_activate_action_file_camera_import (NULL, NULL);
dlg_photo_importer (NULL, import_dir);
}
else if (! view_comline_catalog
&& (n_dir_urls == 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment