Commit b0e76145 authored by Benedikt Meurer's avatar Benedikt Meurer

2006-04-12 Benedikt Meurer <benny@xfce.org>

	* plugins/thunar-apr/, acinclude.m4, plugins/Makefile.am,
	  configure.in.in: Import the "Advanced Properties" plugin.
	* README: Add note about optional pcre and libexif dependencies.
	* po/POTFILES.in: Add new files.
	* po/Thunar.pot, po/*.po: Merge new strings.
	* po/de.po: Update german translations.




(Old svn revision: 20858)
parent 03e45fb9
2006-04-12 Benedikt Meurer <benny@xfce.org>
* plugins/thunar-apr/, acinclude.m4, plugins/Makefile.am,
configure.in.in: Import the "Advanced Properties" plugin.
* README: Add note about optional pcre and libexif dependencies.
* po/POTFILES.in: Add new files.
* po/Thunar.pot, po/*.po: Merge new strings.
* po/de.po: Update german translations.
2006-04-11 Benedikt Meurer <benny@xfce.org>
* thunar-vfs/thunar-vfs-deep-count-job.c
......
......@@ -24,8 +24,10 @@ Thunar can optionally use the following packages:
- HAL 0.5.0 or above (esp. the libhal-storage devel package)
- gamin 0.1.0 or above
- gconf 2.4 or above
- libexif 0.6 or above
- libjpeg 6 or above
- libstartup-notification 0.4 or above
- pcre 6.0 or above
Installation
......
......@@ -8,6 +8,25 @@ dnl
dnl # BM_THUNAR_PLUGIN_APR()
dnl #
dnl # Check whether the "Advanced Properties" plugin
dnl # should be built and installed.
dnl #
AC_DEFUN([BM_THUNAR_PLUGIN_APR],
[
AC_ARG_ENABLE([apr-plugin], [AC_HELP_STRING([--disable-apr-plugin], [Don't build the thunar-apr plugin, see plugins/thunar-apr/README])],
[ac_bm_thunar_plugin_apr=$enable_val], [ac_bm_thunar_plugin_apr=yes])
AC_MSG_CHECKING([whether to build the thunar-apr plugin])
AM_CONDITIONAL([THUNAR_PLUGIN_APR], [test x"$ac_bm_thunar_plugin_apr" = x"yes"])
AC_MSG_RESULT([$ac_bm_thunar_plugin_apr])
dnl Check for libexif (for the "Image" properties page)
XDT_CHECK_OPTIONAL_PACKAGE([EXIF], [libexif], [0.6.0], [exif], [Exif support])
])
dnl # BM_THUNAR_PLUGIN_SBR()
dnl #
dnl # Check whether the "Simple Builtin Renamers" plugin
......
......@@ -341,6 +341,7 @@ AC_SUBST([PLATFORM_LDFLAGS])
dnl ************************************
dnl *** Check for additional plugins ***
dnl ************************************
BM_THUNAR_PLUGIN_APR()
BM_THUNAR_PLUGIN_SBR()
BM_THUNAR_PLUGIN_UCA()
......@@ -370,6 +371,7 @@ icons/48x48/Makefile
icons/scalable/Makefile
pixmaps/Makefile
plugins/Makefile
plugins/thunar-apr/Makefile
plugins/thunar-sbr/Makefile
plugins/thunar-uca/Makefile
po/Makefile.in
......@@ -413,6 +415,7 @@ echo "* Volume Manager: $ac_bm_thunar_vfs_volume_impl"
echo
echo "Additional Plugins:"
echo
echo "* Advanced Properties: $ac_bm_thunar_plugin_apr"
echo "* Simple Builting Renamers: $ac_bm_thunar_plugin_sbr"
echo "* User Customizable Actions: $ac_bm_thunar_plugin_uca"
echo
# $Id$
if THUNAR_PLUGIN_APR
THUNAR_APR_SUBDIRS = thunar-apr
endif
if THUNAR_PLUGIN_SBR
THUNAR_SBR_SUBDIRS = thunar-sbr
endif
......@@ -9,6 +13,7 @@ THUNAR_UCA_SUBDIRS = thunar-uca
endif
SUBDIRS = \
$(THUNAR_APR_SUBDIRS) \
$(THUNAR_SBR_SUBDIRS) \
$(THUNAR_UCA_SUBDIRS)
......
# $Id$
INCLUDES = \
-I$(top_builddir) \
-I$(top_builddir)/plugins \
-I$(top_srcdir) \
-I$(top_srcdir)/plugins \
-DEXO_API_SUBJECT_TO_CHANGE \
-DG_LOG_DOMAIN=\"thunar-apr\" \
$(PLATFORM_CPPFLAGS)
extensionsdir = $(libdir)/thunarx-$(THUNAR_VERSION_API)
extensions_LTLIBRARIES = \
thunar-apr.la
thunar_apr_la_SOURCES = \
thunar-apr-abstract-page.c \
thunar-apr-abstract-page.h \
thunar-apr-desktop-page.c \
thunar-apr-desktop-page.h \
thunar-apr-image-page.c \
thunar-apr-image-page.h \
thunar-apr-plugin.c \
thunar-apr-provider.c \
thunar-apr-provider.h
thunar_apr_la_CFLAGS = \
$(EXIF_CFLAGS) \
$(EXO_CFLAGS) \
$(PLATFORM_CFLAGS)
thunar_apr_la_LDFLAGS = \
-avoid-version \
-export-dynamic \
-module \
$(PLATFORM_LDFLAGS)
thunar_apr_la_LIBADD = \
$(EXIF_LIBS)
EXTRA_DIST = \
README
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
Thunar Advanced Properties (thunar-apr)
=======================================
Thunar-apr is an extension to Thunar, which provides additional pages for
the file properties dialog, that are displayed for certain kinds of files:
* Launcher/Link
* Image
The Launcher/Link page is displayed for .desktop files and allows users to
easily edit the most important values (i.e. the command for a launcher and
the URL for a link).
The Image page is displayed for all kinds of image files supported by the
GTK+ version used by Thunar. The page displays atleast the exact format of
the image and the dimensions in pixels. If the plugin is build with support
for libexif (you can explicitly disable this using the `--disable-exif'
configure option) and the image file includes Exif tags, the most important
Exif tags found in the image file will also be displayed.
By default the thunar-apr extension will be installed, but as with every
extension, it will slightly increase the resource usage of Thunar (this
shouldn't be a real problem unless you're targeting an embedded system),
and so you can pass `--disable-apr-plugin' to configure and the plugin
won't be built and installed. Since it is an extension, you can also
easily uninstall it afterwards by removing the thunar-apr.so file from
the lib/thunarx-1/ directory of your installation (be sure to quit Thunar
before removing files though).
/* $Id$ */
/*-
* Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <thunar-apr/thunar-apr-abstract-page.h>
/* Property identifiers */
enum
{
PROP_0,
PROP_FILE,
};
/* Signal identifiers */
enum
{
FILE_CHANGED,
LAST_SIGNAL,
};
static void thunar_apr_abstract_page_class_init (ThunarAprAbstractPageClass *klass);
static void thunar_apr_abstract_page_init (ThunarAprAbstractPage *abstract_page);
static void thunar_apr_abstract_page_dispose (GObject *object);
static void thunar_apr_abstract_page_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void thunar_apr_abstract_page_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void thunar_apr_abstract_page_file_changed (ThunarAprAbstractPage *abstract_page,
ThunarxFileInfo *file);
static guint abstract_page_signals[LAST_SIGNAL];
THUNARX_DEFINE_ABSTRACT_TYPE (ThunarAprAbstractPage,
thunar_apr_abstract_page,
THUNARX_TYPE_PROPERTY_PAGE);
static void
thunar_apr_abstract_page_class_init (ThunarAprAbstractPageClass *klass)
{
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->dispose = thunar_apr_abstract_page_dispose;
gobject_class->get_property = thunar_apr_abstract_page_get_property;
gobject_class->set_property = thunar_apr_abstract_page_set_property;
/**
* ThunarAprAbstractPage:file:
*
* The #ThunarxFileInfo for the file being displayed by
* this property page.
**/
g_object_class_install_property (gobject_class,
PROP_FILE,
g_param_spec_object ("file", "file", "file",
THUNARX_TYPE_FILE_INFO,
G_PARAM_READWRITE));
/**
* ThunarAprAbstractPage::file-changed:
* @abstract_page : a #ThunarAprAbstractPage.
* @file : a #ThunarxFileInfo.
*
* Emitted by @abstract_page whenever the associated
* @file changes.
**/
abstract_page_signals[FILE_CHANGED] =
g_signal_new ("file-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ThunarAprAbstractPageClass, file_changed),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
THUNARX_TYPE_FILE_INFO);
}
static void
thunar_apr_abstract_page_init (ThunarAprAbstractPage *abstract_page)
{
}
static void
thunar_apr_abstract_page_dispose (GObject *object)
{
ThunarAprAbstractPage *abstract_page = THUNAR_APR_ABSTRACT_PAGE (object);
/* disconnect from the file */
thunar_apr_abstract_page_set_file (abstract_page, NULL);
(*G_OBJECT_CLASS (thunar_apr_abstract_page_parent_class)->dispose) (object);
}
static void
thunar_apr_abstract_page_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ThunarAprAbstractPage *abstract_page = THUNAR_APR_ABSTRACT_PAGE (object);
switch (prop_id)
{
case PROP_FILE:
g_value_set_object (value, thunar_apr_abstract_page_get_file (abstract_page));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
thunar_apr_abstract_page_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ThunarAprAbstractPage *abstract_page = THUNAR_APR_ABSTRACT_PAGE (object);
switch (prop_id)
{
case PROP_FILE:
thunar_apr_abstract_page_set_file (abstract_page, g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
thunar_apr_abstract_page_file_changed (ThunarAprAbstractPage *abstract_page,
ThunarxFileInfo *file)
{
/* emit the "file-changed" signal */
g_signal_emit (G_OBJECT (abstract_page), abstract_page_signals[FILE_CHANGED], 0, file);
}
/**
* thunar_apr_abstract_page_get_file:
* @abstract_page : a #ThunarAprAbstractPage.
*
* Returns the #ThunarxFileInfo for the file being
* displayed by the @abstract_page.
*
* Return value: the file for @abstract_page.
**/
ThunarxFileInfo*
thunar_apr_abstract_page_get_file (ThunarAprAbstractPage *abstract_page)
{
g_return_val_if_fail (THUNAR_APR_IS_ABSTRACT_PAGE (abstract_page), NULL);
return abstract_page->file;
}
/**
* thunar_apr_abstract_page_set_file:
* @abstract_page : a #ThunarAprAbstractPage.
* @file : a #ThunarxFileInfo or %NULL.
*
* Sets the #ThunarxFileInfo being displayed by the
* @abstract_page to @file. If @file is %NULL, the
* property will be reset.
**/
void
thunar_apr_abstract_page_set_file (ThunarAprAbstractPage *abstract_page,
ThunarxFileInfo *file)
{
g_return_if_fail (THUNAR_APR_IS_ABSTRACT_PAGE (abstract_page));
g_return_if_fail (file == NULL || THUNARX_IS_FILE_INFO (file));
/* verify that we don't already display that file */
if (G_UNLIKELY (abstract_page->file == file))
return;
/* disconnect from the previous file */
if (G_UNLIKELY (abstract_page->file != NULL))
{
g_signal_handlers_disconnect_by_func (G_OBJECT (abstract_page->file), thunar_apr_abstract_page_file_changed, abstract_page);
g_object_unref (G_OBJECT (abstract_page->file));
}
/* activate the new file */
abstract_page->file = file;
/* connect to the new file */
if (G_LIKELY (file != NULL))
{
/* connect "changed" signal and take a reference */
g_signal_connect_swapped (G_OBJECT (file), "changed", G_CALLBACK (thunar_apr_abstract_page_file_changed), abstract_page);
g_object_ref (G_OBJECT (file));
/* update the initial state */
thunar_apr_abstract_page_file_changed (abstract_page, file);
}
/* notify listeners */
g_object_notify (G_OBJECT (abstract_page), "file");
}
/* $Id$ */
/*-
* Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __THUNAR_APR_ABSTRACT_PAGE_H__
#define __THUNAR_APR_ABSTRACT_PAGE_H__
#include <thunarx/thunarx.h>
G_BEGIN_DECLS;
typedef struct _ThunarAprAbstractPageClass ThunarAprAbstractPageClass;
typedef struct _ThunarAprAbstractPage ThunarAprAbstractPage;
#define THUNAR_APR_TYPE_ABSTRACT_PAGE (thunar_apr_abstract_page_get_type ())
#define THUNAR_APR_ABSTRACT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_APR_TYPE_ABSTRACT_PAGE, ThunarAprAbstractPage))
#define THUNAR_APR_ABSTRACT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_APR_TYPE_ABSTRACT_PAGE, ThunarAprAbstractPageClass))
#define THUNAR_APR_IS_ABSTRACT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_APR_TYPE_ABSTRACT_PAGE))
#define THUNAR_APR_IS_ABSTRACT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_APR_TYPE_ABSTRACT_PAGE))
#define THUNAR_APR_ABSTRACT_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_APR_TYPE_ABSTRACT_PAGE, ThunarAprAbstractPageClass))
struct _ThunarAprAbstractPageClass
{
ThunarxPropertyPageClass __parent__;
/* signals */
void (*file_changed) (ThunarAprAbstractPage *abstract_page,
ThunarxFileInfo *file);
};
struct _ThunarAprAbstractPage
{
ThunarxPropertyPage __parent__;
ThunarxFileInfo *file;
};
GType thunar_apr_abstract_page_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL;
void thunar_apr_abstract_page_register_type (ThunarxProviderPlugin *plugin) G_GNUC_INTERNAL;
ThunarxFileInfo *thunar_apr_abstract_page_get_file (ThunarAprAbstractPage *abstract_page) G_GNUC_INTERNAL;
void thunar_apr_abstract_page_set_file (ThunarAprAbstractPage *abstract_page,
ThunarxFileInfo *file) G_GNUC_INTERNAL;
G_END_DECLS;
#endif /* !__THUNAR_APR_ABSTRACT_PAGE_H__ */
/* $Id$ */
/*-
* Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifdef HAVE_MEMORY_H
#include <memory.h>
#endif
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <exo/exo.h>
#include <thunar-apr/thunar-apr-desktop-page.h>
/* use g_access() if available */
#if GLIB_CHECK_VERSION(2,8,0)
#include <glib/gstdio.h>
#else
#define g_access(filename, mode) (access ((filename), (mode)))
#endif
static void thunar_apr_desktop_page_class_init (ThunarAprDesktopPageClass *klass);
static void thunar_apr_desktop_page_init (ThunarAprDesktopPage *desktop_page);
static void thunar_apr_desktop_page_finalize (GObject *object);
static void thunar_apr_desktop_page_file_changed (ThunarAprAbstractPage *abstract_page,
ThunarxFileInfo *file);
static void thunar_apr_desktop_page_save (ThunarAprDesktopPage *desktop_page,
GtkWidget *widget);
static void thunar_apr_desktop_page_save_widget (ThunarAprDesktopPage *desktop_page,
GtkWidget *widget,
GKeyFile *key_file);
static void thunar_apr_desktop_page_activated (GtkWidget *entry,
ThunarAprDesktopPage *desktop_page);
static gboolean thunar_apr_desktop_page_focus_out_event (GtkWidget *entry,
GdkEventFocus *event,
ThunarAprDesktopPage *desktop_page);
static void thunar_apr_desktop_page_toggled (GtkWidget *button,
ThunarAprDesktopPage *desktop_page);
struct _ThunarAprDesktopPageClass
{
ThunarAprAbstractPageClass __parent__;
};
struct _ThunarAprDesktopPage
{
ThunarAprAbstractPage __parent__;
GtkTooltips *tooltips;
GtkWidget *description_entry;
GtkWidget *command_entry;
GtkWidget *url_entry;
GtkWidget *comment_entry;
GtkWidget *snotify_button;
GtkWidget *terminal_button;
/* the values of the entries remember when
* the file was saved last time to avoid a
* race condition between saving the file
* and the FAM notification which is received
* with some delay and would otherwise over-
* ride the (possibly changed) values of the
* entries.
*/
gchar *description_text;
gchar *command_text;
gchar *url_text;
gchar *comment_text;
};
THUNARX_DEFINE_TYPE (ThunarAprDesktopPage,
thunar_apr_desktop_page,
THUNAR_APR_TYPE_ABSTRACT_PAGE);
static void
thunar_apr_desktop_page_class_init (ThunarAprDesktopPageClass *klass)
{
ThunarAprAbstractPageClass *thunarapr_abstract_page_class;
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_apr_desktop_page_finalize;
thunarapr_abstract_page_class = THUNAR_APR_ABSTRACT_PAGE_CLASS (klass);
thunarapr_abstract_page_class->file_changed = thunar_apr_desktop_page_file_changed;
}
static void
thunar_apr_desktop_page_init (ThunarAprDesktopPage *desktop_page)
{
AtkRelationSet *relations;
PangoAttribute *attribute;
PangoAttrList *attr_list;
AtkRelation *relation;
AtkObject *object;
GtkWidget *table;
GtkWidget *label;
gtk_container_set_border_width (GTK_CONTAINER (desktop_page), 12);
/* allocate the shared tooltips */
desktop_page->tooltips = gtk_tooltips_new ();
exo_gtk_object_ref_sink (GTK_OBJECT (desktop_page->tooltips));
/* allocate shared bold Pango attributes */
attr_list = pango_attr_list_new ();
attribute = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
attribute->start_index = 0;
attribute->end_index = -1;
pango_attr_list_insert (attr_list, attribute);
table = gtk_table_new (7, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
gtk_table_set_row_spacings (GTK_TABLE (table), 0);
gtk_container_add (GTK_CONTAINER (desktop_page), table);
gtk_widget_show (table);