[Xfce4-commits] <thunar-volman:jannis/port-to-udev-etc> Initial work on rewriting thunar-volman based on (g)udev.

Jannis Pohlmann noreply at xfce.org
Wed Jan 20 14:38:02 CET 2010


Updating branch refs/heads/jannis/port-to-udev-etc
         to 9a60a05211908bb2a6aa5df7edf309888425095f (commit)
       from a31c138ead39cd5cb5b365a62944e6a5e0842961 (commit)

commit 9a60a05211908bb2a6aa5df7edf309888425095f
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Wed Jan 20 14:35:54 2010 +0100

    Initial work on rewriting thunar-volman based on (g)udev.

 INSTALL                                |  199 ++++++--
 configure.in.in                        |  121 ++---
 thunar-volman/Makefile.am              |   53 +-
 thunar-volman/main.c                   |  195 ++++---
 thunar-volman/tvm-block-device.c       |  810 +++------------------------
 thunar-volman/tvm-block-device.h       |   40 +-
 thunar-volman/tvm-camera-device.c      |   89 ---
 thunar-volman/tvm-camera-device.h      |   35 --
 thunar-volman/tvm-command-entry.c      |  411 --------------
 thunar-volman/tvm-command-entry.h      |   61 --
 thunar-volman/tvm-crypto-volume.c      |  483 ----------------
 thunar-volman/tvm-crypto-volume.h      |   35 --
 thunar-volman/tvm-device.c             |  220 ++------
 thunar-volman/tvm-device.h             |   67 +--
 thunar-volman/tvm-input-device.c       |  105 +---
 thunar-volman/tvm-input-device.h       |   39 +-
 thunar-volman/tvm-pda-device.c         |  120 ----
 thunar-volman/tvm-pda-device.h         |   35 --
 thunar-volman/tvm-preferences-dialog.c |  719 ------------------------
 thunar-volman/tvm-preferences-dialog.h |   43 --
 thunar-volman/tvm-preferences.c        |  963 --------------------------------
 thunar-volman/tvm-preferences.h        |   43 --
 thunar-volman/tvm-printer-device.c     |   80 ---
 thunar-volman/tvm-printer-device.h     |   35 --
 thunar-volman/tvm-prompt.c             |  140 +++---
 thunar-volman/tvm-prompt.h             |   49 +-
 thunar-volman/tvm-run.c                |  369 +++----------
 thunar-volman/tvm-run.h                |   51 +-
 thunar-volman/xfce-heading.c           |  755 -------------------------
 thunar-volman/xfce-heading.h           |   82 ---
 thunar-volman/xfce-titled-dialog.c     |  370 ------------
 thunar-volman/xfce-titled-dialog.h     |   75 ---
 32 files changed, 761 insertions(+), 6131 deletions(-)

diff --git a/INSTALL b/INSTALL
index 5458714..7d1c323 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,18 +2,24 @@ Installation Instructions
 *************************
 
 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
-This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
+   Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.  This file is offered as-is,
+without warranty of any kind.
 
 Basic Installation
 ==================
 
-Briefly, the shell commands `./configure; make; make install' should
+   Briefly, the shell commands `./configure; make; make install' should
 configure, build, and install this package.  The following
 more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+instructions specific to this package.  Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below.  The lack of an optional feature in a given package is not
+necessarily a bug.  More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -42,7 +48,7 @@ may remove or edit it.
 you want to change it or regenerate `configure' using a newer version
 of `autoconf'.
 
-The simplest way to compile this package is:
+   The simplest way to compile this package is:
 
   1. `cd' to the directory containing the package's source code and type
      `./configure' to configure the package for your system.
@@ -53,12 +59,22 @@ The simplest way to compile this package is:
   2. Type `make' to compile the package.
 
   3. Optionally, type `make check' to run any self-tests that come with
-     the package.
+     the package, generally using the just-built uninstalled binaries.
 
   4. Type `make install' to install the programs and any data files and
-     documentation.
-
-  5. You can remove the program binaries and object files from the
+     documentation.  When installing into a prefix owned by root, it is
+     recommended that the package be configured and built as a regular
+     user, and only the `make install' phase executed with root
+     privileges.
+
+  5. Optionally, type `make installcheck' to repeat any self-tests, but
+     this time using the binaries in their final installed location.
+     This target does not install anything.  Running this target as a
+     regular user, particularly if the prior `make install' required
+     root privileges, verifies that the installation completed
+     correctly.
+
+  6. You can remove the program binaries and object files from the
      source code directory by typing `make clean'.  To also remove the
      files that `configure' created (so you can compile the package for
      a different kind of computer), type `make distclean'.  There is
@@ -67,12 +83,22 @@ The simplest way to compile this package is:
      all sorts of other programs in order to regenerate files that came
      with the distribution.
 
+  7. Often, you can also type `make uninstall' to remove the installed
+     files again.  In practice, not all packages have tested that
+     uninstallation works correctly, even though it is required by the
+     GNU Coding Standards.
+
+  8. Some packages, particularly those that use Automake, provide `make
+     distcheck', which can by used by developers to test that all other
+     targets like `make install' and `make uninstall' work correctly.
+     This target is generally not run by end users.
+
 Compilers and Options
 =====================
 
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about.  Run `./configure --help' for
-details on some of the pertinent environment variables.
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
 
    You can give `configure' initial values for configuration parameters
 by setting variables in the command line or in the environment.  Here
@@ -85,25 +111,41 @@ is an example:
 Compiling For Multiple Architectures
 ====================================
 
-You can compile the package for more than one kind of computer at the
+   You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
 own directory.  To do this, you can use GNU `make'.  `cd' to the
 directory where you want the object files and executables to go and run
 the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
+source code in the directory that `configure' is in and in `..'.  This
+is known as a "VPATH" build.
 
    With a non-GNU `make', it is safer to compile the package for one
 architecture at a time in the source code directory.  After you have
 installed the package for one architecture, use `make distclean' before
 reconfiguring for another architecture.
 
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
 Installation Names
 ==================
 
-By default, `make install' installs the package's commands under
+   By default, `make install' installs the package's commands under
 `/usr/local/bin', include files under `/usr/local/include', etc.  You
 can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
 
    You can specify separate installation prefixes for
 architecture-specific files and architecture-independent files.  If you
@@ -114,16 +156,47 @@ Documentation and other data files still use the regular prefix.
    In addition, if you use an unusual directory layout you can give
 options like `--bindir=DIR' to specify different values for particular
 kinds of files.  Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
+you can set and what kinds of files go in them.  In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+   The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+   The first method involves providing an override variable for each
+affected directory.  For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'.  Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated.  The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+   The second method involves providing the `DESTDIR' variable.  For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names.  The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters.  On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
 
    If the package supports it, you can cause programs to be installed
 with an extra prefix or suffix on their names by giving `configure' the
 option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
 
-Optional Features
-=================
-
-Some packages pay attention to `--enable-FEATURE' options to
+   Some packages pay attention to `--enable-FEATURE' options to
 `configure', where FEATURE indicates an optional part of the package.
 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
 is something like `gnu-as' or `x' (for the X Window System).  The
@@ -135,14 +208,53 @@ find the X include and library files automatically, but if it doesn't,
 you can use the `configure' options `--x-includes=DIR' and
 `--x-libraries=DIR' to specify their locations.
 
+   Some packages offer the ability to configure how verbose the
+execution of `make' will be.  For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+   On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'.  It is recommended to use the following options:
+
+     ./configure --prefix=/boot/common
+
 Specifying the System Type
 ==========================
 
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
 `--build=TYPE' option.  TYPE can either be a short name for the system
 type, such as `sun4', or a canonical name which has the form:
 
@@ -150,7 +262,8 @@ type, such as `sun4', or a canonical name which has the form:
 
 where SYSTEM can have one of these forms:
 
-     OS KERNEL-OS
+     OS
+     KERNEL-OS
 
    See the file `config.sub' for the possible values of each field.  If
 `config.sub' isn't included in this package, then this package doesn't
@@ -168,9 +281,9 @@ eventually be run) with `--host=TYPE'.
 Sharing Defaults
 ================
 
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
 `configure' looks for `PREFIX/share/config.site' if it exists, then
 `PREFIX/etc/config.site' if it exists.  Or, you can set the
 `CONFIG_SITE' environment variable to the location of the site script.
@@ -179,7 +292,7 @@ A warning: not all `configure' scripts look for a site script.
 Defining Variables
 ==================
 
-Variables not defined in a site shell script can be set in the
+   Variables not defined in a site shell script can be set in the
 environment passed to `configure'.  However, some packages may run
 configure again during the build, and the customized values of these
 variables may be lost.  In order to avoid this problem, you should set
@@ -198,11 +311,19 @@ an Autoconf bug.  Until the bug is fixed you can use this workaround:
 `configure' Invocation
 ======================
 
-`configure' recognizes the following options to control how it operates.
+   `configure' recognizes the following options to control how it
+operates.
 
 `--help'
 `-h'
-     Print a summary of the options to `configure', and exit.
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
 
 `--version'
 `-V'
@@ -229,6 +350,16 @@ an Autoconf bug.  Until the bug is fixed you can use this workaround:
      Look for the package's source code in directory DIR.  Usually
      `configure' can determine that directory automatically.
 
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
 `configure' also accepts some other, not widely useful, options.  Run
 `configure --help' for more details.
 
diff --git a/configure.in.in b/configure.in.in
index e99da55..763e3cc 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -1,19 +1,31 @@
-dnl $Id$
-dnl
-dnl Copyright (c) 2004-2007
-dnl         The Thunar development team. All rights reserved.
-dnl
-dnl Written for thunar-volman by Benedikt Meurer <benny at xfce.org>.
-dnl
+# vi:set et ai sw=2 sts=2 ts=2: */
+#-
+# Copyright (c) 2004-2007 Benedikt Meurer <benny at xfce.org>
+# Copyright (c) 2010      Jannis Pohlmann <jannis at xfce.org>
+#
+# 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., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
 
 dnl ***************************
 dnl *** Version information ***
 dnl ***************************
 m4_define([tvm_version_major], [0])
-m4_define([tvm_version_minor], [3])
-m4_define([tvm_version_micro], [80])
-m4_define([tvm_version_build], [r at REVISION@])
-m4_define([tvm_version_tag], [])
+m4_define([tvm_version_minor], [5])
+m4_define([tvm_version_micro], [0])
+m4_define([tvm_version_build], [@REVISION@])
+m4_define([tvm_version_tag], [git])
 m4_define([tvm_version], [tvm_version_major().tvm_version_minor().tvm_version_micro()ifelse(tvm_version_tag(), [svn], [tvm_version_tag()-tvm_version_build()], [tvm_version_tag()])])
 
 dnl *******************************************
@@ -24,10 +36,11 @@ m4_define([tvm_debug_default], [ifelse(tvm_version_tag(), [svn], [yes], [minimum
 dnl ***************************
 dnl *** Initialize autoconf ***
 dnl ***************************
-AC_COPYRIGHT([Copyright (c) 2004-2007
-        The Thunar development team. All rights reserved.
-        
-Written for thunar-volman by Benedikt Meurer <benny at xfce.org>.])
+AC_COPYRIGHT([Copyright (c) 2004-2007 Benedikt Meurer <benny at xfce.org>
+Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
+
+All rights reserved.
+])
 AC_INIT([thunar-volman], [tvm_version], [http://bugzilla.xfce.org/])
 AC_PREREQ([2.50])
 AC_CANONICAL_TARGET()
@@ -55,6 +68,7 @@ AC_PROG_CC_C_O()
 AC_PROG_LD()
 AC_PROG_INSTALL()
 AC_PROG_INTLTOOL()
+AM_PROG_CC_C_O()
 
 dnl **************************
 dnl *** Initialize libtool ***
@@ -65,7 +79,7 @@ AC_PROG_LIBTOOL()
 dnl **********************************
 dnl *** Check for standard headers ***
 dnl **********************************
-AC_CHECK_HEADERS([errno.h path.h stdarg.h sys/types.h sys/wait.h])
+AC_CHECK_HEADERS([stdio.h])
 
 dnl ************************************
 dnl *** Check for standard functions ***
@@ -81,79 +95,24 @@ dnl ***********************************
 dnl *** Check for required packages ***
 dnl ***********************************
 XDT_CHECK_PACKAGE([DBUS], [dbus-glib-1], [0.34])
-XDT_CHECK_PACKAGE([EXO_HAL], [exo-hal-0.3], [0.3.7.1svn-r27445])
-XDT_CHECK_PACKAGE([HAL], [hal], [0.5.0])
-XDT_CHECK_PACKAGE([THUNAR_VFS], [thunar-vfs-1], [0.5.1])
+XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.18.0])
+XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.18.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
+XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.18.0])
+XDT_CHECK_PACKAGE([GUDEV], [gudev-1.0], [145])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.7.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.7.0])
+XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.7.0])
 
 dnl ***********************************
 dnl *** Check for debugging support ***
 dnl ***********************************
-AC_ARG_ENABLE([debug],
-AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes/full@:>@], [Turn on debugging @<:@default=tvm_debug_default@:>@]),
-  [], [enable_debug=tvm_debug_default])
-AC_MSG_CHECKING([whether to enable debugging support])
-if test x"$enable_debug" = x"full" -o x"$enable_debug" = x"yes"; then
-  dnl Print the result
-  AC_MSG_RESULT([$enable_debug])
-
-  dnl Make sure we detect possible errors (if supported)
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -Wall -Werror"
-  AC_MSG_CHECKING([whether $CC accepts -Wall -Werror])
-  AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
-    AC_MSG_RESULT([yes])
-    PLATFORM_CFLAGS="$PLATFORM_CFLAGS -Wall -Werror"
-  ], [
-    AC_MSG_RESULT([no])
-  ])
-  CFLAGS="$save_CFLAGS"
-
-  dnl Paranoia for --enable-debug=full
-  if test x"$enable_debug" = x"full"; then
-    dnl Enable extensive debugging
-    PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_ENABLE_DEBUG"
-
-    dnl Use -O0 -g3 if the compiler supports it
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS -O0 -g3"
-    AC_MSG_CHECKING([whether $CC accepts -O0 -g3])
-    AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
-      AC_MSG_RESULT([yes])
-      PLATFORM_CFLAGS="$PLATFORM_CFLAGS -O0 -g3"
-    ], [
-      AC_MSG_RESULT([no])
-    ])
-    CFLAGS="$save_CFLAGS"
-  fi
-else
-  dnl Print the result
-  AC_MSG_RESULT([$enable_debug])
-
-  dnl Disable debugging (release build)
-  PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DNDEBUG"
-
-  dnl Disable object cast checks
-  PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_DISABLE_CAST_CHECKS"
-
-  dnl Disable all checks for --enable-debug=no
-  if test x"$enable_debug" = x"no"; then
-    PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
-  fi
-fi
+XDT_FEATURE_DEBUG()
 
 dnl **************************************
 dnl *** Check for linker optimizations ***
 dnl **************************************
-AC_MSG_CHECKING([whether $LD accepts -O1])
-case `$LD -O1 -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -Wl,-O1"
-  AC_MSG_RESULT([yes])
-  ;;
-*)
-  AC_MSG_RESULT([no])
-  ;;
-esac
+XDT_FEATURE_LINKER_OPTS()
 
 dnl *********************************
 dnl *** Substitute platform flags ***
diff --git a/thunar-volman/Makefile.am b/thunar-volman/Makefile.am
index c072b41..e4cb767 100644
--- a/thunar-volman/Makefile.am
+++ b/thunar-volman/Makefile.am
@@ -7,6 +7,7 @@ INCLUDES =								\
 	-DEXO_API_SUBJECT_TO_CHANGE					\
 	-DEXO_DISABLE_DEPRECATED					\
 	-DG_LOG_DOMAIN=\"thunar-volman\"				\
+	-DG_UDEV_API_IS_SUBJECT_TO_CHANGE				\
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"				\
 	$(PLATFORM_CPPFLAGS)
 
@@ -15,42 +16,29 @@ bin_PROGRAMS =								\
 
 thunar_volman_SOURCES =							\
 	main.c								\
-	tvm-block-device.c						\
 	tvm-block-device.h						\
-	tvm-camera-device.c						\
-	tvm-camera-device.h						\
-	tvm-command-entry.c						\
-	tvm-command-entry.h						\
-	tvm-crypto-volume.c						\
-	tvm-crypto-volume.h						\
-	tvm-device.c							\
+	tvm-block-device.c						\
 	tvm-device.h							\
-	tvm-input-device.c						\
+	tvm-device.c							\
 	tvm-input-device.h						\
-	tvm-pango-extensions.c						\
+	tvm-input-device.c						\
 	tvm-pango-extensions.h						\
-	tvm-pda-device.c						\
-	tvm-pda-device.h						\
-	tvm-preferences-dialog.c					\
-	tvm-preferences-dialog.h					\
-	tvm-preferences.c						\
-	tvm-preferences.h						\
-	tvm-printer-device.c						\
-	tvm-printer-device.h						\
-	tvm-prompt.c							\
+	tvm-pango-extensions.c						\
 	tvm-prompt.h							\
-	tvm-run.c							\
+	tvm-prompt.c							\
 	tvm-run.h							\
-	xfce-heading.c							\
-	xfce-heading.h							\
-	xfce-titled-dialog.c						\
-	xfce-titled-dialog.h
+	tvm-run.c
 
 thunar_volman_CFLAGS =							\
 	$(DBUS_CFLAGS)							\
-	$(EXO_HAL_CFLAGS)						\
-	$(HAL_CFLAGS)							\
-	$(THUNAR_VFS_CFLAGS)						\
+	$(GIO_CFLAGS)							\
+	$(GLIB_CFLAGS)							\
+	$(GTK_CFLAGS)							\
+	$(GTHREAD_CFLAGS)						\
+	$(GUDEV_CFLAGS)							\
+	$(LIBXFCE4UI_CFLAGS)						\
+	$(LIBXFCE4UTIL_CFLAGS)						\
+	$(XFCONF_CFLAGS)						\
 	$(PLATFORM_CFLAGS)
 
 thunar_volman_LDFLAGS =							\
@@ -59,8 +47,13 @@ thunar_volman_LDFLAGS =							\
 
 thunar_volman_LDADD =							\
 	$(DBUS_LIBS)							\
-	$(EXO_HAL_LIBS)							\
-	$(HAL_LIBS)							\
-	$(THUNAR_VFS_LIBS)
+	$(GIO_LIBS)							\
+	$(GLIB_LIBS)							\
+	$(GTK_LIBS)							\
+	$(GTHREAD_LIBS)							\
+	$(GUDEV_LIBS)							\
+	$(LIBXFCE4UI_LIBS)						\
+	$(LIBXFCE4UTIL_LIBS)						\
+	$(XFCONF_LIBS)
 
 # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/thunar-volman/main.c b/thunar-volman/main.c
index e4e4f15..216f61e 100644
--- a/thunar-volman/main.c
+++ b/thunar-volman/main.c
@@ -1,66 +1,85 @@
-/* $Id$ */
+/* vi:set et ai sw=2 sts=2 ts=2: */
 /*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
  *
- * 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 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.
+ * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
+#ifdef HAVE_STDIO_H
 #include <stdio.h>
+#endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
-#include <glib/gstdio.h>
+#include <glib.h>
+#include <glib/gi18n.h>
 
-#include <exo-hal/exo-hal.h>
+#include <gudev/gudev.h>
 
-#include <thunar-vfs/thunar-vfs.h>
+#include <xfconf/xfconf.h>
 
 #include <thunar-volman/tvm-device.h>
-#include <thunar-volman/tvm-preferences-dialog.h>
 
 
 
-/* --- globals --- */
-static gchar   *opt_hal_udi = NULL;
-static gboolean opt_configure = FALSE;
-static gboolean opt_version = FALSE;
+/* variables for command line options */
+static gchar *opt_sysfs_path = NULL;
+static gchar *opt_configure = FALSE;
+static gchar *opt_version = FALSE;
 
 
 
-/* --- command line options --- */
+/* command line options */
 static GOptionEntry option_entries[] =
 {
-  { "device-added", 'a', 0, G_OPTION_ARG_STRING, &opt_hal_udi, N_ ("The HAL device UDI of the newly added device"), NULL, },
+  { "device-added", 'a', 0, G_OPTION_ARG_STRING, &opt_sysfs_path, N_ ("The sysfs path of the newly added device"), NULL, },
   { "configure", 'c', 0, G_OPTION_ARG_NONE, &opt_configure, N_ ("Configure management of removable drives and media"), NULL, },
-  { "version", 'v', 0, G_OPTION_ARG_NONE, &opt_version, N_ ("Print version information and exit"), NULL, },
+  { "version", 'V', 0, G_OPTION_ARG_NONE, &opt_version, N_ ("Print version information and exit"), NULL, },
   { NULL, },
 };
 
 
 
+/* udev subsystems supported by thunar-volman */
+static const gchar *subsystems[] = 
+{
+  "block",
+  "input",
+  NULL,
+};
+
+
+
 int
-main (int argc, char **argv)
+main (int    argc,
+      char **argv)
 {
-  TvmPreferences *preferences;
-  GtkWidget      *dialog;
-  GError         *err = NULL;
+  XfconfChannel *channel;
+  GUdevClient   *client;
+  GUdevDevice   *device;
+  GError        *error = NULL;
+  gint           exit_status;
 
   /* setup translation domain */
   xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
@@ -69,96 +88,106 @@ main (int argc, char **argv)
   g_set_application_name (_("Thunar Volume Manager"));
 
 #ifdef G_ENABLE_DEBUG
-  /* Do NOT remove this line for now, If something doesn't work,
-   * fix your code instead!
-   */
+  /* Do NOT remove this line for now. If something doesn't work, fix your
+   * code instead */
   g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
 #endif
 
-  /* initialize the GThread system */
+  /* initialize the threading system */
   if (!g_thread_supported ())
     g_thread_init (NULL);
 
-  /* initialize Gtk+ */
-  if (!gtk_init_with_args (&argc, &argv, NULL, option_entries, GETTEXT_PACKAGE, &err))
+  /* initialize GTK+ */
+  if (!gtk_init_with_args (&argc, &argv, NULL, option_entries, GETTEXT_PACKAGE, &error))
     {
-      /* check if we have an error message */
-      if (G_LIKELY (err == NULL))
-        {
-          /* no error message, the GUI initialization failed */
-          const gchar *display_name = gdk_get_display_arg_name ();
-          g_fprintf (stderr, "thunar-volman: %s: %s.\n", _("Failed to open display"), (display_name != NULL) ? display_name : " ");
-        }
-      else
-        {
-          /* yep, there's an error, so print it */
-          g_fprintf (stderr, "%s: %s.\n", g_get_prgname (), err->message);
-          g_error_free (err);
-        }
+      g_fprintf (stderr, "%s: %s.\n", g_get_prgname (), error->message);
+      g_error_free (error);
+      return EXIT_FAILURE;
+    }
+
+  /* initialize xfconf */
+  if (!xfconf_init (&error))
+    {
+      g_fprintf (stderr, "%s: %s.\n", g_get_prgname (), error->message);
+      g_error_free (error);
       return EXIT_FAILURE;
     }
 
-  /* check if we should print version information */
-  if (G_UNLIKELY (opt_version))
+  /* check if we should print the version information */
+  if (opt_version)
     {
       g_print ("%s %s (Xfce %s)\n\n", PACKAGE_NAME, PACKAGE_VERSION, xfce_version_string ());
-      g_print ("%s\n", "Copyright (c) 2004-2007");
-      g_print ("\t%s\n\n", _("The Thunar development team. All rights reserved."));
-      g_print ("%s\n\n", _("Written by Benedikt Meurer <benny at xfce.org>."));
+      g_print ("%s\n", "Copyright (c) 2004-2007 Benedikt Meurer <benny at xfce.org>");
+      g_print ("%s\n", "Copyright (c) 2010      Jannis Pohlmann <jannis at xfce.org>");
+      g_print ("\n%s\n\n", _("All rights reserved."));
       g_print (_("Please report bugs to <%s>."), PACKAGE_BUGREPORT);
       g_print ("\n");
       return EXIT_SUCCESS;
     }
 
-  /* initialize the ThunarVFS library */
-  thunar_vfs_init ();
-
-  /* load the preferences for the volume manager */
-  preferences = tvm_preferences_get ();
-
   /* check if we should configure the volume manager */
-  if (G_UNLIKELY (opt_configure))
+  if (opt_configure)
     {
-      /* bring up the preferences dialog */
-      dialog = tvm_preferences_dialog_new ();
-      gtk_dialog_run (GTK_DIALOG (dialog));
-      gtk_widget_destroy (dialog);
+      /* the --configure/-c option of thunar-volman exists for 
+       * backwards-compatibility reasons only. what we really do 
+       * here is spawning thunar-volman-settings */
+      if (!g_spawn_command_line_sync ("thunar-volman-settings", NULL, NULL, &exit_status, &error))
+        {
+          g_fprintf (stderr, "%s: %s.\n", g_get_prgname (), error->message);
+          g_error_free (error);
+          return WEXITSTATUS (exit_status);
+        }
+
+      return EXIT_SUCCESS;
     }
-  else if (G_LIKELY (opt_hal_udi != NULL))
+  else if (opt_sysfs_path != NULL)
     {
-      /* make sure the specified UDI is valid */
-      if (!exo_hal_udi_validate (opt_hal_udi, -1, NULL))
+      /* create an udev client */
+      client = g_udev_client_new (subsystems);
+
+      /* determine the device belonging to the sysfs path */
+      device = g_udev_client_query_by_sysfs_path (client, opt_sysfs_path);
+
+      if (device == NULL)
         {
-          /* TRANSLATORS: A HAL device UDI must match certain conditions to be valid (to be exact, it must be a valid D-Bus object path) */
-          g_set_error (&err, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("The specified UDI \"%s\" is not a valid HAL device UDI"), opt_hal_udi);
+          g_set_error (&error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                       _("There is no device with the sysfs path \"%s\""), 
+                       opt_sysfs_path);
         }
       else
         {
+          /* get a reference on the thunar-volman settings channel */
+          channel = xfconf_channel_get ("thunar-volman");
+
           /* try to handle the newly added device */
-          tvm_device_added (preferences, opt_hal_udi, &err);
+          tvm_device_added (client, device, channel, &error);
+
+          /* release the udev device */
+          g_object_unref (device);
         }
+
+      /* release the udev client */
+      g_object_unref (client);
     }
   else
     {
-      /* TRANSLATORS: thunar-volman wasn't invoked with either --device-added or --configure. */
-      g_set_error (&err, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Must specify the new HAL device UDI with --device-added"));
+      /* TRANSLATORS: thunar-volman wasn't invoked with either --device-added 
+       * or --configure. */
+      g_set_error (&error, G_FILE_ERROR, G_FILE_ERROR_FAILED, 
+                   _("Must specify the sysfs path of new devices with --device-added"));
     }
 
-  /* flush the preferences */
-  g_object_unref (G_OBJECT (preferences));
-
-  /* shutdown thunar-vfs */
-  thunar_vfs_shutdown ();
-
-  /* check if an error occurred */
-  if (G_UNLIKELY (err != NULL))
+  /* check whether an error occurred */
+  if (G_UNLIKELY (error != NULL))
     {
-      /* tell the user about the problem */
-      g_fprintf (stderr, "%s: %s.\n", g_get_prgname (), err->message);
-      g_error_free (err);
+      /* let the user know about the cause of the problem */
+      g_fprintf (stderr, "%s: %s.\n", g_get_prgname (), error->message);
+      g_error_free (error);
       return EXIT_FAILURE;
     }
 
+  /* free xfconf resources */
+  xfconf_shutdown ();
+
   return EXIT_SUCCESS;
 }
-
diff --git a/thunar-volman/tvm-block-device.c b/thunar-volman/tvm-block-device.c
index de4e774..b10833c 100644
--- a/thunar-volman/tvm-block-device.c
+++ b/thunar-volman/tvm-block-device.c
@@ -1,782 +1,122 @@
-/* $Id$ */
+/* vi:set et ai sw=2 sts=2 ts=2: */
 /*-
- * Copyright (c) 2007-2008 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
  *
- * 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 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.
+ * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <dbus/dbus-glib-lowlevel.h>
-
-#include <thunar-volman/tvm-block-device.h>
-#include <thunar-volman/tvm-crypto-volume.h>
-#include <thunar-volman/tvm-prompt.h>
-#include <thunar-volman/tvm-run.h>
-
-
-
-static gboolean tvm_file_test               (const gchar    *directory,
-                                             const gchar    *filename,
-                                             GFileTest       test);
-static gboolean tvm_block_device_autoipod   (TvmPreferences *preferences,
-                                             LibHalContext  *context,
-                                             const gchar    *udi,
-                                             const gchar    *device_file,
-                                             const gchar    *mount_point,
-                                             GError        **error);
-static gboolean tvm_block_device_autophoto  (TvmPreferences *preferences,
-                                             LibHalContext  *context,
-                                             const gchar    *udi,
-                                             const gchar    *device_file,
-                                             const gchar    *mount_point,
-                                             GError        **error);
-static gboolean tvm_block_device_autorun    (TvmPreferences *preferences,
-                                             LibHalContext  *context,
-                                             const gchar    *udi,
-                                             const gchar    *device_file,
-                                             const gchar    *mount_point,
-                                             GError        **error);
-static gboolean tvm_block_device_mount      (TvmPreferences *preferences,
-                                             LibHalContext  *context,
-                                             const gchar    *udi,
-                                             GError        **error);
-static gboolean tvm_block_device_mounted    (TvmPreferences *preferences,
-                                             LibHalContext  *context,
-                                             const gchar    *udi,
-                                             const gchar    *device_file,
-                                             const gchar    *mount_point,
-                                             GError        **error);
-
-
-
-static gboolean
-tvm_file_test (const gchar *directory,
-               const gchar *filename,
-               GFileTest    test)
-{
-  const gchar *name;
-  gboolean     result = FALSE;
-  gchar       *path;
-  GDir        *dp;
-
-  /* try to open the specified directory */
-  dp = g_dir_open (directory, 0, NULL);
-  if (G_LIKELY (dp != NULL))
-    {
-      while (!result)
-        {
-          /* read the next entry */
-          name = g_dir_read_name (dp);
-          if (G_UNLIKELY (name == NULL))
-            break;
+#include <gudev/gudev.h>
 
-          /* check if we have a potential match */
-          if (g_ascii_strcasecmp (name, filename) == 0)
-            {
-              /* check if test condition met */
-              path = g_build_filename (directory, name, NULL);
-              result = g_file_test (path, test);
-              g_free (path);
-            }
-        }
+#include <xfconf/xfconf.h>
 
-      /* cleanup */
-      g_dir_close (dp);
-    }
-
-  return result;
-}
+#include <thunar-volman/tvm-input-device.h>
 
 
 
 static gboolean
-tvm_block_device_autoipod (TvmPreferences *preferences,
-                           LibHalContext  *context,
-                           const gchar    *udi,
-                           const gchar    *device_file,
-                           const gchar    *mount_point,
-                           GError        **error)
+tvm_block_device_mount (GUdevClient   *client,
+                        GUdevDevice   *device,
+                        XfconfChannel *channel,
+                        GError       **error)
 {
-  gboolean result = FALSE;
-  gboolean autoipod;
-  gboolean is_audio_player = FALSE;
-  gchar   *autoipod_command;
-  gchar   *autophoto_command;
-  gchar   *storage_udi;
-  gchar   *path_dcim = NULL;
-  gchar   *product;
-  gint     response = TVM_RESPONSE_NONE;
-
-  /* check if music players should be handled automatically */
-  g_object_get (G_OBJECT (preferences), "autoipod", &autoipod, "autoipod-command", &autoipod_command, NULL);
-  if (G_LIKELY (autoipod && autoipod_command != NULL && *autoipod_command != '\0'))
-    {
-      /* determine the storage device UDI */
-      storage_udi = libhal_device_get_property_string (context, udi, "block.storage_device", NULL);
-      if (G_LIKELY (storage_udi != NULL))
-        {
-          /* check if we have a portable audio player here */
-          if (libhal_device_query_capability (context, storage_udi, "portable_audio_player", NULL))
-            {
-	      is_audio_player = TRUE;
-              /* check if we have an iPod here */
-              product = libhal_device_get_property_string (context, storage_udi, "info.product", NULL);
-              if (product != NULL && strcmp (product, "iPod") != 0)
-                {
-                  /* an iPod may have photos */
-                  path_dcim = g_build_filename (mount_point, "dcim", NULL);
-                  if (!g_file_test (path_dcim, G_FILE_TEST_IS_DIR))
-                    {
-                      /* no photos */
-                      g_free (path_dcim);
-                      path_dcim = NULL;
-                    }
-                  else
-                    {
-                      /* add the "content.photos" capability to this device */
-                      libhal_device_add_capability (context, udi, "content.photos", NULL);
-                    }
-                }
-              libhal_free_string (product);
-            }
-
-          /* check if autophoto command is specified, else we cannot handle the photos on the iPod anyway */
-          g_object_get (G_OBJECT (preferences), "autophoto-command", &autophoto_command, NULL);
-          if (G_UNLIKELY (autophoto_command == NULL || *autophoto_command == '\0'))
-            {
-              /* cannot handle photos */
-              g_free (path_dcim);
-              path_dcim = NULL;
-            }
-
-          /* iPods can carry both music and photos... */
-          if (G_LIKELY (path_dcim != NULL))
-            {
-              /* ...so we need to prompt what to do */
-              response = tvm_prompt (context, udi, "gnome-dev-ipod", _("Photos and Music"),
-                                     _("Photos were found on your portable music player."),
-                                     _("Would you like to import the photos or manage the music?"),
-                                     _("Ig_nore"), GTK_RESPONSE_CANCEL,
-                                     _("Import _Photos"), TVM_RESPONSE_PHOTOS,
-                                     _("Manage _Music"), TVM_RESPONSE_MUSIC,
-                                     NULL);
-            }
-          else
-            {
-              /* no photos, so we can manage only music */
-              if(is_audio_player)
-		      response = TVM_RESPONSE_MUSIC;
-            }
-
-          /* check what to do */
-          if (response == TVM_RESPONSE_MUSIC)
-            {
-              /* run the preferred application to manage music players */
-              result = tvm_run_command (context, udi, autoipod_command, device_file, mount_point, error);
-            }
-          else if (response == TVM_RESPONSE_PHOTOS)
-            {
-              /* run the preferred application to manage photos */
-              result = tvm_run_command (context, udi, autophoto_command, device_file, mount_point, error);
-            }
-
-          /* cleanup */
-          libhal_free_string (storage_udi);
-          g_free (autophoto_command);
-          g_free (path_dcim);
-        }
-    }
-
-  /* cleanup */
-  g_free (autoipod_command);
+  g_return_val_if_fail (G_UDEV_IS_CLIENT (client), FALSE);
+  g_return_val_if_fail (G_UDEV_IS_DEVICE (device), FALSE);
+  g_return_val_if_fail (XFCONF_IS_CHANNEL (channel), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-  return result;
+  return TRUE;
 }
 
 
 
-static gboolean
-tvm_block_device_autophoto (TvmPreferences *preferences,
-                            LibHalContext  *context,
-                            const gchar    *udi,
-                            const gchar    *device_file,
-                            const gchar    *mount_point,
-                            GError        **error)
-{
-  gboolean result = FALSE;
-  gboolean autophoto;
-  gchar   *autophoto_command;
-  gint     response;
-
-  /* check autophoto support is enabled */
-  g_object_get (G_OBJECT (preferences), "autophoto", &autophoto, "autophoto-command", &autophoto_command, NULL);
-  if (G_LIKELY (autophoto && autophoto_command != NULL && *autophoto_command != '\0'))
-    {
-      /* check if we have photos on the volume */
-      if (tvm_file_test (mount_point, "dcim", G_FILE_TEST_IS_DIR))
-        {
-          /* add the "content.photos" capability to this device */
-          libhal_device_add_capability (context, udi, "content.photos", NULL);
-
-          /* ask the user whether to import photos */
-          response = tvm_prompt (context, udi, "camera-photo", _("Photo Import"),
-                                 _("A photo card has been detected."),
-                                 _("There are photos on the card. Would you like to add these photos to your album?"),
-                                 _("Ig_nore"), GTK_RESPONSE_CANCEL,
-                                 _("Import _Photos"), TVM_RESPONSE_PHOTOS,
-                                 NULL);
-          if (G_LIKELY (response == TVM_RESPONSE_PHOTOS))
-            {
-              /* run the preferred application to manage photos */
-              result = tvm_run_command (context, udi, autophoto_command, device_file, mount_point, error);
-            }
-          else
-            {
-              /* pretend that we handled the device */
-              result = TRUE;
-            }
-        }
-    }
-  g_free (autophoto_command);
-
-  return result;
-}
+gboolean
+tvm_block_device_added (GUdevClient   *client,
+                        GUdevDevice   *device,
+                        XfconfChannel *channel,
+                        GError       **error)
+{ 
+  const gchar *devtype;
+  const gchar *id_type;
+  const gchar *media_state;
+  const gchar *fs_usage;
+  gboolean     is_cdrom;
+  gboolean     is_partition;
+  guint64      audio_tracks;
+
+  g_return_val_if_fail (G_UDEV_IS_CLIENT (client), FALSE);
+  g_return_val_if_fail (G_UDEV_IS_DEVICE (device), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
+  /* collect general device information */
+  devtype = g_udev_device_get_devtype (device);
+  id_type = g_udev_device_get_property (device, "ID_TYPE");
 
+  /* distinguish device types */
+  is_cdrom = (g_strcmp0 (id_type, "cd") == 0);
+  is_partition = (g_strcmp0 (devtype, "partition") == 0);
 
-static gboolean
-tvm_block_device_autorun (TvmPreferences *preferences,
-                          LibHalContext  *context,
-                          const gchar    *udi,
-                          const gchar    *device_file,
-                          const gchar    *mount_point,
-                          GError        **error)
-{
-  struct stat statb_mount_point;
-  struct stat statb_autoopen;
-  gboolean    result;
-  gboolean    autoopen;
-  gboolean    autoplay;
-  gboolean    autorun;
-  gchar      *autoplay_command;
-  gchar      *path_autoopen;
-  gchar       line[1024];
-  gchar      *message;
-  gchar      *wine;
-  gchar     **argv;
-  FILE       *fp;
-  gint        response;
-  gint        n;
-
-  /* check if autoplay video CDs/DVDs is enabled */
-  g_object_get (G_OBJECT (preferences), "autoplay-video-cd", &autoplay, "autoplay-video-cd-command", &autoplay_command, NULL);
-  if (G_LIKELY (autoplay))
+  if (is_cdrom)
     {
-      /* check if we have a video CD or video DVD here */
-      if (tvm_file_test (mount_point, "vcd", G_FILE_TEST_IS_DIR) || tvm_file_test (mount_point, "video_ts", G_FILE_TEST_IS_DIR))
-        {
-          /* try to spawn the preferred video CD/DVD-Player */
-          result = tvm_run_command (context, udi, autoplay_command, device_file, mount_point, error);
-          g_free (autoplay_command);
-          return result;
-        }
-    }
-  g_free (autoplay_command);
-
-  /* check if autorun support is enabled */
-  g_object_get (G_OBJECT (preferences), "autorun", &autorun, NULL);
-  if (G_LIKELY (autorun))
-    {
-      /* "Autostart Files" (Desktop Application Autostart Specification) */
-      static const gchar *AUTORUN[] = { ".autorun", "autorun", "autorun.sh" };
-      for (n = 0; n < G_N_ELEMENTS (AUTORUN); ++n)
-        {
-          /* check if one of the autorun files is present and executable */
-          if (tvm_file_test (mount_point, AUTORUN[n], G_FILE_TEST_IS_EXECUTABLE)
-              && tvm_file_test (mount_point, AUTORUN[n], G_FILE_TEST_IS_REGULAR))
-            {
-              /* prompt the user whether to execute this file */
-              message = g_strdup_printf (_("Would you like to allow \"%s\" to run?"), AUTORUN[n]);
-              response = tvm_prompt (context, udi, "gnome-fs-executable", _("Auto-Run Confirmation"),
-                                     _("Auto-Run capability detected"), message,
-                                     _("Ig_nore"), GTK_RESPONSE_CANCEL,
-                                     _("_Allow Auto-Run"), TVM_RESPONSE_AUTORUN,
-                                     NULL);
-              g_free (message);
-
-              /* check if we should autorun */
-              if (response == TVM_RESPONSE_AUTORUN)
-                {
-                  /* prepare argv to launch autorun file */
-                  argv = g_new (gchar *, 2);
-                  argv[0] = g_build_filename (mount_point, AUTORUN[n], NULL);
-                  argv[1] = NULL;
-
-                  /* try to launch the autorun file */
-                  result = g_spawn_async (mount_point, argv, NULL, 0, NULL, NULL, NULL, error);
+      /* abort silently if CD media is available */
+      if (!g_udev_device_get_property_as_boolean (device, "ID_CDROM_MEDIA"))
+        return TRUE;
 
-                  /* cleanup */
-                  g_strfreev (argv);
+      /* collect CD information */
+      media_state = g_udev_device_get_property (device, "ID_CDROM_MEDIA_STATE");
+      audio_tracks = g_udev_device_get_property_as_uint64 (device, "ID_CDROM_MEDIA_TRACK_COUNT_AUDIO");
 
-                  /* outa here */
-                  return result;
-                }
-            }
-        }
-
-      /* check if wine is present */
-      wine = g_find_program_in_path ("wine");
-      if (G_UNLIKELY (wine != NULL))
-        {
-          /* check if we have an autorun.exe file */
-          if (tvm_file_test (mount_point, "autorun.exe", G_FILE_TEST_IS_REGULAR))
-            {
-              /* prompt the user whether to execute this file */
-              message = g_strdup_printf (_("Would you like to allow \"%s\" to run?"), "autorun.exe");
-              response = tvm_prompt (context, udi, "gnome-fs-executable", _("Auto-Run Confirmation"),
-                                     _("Auto-Run capability detected"), message,
-                                     _("Ig_nore"), GTK_RESPONSE_CANCEL,
-                                     _("_Allow Auto-Run"), TVM_RESPONSE_AUTORUN,
-                                     NULL);
-              g_free (message);
-
-              /* check if we should autorun */
-              if (response == TVM_RESPONSE_AUTORUN)
-                {
-                  /* prepare argv to launch autorun.exe file */
-                  argv = g_new (gchar *, 3);
-                  argv[0] = wine;
-                  argv[1] = g_strdup ("autorun.exe");
-                  argv[2] = NULL;
-
-                  /* try to launch the autorun.exe file via wine */
-                  result = g_spawn_async (mount_point, argv, NULL, 0, NULL, NULL, NULL, error);
-
-                  /* cleanup */
-                  g_strfreev (argv);
-
-                  /* outa here */
-                  return result;
-                }
-            }
-        }
-      g_free (wine);
-    }
-
-  /* check if autoopen support is enabled */
-  g_object_get (G_OBJECT (preferences), "autoopen", &autoopen, NULL);
-  if (G_LIKELY (autoopen))
-    {
-      /* "Autoopen Files" (Desktop Application Autostart Specification) */
-      static const gchar *AUTOOPEN[] = { ".autoopen", "autoopen" };
-      for (n = 0; n < G_N_ELEMENTS (AUTOOPEN); ++n)
+      if (g_strcmp0 (media_state, "blank") == 0)
         {
-          /* check if one of the autoopen files is present */
-          path_autoopen = g_build_filename (mount_point, AUTOOPEN[n], NULL);
-          fp = fopen (path_autoopen, "r");
-          g_free (path_autoopen);
-
-          /* check if the file could be opened */
-          if (G_UNLIKELY (fp != NULL))
-            {
-              /* read the first line of the file (MUST NOT be an absolute path) */
-              if (fgets (line, sizeof (line), fp) != NULL && !g_path_is_absolute (line))
-                {
-                  /* determine the absolute path of the file */
-                  path_autoopen = g_build_filename (mount_point, line, NULL);
-
-                  /* the file must exist on exactly this device */
-                  if (stat (mount_point, &statb_mount_point) == 0 && stat (path_autoopen, &statb_autoopen) == 0
-                      && S_ISREG (statb_autoopen.st_mode) && (statb_autoopen.st_mode & 0111) == 0
-                      && (statb_mount_point.st_dev == statb_autoopen.st_dev))
-                    {
-                      /* prompt the user whether to autoopen this file */
-                      message = g_strdup_printf (_("Would you like to open \"%s\"?"), AUTOOPEN[n]);
-                      response = tvm_prompt (context, udi, "gnome-fs-executable", _("Auto-Open Confirmation"),
-                                             _("Auto-Open capability detected"), message,
-                                             _("Ig_nore"), GTK_RESPONSE_CANCEL,
-                                             _("_Open"), TVM_RESPONSE_AUTOOPEN,
-                                             NULL);
-                      g_free (message);
-
-                      /* check if we should autoopen */
-                      if (response == TVM_RESPONSE_AUTOOPEN)
-                        {
-                          /* prepare the command to autoopen */
-                          argv = g_new (gchar *, 3);
-                          argv[0] = g_strdup ("Thunar");
-                          argv[1] = path_autoopen;
-                          argv[2] = NULL;
-
-                          /* let Thunar open the file */
-                          result = g_spawn_async (mount_point, argv, NULL, 0, NULL, NULL, NULL, error);
-
-                          /* cleanup */
-                          g_free (path_autoopen);
-                          fclose (fp);
-                          return result;
-                        }
-                    }
-
-                  /* cleanup */
-                  g_free (path_autoopen);
-                }
-
-              /* close the file handle */
-              fclose (fp);
-            }
+          return tvm_run_burn_software (client, device, channel, error);
         }
-    }
-
-  /* not handled */
-  return FALSE;
-}
-
-
-
-static gboolean
-tvm_block_device_mount (TvmPreferences *preferences,
-                        LibHalContext  *context,
-                        const gchar    *udi,
-                        GError        **error)
-{
-  DBusError derror;
-  gboolean  result = FALSE;
-  GSList   *mount_points;
-  gchar    *device_file;
-  gchar    *argv[4];
-  gint      status;
-
-  /* check if we should ignore the volume, if so, pretend that we succeed */
-  if (libhal_device_get_property_bool (context, udi, "volume.ignore", NULL))
-    return TRUE;
-
-  /* generate the command to mount the device */
-  argv[0] = (gchar *) "exo-mount";
-  argv[1] = (gchar *) "--hal-udi";
-  argv[2] = (gchar *) udi;
-  argv[3] = NULL;
-
-  /* let exo-mount mount the device */
-  if (!g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL, &status, error))
-    {
-      /* failed to spawn the exo-mount command */
-      return FALSE;
-    }
-  else if (!WIFEXITED (status) || WEXITSTATUS (status) != 0)
-    {
-      /* exo-mount failed, but already displayed an error */
-      return TRUE;
-    }
-
-  /* initalize D-Bus error */
-  dbus_error_init (&derror);
-
-  /* successfully mounted the device, determine the device file */
-  device_file = libhal_device_get_property_string (context, udi, "block.device", &derror);
-  if (G_UNLIKELY (device_file == NULL))
-    {
-      /* propagate the error */
-      dbus_set_g_error (error, &derror);
-      return FALSE;
-    }
-
-  /* determine the active mount point(s) for the device from the kernel */
-  mount_points = exo_mount_point_list_matched (EXO_MOUNT_POINT_MATCH_ACTIVE | EXO_MOUNT_POINT_MATCH_DEVICE, device_file, NULL, NULL, error);
-  if (G_LIKELY (mount_points != NULL))
-    {
-      /* try to handled the mounted volume */
-      result = tvm_block_device_mounted (preferences, context, udi, device_file, ((ExoMountPoint *) mount_points->data)->folder, error);
-
-      /* release the mount points */
-      g_slist_foreach (mount_points, (GFunc) exo_mount_point_free, NULL);
-      g_slist_free (mount_points);
-    }
-
-  /* release the device file */
-  libhal_free_string (device_file);
-
-  return result;
-}
-
-
-
-
-static gboolean
-tvm_block_device_mounted (TvmPreferences *preferences,
-                          LibHalContext  *context,
-                          const gchar    *udi,
-                          const gchar    *device_file,
-                          const gchar    *mount_point,
-                          GError        **error)
-{
-  gboolean autobrowse;
-  gboolean result;
-  GError  *err = NULL;
-
-  /* check if we have a portable media player here */
-  result = tvm_block_device_autoipod (preferences, context, udi, device_file, mount_point, &err);
-  if (G_LIKELY (!result && err == NULL))
-    {
-      /* check if we have a digital photo camera here */
-      result = tvm_block_device_autophoto (preferences, context, udi, device_file, mount_point, &err);
-      if (G_LIKELY (!result && err == NULL))
+      else if (audio_tracks > 0)
         {
-          /* try autorun (video CD/DVD, autoopen, etc.) first */
-          result = tvm_block_device_autorun (preferences, context, udi, device_file, mount_point, &err);
-          if (G_LIKELY (!result && err == NULL))
-            {
-              /* check if we should autobrowse the mount point folder */
-              g_object_get (G_OBJECT (preferences), "autobrowse", &autobrowse, NULL);
-              if (G_LIKELY (autobrowse))
-                {
-                  /* open the mount point folder in Thunar */
-                  result = tvm_run_command (context, udi, "Thunar %m", device_file, mount_point, &err);
-                }
-            }
+          /* TODO detect mixed CDs with audio AND data tracks */
+          g_debug ("  => audio CD");
         }
-    }
-
-  /* check if we need to propagate an error */
-  if (G_UNLIKELY (err != NULL))
-    {
-      /* propagate the error */
-      g_propagate_error (error, err);
-      result = FALSE;
-    }
-
-  return result;
-}
-
-
-
-/**
- * tvm_block_device_added:
- * @preferences : a #TvmPreferences.
- * @context     : a #LibHalContext.
- * @udi         : the HAL device UDI of the newly added block device.
- * @capability  : the capability, which caused this handler to be run.
- * @error       : return location for errors or %NULL.
- *
- * See #TvmDeviceCallback for further information.
- *
- * Return value: %TRUE if handled, %FALSE if not handled or an
- *               unrecoverable error occurred.
- **/
-gboolean
-tvm_block_device_added (TvmPreferences *preferences,
-                        LibHalContext  *context,
-                        const gchar    *udi,
-                        const gchar    *capability,
-                        GError        **error)
-{
-  DBusError derror;
-  gboolean  disc_has_audio;
-  gboolean  disc_has_data;
-  gboolean  automount;
-  gboolean  autoplay;
-  gboolean  is_cdrom;
-  gboolean  has_filesystem;
-  gboolean  has_crypto;
-  gchar    *storage_udi;
-  gchar    *drive_type;
-  gchar    *fsusage;
-  gint      response;
-
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), FALSE);
-  g_return_val_if_fail (TVM_IS_PREFERENCES (preferences), FALSE);
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-  g_return_val_if_fail (capability != NULL, FALSE);
-  g_return_val_if_fail (context != NULL, FALSE);
-
-  /* initialize D-Bus error */
-  dbus_error_init (&derror);
-
-  /* verify that we have a mountable volume here */
-  if (!libhal_device_get_property_bool (context, udi, "block.is_volume", &derror))
-    {
-err0: /* check if we have an error to propagate */
-      if (dbus_error_is_set (&derror))
+      else
         {
-          /* propagate the error */
-          dbus_set_g_error (error, &derror);
-          dbus_error_free (&derror);
+          /* mount the CD/DVD and continue with inspecting its contents */
+          return tvm_block_device_mount (client, device, channel, error);
         }
-
-      return FALSE;
     }
-
-  /* determine the HAL UDI of the backing storage device */
-  storage_udi = libhal_device_get_property_string (context, udi, "block.storage_device", &derror);
-  if (G_UNLIKELY (storage_udi == NULL))
-    goto err0;
-
-  /* if the partition_table_changed flag is set, we don't want to mount as a partitioning tool might be modifying this device */
-  if (libhal_device_get_property_bool (context, storage_udi, "storage.partition_table_changed", NULL))
+  else if (is_partition)
     {
-err1: libhal_free_string (storage_udi);
-      goto err0;
-    }
+      /* collect more information about the partition */
+      fs_usage = g_udev_device_get_property (device, "ID_FS_USAGE");
 
-  /* check if this device supports removable media */
-  if (libhal_device_get_property_bool (context, storage_udi, "storage.removable", NULL))
-    {
-      /* check if the device is locked */
-      if (libhal_device_get_property_bool (context, storage_udi, "info.locked", NULL))
+      if (g_strcmp0 (fs_usage, "crypto") == 0)
         {
-          /* pretend that we handled the device */
-          libhal_free_string (storage_udi);
-          return TRUE;
+          /* TODO return tvm_crypto_device_added (device, channel, error); */
         }
-
-      /* determine the drive type */
-      drive_type = libhal_device_get_property_string (context, storage_udi, "storage.drive_type", &derror);
-      if (G_UNLIKELY (drive_type == NULL))
-        goto err1;
-
-      /* check if we have a CD-ROM here */
-      is_cdrom = (strcmp (drive_type, "cdrom") == 0);
-
-      /* we don't need the storage UDI any more */
-      libhal_free_string (storage_udi);
-
-      /* free the drive type */
-      libhal_free_string (drive_type);
-
-      /* CD-ROMs deserve special handling */
-      if (G_LIKELY (is_cdrom))
+      else
         {
-          /* check for blank discs */
-          if (libhal_device_get_property_bool (context, udi, "volume.disc.is_blank", NULL))
-            {
-              /* run the preferred CD-Burner application */
-              return tvm_run_cdburner (preferences, context, udi, error);
-            }
-          else
-            {
-              /* check if we have DATA/AUDIO tracks */
-              disc_has_audio = libhal_device_get_property_bool (context, udi, "volume.disc.has_audio", NULL);
-              disc_has_data = libhal_device_get_property_bool (context, udi, "volume.disc.has_data", NULL);
-              if (G_UNLIKELY (disc_has_audio && disc_has_data))
-                {
-                  /* check if we need to prompt the user */
-                  g_object_get (G_OBJECT (preferences), "automount-media", &automount, "autoplay-audio-cd", &autoplay, NULL);
-                  if (G_LIKELY (automount && autoplay))
-                    {
-                      /* ask what do with the mixed audio/data disc */
-                      response = tvm_prompt (context, udi, "gnome-dev-cdrom-audio", _("Audio / Data CD"),
-                                             _("The CD in the drive contains both music and files."),
-	                                           _("Would you like to listen to music or browse the files?"),
-                                             _("Ig_nore"), GTK_RESPONSE_CANCEL,
-                                             _("_Browse Files"), TVM_RESPONSE_BROWSE,
-                                             _("_Play CD"), TVM_RESPONSE_PLAY,
-                                             NULL);
-                      switch (response)
-                        {
-                        case TVM_RESPONSE_PLAY:
-                          goto autoplay_disc;
-
-                        case TVM_RESPONSE_BROWSE:
-                          goto automount_disc;
-
-                        default:
-                          break;
-                        }
-                    }
-                  else if (automount)
-                    {
-                      /* just automount the media */
-                      goto automount_disc;
-                    }
-                  else if (autoplay)
-                    {
-                      /* just autoplay the disc */
-                      goto autoplay_disc;
-                    }
-                }
-              else if (G_LIKELY (disc_has_audio))
-                {
-autoplay_disc:    /* run the preferred CD-Player application */
-                  return tvm_run_cdplayer (preferences, context, udi, error);
-                }
-              else if (G_LIKELY (disc_has_data))
-                {
-automount_disc:   /* check if we should automount removable media */
-                  g_object_get (G_OBJECT (preferences), "automount-media", &automount, NULL);
-                  if (G_LIKELY (automount))
-                    {
-                      /* try to mount the CD-ROM in the disc */
-                      return tvm_block_device_mount (preferences, context, udi, error);
-                    }
-                }
-            }
+          /* mount the partition and continue with inspecting its contents */
+          return tvm_block_device_mount (client, device, channel, error);
         }
     }
   else
     {
-      /* we don't need the storage UDI any more */
-      libhal_free_string (storage_udi);
-    }
-
-  /* determine the file system usage of the volume */
-  fsusage = libhal_device_get_property_string (context, udi, "volume.fsusage", NULL);
-  has_crypto = (G_UNLIKELY (fsusage != NULL && strcmp (fsusage, "crypto") == 0));
-  has_filesystem = (G_LIKELY (fsusage != NULL && strcmp (fsusage, "filesystem") == 0));
-  libhal_free_string (fsusage);
-
-  /* check if we have a crypto volume to setup here */
-  if (G_UNLIKELY (has_crypto))
-    {
-      /* try to setup the crypto volume */
-      return tvm_crypto_volume_setup (preferences, context, udi, error);
-    }
-  else if (G_LIKELY (has_filesystem))
-    {
-      /* check if we should automount drives, otherwise, we're done here */
-      g_object_get (G_OBJECT (preferences), "automount-drives", &automount, NULL);
-      if (G_UNLIKELY (!automount))
-        return FALSE;
-
-      /* try to mount the block device */
-      return tvm_block_device_mount (preferences, context, udi, error);
+      /* TODO detect encrypted volumes, implement this before 
+       * the regular partition check */
     }
 
-  return FALSE;
+  return TRUE;
 }
-
-
-
-
diff --git a/thunar-volman/tvm-block-device.h b/thunar-volman/tvm-block-device.h
index 2f51e6a..78e715d 100644
--- a/thunar-volman/tvm-block-device.h
+++ b/thunar-volman/tvm-block-device.h
@@ -1,34 +1,36 @@
-/* $Id$ */
+/* vi:set et ai sw=2 sts=2 ts=2: */
 /*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
  *
- * 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 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.
+ * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifndef __TVM_BLOCK_DEVICE_H__
 #define __TVM_BLOCK_DEVICE_H__
 
-#include <thunar-volman/tvm-device.h>
+#include <gudev/gudev.h>
+
+#include <xfconf/xfconf.h>
 
 G_BEGIN_DECLS
 
-gboolean tvm_block_device_added (TvmPreferences *preferences,
-                                 LibHalContext  *context,
-                                 const gchar    *udi,
-                                 const gchar    *capability,
-                                 GError        **error) G_GNUC_INTERNAL;
+gboolean tvm_block_device_added (GUdevClient   *client,
+                                 GUdevDevice   *device,
+                                 XfconfChannel *channel,
+                                 GError       **error);
 
 G_END_DECLS
 
diff --git a/thunar-volman/tvm-camera-device.c b/thunar-volman/tvm-camera-device.c
deleted file mode 100644
index fb04a5a..0000000
--- a/thunar-volman/tvm-camera-device.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <thunar-volman/tvm-camera-device.h>
-#include <thunar-volman/tvm-prompt.h>
-#include <thunar-volman/tvm-run.h>
-
-
-
-/**
- * tvm_block_camera_added:
- * @preferences : a #TvmPreferences.
- * @context     : a #LibHalContext.
- * @udi         : the HAL device UDI of the newly added camera device.
- * @capability  : the capability, which caused this handler to be run.
- * @error       : return location for errors or %NULL.
- *
- * See #TvmDeviceCallback for further information.
- *
- * Return value: %TRUE if handled, %FALSE if not handled or an
- *               unrecoverable error occurred.
- **/
-gboolean
-tvm_camera_device_added (TvmPreferences *preferences,
-                         LibHalContext  *context,
-                         const gchar    *udi,
-                         const gchar    *capability,
-                         GError        **error)
-{
-  gboolean result = FALSE;
-  gboolean autophoto;
-  gchar   *autophoto_command;
-  gchar   *access_method;
-
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), FALSE);
-  g_return_val_if_fail (TVM_IS_PREFERENCES (preferences), FALSE);
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-  g_return_val_if_fail (capability != NULL, FALSE);
-  g_return_val_if_fail (context != NULL, FALSE);
-
-  /* check if this is a non-mass-storage camera device, handled by gphoto2 */
-  access_method = libhal_device_get_property_string (context, udi, "camera.access_method", NULL);
-  if ((access_method != NULL && strcmp (access_method, "ptp") == 0)
-      || libhal_device_get_property_bool (context, udi, "camera.libgphoto2.support", NULL))
-    {
-      /* check if autophoto support is enabled */
-      g_object_get (G_OBJECT (preferences), "autophoto", &autophoto, "autophoto-command", &autophoto_command, NULL);
-      if (G_LIKELY (autophoto && autophoto_command != NULL && *autophoto_command != '\0'))
-        {
-          /* run the preferred photo management application */
-          result = tvm_run_command (context, udi, autophoto_command, NULL, NULL, error);
-        }
-      g_free (autophoto_command);
-    }
-  libhal_free_string (access_method);
-
-  return result;
-}
-
-
-
-
diff --git a/thunar-volman/tvm-camera-device.h b/thunar-volman/tvm-camera-device.h
deleted file mode 100644
index df09a27..0000000
--- a/thunar-volman/tvm-camera-device.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __TVM_CAMERA_DEVICE_H__
-#define __TVM_CAMERA_DEVICE_H__
-
-#include <thunar-volman/tvm-device.h>
-
-G_BEGIN_DECLS
-
-gboolean tvm_camera_device_added (TvmPreferences *preferences,
-                                  LibHalContext  *context,
-                                  const gchar    *udi,
-                                  const gchar    *capability,
-                                  GError        **error) G_GNUC_INTERNAL;
-
-G_END_DECLS
-
-#endif /* !__TVM_CAMERA_DEVICE_H__ */
diff --git a/thunar-volman/tvm-command-entry.c b/thunar-volman/tvm-command-entry.c
deleted file mode 100644
index 8f2e349..0000000
--- a/thunar-volman/tvm-command-entry.c
+++ /dev/null
@@ -1,411 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2005-2007 Benedikt Meurer <benny at xfce.org>
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <thunar-volman/tvm-command-entry.h>
-
-
-
-/* Property identifiers */
-enum
-{
-  PROP_0,
-  PROP_COMMAND,
-};
-
-
-
-static void tvm_command_entry_class_init    (TvmCommandEntryClass *klass);
-static void tvm_command_entry_init          (TvmCommandEntry      *command_entry);
-static void tvm_command_entry_finalize      (GObject              *object);
-static void tvm_command_entry_get_property  (GObject              *object,
-                                             guint                 prop_id,
-                                             GValue               *value,
-                                             GParamSpec           *pspec);
-static void tvm_command_entry_set_property  (GObject              *object,
-                                             guint                 prop_id,
-                                             const GValue         *value,
-                                             GParamSpec           *pspec);
-static void tvm_command_entry_clicked       (GtkWidget            *button,
-                                             TvmCommandEntry      *command_entry);
-
-
-
-static GObjectClass *tvm_command_entry_parent_class;
-
-
-
-GType
-tvm_command_entry_get_type (void)
-{
-  static GType type = G_TYPE_INVALID;
-
-  if (G_UNLIKELY (type == G_TYPE_INVALID))
-    {
-      static const GTypeInfo info =
-      {
-        sizeof (TvmCommandEntryClass),
-        NULL,
-        NULL,
-        (GClassInitFunc) tvm_command_entry_class_init,
-        NULL,
-        NULL,
-        sizeof (TvmCommandEntry),
-        0,
-        (GInstanceInitFunc) tvm_command_entry_init,
-        NULL,
-      };
-
-      type = g_type_register_static (GTK_TYPE_HBOX, I_("TvmCommandEntry"), &info, 0);
-    }
-
-  return type;
-}
-
-
-
-static void
-tvm_command_entry_class_init (TvmCommandEntryClass *klass)
-{
-  GObjectClass *gobject_class;
-
-  /* determine the parent type class */
-  tvm_command_entry_parent_class = g_type_class_peek_parent (klass);
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->finalize = tvm_command_entry_finalize;
-  gobject_class->get_property = tvm_command_entry_get_property;
-  gobject_class->set_property = tvm_command_entry_set_property;
-
-  /**
-   * TvmCommandEntry:command:
-   *
-   * The command currently entered into this command entry widget.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_COMMAND,
-                                   g_param_spec_string ("command",
-                                                        "command",
-                                                        "command",
-                                                        NULL,
-                                                        EXO_PARAM_READWRITE));
-}
-
-
-
-static void
-tvm_command_entry_init (TvmCommandEntry *command_entry)
-{
-  GtkWidget *button;
-  GtkWidget *align;
-  GtkWidget *image;
-
-  gtk_box_set_spacing (GTK_BOX (command_entry), 2);
-
-  align = g_object_new (GTK_TYPE_ALIGNMENT, "width-request", 10, NULL);
-  gtk_box_pack_start (GTK_BOX (command_entry), align, FALSE, FALSE, 0);
-  gtk_widget_show (align);
-
-  command_entry->label = g_object_new (GTK_TYPE_LABEL, "use-underline", TRUE, "xalign", 0.0f, NULL);
-  gtk_box_pack_start (GTK_BOX (command_entry), command_entry->label, FALSE, FALSE, 10);
-  gtk_widget_show (command_entry->label);
-
-  command_entry->entry = gtk_entry_new ();
-  gtk_label_set_mnemonic_widget (GTK_LABEL (command_entry->label), command_entry->entry);
-  exo_mutual_binding_new (G_OBJECT (command_entry->entry), "text", G_OBJECT (command_entry), "command");
-  gtk_box_pack_start (GTK_BOX (command_entry), command_entry->entry, TRUE, TRUE, 0);
-  gtk_widget_show (command_entry->entry);
-
-  button = gtk_button_new ();
-  g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (tvm_command_entry_clicked), command_entry);
-  gtk_box_pack_start (GTK_BOX (command_entry), button, FALSE, FALSE, 0);
-  gtk_widget_show (button);
-
-  image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
-  gtk_container_add (GTK_CONTAINER (button), image);
-  gtk_widget_show (image);
-}
-
-
-
-static void
-tvm_command_entry_finalize (GObject *object)
-{
-  TvmCommandEntry *command_entry = TVM_COMMAND_ENTRY (object);
-
-  /* cleanup properties */
-  g_free (command_entry->command);
-
-  (*G_OBJECT_CLASS (tvm_command_entry_parent_class)->finalize) (object);
-}
-
-
-
-static void
-tvm_command_entry_get_property (GObject    *object,
-                                guint       prop_id,
-                                GValue     *value,
-                                GParamSpec *pspec)
-{
-  TvmCommandEntry *command_entry = TVM_COMMAND_ENTRY (object);
-
-  switch (prop_id)
-    {
-    case PROP_COMMAND:
-      g_value_set_string (value, tvm_command_entry_get_command (command_entry));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-
-
-static void
-tvm_command_entry_set_property (GObject      *object,
-                                guint         prop_id,
-                                const GValue *value,
-                                GParamSpec   *pspec)
-{
-  TvmCommandEntry *command_entry = TVM_COMMAND_ENTRY (object);
-
-  switch (prop_id)
-    {
-    case PROP_COMMAND:
-      tvm_command_entry_set_command (command_entry, g_value_get_string (value));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-
-
-
-static void
-tvm_command_entry_clicked (GtkWidget       *button,
-                           TvmCommandEntry *command_entry)
-{
-  GtkFileFilter *filter;
-  GtkWidget     *toplevel;
-  GtkWidget     *chooser;
-  gchar         *filename;
-  gchar         *s;
-
-  g_return_if_fail (GTK_IS_BUTTON (button));
-  g_return_if_fail (TVM_IS_COMMAND_ENTRY (command_entry));
-
-  /* determine the toplevel widget */
-  toplevel = gtk_widget_get_toplevel (button);
-  if (toplevel == NULL || !GTK_WIDGET_TOPLEVEL (toplevel))
-    return;
-
-  chooser = gtk_file_chooser_dialog_new (_("Select an Application"),
-                                         GTK_WINDOW (toplevel),
-                                         GTK_FILE_CHOOSER_ACTION_OPEN,
-                                         GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                                         GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
-                                         NULL);
-  gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (chooser), TRUE);
-
-  /* add file chooser filters */
-  filter = gtk_file_filter_new ();
-  gtk_file_filter_set_name (filter, _("All Files"));
-  gtk_file_filter_add_pattern (filter, "*");
-  gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter);
-
-  filter = gtk_file_filter_new ();
-  gtk_file_filter_set_name (filter, _("Executable Files"));
-  gtk_file_filter_add_mime_type (filter, "application/x-csh");
-  gtk_file_filter_add_mime_type (filter, "application/x-executable");
-  gtk_file_filter_add_mime_type (filter, "application/x-perl");
-  gtk_file_filter_add_mime_type (filter, "application/x-python");
-  gtk_file_filter_add_mime_type (filter, "application/x-ruby");
-  gtk_file_filter_add_mime_type (filter, "application/x-shellscript");
-  gtk_file_filter_add_pattern (filter, "*.pl");
-  gtk_file_filter_add_pattern (filter, "*.py");
-  gtk_file_filter_add_pattern (filter, "*.rb");
-  gtk_file_filter_add_pattern (filter, "*.sh");
-  gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter);
-  gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser), filter);
-
-  filter = gtk_file_filter_new ();
-  gtk_file_filter_set_name (filter, _("Perl Scripts"));
-  gtk_file_filter_add_mime_type (filter, "application/x-perl");
-  gtk_file_filter_add_pattern (filter, "*.pl");
-  gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter);
-
-  filter = gtk_file_filter_new ();
-  gtk_file_filter_set_name (filter, _("Python Scripts"));
-  gtk_file_filter_add_mime_type (filter, "application/x-python");
-  gtk_file_filter_add_pattern (filter, "*.py");
-  gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter);
-
-  filter = gtk_file_filter_new ();
-  gtk_file_filter_set_name (filter, _("Ruby Scripts"));
-  gtk_file_filter_add_mime_type (filter, "application/x-ruby");
-  gtk_file_filter_add_pattern (filter, "*.rb");
-  gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter);
-
-  filter = gtk_file_filter_new ();
-  gtk_file_filter_set_name (filter, _("Shell Scripts"));
-  gtk_file_filter_add_mime_type (filter, "application/x-csh");
-  gtk_file_filter_add_mime_type (filter, "application/x-shellscript");
-  gtk_file_filter_add_pattern (filter, "*.sh");
-  gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter);
-
-  /* use the bindir as default folder */
-  gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (chooser), BINDIR);
-
-  /* setup the currently selected file */
-  g_object_get (G_OBJECT (command_entry), "command", &filename, NULL);
-  if (G_LIKELY (filename != NULL))
-    {
-      /* use only the first argument */
-      s = strchr (filename, ' ');
-      if (G_UNLIKELY (s != NULL))
-        *s = '\0';
-
-      /* check if we have a file name */
-      if (G_LIKELY (*filename != '\0'))
-        {
-          /* check if the filename is not an absolute path */
-          if (G_LIKELY (!g_path_is_absolute (filename)))
-            {
-              /* try to lookup the filename in $PATH */
-              s = g_find_program_in_path (filename);
-              if (G_LIKELY (s != NULL))
-                {
-                  /* use the absolute path instead */
-                  g_free (filename);
-                  filename = s;
-                }
-            }
-
-          /* check if we have an absolute path now */
-          if (G_LIKELY (g_path_is_absolute (filename)))
-            gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (chooser), filename);
-        }
-
-      /* release the filename */
-      g_free (filename);
-    }
-
-  /* run the chooser dialog */
-  if (gtk_dialog_run (GTK_DIALOG (chooser)) == GTK_RESPONSE_ACCEPT)
-    {
-      filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));
-      tvm_command_entry_set_command (command_entry, filename);
-      g_free (filename);
-    }
-
-  gtk_widget_destroy (chooser);
-}
-
-
-
-/**
- * tvm_command_entry_new:
- *
- * Allocates a new #TvmCommandEntry instance.
- *
- * Return value: the newly allocated #TvmCommandEntry.
- **/
-GtkWidget*
-tvm_command_entry_new (void)
-{
-  return g_object_new (TVM_TYPE_COMMAND_ENTRY, NULL);
-}
-
-
-
-/**
- * tvm_command_entry_new:
- * @label : the label for the command entry.
- *
- * Allocates a new #TvmCommandEntry instance with the @label.
- *
- * Return value: the newly allocated #TvmCommandEntry.
- **/
-GtkWidget*
-tvm_command_entry_new_with_label (const gchar *label)
-{
-  TvmCommandEntry *entry;
-
-  g_return_val_if_fail (label == NULL || g_utf8_validate (label, -1, NULL), NULL);
-
-  entry = g_object_new (TVM_TYPE_COMMAND_ENTRY, NULL);
-  if (G_LIKELY (label != NULL))
-    g_object_set (G_OBJECT (entry->label), "label", label, "use-underline", TRUE, NULL);
-  return GTK_WIDGET (entry);
-}
-
-
-
-/**
- * tvm_command_entry_get_command:
- * @command_entry : a #TvmCommandEntry.
- *
- * Returns the command of the @command_entry.
- *
- * Return value: the command in the @command_entry.
- **/
-const gchar*
-tvm_command_entry_get_command (TvmCommandEntry *command_entry)
-{
-  g_return_val_if_fail (TVM_IS_COMMAND_ENTRY (command_entry), NULL);
-  return command_entry->command;
-}
-
-
-
-/**
- * tvm_command_entry_set_command:
- * @command_entry : a #TvmCommandEntry.
- * @command       : the new command.
- *
- * Sets the command in @command_entry to @command.
- **/
-void
-tvm_command_entry_set_command (TvmCommandEntry *command_entry,
-                               const gchar     *command)
-{
-  g_return_if_fail (TVM_IS_COMMAND_ENTRY (command_entry));
-  g_return_if_fail (g_utf8_validate (command, -1, NULL));
-
-  /* update to the new command */
-  g_free (command_entry->command);
-  command_entry->command = g_strdup (command);
-  g_object_notify (G_OBJECT (command_entry), "command");
-}
-
diff --git a/thunar-volman/tvm-command-entry.h b/thunar-volman/tvm-command-entry.h
deleted file mode 100644
index 73b213f..0000000
--- a/thunar-volman/tvm-command-entry.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2005-2007 Benedikt Meurer <benny at xfce.org>
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __TVM_COMMAND_ENTRY_H__
-#define __TVM_COMMAND_ENTRY_H__
-
-#include <exo/exo.h>
-
-G_BEGIN_DECLS
-
-typedef struct _TvmCommandEntryClass TvmCommandEntryClass;
-typedef struct _TvmCommandEntry      TvmCommandEntry;
-
-#define TVM_TYPE_COMMAND_ENTRY            (tvm_command_entry_get_type ())
-#define TVM_COMMAND_ENTRY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), TVM_TYPE_COMMAND_ENTRY, TvmCommandEntry))
-#define TVM_COMMAND_ENTRY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), TVM_TYPE_COMMAND_ENTRY, TvmCommandEntryClass))
-#define TVM_IS_COMMAND_ENTRY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TVM_TYPE_COMMAND_ENTRY))
-#define TVM_IS_COMMAND_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TVM_TYPE_COMMAND_ENTRY))
-#define TVM_COMMAND_ENTRY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), TVM_TYPE_COMMAND_ENTRY, TvmCommandEntryClass))
-
-struct _TvmCommandEntryClass
-{
-  GtkHBoxClass __parent__;
-};
-
-struct _TvmCommandEntry
-{
-  GtkHBox    __parent__;
-  GtkWidget *entry;
-  GtkWidget *label;
-  gchar     *command;
-};
-
-GType        tvm_command_entry_get_type       (void) G_GNUC_CONST G_GNUC_INTERNAL;
-
-GtkWidget   *tvm_command_entry_new            (void) G_GNUC_INTERNAL G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
-GtkWidget   *tvm_command_entry_new_with_label (const gchar     *label) G_GNUC_INTERNAL G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
-
-const gchar *tvm_command_entry_get_command    (TvmCommandEntry *command_entry) G_GNUC_INTERNAL;
-void         tvm_command_entry_set_command    (TvmCommandEntry *command_entry,
-                                               const gchar     *command) G_GNUC_INTERNAL;
-
-G_END_DECLS
-
-#endif /* !__TVM_COMMAND_ENTRY_H__ */
diff --git a/thunar-volman/tvm-crypto-volume.c b/thunar-volman/tvm-crypto-volume.c
deleted file mode 100644
index 550089e..0000000
--- a/thunar-volman/tvm-crypto-volume.c
+++ /dev/null
@@ -1,483 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2008 Benedikt Meurer <benny at xfce.org>.
- * Copyright (c) 2008 Colin Leroy <colin at colino.net>.
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#include <errno.h>
-
-#include <dbus/dbus-glib-lowlevel.h>
-#include <thunar-volman/tvm-block-device.h>
-#include <thunar-volman/tvm-crypto-volume.h>
-#include <libhal-storage.h>
-
-static void 
-tvm_crypto_volume_prompt_update_text (GtkEditable *editable,
-                        gchar *new_text,
-			gint new_text_len,
-			gint *position,
-			gpointer data)
-{
-  gchar **response = (gchar **)data;
-  if (response == NULL)
-    return;
-  g_free(*response);
-  *response = gtk_editable_get_chars(editable, 0, -1);    
-}
- 
-typedef struct _CryptoDialogValidate {
-  GtkWidget *dialog;
-  gint       response;
-} CryptoDialogValidate;
-
-void
-tvm_crypto_volume_prompt_validate_text (GtkEntry *entry,
-                          gpointer data)
-{
-  CryptoDialogValidate *validate_data = (CryptoDialogValidate *)data;
-  gtk_dialog_response(GTK_DIALOG(validate_data->dialog), validate_data->response);
-}
-
-static void
-tvm_crypto_volume_hal_device_removed (LibHalContext *context,
-                        const gchar   *udi)
-{
-  const gchar *dialog_udi;
-  GtkWidget   *dialog = libhal_ctx_get_user_data (context);
-
-  /* check if the active UDI of the dialog was removed */
-  dialog_udi = g_object_get_data (G_OBJECT (dialog), "udi");
-  if (exo_str_is_equal (dialog_udi, udi))
-    {
-      /* cancel the dialog */
-      gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
-    }
-}
-
- /**
- * tvm_crypto_volume_ask_password:
- * @context           : a #LibHalContext.
- * @udi               : the UDI of the device being added, which is watched for removal.
- * @icon              : the icon or %NULL.
- * @title             : the prompt title.
- * @response_text     : the response text.
- * @visible           : whether text typed should be visible.
- * @default_response  : Which response to return on Enter.
- * @primary_text      : the primary prompt text.
- * @secondary_text    : the secondary prompt text.
- * @first_button_text : the first button text.
- * @...               : %NULL-terminated list of button text, response id pairs.
- *
- * Return value: the selected response.
- **/
-static gint
-tvm_crypto_volume_ask_password (LibHalContext *context,
-		  const gchar   *udi,
-		  const gchar   *icon,
-		  const gchar   *title,
-		  gchar        **response_text,
-		  gboolean       visible,
-		  gint           default_response,
-		  const gchar   *primary_text,
-		  const gchar   *secondary_text,
-		  const gchar   *first_button_text,
-		  ...)
-{
-  GtkWidget *dialog;
-  GtkWidget *image;
-  GtkWidget *label;
-  GtkWidget *hbox;
-  GtkWidget *vbox;
-  GtkWidget *entry;
-  DBusError  derror;
-  va_list    args;
-  gint       response;
-  CryptoDialogValidate validate_data;
-
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), 0);
-  g_return_val_if_fail (context != NULL, GTK_RESPONSE_CANCEL);
-
-  /* allocate a new dialog */
-  dialog = gtk_dialog_new ();
-  gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
-  gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-  g_object_set_data_full (G_OBJECT (dialog), "udi", g_strdup (udi), g_free);
-  gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 6);
-  gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 12);
-
-  /* setup the specified title */
-  if (G_LIKELY (title != NULL))
-    gtk_window_set_title (GTK_WINDOW (dialog), title);
-
-  /* setup the specified buttons */
-  if (G_LIKELY (first_button_text != NULL))
-    {
-      va_start (args, first_button_text);
-      for (response = va_arg (args, gint); first_button_text != NULL; )
-        {
-          /* insert the button */
-          gtk_dialog_add_button (GTK_DIALOG (dialog), first_button_text, response);
-          first_button_text = va_arg (args, const gchar *);
-          if (G_UNLIKELY (first_button_text == NULL))
-            break;
-          response = va_arg (args, gint);
-        }
-      va_end (args);
-    }
-
-  /* setup the hbox */
-  hbox = gtk_hbox_new (FALSE, 12);
-  gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
-  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
-  gtk_widget_show (hbox);
-
-  /* setup the specified icon */
-  if (G_LIKELY (icon != NULL))
-    {
-      /* setup an image for the icon */
-      image = gtk_image_new_from_icon_name (icon, GTK_ICON_SIZE_DIALOG);
-      gtk_misc_set_alignment (GTK_MISC (image), 0.0f, 0.0f);
-      gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
-      gtk_widget_show (image);
-    }
-
-  /* setup the vbox */
-  vbox = gtk_vbox_new (FALSE, 0);
-  gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
-  gtk_widget_show (vbox);
-  g_object_set_data(G_OBJECT(dialog), "main_vbox", vbox);
-
-  /* setup the primary text */
-  label = gtk_label_new (primary_text);
-  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.5f);
-  gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
-  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
-  gtk_widget_show (label);
-
-  /* setup the secondary text */
-  if (G_LIKELY (secondary_text != NULL))
-    {
-      label = gtk_label_new (secondary_text);
-      gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-      gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.5f);
-      gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
-      gtk_widget_show (label);
-      g_object_set_data(G_OBJECT(dialog), "secondary_text", label);
-    }
-
-  entry = gtk_entry_new();
-  gtk_entry_set_visibility(GTK_ENTRY(entry), visible);
-  gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
-  gtk_widget_show (entry);
-  g_object_set_data(G_OBJECT(dialog), "pass_entry", entry);
-  
-  /* initialize D-Bus error */
-  dbus_error_init (&derror);
-
-  /* setup HAL to watch the UDI for removal */
-  libhal_ctx_set_user_data (context, dialog);
-  libhal_ctx_set_device_removed (context, tvm_crypto_volume_hal_device_removed);
-  libhal_device_property_watch_all (context, &derror);
-
-  /* setup handler for the entered text */
-  if (response_text)
-    *response_text = NULL;
-  g_signal_connect_after(G_OBJECT(entry), "insert-text",
-       G_CALLBACK(tvm_crypto_volume_prompt_update_text),
-       (gpointer) response_text);
-  validate_data.dialog = dialog;
-  validate_data.response = default_response;
-  g_signal_connect(G_OBJECT(entry), "activate",
-       G_CALLBACK(tvm_crypto_volume_prompt_validate_text),
-       (gpointer) &validate_data);
-
-  /* run the dialog */
-  response = gtk_dialog_run (GTK_DIALOG (dialog));
-  gtk_widget_destroy(dialog);
-
-  /* cleanup */
-  libhal_ctx_set_device_removed (context, NULL);
-  libhal_ctx_set_user_data (context, NULL);
-  dbus_error_free (&derror);
-
-  return response;
-}
-
-static gboolean 
-progress_pulse(gpointer data)
-{
-  GtkProgressBar *progress = GTK_PROGRESS_BAR(data);
-  g_return_val_if_fail(progress != NULL, FALSE);
-  
-  gtk_progress_bar_pulse(progress);
-  
-  return TRUE;
-}
-
-static void 
-tvm_crypto_volume_dbus_call_done (DBusPendingCall *call, 
-                                 void *user_data)
-{
-  gtk_main_quit();
-}
-
-static gchar *
-tvm_crypto_volume_mount_install_crypto_volume (LibHalContext *context,
-				 const gchar *udi, 
-				 LibHalVolume *volume,
-				 const gchar *password,
-				 gboolean *pass_error,
-				 GError **error)
-{
-  gchar *plain_udi = NULL;
-  DBusMessage *message = NULL;
-  DBusMessage *result = NULL;
-  DBusConnection *dbus_connection = NULL;
-  DBusPendingCall *call = NULL;
-  DBusError derror;
-  dbus_bool_t send_err;
-  *pass_error = FALSE;
-  GtkWidget *window = NULL;
-  GtkWidget *label, *vbox, *hbox;
-  GtkWidget *wait_progress;
-  GtkWidget *image;
-  guint animator_id;
-  g_clear_error(error);
-
-  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-  gtk_container_set_border_width(GTK_CONTAINER(window), 8);
-  gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
-  gtk_window_set_title(GTK_WINDOW(window), _("Encrypted volume"));
-  gtk_window_set_modal(GTK_WINDOW(window), TRUE);
-  gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
-
-  vbox = gtk_vbox_new(FALSE, 6);
-  hbox = gtk_hbox_new(FALSE, 6);
-  image = gtk_image_new_from_icon_name ("gtk-dialog-authentication", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.0f, 0.0f);
-  gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
-  gtk_widget_show (image);
-
-  label = gtk_label_new(_("<span weight=\"bold\" size=\"larger\">Mounting encrypted volume...</span>"));
-  gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
-  gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-  gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, FALSE, 0);
-
-  label = gtk_label_new(_("Setting up the crypto layer..."));
-  gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-  gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, FALSE, 0);
-
-  wait_progress = gtk_progress_bar_new();
-  gtk_box_pack_start(GTK_BOX(vbox), wait_progress, TRUE, FALSE, 0);
-
-  gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
-
-  gtk_container_add(GTK_CONTAINER(window), hbox);
-  gtk_widget_show_all(hbox);
-  animator_id = g_timeout_add(100, progress_pulse, wait_progress);
-
-  gtk_widget_show_now(window);
-
-  message = dbus_message_new_method_call ("org.freedesktop.Hal", udi,
-              "org.freedesktop.Hal.Device.Volume.Crypto",
-              "Setup");
-
-  if (G_UNLIKELY (message == NULL))
-    {
-      /* out of memory */
-oom:  g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM, g_strerror (ENOMEM));
-      goto out;
-    }
-
-  if (!dbus_message_append_args (message, 
-               DBUS_TYPE_STRING, &password,
-               DBUS_TYPE_INVALID)) {
-      dbus_message_unref (message);
-      goto oom;
-  }
-  
-  dbus_error_init (&derror);
-
-  dbus_connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror);
-  if (G_UNLIKELY (dbus_connection == NULL))
-    {
-      /* propagate the error */
-      dbus_set_g_error (error, &derror);
-      goto out;
-    }
-
-  send_err = dbus_connection_send_with_reply (dbus_connection, message, &call, -1);
-  if (G_UNLIKELY (send_err == FALSE))
-    {
-      /* release the result */
-      dbus_message_unref (message);
-      goto out;
-    }
-
-  dbus_pending_call_set_notify(call, tvm_crypto_volume_dbus_call_done, NULL, NULL);
-  gtk_main();
-
-  result = dbus_pending_call_steal_reply(call);
-  /* release the message */
-  dbus_message_unref (message);
-
-  /* release the connection */
-  dbus_connection_unref (dbus_connection);
-
-  if (G_UNLIKELY (dbus_set_error_from_message(&derror, result)))
-    {
-      /* try to translate the error appropriately */
-      if (strcmp (derror.name, "org.freedesktop.Hal.Device.Volume.PermissionDenied") == 0)
-        {
-          /* TRANSLATORS: The user tried to setup a crypto layer (LUKS-encrpyted volume) but got Permission denied. */
-          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("You are not privileged to setup the crypto layer"));
-        }
-      else if (strcmp (derror.name, "org.freedesktop.Hal.Device.Volume.Crypto.SetupPasswordError") == 0)
-        {
-          /* TRANSLATORS: The user tried to setup a crypto layer (LUKS-encrpyted volume) and typed the wrong password. */
-          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Wrong password"));
-          *pass_error = TRUE;
-        }
-      else
-        {
-          /* no precise error message, use the HAL one */
-          dbus_set_g_error (error, &derror);
-        }
-
-      /* release the DBus error */
-      dbus_error_free (&derror);
-      dbus_message_unref (result);
-      plain_udi = NULL;
-      goto out;
-    }
-  else
-    {
-      dbus_message_unref (result);
-      plain_udi = libhal_volume_crypto_get_clear_volume_udi (context, volume);
-    }
-
-out:
-  g_source_remove(animator_id);
-  gtk_widget_destroy(window);
-  return plain_udi;
-}
-
-/**
- * tvm_crypto_volume_setup:
- * @preferences : a #TvmPreferences.
- * @context     : a #LibHalContext.
- * @udi         : the HAL volume UDI of the newly added crypto volume.
- * @error       : return location for errors or %NULL.
- *
- * Tries to setup the crypto layer for the volume with the
- * specified @udi.
- *
- * Return value: %TRUE if handled, %FALSE if not handled or an
- *               unrecoverable error occurred.
- */
-gboolean
-tvm_crypto_volume_setup (TvmPreferences *preferences,
-                         LibHalContext  *context,
-                         const gchar    *udi,
-                         GError        **error)
-{
-  gchar *password = NULL;
-  gboolean pass_error = FALSE;
-  gint num_tries = 0;
-  gchar *plain_udi = NULL;
-  LibHalVolume *volume = NULL;
-  gboolean result = FALSE;
-
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), FALSE);
-  g_return_val_if_fail (TVM_IS_PREFERENCES (preferences), FALSE);
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-  g_return_val_if_fail (context != NULL, FALSE);
-
-  volume = libhal_volume_from_udi (context, udi);
-  g_return_val_if_fail(volume != NULL, FALSE);
-  plain_udi = libhal_volume_crypto_get_clear_volume_udi (context, volume);
-  if (plain_udi != NULL) {
-    libhal_volume_free(volume);
-    libhal_free_string(plain_udi);
-    return TRUE;
-  }
-  
-  for (num_tries = 0; num_tries < 3; num_tries++) {
-    gint response,len;
-    response = tvm_crypto_volume_ask_password (context, udi, "gtk-dialog-authentication", _("Encrypted volume"),
-               &password, FALSE, GTK_RESPONSE_OK,
-                                             pass_error? _("<span weight=\"bold\" size=\"larger\">Wrong password.</span>")
-                                :_("<span weight=\"bold\" size=\"larger\">This volume is encrypted.</span>"),
-                                             _("Please enter your password to decrypt and mount the volume."),
-                                             _("Ig_nore"), GTK_RESPONSE_CANCEL,
-                                             _("_Mount"), GTK_RESPONSE_OK,
-                                             NULL);
-    if (response == GTK_RESPONSE_CANCEL || response == GTK_RESPONSE_DELETE_EVENT) {
-      g_clear_error(error);
-      num_tries = 3;
-    } else if (password) {
-      plain_udi = tvm_crypto_volume_mount_install_crypto_volume(context, udi, volume, password, &pass_error, error);
-    }
-    if (password) {
-      len = strlen(password);
-      memset(password, 0, len);
-      g_debug("zeroed password %p", password);
-      g_free(password);
-    }
-    if (*error != NULL && !pass_error) {
-      /* display an error message to the user (exo-mount won't do it as it won't see the clear device */
-      GtkWidget *message = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
-                                        GTK_MESSAGE_ERROR,
-                                        GTK_BUTTONS_CLOSE,
-                                        "%s.", _("Failed to setup the encrypted volume"));
-      gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message), "%s.", (*error)->message);
-      gtk_dialog_run (GTK_DIALOG (message));
-      gtk_widget_destroy (message);
-      break;
-    }
-    if (plain_udi != NULL) {
-      libhal_free_string(plain_udi);
-      result = TRUE;
-      break;
-    }
-  }
-  return result;  
-}
-
-
diff --git a/thunar-volman/tvm-crypto-volume.h b/thunar-volman/tvm-crypto-volume.h
deleted file mode 100644
index 0e4ebf3..0000000
--- a/thunar-volman/tvm-crypto-volume.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2008 Benedikt Meurer <benny at xfce.org>.
- * Copyright (c) 2008 Colin Leroy <colin at colino.net>.
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __TVM_CRYPTO_VOLUME_H__
-#define __TVM_CRYPTO_VOLUME_H__
-
-#include <thunar-volman/tvm-device.h>
-
-G_BEGIN_DECLS
-
-gboolean tvm_crypto_volume_setup (TvmPreferences *preferences,
-                                  LibHalContext  *context,
-                                  const gchar    *udi,
-                                  GError        **error) G_GNUC_INTERNAL;
-
-G_END_DECLS
-
-#endif /* !__TVM_CRYPTO_VOLUME_H__ */
diff --git a/thunar-volman/tvm-device.c b/thunar-volman/tvm-device.c
index 584b222..8cdfd0d 100644
--- a/thunar-volman/tvm-device.c
+++ b/thunar-volman/tvm-device.c
@@ -1,203 +1,93 @@
-/* $Id$ */
+/* vi:set et ai sw=2 sts=2 ts=2: */
 /*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
  *
- * 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 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.
+ * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, 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
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
+#include <gudev/gudev.h>
 
-#include <dbus/dbus-glib-lowlevel.h>
+#include <xfconf/xfconf.h>
 
 #include <thunar-volman/tvm-block-device.h>
-#include <thunar-volman/tvm-camera-device.h>
 #include <thunar-volman/tvm-device.h>
 #include <thunar-volman/tvm-input-device.h>
-#include <thunar-volman/tvm-pda-device.h>
-#include <thunar-volman/tvm-printer-device.h>
 
 
 
 typedef struct _TvmDeviceHandler TvmDeviceHandler;
 struct _TvmDeviceHandler
 {
-  const gchar      *capability;
-  TvmDeviceCallback callback;
+  const gchar       *subsystem;
+  TvmDeviceCallback  callback;
 };
 
 
 
-static const TvmDeviceHandler handlers[] =
+static TvmDeviceHandler subsystem_handlers[] =
 {
-  { "block",          tvm_block_device_added,   },
-  { "camera",         tvm_camera_device_added,  },
-  { "input.keyboard", tvm_input_device_added,   },
-  { "input.mouse",    tvm_input_device_added,   },
-  { "input.tablet",   tvm_input_device_added,   },
-  { "pda",            tvm_pda_device_added,     },
-  { "printer",        tvm_printer_device_added, },
+  { "block",       tvm_block_device_added },
+  { "input",       tvm_input_device_added },
+#if 0 /* TODO */
+  { "sound",       tvm_sound_device_added },
+  { "video4linux", tvm_video_device_added },
+#endif
 };
 
 
 
-static gint
-strptrcmp (gconstpointer strptr1,
-           gconstpointer strptr2)
-{
-	return strcmp (*((const gchar **) strptr1),
-                 *((const gchar **) strptr2));
-}
-
-
-
-/**
- * tvm_device_added:
- * @preferences : a #TvmPreferences.
- * @udi         : the HAL device UDI of the newly added device.
- * @error       : return location for errors or %NULL.
- *
- * Invoked whenever a new device is added, where @udi is the
- * HAL device UDI of the device in question. Returns %FALSE if
- * an unrecoverable error occurred, %TRUE otherwise.
- *
- * Return value: %FALSE in case of an unrecoverable error,
- *               %TRUE otherwise.
- **/
-gboolean
-tvm_device_added (TvmPreferences *preferences,
-                  const gchar    *udi,
-                  GError        **error)
+void
+tvm_device_added (GUdevClient   *client,
+                  GUdevDevice   *device,
+                  XfconfChannel *channel,
+                  GError       **error)
 {
-  DBusConnection *connection;
-  LibHalContext  *context;
-  DBusError       derror;
-  GError         *err = NULL;
-  gchar         **capabilities;
-  gint            n_capabilities;
-  gint            i, j, n;
-
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), FALSE);
-  g_return_val_if_fail (TVM_IS_PREFERENCES (preferences), FALSE);
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
-  /* try to allocate a new HAL context */
-  context = libhal_ctx_new ();
-  if (G_UNLIKELY (context == NULL))
-    {
-      /* out of memory */
-      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM, g_strerror (ENOMEM));
-      return FALSE;
-    }
-
-  /* initialize D-Bus error */
-  dbus_error_init (&derror);
-
-  /* try to connect to the system bus */
-  connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror);
-  if (G_UNLIKELY (connection == NULL))
-    {
-err0: /* release the HAL context */
-      libhal_ctx_free (context);
-
-      /* propagate the error */
-      dbus_set_g_error (error, &derror);
-      return FALSE;
-    }
-
-  /* setup the D-Bus connection for the GLib main loop */
-  dbus_connection_setup_with_g_main (connection, NULL);
-
-  /* setup the D-Bus connection for the HAL context */
-  libhal_ctx_set_dbus_connection (context, connection);
-
-  /* the HAL context now owns the connection */
-  dbus_connection_unref (connection);
-
-  /* try to initialize the HAL context */
-  if (!libhal_ctx_init (context, &derror))
-    goto err0;
-
-  /* query the capabilities of the device */
-  capabilities = libhal_device_get_property_strlist (context, udi, "info.capabilities", &derror);
-  if (G_UNLIKELY (capabilities == NULL))
-    {
-      /* shutdown the HAL context */
-      libhal_ctx_shutdown (context, NULL);
-      goto err0;
-    }
-
-  /* determine the number of capabilities */
-  n_capabilities = g_strv_length (capabilities);
-
-  /* sort the capabilities */
-  qsort (capabilities, n_capabilities, sizeof (*capabilities), strptrcmp);
-
-  /* try various handlers until one of them succeeds */
-  for (i = 0, j = 0; err == NULL && i < G_N_ELEMENTS (handlers) && j < n_capabilities; ++i)
+  const gchar *const *keys;
+  const gchar        *subsystem;
+  GError             *err = NULL;
+  guint               n;
+
+  g_return_if_fail (G_UDEV_IS_CLIENT (client));
+  g_return_if_fail (G_UDEV_IS_DEVICE (device));
+  g_return_if_fail (XFCONF_IS_CHANNEL (channel));
+  g_return_if_fail (error == NULL || *error == NULL);
+
+  g_debug ("device added:");
+  keys = g_udev_device_get_property_keys (device);
+  for (n = 0; keys != NULL && keys[n] != NULL; ++n)
+    g_debug ("    %s=%s", keys[n], g_udev_device_get_property (device, keys[n]));
+
+  /* determine the subsystem to which the device belongs */
+  subsystem = g_udev_device_get_subsystem (device);
+
+  /* try all subsystem handlers until one of them succeeds */
+  for (n = 0; err == NULL && n < G_N_ELEMENTS (subsystem_handlers); ++n)
     {
-      /* search for a handler with the capability */
-      for (n = -1; j < n_capabilities; )
-        {
-          /* check if we have a match here */
-          n = strcmp (capabilities[j], handlers[i].capability);
-          if (G_LIKELY (n >= 0))
-            break;
-          ++j;
-        }
-
-      /* check if we have a potential match */
-      if (n == 0)
+      if (g_strcmp0 (subsystem, subsystem_handlers[n].subsystem) == 0)
         {
-          /* try to handle the device */
-          if ((*handlers[i].callback) (preferences, context, udi, capabilities[j], &err))
+          if (subsystem_handlers[n].callback (client, device, channel, &err))
             break;
-          ++j;
         }
     }
 
-  /* cleanup the capabilities */
-  libhal_free_string_array (capabilities);
-
-  /* shutdown the HAL context */
-  libhal_ctx_shutdown (context, NULL);
-  libhal_ctx_free (context);
-
-  /* check if we failed */
-  if (G_UNLIKELY (err != NULL))
-    {
-      /* propagate the error */
-      g_propagate_error (error, err);
-      return FALSE;
-    }
-
-  return TRUE;
+  /* propagate possible errors */
+  if (err != NULL)
+    g_propagate_error (error, err);
 }
-
-
diff --git a/thunar-volman/tvm-device.h b/thunar-volman/tvm-device.h
index 4934383..fb7d9f2 100644
--- a/thunar-volman/tvm-device.h
+++ b/thunar-volman/tvm-device.h
@@ -1,57 +1,42 @@
-/* $Id$ */
+/* vi:set et ai sw=2 sts=2 ts=2: */
 /*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
  *
- * 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 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.
+ * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifndef __TVM_DEVICE_H__
 #define __TVM_DEVICE_H__
 
-#include <libhal.h>
+#include <gudev/gudev.h>
 
-#include <exo-hal/exo-hal.h>
+G_BEGIN_DECLS
 
-#include <thunar-volman/tvm-preferences.h>
+/* callback type for device handlers */
+typedef gboolean (*TvmDeviceCallback) (GUdevClient   *client,
+                                       GUdevDevice   *device,
+                                       XfconfChannel *channel,
+                                       GError       **error);
 
-G_BEGIN_DECLS
 
-/**
- * TvmDeviceCallback:
- * @preferences : a #TvmPreferences.
- * @context     : a #LibHalContext.
- * @udi         : the HAL device UDI of the newly added device.
- * @capability  : the capability that caused this callback to be invoked.
- * @error       : return location for errors or %NULL.
- *
- * Prototype for device callbacks, which are invoked if a device is inserted,
- * with a capability they claim to be able to handle. Returns %TRUE if the
- * device was handled, %FALSE if the device cannot be handled or an unrecoverable
- * error occurred (in which case the @error should be set).
- *
- * Return value: 
- **/
-typedef gboolean (*TvmDeviceCallback) (TvmPreferences *preferences,
-                                       LibHalContext  *context,
-                                       const gchar    *udi,
-                                       const gchar    *capability,
-                                       GError        **error);
-
-gboolean tvm_device_added (TvmPreferences *preferences,
-                           const gchar    *udi,
-                           GError        **error) G_GNUC_INTERNAL;
+
+void tvm_device_added (GUdevClient   *client,
+                       GUdevDevice   *device,
+                       XfconfChannel *channel,
+                       GError       **error);
 
 G_END_DECLS
 
diff --git a/thunar-volman/tvm-input-device.c b/thunar-volman/tvm-input-device.c
index 664e856..64f6d63 100644
--- a/thunar-volman/tvm-input-device.c
+++ b/thunar-volman/tvm-input-device.c
@@ -1,101 +1,40 @@
-/* $Id$ */
+/* vi:set et ai sw=2 sts=2 ts=2: */
 /*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
  *
- * 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 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.
+ * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <thunar-volman/tvm-input-device.h>
-#include <thunar-volman/tvm-run.h>
+#include <gudev/gudev.h>
 
+#include <xfconf/xfconf.h>
 
-
-static const struct
-{
-  const gchar *capability;
-  const gchar *auto_option_name;
-  const gchar *auto_command_name;
-} commands[] = {
-  { "input.keyboard", "autokeyboard", "autokeyboard-command", },
-  { "input.mouse",    "automouse",    "automouse-command",    },
-  { "input.tablet",   "autotablet",   "autotablet-command",   },
-};
+#include <thunar-volman/tvm-input-device.h>
 
 
 
-/**
- * tvm_input_device_added:
- * @preferences : a #TvmPreferences.
- * @context     : a #LibHalContext.
- * @udi         : the HAL device UDI of the newly added input device.
- * @capability  : the capability, which caused this handler to be run.
- * @error       : return location for errors or %NULL.
- *
- * See #TvmDeviceCallback for further information.
- *
- * Return value: %TRUE if handled, %FALSE if not handled or an
- *               unrecoverable error occurred.
- **/
 gboolean
-tvm_input_device_added (TvmPreferences *preferences,
-                        LibHalContext  *context,
-                        const gchar    *udi,
-                        const gchar    *capability,
-                        GError        **error)
+tvm_input_device_added (GUdevDevice   *device,
+                        XfconfChannel *channel,
+                        GError       **error)
 {
-  gboolean result = FALSE;
-  gboolean auto_enabled;
-  gchar   *auto_command;
-  guint    n;
-
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), FALSE);
-  g_return_val_if_fail (TVM_IS_PREFERENCES (preferences), FALSE);
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-  g_return_val_if_fail (capability != NULL, FALSE);
-  g_return_val_if_fail (context != NULL, FALSE);
-
-  /* check which type of input device we have */
-  for (n = 0; n < G_N_ELEMENTS (commands); ++n)
-    if (strcmp (commands[n].capability, capability) == 0)
-      break;
-  if (G_LIKELY (n < G_N_ELEMENTS (commands)))
-    {
-      /* check if this handling is enabled and we have a command */
-      g_object_get (G_OBJECT (preferences), commands[n].auto_option_name, &auto_enabled, commands[n].auto_command_name, &auto_command, NULL);
-      if (G_LIKELY (auto_enabled && auto_command != NULL && *auto_command != '\0'))
-        {
-          /* try to run the command */
-          result = tvm_run_command (context, udi, auto_command, NULL, NULL, error);
-        }
-      g_free (auto_command);
-    }
-
-  return result;
+  g_debug ("input device added");
+  return TRUE;
 }
-
-
-
-
diff --git a/thunar-volman/tvm-input-device.h b/thunar-volman/tvm-input-device.h
index 211b9ac..be1834e 100644
--- a/thunar-volman/tvm-input-device.h
+++ b/thunar-volman/tvm-input-device.h
@@ -1,34 +1,35 @@
-/* $Id$ */
+/* vi:set et ai sw=2 sts=2 ts=2: */
 /*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
  *
- * 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 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.
+ * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifndef __TVM_INPUT_DEVICE_H__
 #define __TVM_INPUT_DEVICE_H__
 
-#include <thunar-volman/tvm-device.h>
+#include <gudev/gudev.h>
+
+#include <xfconf/xfconf.h>
 
 G_BEGIN_DECLS
 
-gboolean tvm_input_device_added (TvmPreferences *preferences,
-                                 LibHalContext  *context,
-                                 const gchar    *udi,
-                                 const gchar    *capability,
-                                 GError        **error) G_GNUC_INTERNAL;
+gboolean tvm_input_device_added (GUdevDevice   *device,
+                                 XfconfChannel *channel,
+                                 GError       **error);
 
 G_END_DECLS
 
diff --git a/thunar-volman/tvm-pda-device.c b/thunar-volman/tvm-pda-device.c
deleted file mode 100644
index 8e3b942..0000000
--- a/thunar-volman/tvm-pda-device.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <dbus/dbus-glib-lowlevel.h>
-
-#include <thunar-volman/tvm-pda-device.h>
-#include <thunar-volman/tvm-run.h>
-
-
-
-static const struct
-{
-  const gchar *platform;
-  const gchar *auto_option_name;
-  const gchar *auto_command_name;
-} commands[] = {
-  { "palm",     "autopalm",     "autopalm-command", },
-  { "pocketpc", "autopocketpc", "autopocketpc-command",    },
-};
-
-
-
-/**
- * tvm_pda_device_added:
- * @preferences : a #TvmPreferences.
- * @context     : a #LibHalContext.
- * @udi         : the HAL device UDI of the newly added PDA device.
- * @capability  : the capability, which caused this handler to be run.
- * @error       : return location for errors or %NULL.
- *
- * See #TvmDeviceCallback for further information.
- *
- * Return value: %TRUE if handled, %FALSE if not handled or an
- *               unrecoverable error occurred.
- **/
-gboolean
-tvm_pda_device_added (TvmPreferences *preferences,
-                      LibHalContext  *context,
-                      const gchar    *udi,
-                      const gchar    *capability,
-                      GError        **error)
-{
-  DBusError derror;
-  gboolean  result = FALSE;
-  gboolean  auto_enabled;
-  gchar    *auto_command;
-  gchar    *platform;
-  guint     n;
-
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), FALSE);
-  g_return_val_if_fail (TVM_IS_PREFERENCES (preferences), FALSE);
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-  g_return_val_if_fail (capability != NULL, FALSE);
-  g_return_val_if_fail (context != NULL, FALSE);
-
-  /* initialize D-Bus error */
-  dbus_error_init (&derror);
-
-  /* determine the PDA platform */
-  platform = libhal_device_get_property_string (context, udi, "pda.platform", &derror);
-  if (G_UNLIKELY (platform == NULL))
-    {
-      /* propagate the error */
-      dbus_set_g_error (error, &derror);
-      dbus_error_free (&derror);
-      return FALSE;
-    }
-
-  /* check if we can handle that platform */
-  for (n = 0; n < G_N_ELEMENTS (commands); ++n)
-    if (strcmp (commands[n].platform, platform) == 0)
-      break;
-  if (G_LIKELY (n < G_N_ELEMENTS (commands)))
-    {
-      /* check if this handling is enabled and we have a command */
-      g_object_get (G_OBJECT (preferences), commands[n].auto_option_name, &auto_enabled, commands[n].auto_command_name, &auto_command, NULL);
-      if (G_LIKELY (auto_enabled && auto_command != NULL && *auto_command != '\0'))
-        {
-          /* try to run the command */
-          result = tvm_run_command (context, udi, auto_command, NULL, NULL, error);
-        }
-      g_free (auto_command);
-    }
-
-  /* cleanup */
-  libhal_free_string (platform);
-
-  return result;
-}
-
-
-
-
diff --git a/thunar-volman/tvm-pda-device.h b/thunar-volman/tvm-pda-device.h
deleted file mode 100644
index 41edfbf..0000000
--- a/thunar-volman/tvm-pda-device.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __TVM_PDA_DEVICE_H__
-#define __TVM_PDA_DEVICE_H__
-
-#include <thunar-volman/tvm-device.h>
-
-G_BEGIN_DECLS
-
-gboolean tvm_pda_device_added (TvmPreferences *preferences,
-                               LibHalContext  *context,
-                               const gchar    *udi,
-                               const gchar    *capability,
-                               GError        **error) G_GNUC_INTERNAL;
-
-G_END_DECLS
-
-#endif /* !__TVM_PDA_DEVICE_H__ */
diff --git a/thunar-volman/tvm-preferences-dialog.c b/thunar-volman/tvm-preferences-dialog.c
deleted file mode 100644
index 614e68b..0000000
--- a/thunar-volman/tvm-preferences-dialog.c
+++ /dev/null
@@ -1,719 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2005-2007 Benedikt Meurer <benny at xfce.org>
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <thunar-volman/tvm-command-entry.h>
-#include <thunar-volman/tvm-pango-extensions.h>
-#include <thunar-volman/tvm-preferences-dialog.h>
-#include <thunar-volman/xfce-titled-dialog.h>
-
-
-
-static void tvm_preferences_dialog_class_init   (TvmPreferencesDialogClass *klass);
-static void tvm_preferences_dialog_init         (TvmPreferencesDialog      *dialog);
-static void tvm_preferences_dialog_finalize     (GObject                   *object);
-static void tvm_preferences_dialog_help_clicked (GtkWidget                 *button,
-                                                 TvmPreferencesDialog      *dialog);
-
-
-
-struct _TvmPreferencesDialogClass
-{
-  XfceTitledDialogClass __parent__;
-};
-
-struct _TvmPreferencesDialog
-{
-  XfceTitledDialog __parent__;
-  TvmPreferences  *preferences;
-};
-
-
-
-static GObjectClass *tvm_preferences_dialog_parent_class;
-
-
-
-GType
-tvm_preferences_dialog_get_type (void)
-{
-  static GType type = G_TYPE_INVALID;
-
-  if (G_UNLIKELY (type == G_TYPE_INVALID))
-    {
-      static const GTypeInfo info =
-      {
-        sizeof (TvmPreferencesDialogClass),
-        NULL,
-        NULL,
-        (GClassInitFunc) tvm_preferences_dialog_class_init,
-        NULL,
-        NULL,
-        sizeof (TvmPreferencesDialog),
-        0,
-        (GInstanceInitFunc) tvm_preferences_dialog_init,
-        NULL,
-      };
-
-      type = g_type_register_static (XFCE_TYPE_TITLED_DIALOG, I_("TvmPreferencesDialog"), &info, 0);
-    }
-
-  return type;
-}
-
-
-
-static void
-tvm_preferences_dialog_class_init (TvmPreferencesDialogClass *klass)
-{
-  GObjectClass *gobject_class;
-
-  /* determine the parent type class */
-  tvm_preferences_dialog_parent_class = g_type_class_peek_parent (klass);
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->finalize = tvm_preferences_dialog_finalize;
-}
-
-
-
-static void
-tvm_preferences_dialog_init (TvmPreferencesDialog *dialog)
-{
-  GtkSizeGroup *size_group;
-  GtkWidget    *notebook;
-  GtkWidget    *button;
-  GtkWidget    *entry;
-  GtkWidget    *frame;
-  GtkWidget    *image;
-  GtkWidget    *label;
-  GtkWidget    *table;
-  GtkWidget    *vbox;
-
-  /* grab a reference on the preferences */
-  dialog->preferences = tvm_preferences_get ();
-
-  /* configure the dialog properties */
-  gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-  gtk_window_set_icon_name (GTK_WINDOW (dialog), "gnome-dev-removable");
-  gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
-  gtk_window_set_title (GTK_WINDOW (dialog), _("Removable Drives and Media"));
-  xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (dialog), _("Configure management of removable drives and media"));
-
-  /* add "Help" button */
-  button = gtk_button_new_from_stock (GTK_STOCK_HELP);
-  g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (tvm_preferences_dialog_help_clicked), dialog);
-  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, FALSE, FALSE, 0);
-  gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (GTK_DIALOG (dialog)->action_area), button, TRUE);
-  gtk_widget_show (button);
-
-  /* add "Close" button */
-  gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-                          GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
-                          NULL);
-
-  notebook = gtk_notebook_new ();
-  gtk_container_set_border_width (GTK_CONTAINER (notebook), 6);
-  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, TRUE, TRUE, 0);
-  gtk_widget_show (notebook);
-
-
-  /*
-     Storage
-   */
-  label = gtk_label_new (_("Storage"));
-  vbox = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 12, NULL);
-  gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label);
-  gtk_widget_show (label);
-  gtk_widget_show (vbox);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Removable Storage"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (5, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("gnome-dev-removable", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("_Mount removable drives when hot-plugged"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "automount-drives", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  button = gtk_check_button_new_with_mnemonic (_("Mount removable media when _inserted"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "automount-media", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  button = gtk_check_button_new_with_mnemonic (_("B_rowse removable media when inserted"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autobrowse", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  button = gtk_check_button_new_with_mnemonic (_("_Auto-run programs on new drives and media"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autorun", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  button = gtk_check_button_new_with_mnemonic (_("Auto-open files on new drives and media"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoopen", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Blank CDs and DVDs"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (3, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("tvm-burn-cd", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("_Burn a CD or DVD when a blank disc is inserted"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoburn", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  /* use a size group to make sure both labels request the same width */
-  size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-
-  entry = tvm_command_entry_new_with_label (_("Command for _Data CDs:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoburn-data-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_size_group_add_widget (size_group, TVM_COMMAND_ENTRY (entry)->label);
-  gtk_widget_show (entry);
-
-  entry = tvm_command_entry_new_with_label (_("Command for A_udio CDs:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoburn-audio-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_size_group_add_widget (size_group, TVM_COMMAND_ENTRY (entry)->label);
-  gtk_widget_show (entry);
-
-  /* release the size group */
-  g_object_unref (G_OBJECT (size_group));
-
-
-  /*
-     Multimedia
-   */
-  label = gtk_label_new (_("Multimedia"));
-  vbox = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 12, NULL);
-  gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label);
-  gtk_widget_show (label);
-  gtk_widget_show (vbox);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Audio CDs"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("gnome-dev-cdrom-audio", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("Play _audio CDs when inserted"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoplay-audio-cd", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  entry = tvm_command_entry_new_with_label (_("_Command:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoplay-audio-cd-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (entry);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Video CDs/DVDs"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("gnome-dev-cdrom", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("Play _video CDs and DVDs when inserted"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoplay-video-cd", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  entry = tvm_command_entry_new_with_label (_("C_ommand:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoplay-video-cd-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (entry);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Portable Music Players"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("gnome-dev-ipod", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("Play _music files when connected"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoipod", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  entry = tvm_command_entry_new_with_label (_("C_ommand:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoipod-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (entry);
-
-
-  /*
-     Cameras
-   */
-  label = gtk_label_new (_("Cameras"));
-  vbox = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 12, NULL);
-  gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label);
-  gtk_widget_show (label);
-  gtk_widget_show (vbox);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Digital Cameras"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("camera-photo", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("Import digital photographs when connected"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autophoto", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  entry = tvm_command_entry_new_with_label (_("_Command:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autophoto-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (entry);
-
-
-  /*
-     PDAs
-   */
-  label = gtk_label_new (_("PDAs"));
-  vbox = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 12, NULL);
-  gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label);
-  gtk_widget_show (label);
-  gtk_widget_show (vbox);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Palm™"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("palm-pilot", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("Sync _Palm™ devices when connected"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autopalm", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  entry = tvm_command_entry_new_with_label (_("_Command:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autopalm-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (entry);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Pocket PCs"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("tvm-dev-pocketpc", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("Sync Pocket P_C devices when connected"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autopocketpc", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  entry = tvm_command_entry_new_with_label (_("C_ommand:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autopocketpc-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (entry);
-
-
-  /*
-     Printers
-   */
-  label = gtk_label_new (_("Printers"));
-  vbox = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 12, NULL);
-  gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label);
-  gtk_widget_show (label);
-  gtk_widget_show (vbox);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Printers"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("gnome-dev-printer", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("Automatically run a program when a _printer is connected"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoprinter", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  entry = tvm_command_entry_new_with_label (_("_Command:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autoprinter-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (entry);
-
-
-  /*
-     Input Devices
-   */
-  label = gtk_label_new (_("Input Devices"));
-  vbox = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 12, NULL);
-  gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label);
-  gtk_widget_show (label);
-  gtk_widget_show (vbox);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Keyboards"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("gnome-dev-keyboard", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("Automatically run a program when an USB _keyboard is connected"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autokeyboard", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  entry = tvm_command_entry_new_with_label (_("_Command:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autokeyboard-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (entry);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Mice"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("gnome-dev-mouse-optical", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("Automatically run a program when an USB _mouse is connected"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "automouse", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  entry = tvm_command_entry_new_with_label (_("C_ommand:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "automouse-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (entry);
-
-  frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
-  gtk_widget_show (frame);
-
-  label = gtk_label_new (_("Tablet"));
-  gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
-  gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-  gtk_widget_show (label);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-  gtk_container_add (GTK_CONTAINER (frame), table);
-  gtk_widget_show (table);
-
-  image = gtk_image_new_from_icon_name ("tvm-dev-tablet", GTK_ICON_SIZE_DIALOG);
-  gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
-  gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 3, GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (image);
-
-  button = gtk_check_button_new_with_mnemonic (_("Automatically run a program when a _tablet is connected"));
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autotablet", G_OBJECT (button), "active");
-  gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (button);
-
-  entry = tvm_command_entry_new_with_label (_("Com_mand:"));
-  exo_binding_new (G_OBJECT (button), "active", G_OBJECT (entry), "sensitive");
-  exo_mutual_binding_new (G_OBJECT (dialog->preferences), "autotablet-command", G_OBJECT (entry), "command");
-  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show (entry);
-}
-
-
-
-static void
-tvm_preferences_dialog_finalize (GObject *object)
-{
-  TvmPreferencesDialog *dialog = TVM_PREFERENCES_DIALOG (object);
-
-  /* release our reference on the preferences */
-  g_object_unref (G_OBJECT (dialog->preferences));
-
-  (*G_OBJECT_CLASS (tvm_preferences_dialog_parent_class)->finalize) (object);
-}
-
-
-
-static void
-tvm_preferences_dialog_help_clicked (GtkWidget            *button,
-                                     TvmPreferencesDialog *dialog)
-{
-  GtkWidget *message;
-  GError    *err = NULL;
-  gchar    **argv;
-  gchar     *bindir;
-  gchar     *prefix;
-  gchar     *path;
-
-  g_return_if_fail (TVM_IS_PREFERENCES_DIALOG (dialog));
-  g_return_if_fail (GTK_IS_BUTTON (button));
-
-  /* try to locate Thunar in the $PATH */
-  path = g_find_program_in_path ("Thunar");
-  if (G_UNLIKELY (path == NULL))
-    path = g_find_program_in_path ("thunar");
-  if (G_LIKELY (path != NULL))
-    {
-      bindir = g_path_get_dirname (path);
-      prefix = g_path_get_dirname (bindir);
-      g_free (bindir);
-      g_free (path);
-
-      /* now check if ThunarHelp is in $prefix/libexec */
-      path = g_build_filename (prefix, "libexec", "ThunarHelp", NULL);
-      if (!g_file_test (path, G_FILE_TEST_IS_EXECUTABLE))
-        {
-          /* release path */
-          g_free (path);
-
-          /* try to support Debian weirdness */
-          path = g_build_filename (prefix, "lib", "thunar", "ThunarHelp", NULL);
-          if (!g_file_test (path, G_FILE_TEST_IS_EXECUTABLE))
-            {
-              /* release path */
-              g_free (path);
-              path = NULL;
-            }
-        }
-    }
-
-  /* no ThunarHelp, weird! */
-  if (G_UNLIKELY (path == NULL))
-    path = g_strdup ("ThunarHelp");
-
-  /* prepare command to run help */
-  argv = g_new (gchar *, 4);
-  argv[0] = path;
-  argv[1] = g_strdup ("using-removable-media");
-  argv[2] = g_strdup ("management-of-removable-drives-and-media");
-  argv[3] = NULL;
-
-  /* try to open the user manual */
-  if (!gdk_spawn_on_screen (gtk_widget_get_screen (button), NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &err))
-    {
-      /* display an error message to the user */
-      message = gtk_message_dialog_new (GTK_WINDOW (dialog),
-                                        GTK_DIALOG_DESTROY_WITH_PARENT
-                                        | GTK_DIALOG_MODAL,
-                                        GTK_MESSAGE_ERROR,
-                                        GTK_BUTTONS_CLOSE,
-                                        "%s.", _("Failed to open the documentation browser"));
-      gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message), "%s.", err->message);
-      gtk_dialog_run (GTK_DIALOG (message));
-      gtk_widget_destroy (message);
-      g_error_free (err);
-    }
-
-  /* cleanup */
-  g_strfreev (argv);
-}
-
-
-
-/**
- * tvm_preferences_dialog_new:
- * @parent : a #GtkWindow or %NULL.
- *
- * Allocates a new #TvmPreferencesDialog widget.
- *
- * Return value: the newly allocated #TvmPreferencesDialog.
- **/
-GtkWidget*
-tvm_preferences_dialog_new (void)
-{
-  return g_object_new (TVM_TYPE_PREFERENCES_DIALOG, NULL);
-}
-
-
-
-/* vim:set encoding=UTF-8: */
diff --git a/thunar-volman/tvm-preferences-dialog.h b/thunar-volman/tvm-preferences-dialog.h
deleted file mode 100644
index 2c26142..0000000
--- a/thunar-volman/tvm-preferences-dialog.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2005-2007 Benedikt Meurer <benny at xfce.org>
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __TVM_PREFERENCES_DIALOG_H__
-#define __TVM_PREFERENCES_DIALOG_H__
-
-#include <thunar-volman/tvm-preferences.h>
-
-G_BEGIN_DECLS
-
-typedef struct _TvmPreferencesDialogClass TvmPreferencesDialogClass;
-typedef struct _TvmPreferencesDialog      TvmPreferencesDialog;
-
-#define TVM_TYPE_PREFERENCES_DIALOG            (tvm_preferences_dialog_get_type ())
-#define TVM_PREFERENCES_DIALOG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), TVM_TYPE_PREFERENCES_DIALOG, TvmPreferencesDialog))
-#define TVM_PREFERENCES_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), TVM_TYPE_PREFERENCES_DIALOG, TvmPreferencesDialogClass))
-#define TVM_IS_PREFERENCES_DIALOG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TVM_TYPE_PREFERENCES_DIALOG))
-#define TVM_IS_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TVM_TYPE_PREFERENCES_DIALOG))
-#define TVM_PREFERENCES_DIALOG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), TVM_TYPE_PREFERENCES_DIALOG, TvmPreferencesDialogClass))
-
-GType      tvm_preferences_dialog_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL;
-
-GtkWidget *tvm_preferences_dialog_new      (void) G_GNUC_INTERNAL G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
-
-G_END_DECLS
-
-#endif /* !__TVM_PREFERENCES_DIALOG_H__ */
diff --git a/thunar-volman/tvm-preferences.c b/thunar-volman/tvm-preferences.c
deleted file mode 100644
index 5896ca2..0000000
--- a/thunar-volman/tvm-preferences.c
+++ /dev/null
@@ -1,963 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2005-2007 Benedikt Meurer <benny at xfce.org>
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <thunar-vfs/thunar-vfs.h>
-
-#include <thunar-volman/tvm-preferences.h>
-
-
-
-/* Property identifiers */
-enum
-{
-  PROP_0,
-  PROP_AUTOMOUNT_DRIVES,
-  PROP_AUTOMOUNT_MEDIA,
-  PROP_AUTOBROWSE,
-  PROP_AUTORUN,
-  PROP_AUTOOPEN,
-  PROP_AUTOBURN,
-  PROP_AUTOBURN_DATA_COMMAND,
-  PROP_AUTOBURN_AUDIO_COMMAND,
-  PROP_AUTOPLAY_AUDIO_CD,
-  PROP_AUTOPLAY_AUDIO_CD_COMMAND,
-  PROP_AUTOPLAY_VIDEO_CD,
-  PROP_AUTOPLAY_VIDEO_CD_COMMAND,
-  PROP_AUTOIPOD,
-  PROP_AUTOIPOD_COMMAND,
-  PROP_AUTOPHOTO,
-  PROP_AUTOPHOTO_COMMAND,
-  PROP_AUTOPALM,
-  PROP_AUTOPALM_COMMAND,
-  PROP_AUTOPOCKETPC,
-  PROP_AUTOPOCKETPC_COMMAND,
-  PROP_AUTOPRINTER,
-  PROP_AUTOPRINTER_COMMAND,
-  PROP_AUTOKEYBOARD,
-  PROP_AUTOKEYBOARD_COMMAND,
-  PROP_AUTOMOUSE,
-  PROP_AUTOMOUSE_COMMAND,
-  PROP_AUTOTABLET,
-  PROP_AUTOTABLET_COMMAND,
-  N_PROPERTIES,
-};
-
-
-
-static void     tvm_preferences_class_init         (TvmPreferencesClass    *klass);
-static void     tvm_preferences_init               (TvmPreferences         *preferences);
-static void     tvm_preferences_dispose            (GObject                *object);
-static void     tvm_preferences_finalize           (GObject                *object);
-static void     tvm_preferences_get_property       (GObject                *object,
-                                                    guint                   prop_id,
-                                                    GValue                 *value,
-                                                    GParamSpec             *pspec);
-static void     tvm_preferences_set_property       (GObject                *object,
-                                                    guint                   prop_id,
-                                                    const GValue           *value,
-                                                    GParamSpec             *pspec);
-static void     tvm_preferences_resume_monitor     (TvmPreferences         *preferences);
-static void     tvm_preferences_suspend_monitor    (TvmPreferences         *preferences);
-static void     tvm_preferences_monitor            (ThunarVfsMonitor       *monitor,
-                                                    ThunarVfsMonitorHandle *handle,
-                                                    ThunarVfsMonitorEvent   event,
-                                                    ThunarVfsPath          *handle_path,
-                                                    ThunarVfsPath          *event_path,
-                                                    gpointer                user_data);
-static void     tvm_preferences_queue_load         (TvmPreferences         *preferences);
-static void     tvm_preferences_queue_store        (TvmPreferences         *preferences);
-static gboolean tvm_preferences_load_idle          (gpointer                user_data);
-static void     tvm_preferences_load_idle_destroy  (gpointer                user_data);
-static gboolean tvm_preferences_store_idle         (gpointer                user_data);
-static void     tvm_preferences_store_idle_destroy (gpointer                user_data);
-
-
-
-struct _TvmPreferencesClass
-{
-  GObjectClass __parent__;
-};
-
-struct _TvmPreferences
-{
-  GObject                 __parent__;
-
-  ThunarVfsMonitorHandle *handle;
-  ThunarVfsMonitor       *monitor;
-
-  GValue                  values[N_PROPERTIES];
-
-  gboolean                loading_in_progress;
-
-  gint                    load_idle_id;
-  gint                    store_idle_id;
-};
-
-
-
-static GObjectClass *tvm_preferences_parent_class;
-
-
-
-GType
-tvm_preferences_get_type (void)
-{
-  static GType type = G_TYPE_INVALID;
-
-  if (G_UNLIKELY (type == G_TYPE_INVALID))
-    {
-      static const GTypeInfo info =
-      {
-        sizeof (TvmPreferencesClass),
-        NULL,
-        NULL,
-        (GClassInitFunc) tvm_preferences_class_init,
-        NULL,
-        NULL,
-        sizeof (TvmPreferences),
-        0,
-        (GInstanceInitFunc) tvm_preferences_init,
-        NULL,
-      };
-
-      type = g_type_register_static (G_TYPE_OBJECT, I_("TvmPreferences"), &info, 0);
-    }
-
-  return type;
-}
-
-
-
-static void
-transform_string_to_boolean (const GValue *src,
-                             GValue       *dst)
-{
-  g_value_set_boolean (dst, strcmp (g_value_get_string (src), "FALSE") != 0);
-}
-
-
-
-static void
-tvm_preferences_class_init (TvmPreferencesClass *klass)
-{
-  GObjectClass *gobject_class;
-
-  /* register transformation functions */
-  if (!g_value_type_transformable (G_TYPE_STRING, G_TYPE_BOOLEAN))
-    g_value_register_transform_func (G_TYPE_STRING, G_TYPE_BOOLEAN, transform_string_to_boolean);
-
-  /* determine the parent type class */
-  tvm_preferences_parent_class = g_type_class_peek_parent (klass);
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->dispose = tvm_preferences_dispose;
-  gobject_class->finalize = tvm_preferences_finalize;
-  gobject_class->get_property = tvm_preferences_get_property;
-  gobject_class->set_property = tvm_preferences_set_property;
-
-  /**
-   * TvmPreferences:automount-drives:
-   *
-   * Mount removable drives when hot-plugged.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOMOUNT_DRIVES,
-                                   g_param_spec_boolean ("automount-drives",
-                                                         "automount-drives",
-                                                         "automount-drives",
-                                                         TRUE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:automount-media:
-   *
-   * Mount removable media when inserted.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOMOUNT_MEDIA,
-                                   g_param_spec_boolean ("automount-media",
-                                                         "automount-media",
-                                                         "automount-media",
-                                                         TRUE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autobrowse:
-   *
-   * Browse removable media when inserted.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOBROWSE,
-                                   g_param_spec_boolean ("autobrowse",
-                                                         "autobrowse",
-                                                         "autobrowse",
-                                                         TRUE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autorun:
-   *
-   * Auto-run programs on new drives and media.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTORUN,
-                                   g_param_spec_boolean ("autorun",
-                                                         "autorun",
-                                                         "autorun",
-                                                         TRUE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoopen:
-   *
-   * Auto-open files on new drives and media.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOOPEN,
-                                   g_param_spec_boolean ("autoopen",
-                                                         "autoopen",
-                                                         "autoopen",
-                                                         TRUE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoburn:
-   *
-   * Burn a CD or DVD if a blank disc is inserted.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOBURN,
-                                   g_param_spec_boolean ("autoburn",
-                                                         "autoburn",
-                                                         "autoburn",
-                                                         FALSE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoburn-data-command:
-   *
-   * Command to burn a new data CD/DVD.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOBURN_DATA_COMMAND,
-                                   g_param_spec_string ("autoburn-data-command",
-                                                        "autoburn-data-command",
-                                                        "autoburn-data-command",
-                                                        "xfburn",
-                                                        EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoburn-audio-command:
-   *
-   * Command to burn a new audio CD.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOBURN_AUDIO_COMMAND,
-                                   g_param_spec_string ("autoburn-audio-command",
-                                                        "autoburn-audio-command",
-                                                        "autoburn-audio-command",
-                                                        "xfburn",
-                                                        EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoplay-audio-cd:
-   *
-   * Play audio discs when inserted.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPLAY_AUDIO_CD,
-                                   g_param_spec_boolean ("autoplay-audio-cd",
-                                                         "autoplay-audio-cd",
-                                                         "autoplay-audio-cd",
-                                                         TRUE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoplay-audio-cd-command:
-   *
-   * Command to run the preferred audio CD player.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPLAY_AUDIO_CD_COMMAND,
-                                   g_param_spec_string ("autoplay-audio-cd-command",
-                                                        "autoplay-audio-cd-command",
-                                                        "autoplay-audio-cd-command",
-                                                        "totem %d",
-                                                        EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoplay-video-cd:
-   *
-   * Play video CDs and DVDs when inserted.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPLAY_VIDEO_CD,
-                                   g_param_spec_boolean ("autoplay-video-cd",
-                                                         "autoplay-video-cd",
-                                                         "autoplay-video-cd",
-                                                         TRUE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoplay-video-cd-command:
-   *
-   * Command to run the preferred video CD/DVD-Player.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPLAY_VIDEO_CD_COMMAND,
-                                   g_param_spec_string ("autoplay-video-cd-command",
-                                                        "autoplay-video-cd-command",
-                                                        "autoplay-video-cd-command",
-                                                        "totem %d",
-                                                        EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoipod:
-   *
-   * Play music files when portable music player is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOIPOD,
-                                   g_param_spec_boolean ("autoipod",
-                                                         "autoipod",
-                                                         "autoipod",
-                                                         FALSE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoipod-command:
-   *
-   * Command to run when portable music player is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOIPOD_COMMAND,
-                                   g_param_spec_string ("autoipod-command",
-                                                        "autoipod-command",
-                                                        "autoipod-command",
-                                                        "",
-                                                        EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autophoto:
-   *
-   * Import photos when digital camera is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPHOTO,
-                                   g_param_spec_boolean ("autophoto",
-                                                         "autophoto",
-                                                         "autophoto",
-                                                         FALSE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autophoto-command:
-   *
-   * Command to run when digitcal camera is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPHOTO_COMMAND,
-                                   g_param_spec_string ("autophoto-command",
-                                                        "autophoto-command",
-                                                        "autophoto-command",
-                                                        "",
-                                                        EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autopalm:
-   *
-   * Sync Palm devices when connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPALM,
-                                   g_param_spec_boolean ("autopalm",
-                                                         "autopalm",
-                                                         "autopalm",
-                                                         FALSE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autopalm-command:
-   *
-   * Command to run when Palm device is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPALM_COMMAND,
-                                   g_param_spec_string ("autopalm-command",
-                                                        "autopalm-command",
-                                                        "autopalm-command",
-                                                        "gpilotd-control-applet",
-                                                        EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autopocketpc:
-   *
-   * Sync PocketPC devices when connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPOCKETPC,
-                                   g_param_spec_boolean ("autopocketpc",
-                                                         "autopocketpc",
-                                                         "autopocketpc",
-                                                         FALSE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autopocketpc-command:
-   *
-   * Command to run when PocketPC device is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPOCKETPC_COMMAND,
-                                   g_param_spec_string ("autopocketpc-command",
-                                                        "autopocketpc-command",
-                                                        "autopocketpc-command",
-                                                        "multisync",
-                                                        EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoprinter:
-   *
-   * Automatically run a program when a printer is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPRINTER,
-                                   g_param_spec_boolean ("autoprinter",
-                                                         "autoprinter",
-                                                         "autoprinter",
-                                                         FALSE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autoprinter-command:
-   *
-   * Command to run when a printer is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOPRINTER_COMMAND,
-                                   g_param_spec_string ("autoprinter-command",
-                                                        "autoprinter-command",
-                                                        "autoprinter-command",
-                                                        "gnome-printer-add hal://%h",
-                                                        EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autokeyboard:
-   *
-   * Automatically run a program when an USB keyboard is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOKEYBOARD,
-                                   g_param_spec_boolean ("autokeyboard",
-                                                         "autokeyboard",
-                                                         "autokeyboard",
-                                                         FALSE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autokeyboard-command:
-   *
-   * Command to run when an USB keyboard is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOKEYBOARD_COMMAND,
-                                   g_param_spec_string ("autokeyboard-command",
-                                                        "autokeyboard-command",
-                                                        "autokeyboard-command",
-                                                        "",
-                                                        EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:automouse:
-   *
-   * Automatically run a program when an USB mouse is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOMOUSE,
-                                   g_param_spec_boolean ("automouse",
-                                                         "automouse",
-                                                         "automouse",
-                                                         FALSE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:automouse-command:
-   *
-   * Command to run when an USB mouse is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOMOUSE_COMMAND,
-                                   g_param_spec_string ("automouse-command",
-                                                        "automouse-command",
-                                                        "automouse-command",
-                                                        "",
-                                                        EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autotablet:
-   *
-   * Automatically run a program when a table is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOTABLET,
-                                   g_param_spec_boolean ("autotablet",
-                                                         "autotablet",
-                                                         "autotablet",
-                                                         FALSE,
-                                                         EXO_PARAM_READWRITE));
-
-  /**
-   * TvmPreferences:autotablet-command:
-   *
-   * Command to run when a table is connected.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_AUTOTABLET_COMMAND,
-                                   g_param_spec_string ("autotablet-command",
-                                                        "autotablet-command",
-                                                        "autotablet-command",
-                                                        "",
-                                                        EXO_PARAM_READWRITE));
-}
-
-
-
-static void
-tvm_preferences_init (TvmPreferences *preferences)
-{
-  /* grab a reference on the VFS monitor */
-  preferences->monitor = thunar_vfs_monitor_get_default ();
-
-  /* load the settings */
-  tvm_preferences_load_idle (preferences);
-
-  /* launch the file monitor */
-  tvm_preferences_resume_monitor (preferences);
-}
-
-
-
-static void
-tvm_preferences_dispose (GObject *object)
-{
-  TvmPreferences *preferences = TVM_PREFERENCES (object);
-
-  /* flush preferences */
-  if (G_UNLIKELY (preferences->store_idle_id != 0))
-    {
-      tvm_preferences_store_idle (preferences);
-      g_source_remove (preferences->store_idle_id);
-    }
-
-  (*G_OBJECT_CLASS (tvm_preferences_parent_class)->dispose) (object);
-}
-
-
-
-static void
-tvm_preferences_finalize (GObject *object)
-{
-  TvmPreferences *preferences = TVM_PREFERENCES (object);
-  guint           n;
-
-  /* stop any pending load idle source */
-  if (G_UNLIKELY (preferences->load_idle_id != 0))
-    g_source_remove (preferences->load_idle_id);
-
-  /* stop the file monitor */
-  if (G_LIKELY (preferences->monitor != NULL))
-    {
-      tvm_preferences_suspend_monitor (preferences);
-      g_object_unref (G_OBJECT (preferences->monitor));
-    }
-
-  /* release the property values */
-  for (n = 1; n < N_PROPERTIES; ++n)
-    if (G_IS_VALUE (preferences->values + n))
-      g_value_unset (preferences->values + n);
-
-  (*G_OBJECT_CLASS (tvm_preferences_parent_class)->finalize) (object);
-}
-
-
-
-static void
-tvm_preferences_get_property (GObject    *object,
-                              guint       prop_id,
-                              GValue     *value,
-                              GParamSpec *pspec)
-{
-  TvmPreferences *preferences = TVM_PREFERENCES (object);
-  GValue         *src;
-
-  src = preferences->values + prop_id;
-  if (G_IS_VALUE (src))
-    g_value_copy (src, value);
-  else
-    g_param_value_set_default (pspec, value);
-}
-
-
-
-static void
-tvm_preferences_set_property (GObject      *object,
-                              guint         prop_id,
-                              const GValue *value,
-                              GParamSpec   *pspec)
-{
-  TvmPreferences *preferences = TVM_PREFERENCES (object);
-  GValue         *dst;
-
-  dst = preferences->values + prop_id;
-  if (G_UNLIKELY (!G_IS_VALUE (dst)))
-    {
-      g_value_init (dst, pspec->value_type);
-      g_param_value_set_default (pspec, dst);
-    }
-
-  if (g_param_values_cmp (pspec, value, dst) != 0)
-    {
-      g_value_copy (value, dst);
-      tvm_preferences_queue_store (preferences);
-    }
-}
-
-
-
-static void
-tvm_preferences_resume_monitor (TvmPreferences *preferences)
-{
-  ThunarVfsPath *path;
-  gchar      *filename;
-
-  /* verify that the monitor is suspended */
-  if (G_LIKELY (preferences->handle == NULL))
-    {
-      /* determine the save location for tvmrc to monitor */
-      filename = xfce_resource_save_location (XFCE_RESOURCE_CONFIG, "Thunar/volmanrc", TRUE);
-      if (G_LIKELY (filename != NULL))
-        {
-          /* determine the VFS path for the filename */
-          path = thunar_vfs_path_new (filename, NULL);
-          if (G_LIKELY (path != NULL))
-            {
-              /* add the monitor handle for the file */
-              preferences->handle = thunar_vfs_monitor_add_file (preferences->monitor, path, tvm_preferences_monitor, preferences);
-              thunar_vfs_path_unref (path);
-            }
-
-          /* release the filename */
-          g_free (filename);
-        }
-    }
-}
-
-
-
-static void
-tvm_preferences_suspend_monitor (TvmPreferences *preferences)
-{
-  /* verify that the monitor is active */
-  if (G_LIKELY (preferences->handle != NULL))
-    {
-      /* disconnect the handle from the monitor */
-      thunar_vfs_monitor_remove (preferences->monitor, preferences->handle);
-      preferences->handle = NULL;
-    }
-}
-
-
-
-static void
-tvm_preferences_monitor (ThunarVfsMonitor       *monitor,
-                         ThunarVfsMonitorHandle *handle,
-                         ThunarVfsMonitorEvent   event,
-                         ThunarVfsPath          *handle_path,
-                         ThunarVfsPath          *event_path,
-                         gpointer                user_data)
-{
-  TvmPreferences *preferences = TVM_PREFERENCES (user_data);
-
-  g_return_if_fail (TVM_IS_PREFERENCES (preferences));
-  g_return_if_fail (THUNAR_VFS_IS_MONITOR (monitor));
-  g_return_if_fail (preferences->monitor == monitor);
-  g_return_if_fail (preferences->handle == handle);
-
-  /* schedule a reload whenever the file is created/changed */
-  if (event == THUNAR_VFS_MONITOR_EVENT_CHANGED || event == THUNAR_VFS_MONITOR_EVENT_CREATED)
-    tvm_preferences_queue_load (preferences);
-}
-
-
-
-static void
-tvm_preferences_queue_load (TvmPreferences *preferences)
-{
-  if (preferences->load_idle_id == 0 && preferences->store_idle_id == 0)
-    {
-      preferences->load_idle_id = g_idle_add_full (G_PRIORITY_LOW, tvm_preferences_load_idle,
-                                                   preferences, tvm_preferences_load_idle_destroy);
-    }
-}
-
-
-
-static void
-tvm_preferences_queue_store (TvmPreferences *preferences)
-{
-  if (preferences->store_idle_id == 0 && !preferences->loading_in_progress)
-    {
-      preferences->store_idle_id = g_idle_add_full (G_PRIORITY_LOW, tvm_preferences_store_idle,
-                                                    preferences, tvm_preferences_store_idle_destroy);
-    }
-}
-
-
-
-static gchar*
-property_name_to_option_name (const gchar *property_name)
-{
-  const gchar *s;
-  gboolean     upper = TRUE;
-  gchar       *option;
-  gchar       *t;
-
-  option = g_new (gchar, strlen (property_name) + 1);
-  for (s = property_name, t = option; *s != '\0'; ++s)
-    {
-      if (*s == '-')
-        {
-          upper = TRUE;
-        }
-      else if (upper)
-        {
-          *t++ = g_ascii_toupper (*s);
-          upper = FALSE;
-        }
-      else
-        {
-          *t++ = *s;
-        }
-    }
-  *t = '\0';
-
-  return option;
-}
-
-
-
-static gboolean
-tvm_preferences_load_idle (gpointer user_data)
-{
-  TvmPreferences *preferences = TVM_PREFERENCES (user_data);
-  const gchar    *string;
-  GParamSpec    **specs;
-  GParamSpec     *spec;
-  XfceRc         *rc;
-  GValue          dst = { 0, };
-  GValue          src = { 0, };
-  gchar          *option;
-  guint           nspecs;
-  guint           n;
-
-  rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, "Thunar/volmanrc", TRUE);
-  if (G_UNLIKELY (rc == NULL))
-    {
-      g_warning ("Failed to load tvm preferences.");
-      return FALSE;
-    }
-
-  g_object_freeze_notify (G_OBJECT (preferences));
-
-  xfce_rc_set_group (rc, "Configuration");
-
-  preferences->loading_in_progress = TRUE;
-
-  specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (preferences), &nspecs);
-  for (n = 0; n < nspecs; ++n)
-    {
-      spec = specs[n];
-
-      option = property_name_to_option_name (spec->name);
-      string = xfce_rc_read_entry (rc, option, NULL);
-      g_free (option);
-
-      if (G_UNLIKELY (string == NULL))
-        continue;
-
-      g_value_init (&src, G_TYPE_STRING);
-      g_value_set_static_string (&src, string);
-
-      if (spec->value_type == G_TYPE_STRING)
-        {
-          g_object_set_property (G_OBJECT (preferences), spec->name, &src);
-        }
-      else if (g_value_type_transformable (G_TYPE_STRING, spec->value_type))
-        {
-          g_value_init (&dst, spec->value_type);
-          if (g_value_transform (&src, &dst))
-            g_object_set_property (G_OBJECT (preferences), spec->name, &dst);
-          g_value_unset (&dst);
-        }
-      else
-        {
-          g_warning ("Failed to load property \"%s\"", spec->name);
-        }
-
-      g_value_unset (&src);
-    }
-  g_free (specs);
-
-  preferences->loading_in_progress = FALSE;
-
-  xfce_rc_close (rc);
-
-  g_object_thaw_notify (G_OBJECT (preferences));
-
-  return FALSE;
-}
-
-
-
-static void
-tvm_preferences_load_idle_destroy (gpointer user_data)
-{
-  TVM_PREFERENCES (user_data)->load_idle_id = 0;
-}
-
-
-
-static gboolean
-tvm_preferences_store_idle (gpointer user_data)
-{
-  TvmPreferences *preferences = TVM_PREFERENCES (user_data);
-  const gchar    *string;
-  GParamSpec    **specs;
-  GParamSpec     *spec;
-  XfceRc         *rc;
-  GValue          dst = { 0, };
-  GValue          src = { 0, };
-  gchar          *option;
-  guint           nspecs;
-  guint           n;
-
-  rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, "Thunar/volmanrc", FALSE);
-  if (G_UNLIKELY (rc == NULL))
-    {
-      g_warning ("Failed to store thunar-volman preferences.");
-      return FALSE;
-    }
-
-  /* suspend the monitor (hopefully tricking FAM to avoid unnecessary reloads) */
-  tvm_preferences_suspend_monitor (preferences);
-
-  xfce_rc_set_group (rc, "Configuration");
-
-  specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (preferences), &nspecs);
-  for (n = 0; n < nspecs; ++n)
-    {
-      spec = specs[n];
-
-      g_value_init (&dst, G_TYPE_STRING);
-
-      if (spec->value_type == G_TYPE_STRING)
-        {
-          g_object_get_property (G_OBJECT (preferences), spec->name, &dst);
-        }
-      else
-        {
-          g_value_init (&src, spec->value_type);
-          g_object_get_property (G_OBJECT (preferences), spec->name, &src);
-          g_value_transform (&src, &dst);
-          g_value_unset (&src);
-        }
-
-      /* determine the option name for the spec */
-      option = property_name_to_option_name (spec->name);
-
-      /* store the setting */
-      string = g_value_get_string (&dst);
-      if (G_LIKELY (string != NULL))
-        xfce_rc_write_entry (rc, option, string);
-
-      /* cleanup */
-      g_value_unset (&dst);
-      g_free (option);
-    }
-
-  /* cleanup */
-  xfce_rc_close (rc);
-  g_free (specs);
-
-  /* restart the monitor */
-  tvm_preferences_resume_monitor (preferences);
-
-  return FALSE;
-}
-
-
-
-static void
-tvm_preferences_store_idle_destroy (gpointer user_data)
-{
-  TVM_PREFERENCES (user_data)->store_idle_id = 0;
-}
-
-
-
-/**
- * tvm_preferences_get:
- *
- * Queries the global #TvmPreferences instance, which is shared
- * by all modules. The function automatically takes a reference
- * for the caller, so you'll need to call g_object_unref() when
- * you're done with it.
- *
- * Return value: the global #TvmPreferences instance.
- **/
-TvmPreferences*
-tvm_preferences_get (void)
-{
-  static TvmPreferences *preferences = NULL;
-
-  if (G_UNLIKELY (preferences == NULL))
-    {
-      preferences = g_object_new (TVM_TYPE_PREFERENCES, NULL);
-      g_object_add_weak_pointer (G_OBJECT (preferences), (gpointer) &preferences);
-    }
-  else
-    {
-      g_object_ref (G_OBJECT (preferences));
-    }
-
-  return preferences;
-}
-
-
diff --git a/thunar-volman/tvm-preferences.h b/thunar-volman/tvm-preferences.h
deleted file mode 100644
index 3c80e07..0000000
--- a/thunar-volman/tvm-preferences.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2005-2007 Benedikt Meurer <benny at xfce.org>
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __TVM_PREFERENCES_H__
-#define __TVM_PREFERENCES_H__
-
-#include <exo/exo.h>
-
-G_BEGIN_DECLS
-
-typedef struct _TvmPreferencesClass TvmPreferencesClass;
-typedef struct _TvmPreferences      TvmPreferences;
-
-#define TVM_TYPE_PREFERENCES             (tvm_preferences_get_type ())
-#define TVM_PREFERENCES(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), TVM_TYPE_PREFERENCES, TvmPreferences))
-#define TVM_PREFERENCES_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), TVM_TYPE_PREFERENCES, TvmPreferencesClass))
-#define TVM_IS_PREFERENCES(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TVM_TYPE_PREFERENCES))
-#define TVM_IS_PREFERENCES_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), TVM_TYPE_PREFERENCES))
-#define TVM_PREFERENCES_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), TVM_TYPE_PREFERENCES, TvmPreferencesClass))
-
-GType           tvm_preferences_get_type (void) G_GNUC_CONST;
-
-TvmPreferences *tvm_preferences_get      (void);
-
-G_END_DECLS
-
-#endif /* !__TVM_PREFERENCES_H__ */
diff --git a/thunar-volman/tvm-printer-device.c b/thunar-volman/tvm-printer-device.c
deleted file mode 100644
index 2ae24f8..0000000
--- a/thunar-volman/tvm-printer-device.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <thunar-volman/tvm-printer-device.h>
-#include <thunar-volman/tvm-run.h>
-
-
-
-/**
- * tvm_printer_device_added:
- * @preferences : a #TvmPreferences.
- * @context     : a #LibHalContext.
- * @udi         : the HAL device UDI of the newly added printer device.
- * @capability  : the capability, which caused this handler to be run.
- * @error       : return location for errors or %NULL.
- *
- * See #TvmDeviceCallback for further information.
- *
- * Return value: %TRUE if handled, %FALSE if not handled or an
- *               unrecoverable error occurred.
- **/
-gboolean
-tvm_printer_device_added (TvmPreferences *preferences,
-                          LibHalContext  *context,
-                          const gchar    *udi,
-                          const gchar    *capability,
-                          GError        **error)
-{
-  gboolean result = FALSE;
-  gboolean autoprinter;
-  gchar   *autoprinter_command;
-
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), FALSE);
-  g_return_val_if_fail (TVM_IS_PREFERENCES (preferences), FALSE);
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-  g_return_val_if_fail (capability != NULL, FALSE);
-  g_return_val_if_fail (context != NULL, FALSE);
-
-  /* check if we have a command to run for newly connected printers */
-  g_object_get (G_OBJECT (preferences), "autoprinter", &autoprinter, "autoprinter-command", &autoprinter_command, NULL);
-  if (G_LIKELY (autoprinter && autoprinter_command != NULL && *autoprinter_command != '\0'))
-    {
-      /* run the selected command for the user */
-      result = tvm_run_command (context, udi, autoprinter_command, NULL, NULL, error);
-    }
-  g_free (autoprinter_command);
-
-  return result;
-}
-
-
-
-
diff --git a/thunar-volman/tvm-printer-device.h b/thunar-volman/tvm-printer-device.h
deleted file mode 100644
index ef34ce9..0000000
--- a/thunar-volman/tvm-printer-device.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
- *
- * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __TVM_PRINTER_DEVICE_H__
-#define __TVM_PRINTER_DEVICE_H__
-
-#include <thunar-volman/tvm-device.h>
-
-G_BEGIN_DECLS
-
-gboolean tvm_printer_device_added (TvmPreferences *preferences,
-                                   LibHalContext  *context,
-                                   const gchar    *udi,
-                                   const gchar    *capability,
-                                   GError        **error) G_GNUC_INTERNAL;
-
-G_END_DECLS
-
-#endif /* !__TVM_PRINTER_DEVICE_H__ */
diff --git a/thunar-volman/tvm-prompt.c b/thunar-volman/tvm-prompt.c
index 756bfa5..d299b58 100644
--- a/thunar-volman/tvm-prompt.c
+++ b/thunar-volman/tvm-prompt.c
@@ -1,20 +1,22 @@
-/* $Id$ */
+/* vi:set et ai sw=2 sts=2 ts=2: */
 /*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
  *
- * 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 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.
+ * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -25,21 +27,43 @@
 #include <stdarg.h>
 #endif
 
-#include <thunar-volman/tvm-pango-extensions.h>
+#include <gudev/gudev.h>
+
+#include <gtk/gtk.h>
+
+#include <libxfce4ui/libxfce4ui.h>
+
 #include <thunar-volman/tvm-prompt.h>
 
 
 
 static void
-hal_device_removed (LibHalContext *context,
-                    const gchar   *udi)
+tvm_prompt_uevent (GUdevClient *client,
+                   const gchar *action,
+                   GUdevDevice *device,
+                   GtkWidget   *dialog)
 {
-  const gchar *dialog_udi;
-  GtkWidget   *dialog = libhal_ctx_get_user_data (context);
+  GUdevDevice *dialog_device;
+
+  g_return_if_fail (G_UDEV_IS_CLIENT (client));
+  g_return_if_fail (action != NULL && *action != '\0');
+  g_return_if_fail (G_UDEV_IS_DEVICE (device));
+  g_return_if_fail (GTK_IS_DIALOG (dialog));
+
+  /* ignore "move" and "add" actions, "change" might only be correct 
+   * for CDs/DVDs though */
+  if (g_strcmp0 (action, "remove") != 0 && g_strcmp0 (action, "change") != 0)
+    return;
 
-  /* check if the active UDI of the dialog was removed */
-  dialog_udi = g_object_get_data (G_OBJECT (dialog), "udi");
-  if (exo_str_is_equal (dialog_udi, udi))
+  /* determine the device belonging to the dialog */
+  dialog_device = g_object_get_data (G_OBJECT (dialog), "device");
+
+  /* the device should be set, otherwise it's a bug in the application */
+  g_assert (dialog_device != NULL);
+
+  /* check if the removed/changed device belongs to the dialog */
+  if (g_strcmp0 (g_udev_device_get_sysfs_path (device),
+                 g_udev_device_get_sysfs_path (dialog_device)) == 0)
     {
       /* cancel the dialog */
       gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
@@ -48,55 +72,42 @@ hal_device_removed (LibHalContext *context,
 
 
 
-/**
- * tvm_prompt:
- * @context           : a #LibHalContext.
- * @udi               : the UDI of the device being added, which is watched for removal.
- * @icon              : the icon or %NULL.
- * @title             : the prompt title.
- * @primary_text      : the primary prompt text.
- * @secondary_text    : the secondary prompt text.
- * @first_button_text : the first button text.
- * @...               : %NULL-terminated list of button text, response id pairs.
- *
- * Return value: the selected response.
- **/
 gint
-tvm_prompt (LibHalContext *context,
-            const gchar   *udi,
-            const gchar   *icon,
-            const gchar   *title,
-            const gchar   *primary_text,
-            const gchar   *secondary_text,
-            const gchar   *first_button_text,
+tvm_prompt (GUdevClient *client,
+            GUdevDevice *device,
+            const gchar *icon,
+            const gchar *title,
+            const gchar *primary_text,
+            const gchar *secondary_text,
+            const gchar *first_button_text,
             ...)
 {
   GtkWidget *dialog;
+  GtkWidget *hbox;
   GtkWidget *image;
   GtkWidget *label;
-  GtkWidget *hbox;
   GtkWidget *vbox;
-  DBusError  derror;
   va_list    args;
   gint       response;
 
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), GTK_RESPONSE_CANCEL);
-  g_return_val_if_fail (context != NULL, GTK_RESPONSE_CANCEL);
-
-  /* allocate a new dialog */
+  g_return_val_if_fail (G_UDEV_IS_CLIENT (client), GTK_RESPONSE_CANCEL);
+  g_return_val_if_fail (G_UDEV_IS_DEVICE (device), GTK_RESPONSE_CANCEL);
+  
+  /* create a new dialog */
   dialog = gtk_dialog_new ();
   gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
-  gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-  g_object_set_data_full (G_OBJECT (dialog), "udi", g_strdup (udi), g_free);
+  g_object_set_data_full (G_OBJECT (dialog), "device", g_object_ref (device), 
+                          g_object_unref);
   gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 6);
   gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 12);
+  gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
 
-  /* setup the specified title */
-  if (G_LIKELY (title != NULL))
+  /* apply the specified title */
+  if (title != NULL && *title != '\0')
     gtk_window_set_title (GTK_WINDOW (dialog), title);
 
-  /* setup the specified buttons */
-  if (G_LIKELY (first_button_text != NULL))
+  /* create the specified buttons */
+  if (first_button_text != NULL)
     {
       va_start (args, first_button_text);
       for (response = va_arg (args, gint); first_button_text != NULL; )
@@ -104,22 +115,24 @@ tvm_prompt (LibHalContext *context,
           /* insert the button */
           gtk_dialog_add_button (GTK_DIALOG (dialog), first_button_text, response);
           first_button_text = va_arg (args, const gchar *);
-          if (G_UNLIKELY (first_button_text == NULL))
+          if (first_button_text == NULL)
             break;
           response = va_arg (args, gint);
         }
       va_end (args);
     }
 
-  /* setup the hbox */
+  /* create the hbox */
   hbox = gtk_hbox_new (FALSE, 12);
   gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
   gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
   gtk_widget_show (hbox);
 
-  /* setup the specified icon */
+  /* apply the specified icon */
   if (G_LIKELY (icon != NULL))
     {
+      gtk_window_set_icon_name (GTK_WINDOW (dialog), icon);
+
       /* setup an image for the icon */
       image = gtk_image_new_from_icon_name (icon, GTK_ICON_SIZE_DIALOG);
       gtk_misc_set_alignment (GTK_MISC (image), 0.0f, 0.0f);
@@ -150,24 +163,13 @@ tvm_prompt (LibHalContext *context,
       gtk_widget_show (label);
     }
 
-  /* initialize D-Bus error */
-  dbus_error_init (&derror);
-
-  /* setup HAL to watch the UDI for removal */
-  libhal_ctx_set_user_data (context, dialog);
-  libhal_ctx_set_device_removed (context, hal_device_removed);
-  libhal_device_property_watch_all (context, &derror);
+  g_signal_connect (client, "uevent", G_CALLBACK (tvm_prompt_uevent), dialog);
 
   /* run the dialog */
   response = gtk_dialog_run (GTK_DIALOG (dialog));
 
-  /* cleanup */
-  libhal_ctx_set_device_removed (context, NULL);
-  libhal_ctx_set_user_data (context, NULL);
+  /* clean up */
   gtk_widget_destroy (dialog);
-  dbus_error_free (&derror);
 
   return response;
 }
-
-
diff --git a/thunar-volman/tvm-prompt.h b/thunar-volman/tvm-prompt.h
index ec0c2b7..ca5f153 100644
--- a/thunar-volman/tvm-prompt.h
+++ b/thunar-volman/tvm-prompt.h
@@ -1,26 +1,30 @@
-/* $Id$ */
+/* vi:set et ai sw=2 sts=2 ts=2: */
 /*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
  *
- * 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 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.
+ * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifndef __TVM_PROMPT_H__
 #define __TVM_PROMPT_H__
 
-#include <thunar-volman/tvm-device.h>
+#include <gudev/gudev.h>
+
+#include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
@@ -32,19 +36,18 @@ enum
   TVM_RESPONSE_BROWSE,
   TVM_RESPONSE_PHOTOS,
   TVM_RESPONSE_AUTORUN,
-  TVM_RESPONSE_AUTOOPEN,
   TVM_RESPONSE_BURN_DATA_CD,
   TVM_RESPONSE_BURN_AUDIO_CD,
 };
 
-gint tvm_prompt (LibHalContext *context,
-                 const gchar   *udi,
-                 const gchar   *icon,
-                 const gchar   *title,
-                 const gchar   *primary_text,
-                 const gchar   *secondary_text,
-                 const gchar   *first_button_text,
-                 ...) G_GNUC_INTERNAL G_GNUC_NULL_TERMINATED;
+gint tvm_prompt (GUdevClient *client,
+                 GUdevDevice *device,
+                 const gchar *icon,
+                 const gchar *title,
+                 const gchar *primary_text,
+                 const gchar *secondary_text,
+                 const gchar *first_button_text,
+                 ...) G_GNUC_NULL_TERMINATED;
 
 G_END_DECLS
 
diff --git a/thunar-volman/tvm-run.c b/thunar-volman/tvm-run.c
index 1f2f951..2ce7536 100644
--- a/thunar-volman/tvm-run.c
+++ b/thunar-volman/tvm-run.c
@@ -1,335 +1,134 @@
-/* $Id$ */
+/* vi:set et ai sw=2 sts=2 ts=2: */
 /*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
  *
- * 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 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.
+ * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
+#include <glib/gi18n.h>
 
-#include <thunar-volman/tvm-prompt.h>
-#include <thunar-volman/tvm-run.h>
+#include <gudev/gudev.h>
 
+#include <gtk/gtk.h>
 
+#include <xfconf/xfconf.h>
 
-static void tvm_run_resolve (LibHalContext *context,
-                             const gchar   *udi,
-                             gchar        **device_file_return,
-                             gchar        **mount_point_return);
+#include <thunar-volman/tvm-prompt.h>
 
 
 
-static void
-tvm_run_resolve (LibHalContext *context,
-                 const gchar   *udi,
-                 gchar        **device_file_return,
-                 gchar        **mount_point_return)
+gboolean 
+tvm_run_burn_software (GUdevClient   *client,
+                       GUdevDevice   *device,
+                       XfconfChannel *channel,
+                       GError       **error)
 {
-  GSList *mount_points;
-  gchar  *device_file;
-
-  /* initialize return values */
-  if (device_file_return != NULL)
-    *device_file_return = NULL;
-  if (mount_point_return != NULL)
-    *mount_point_return = NULL;
-
-  /* determine the device file path of the device */
-  device_file = libhal_device_get_property_string (context, udi, "block.device", NULL);
-  if (G_LIKELY (device_file != NULL))
-    {
-      /* determine the active mount point(s) for the device from the kernel */
-      mount_points = exo_mount_point_list_matched (EXO_MOUNT_POINT_MATCH_ACTIVE | EXO_MOUNT_POINT_MATCH_DEVICE, device_file, NULL, NULL, NULL);
-      if (G_LIKELY (mount_points != NULL))
-        {
-          /* return the mount point folder path */
-          if (G_LIKELY (mount_point_return != NULL))
-            *mount_point_return = g_strdup (((ExoMountPoint *) mount_points->data)->folder);
-
-          /* release the mount points */
-          g_slist_foreach (mount_points, (GFunc) exo_mount_point_free, NULL);
-          g_slist_free (mount_points);
-        }
-
-      /* return the device file path */
-      if (G_LIKELY (device_file_return != NULL))
-        *device_file_return = g_strdup (device_file);
+  static const gchar *cd_criteria[] = {
+    "ID_CDROM_MEDIA_CD_R",
+    "ID_CDROM_MEDIA_CD_RW",
+  };
+  
+  static const gchar *dvd_criteria[] = {
+    "ID_CDROM_MEDIA_DVD_R",
+    "ID_CDROM_MEDIA_DVD_RW",
+    "ID_CDROM_MEDIA_DVD_PLUS_R",
+    "ID_CDROM_MEDIA_DVD_PLUS_RW",
+  };
+  gboolean            autoburn;
+  gboolean            is_cd = FALSE;
+  gboolean            is_dvd = FALSE;
+  gboolean            result = FALSE;
+  const gchar        *command_property;
+  gchar              *command;
+  guint               n;
+  gint                response;
+
+  g_return_val_if_fail (G_UDEV_IS_DEVICE (device), FALSE);
+  g_return_val_if_fail (XFCONF_IS_CHANNEL (channel), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-      /* cleanup */
-      libhal_free_string (device_file);
-    }
-}
+  /* abort without error if autoburning is turned off */
+  if (!xfconf_channel_get_bool (channel, "/autoburn/enabled", FALSE))
+    return FALSE;
 
+  /* check if the disc is a CD */
+  for (n = 0; !is_cd && n < G_N_ELEMENTS (cd_criteria); ++n)
+    if (g_udev_device_get_property_as_boolean (device, cd_criteria[n]))
+      is_cd = TRUE;
 
+  /* check if the disc is a DVD */
+  for (n = 0; !is_cd && !is_dvd && n < G_N_ELEMENTS (dvd_criteria); ++n)
+    if (g_udev_device_get_property_as_boolean (device, dvd_criteria[n]))
+      is_dvd = TRUE;
 
-/**
- * tvm_run_cdburner:
- * @preferences : a #TvmPreferences.
- * @context     : a #LibHalContext.
- * @udi         : the UDI of the blank CD/DVD.
- * @error       : return location for errors or %NULL.
- *
- * Tries to spawn the preferred CD-Burner application for the
- * given @udi. Returns %TRUE if the device was handled, %FALSE
- * if not handled or an unrecoverable error occurred.
- *
- * Return value: %TRUE if handled, %FALSE otherwise.
- **/
-gboolean
-tvm_run_cdburner (TvmPreferences *preferences,
-                  LibHalContext  *context,
-                  const gchar    *udi,
-                  GError        **error)
-{
-  const gchar *autoburn_command_name;
-  gboolean     autoburn;
-  gboolean     result = FALSE;
-  gboolean     is_dvd;
-  gchar       *autoburn_command;
-  gchar       *disc_type;
-  gint         response;
+  g_debug ("is_cd = %i, is_dvd = i", is_cd, is_dvd);
 
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), FALSE);
-  g_return_val_if_fail (TVM_IS_PREFERENCES (preferences), FALSE);
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-  g_return_val_if_fail (context != NULL, FALSE);
-
-  /* check if autoburn is enabled */
-  g_object_get (G_OBJECT (preferences), "autoburn", &autoburn, NULL);
-  if (G_UNLIKELY (!autoburn))
-    return TRUE;
-
-  /* check if we have a DVD here */
-  disc_type = libhal_device_get_property_string (context, udi, "volume.disc.type", NULL);
-  is_dvd = (disc_type != NULL && strncmp (disc_type, "dvd_", 4) == 0);
-  libhal_free_string (disc_type);
-
-  /* ask the user what to do now */
-  if (G_LIKELY (is_dvd))
+  if (is_dvd)
     {
       /* ask what to do with the empty DVD */
-      response = tvm_prompt (context, udi, "gnome-dev-disc-dvdr",
-                             _("Choose Disc Type"),
-                             _("You have inserted a blank disc."),
+      response = tvm_prompt (client, device, "gnome-dev-disc-dvdr",
+                             _("Blank DVD inserted"),
+                             _("You have inserted a blank DVD."),
                              _("What would you like to do?"),
                              _("Ig_nore"), GTK_RESPONSE_CANCEL,
-                             _("Make _DVD"), TVM_RESPONSE_BURN_DATA_CD,
+                             _("Burn _DVD"), TVM_RESPONSE_BURN_DATA_CD, 
                              NULL);
     }
   else
     {
       /* ask whether to burn data or audio CD */
-      response = tvm_prompt (context, udi, "gnome-dev-disc-cdr",
-                             _("Choose Disc Type"),
-                             _("You have inserted a blank disc."),
+      response = tvm_prompt (client, device, "gnome-dev-disc-cdr",
+                             _("Blank CD inserted"),
+                             _("You have inserted a blank CD."),
                              _("What would you like to do?"),
                              _("Ig_nore"), GTK_RESPONSE_CANCEL,
-                             _("Make _Data CD"), TVM_RESPONSE_BURN_DATA_CD,
-                             _("Make _Audio CD"), TVM_RESPONSE_BURN_AUDIO_CD,
+                             _("Burn _Data CD"), TVM_RESPONSE_BURN_DATA_CD,
+                             _("Burn _Audio CD"), TVM_RESPONSE_BURN_AUDIO_CD,
                              NULL);
     }
 
-  /* determine the autoburn command name */
+  /* determine the autoburn command property */
   if (response == TVM_RESPONSE_BURN_DATA_CD)
-    autoburn_command_name = "autoburn-data-command";
+    command_property = "/autoburn/data-cd-command";
   else if (response == TVM_RESPONSE_BURN_AUDIO_CD)
-    autoburn_command_name = "autoburn-audio-command";
-  else
+    command_property = "/autoburn/audio-cd-command";
+  else 
     return TRUE;
 
-  /* determine the command */
-  g_object_get (G_OBJECT (preferences), autoburn_command_name, &autoburn_command, NULL);
-  if (G_LIKELY (autoburn_command != NULL && *autoburn_command != '\0'))
-    {
-      /* try to execute the preferred CD-Burner application */
-      result = tvm_run_command (context, udi, autoburn_command, NULL, NULL, error);
-    }
-  g_free (autoburn_command);
-
-  return result;
-}
-
-
-
-/**
- * tvm_run_cdplayer:
- * @preferences : a #TvmPreferences.
- * @context     : a #LibHalContext.
- * @udi         : the UDI of the Audio CD.
- * @error       : return location for errors or %NULL.
- *
- * Tries to spawn the preferred CD-Player application for the
- * given @udi. Returns %TRUE if the device was handled, %FALSE
- * if not handled or an unrecoverable error occurred.
- *
- * Return value: %TRUE if handled, %FALSE otherwise.
- **/
-gboolean
-tvm_run_cdplayer (TvmPreferences *preferences,
-                  LibHalContext  *context,
-                  const gchar    *udi,
-                  GError        **error)
-{
-  gboolean autoplay;
-  gboolean result = TRUE;
-  gchar   *autoplay_command;
-
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), FALSE);
-  g_return_val_if_fail (TVM_IS_PREFERENCES (preferences), FALSE);
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-  g_return_val_if_fail (context != NULL, FALSE);
+  /* determine the command to launch */
+  command = xfconf_channel_get_string (channel, command_property, NULL);
 
-  /* check if autoplay is enabled and we have a command */
-  g_object_get (G_OBJECT (preferences), "autoplay-audio-cd", &autoplay, "autoplay-audio-cd-command", &autoplay_command, NULL);
-  if (G_LIKELY (autoplay && autoplay_command != NULL && *autoplay_command != '\0'))
+  /* only try to launch the command if it is set and non-empty */
+  if (command != NULL && *command != '\0')
     {
-      /* try to run the preferred CD-Player application */
-      result = tvm_run_command (context, udi, autoplay_command, NULL, NULL, error);
+      /* try to execute the preferred burn software */
+      /* result = tvm_run_command (device, command, NULL, NULL, error); */
     }
-  g_free (autoplay_command);
-
-  return result;
-}
-
-
-
-/**
- * tvm_run_command:
- * @context     : a #LibHalContext.
- * @udi         : the UDI of the device for which to run the @command.
- * @command     : the command line of the application to spawn.
- * @device_file : the value to substitute for <literal>%d</literal> or %NULL.
- * @mount_point : the value to substitute for <literal>%m</literal> or %NULL.
- * @error       : return location for errors or %NULL.
- *
- * Substitutes special values in @command and tries to spawn the application
- * identified by the @command.
- *
- * The HAL UDI will be substituted for <literal>%h</literal>, the device file path
- * for <literal>%d</literal> and the mount point for <literal>%m</literal>.
- *
- * Return value: %TRUE if the command was spawn successfully, %FALSE otherwise.
- **/
-gboolean
-tvm_run_command (LibHalContext *context,
-                 const gchar   *udi,
-                 const gchar   *command,
-                 const gchar   *device_file,
-                 const gchar   *mount_point,
-                 GError       **error)
-{
-  const gchar *p;
-  gboolean     result;
-  GString     *command_line;
-  gchar       *quoted;
-  gchar       *device;
-  gchar       *folder;
-  gchar      **argv;
-
-  g_return_val_if_fail (exo_hal_udi_validate (udi, -1, NULL), FALSE);
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-  g_return_val_if_fail (context != NULL, FALSE);
-
-  /* perform the required substitutions */
-  command_line = g_string_new (NULL);
-  for (p = command; *p != '\0'; ++p)
-    {
-      /* check if we should substitute */
-      if (G_UNLIKELY (p[0] == '%' && p[1] != '\0'))
-        {
-          /* check which substitution to perform */
-          switch (*++p)
-            {
-            case 'd': /* device file */
-              /* check if know the device file path */
-              if (G_LIKELY (device_file != NULL))
-                device = g_strdup (device_file);
-              else
-                tvm_run_resolve (context, udi, &device, NULL);
-              if (G_LIKELY (device != NULL))
-                g_string_append (command_line, device);
-              g_free (device);
-              break;
-
-            case 'h': /* HAL UDI */
-              g_string_append (command_line, udi);
-              break;
-
-            case 'm': /* mount point */
-              /* check if know the mount point */
-              if (G_LIKELY (mount_point != NULL))
-                folder = g_strdup (mount_point);
-              else
-                tvm_run_resolve (context, udi, NULL, &folder);
-              if (G_LIKELY (folder != NULL))
-                {
-                  /* substitute mount point quoted */
-                  quoted = g_shell_quote (folder);
-                  g_string_append (command_line, quoted);
-                  g_free (quoted);
-                }
-              else
-                {
-                  /* %m must always be substituted */
-                  g_string_append (command_line, "\"\"");
-                }
-              g_free (folder);
-              break;
-              
-            case '%':
-              g_string_append_c (command_line, '%');
-              break;
-
-            default:
-              g_string_append_c (command_line, '%');
-              g_string_append_c (command_line, *p);
-              break;
-            }
-        }
-      else
-        {
-          /* just append the character */
-          g_string_append_c (command_line, *p);
-        }
-    }
-
-  /* try to parse the command line */
-  result = g_shell_parse_argv (command_line->str, NULL, &argv, error);
-  if (G_LIKELY (result))
+  else
     {
-      /* try to spawn the command asynchronously in the users home directory */
-      result = g_spawn_async (g_get_home_dir (), argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, error);
-
-      /* cleanup */
-      g_strfreev (argv);
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("The burn command may not be empty"));
     }
 
-  /* cleanup */
-  g_string_free (command_line, TRUE);
+  /* free the burn command */
+  g_free (command);
 
   return result;
 }
-
-
-
diff --git a/thunar-volman/tvm-run.h b/thunar-volman/tvm-run.h
index 9e50a98..7b48a5b 100644
--- a/thunar-volman/tvm-run.h
+++ b/thunar-volman/tvm-run.h
@@ -1,45 +1,36 @@
-/* $Id$ */
+/* vi:set et ai sw=2 sts=2 ts=2: */
 /*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
  *
- * 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 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.
+ * 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
- * Place, Suite 330, Boston, MA  02111-1307  USA
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifndef __TVM_RUN_H__
 #define __TVM_RUN_H__
 
-#include <thunar-volman/tvm-device.h>
+#include <gudev/gudev.h>
 
-G_BEGIN_DECLS
-
-gboolean tvm_run_cdburner (TvmPreferences *preferences,
-                           LibHalContext  *context,
-                           const gchar    *udi,
-                           GError        **error) G_GNUC_INTERNAL;
+#include <xfconf/xfconf.h>
 
-gboolean tvm_run_cdplayer (TvmPreferences *preferences,
-                           LibHalContext  *context,
-                           const gchar    *udi,
-                           GError        **error) G_GNUC_INTERNAL;
+G_BEGIN_DECLS
 
-gboolean tvm_run_command  (LibHalContext  *context,
-                           const gchar    *udi,
-                           const gchar    *command,
-                           const gchar    *device_file,
-                           const gchar    *mount_point,
-                           GError        **error) G_GNUC_INTERNAL;
+gboolean tvm_run_burn_software (GUdevClient   *client,
+                                GUdevDevice   *device,
+                                XfconfChannel *channel,
+                                GError       **error);
 
 G_END_DECLS
 
diff --git a/thunar-volman/xfce-heading.c b/thunar-volman/xfce-heading.c
deleted file mode 100644
index e0ebdcd..0000000
--- a/thunar-volman/xfce-heading.c
+++ /dev/null
@@ -1,755 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2006 Benedikt Meurer <benny at 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_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include "xfce-heading.h"
-
-
-
-#define XFCE_HEADING_BORDER      6
-#define XFCE_HEADING_SPACING    12
-#define XFCE_HEADING_ICON_SIZE  48
-
-#define XFCE_HEADING_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFCE_TYPE_HEADING, XfceHeadingPrivate))
-
-
-
-/* Property identifiers */
-enum
-{
-  PROP_0,
-  PROP_ICON,
-  PROP_ICON_NAME,
-  PROP_SUBTITLE,
-  PROP_TITLE,
-};
-
-
-
-static void         xfce_heading_class_init     (XfceHeadingClass *klass);
-static void         xfce_heading_init           (XfceHeading      *heading);
-static void         xfce_heading_finalize       (GObject          *object);
-static void         xfce_heading_get_property   (GObject          *object,
-                                                 guint             prop_id,
-                                                 GValue           *value,
-                                                 GParamSpec       *pspec);
-static void         xfce_heading_set_property   (GObject          *object,
-                                                 guint             prop_id,
-                                                 const GValue     *value,
-                                                 GParamSpec       *pspec);
-static void         xfce_heading_realize        (GtkWidget        *widget);
-static void         xfce_heading_size_request   (GtkWidget        *widget,
-                                                 GtkRequisition   *requisition);
-static void         xfce_heading_style_set      (GtkWidget        *widget,
-                                                 GtkStyle         *previous_style);
-static gboolean     xfce_heading_expose_event   (GtkWidget        *widget,
-                                                 GdkEventExpose   *event);
-static AtkObject   *xfce_heading_get_accessible (GtkWidget        *widget);
-static PangoLayout *xfce_heading_make_layout    (XfceHeading      *heading);
-static GdkPixbuf   *xfce_heading_make_pixbuf    (XfceHeading      *heading);
-
-
-
-struct _XfceHeadingPrivate
-{
-  GdkPixbuf *icon;
-  gchar     *icon_name;
-  gchar     *subtitle;
-  gchar     *title;
-};
-
-
-
-G_DEFINE_TYPE (XfceHeading, xfce_heading, GTK_TYPE_WIDGET);
-
-
-
-static void
-xfce_heading_class_init (XfceHeadingClass *klass)
-{
-  GtkWidgetClass *gtkwidget_class;
-  GObjectClass   *gobject_class;
-
-  /* add our private data to the class */
-  g_type_class_add_private (klass, sizeof (XfceHeadingPrivate));
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->finalize = xfce_heading_finalize;
-  gobject_class->get_property = xfce_heading_get_property;
-  gobject_class->set_property = xfce_heading_set_property;
-
-  gtkwidget_class = GTK_WIDGET_CLASS (klass);
-  gtkwidget_class->realize = xfce_heading_realize;
-  gtkwidget_class->size_request = xfce_heading_size_request;
-  gtkwidget_class->style_set = xfce_heading_style_set;
-  gtkwidget_class->expose_event = xfce_heading_expose_event;
-  gtkwidget_class->get_accessible = xfce_heading_get_accessible;
-
-  /**
-   * XfceHeading:icon:
-   *
-   * The #GdkPixbuf to display as icon, or %NULL to use the
-   * "icon-name" property.
-   *
-   * Since: 4.4.0
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_ICON,
-                                   g_param_spec_object ("icon",
-                                                        "icon",
-                                                        "icon",
-                                                        GDK_TYPE_PIXBUF,
-                                                        G_PARAM_READWRITE));
-
-  /**
-   * XfceHeading:icon-name:
-   *
-   * If the "icon" property value is %NULL this is the name of
-   * the icon to display instead (looked up using the icon theme).
-   * If this property is also %NULL or the specified icon does not
-   * exist in the selected icon theme, no icon will be displayed.
-   *
-   * Since: 4.4.0
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_ICON_NAME,
-                                   g_param_spec_string ("icon-name",
-                                                        "icon-name",
-                                                        "icon-name",
-                                                        NULL,
-                                                        G_PARAM_READWRITE));
-
-  /**
-   * XfceHeading:subtitle:
-   *
-   * The sub title that should be displayed below the
-   * title. May be %NULL or the empty string to display
-   * only the title.
-   *
-   * Since: 4.4.0
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_SUBTITLE,
-                                   g_param_spec_string ("subtitle",
-                                                        "subtitle",
-                                                        "subtitle",
-                                                        NULL,
-                                                        G_PARAM_READWRITE));
-
-  /**
-   * XfceHeading:title:
-   *
-   * The title text to display in the heading.
-   *
-   * Since: 4.4.0
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_TITLE,
-                                   g_param_spec_string ("title",
-                                                        "title",
-                                                        "title",
-                                                        NULL,
-                                                        G_PARAM_READWRITE));
-}
-
-
-
-static void
-xfce_heading_init (XfceHeading *heading)
-{
-  /* setup the private data */
-  heading->priv = XFCE_HEADING_GET_PRIVATE (heading);
-
-  /* setup the widget parameters */
-  GTK_WIDGET_UNSET_FLAGS (heading, GTK_NO_WINDOW);
-}
-
-
-
-static void
-xfce_heading_finalize (GObject *object)
-{
-  XfceHeading *heading = XFCE_HEADING (object);
-
-  /* release the private data */
-  if (G_UNLIKELY (heading->priv->icon != NULL))
-    g_object_unref (G_OBJECT (heading->priv->icon));
-  g_free (heading->priv->icon_name);
-  g_free (heading->priv->subtitle);
-  g_free (heading->priv->title);
-
-  (*G_OBJECT_CLASS (xfce_heading_parent_class)->finalize) (object);
-}
-
-
-
-static void
-xfce_heading_get_property (GObject    *object,
-                           guint       prop_id,
-                           GValue     *value,
-                           GParamSpec *pspec)
-{
-  XfceHeading *heading = XFCE_HEADING (object);
-
-  switch (prop_id)
-    {
-    case PROP_ICON:
-      g_value_set_object (value, xfce_heading_get_icon (heading));
-      break;
-
-    case PROP_ICON_NAME:
-      g_value_set_string (value, xfce_heading_get_icon_name (heading));
-      break;
-
-    case PROP_SUBTITLE:
-      g_value_set_string (value, xfce_heading_get_subtitle (heading));
-      break;
-
-    case PROP_TITLE:
-      g_value_set_string (value, xfce_heading_get_title (heading));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-
-
-static void
-xfce_heading_set_property (GObject      *object,
-                           guint         prop_id,
-                           const GValue *value,
-                           GParamSpec   *pspec)
-{
-  XfceHeading *heading = XFCE_HEADING (object);
-
-  switch (prop_id)
-    {
-    case PROP_ICON:
-      xfce_heading_set_icon (heading, g_value_get_object (value));
-      break;
-
-    case PROP_ICON_NAME:
-      xfce_heading_set_icon_name (heading, g_value_get_string (value));
-      break;
-
-    case PROP_SUBTITLE:
-      xfce_heading_set_subtitle (heading, g_value_get_string (value));
-      break;
-
-    case PROP_TITLE:
-      xfce_heading_set_title (heading, g_value_get_string (value));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-
-
-static void
-xfce_heading_realize (GtkWidget *widget)
-{
-  GdkWindowAttr attributes;
-
-  /* mark the widget as realized */
-  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
-
-  /* setup the window attributes */
-  attributes.x = widget->allocation.x;
-  attributes.y = widget->allocation.y;
-  attributes.width = widget->allocation.width;
-  attributes.height = widget->allocation.height;
-  attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.visual = gtk_widget_get_visual (widget);
-  attributes.colormap = gtk_widget_get_colormap (widget);
-  attributes.event_mask = gtk_widget_get_events (widget)
-                        | GDK_EXPOSURE_MASK;
-
-  /* allocate the widget window */
-  widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes,
-                                   GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP);
-  gdk_window_set_user_data (widget->window, widget);
-
-  /* connect the style to the window */
-  widget->style = gtk_style_attach (widget->style, widget->window);
-
-  /* set background color (using the base color) */
-  gdk_window_set_background (widget->window, &widget->style->base[GTK_STATE_NORMAL]);
-}
-
-
-
-static void
-xfce_heading_size_request (GtkWidget      *widget,
-                           GtkRequisition *requisition)
-{
-  XfceHeading *heading = XFCE_HEADING (widget);
-  PangoLayout *layout;
-  GdkPixbuf   *pixbuf;
-  gint         layout_width;
-  gint         layout_height;
-  gint         pixbuf_width = 0;
-  gint         pixbuf_height = 0;
-
-  /* determine the dimensions of the title text */
-  layout = xfce_heading_make_layout (heading);
-  pango_layout_get_pixel_size (layout, &layout_width, &layout_height);
-  g_object_unref (G_OBJECT (layout));
-
-  /* determine the dimensions of the pixbuf */
-  pixbuf = xfce_heading_make_pixbuf (heading);
-  if (G_LIKELY (pixbuf != NULL))
-    {
-      pixbuf_width = gdk_pixbuf_get_width (pixbuf);
-      pixbuf_height = gdk_pixbuf_get_height (pixbuf);
-      g_object_unref (G_OBJECT (pixbuf));
-    }
-
-  /* determine the base dimensions */
-  requisition->width = layout_width + pixbuf_width + ((pixbuf_width > 0) ? XFCE_HEADING_SPACING : 0);
-  requisition->height = MAX (XFCE_HEADING_ICON_SIZE, MAX (pixbuf_height, layout_height));
-
-  /* add border size */
-  requisition->width += 2 * XFCE_HEADING_BORDER;
-  requisition->height += 2 * XFCE_HEADING_BORDER;
-}
-
-
-
-static void
-xfce_heading_style_set (GtkWidget *widget,
-                        GtkStyle  *previous_style)
-{
-  /* check if we're already realized */
-  if (GTK_WIDGET_REALIZED (widget))
-    {
-      /* set background color (using the base color) */
-      gdk_window_set_background (widget->window, &widget->style->base[GTK_STATE_NORMAL]);
-    }
-}
-
-
-
-static gboolean
-xfce_heading_expose_event (GtkWidget      *widget,
-                           GdkEventExpose *event)
-{
-  XfceHeading *heading = XFCE_HEADING (widget);
-  PangoLayout *layout;
-  GdkPixbuf   *pixbuf;
-  gboolean     rtl;
-  gint         width;
-  gint         height;
-  gint         x;
-  gint         y;
-
-  /* check if we should render from right to left */
-  rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
-
-  /* determine the initial horizontal position */
-  x = (rtl ? widget->allocation.width - XFCE_HEADING_BORDER : XFCE_HEADING_BORDER);
-
-  /* check if we have a pixbuf to render */
-  pixbuf = xfce_heading_make_pixbuf (heading);
-  if (G_LIKELY (pixbuf != NULL))
-    {
-      /* determine the pixbuf dimensions */
-      width = gdk_pixbuf_get_width (pixbuf);
-      height = gdk_pixbuf_get_height (pixbuf);
-
-      /* determine the vertical position */
-      y = (widget->allocation.height - height) / 2;
-
-      /* render the pixbuf */
-      gdk_draw_pixbuf (widget->window, widget->style->black_gc, pixbuf, 0, 0,
-                       (rtl ? x - width : x), y, width, height,
-                       GDK_RGB_DITHER_NORMAL, 0, 0);
-
-      /* release the pixbuf */
-      g_object_unref (G_OBJECT (pixbuf));
-
-      /* advance the horizontal position */
-      x += (rtl ? -1 : 1) * (width + XFCE_HEADING_SPACING);
-    }
-
-  /* generate the title layout */
-  layout = xfce_heading_make_layout (heading);
-  pango_layout_get_pixel_size (layout, &width, &height);
-
-  /* determine the vertical position */
-  y = (widget->allocation.height - height) / 2;
-
-  /* render the title */
-  gtk_paint_layout (widget->style, widget->window, GTK_WIDGET_STATE (widget), TRUE, &event->area,
-                    widget, "heading", (rtl ? x - width : x), y, layout);
-
-  /* release the layout */
-  g_object_unref (G_OBJECT (layout));
-
-  return FALSE;
-}
-
-
-
-static AtkObject*
-xfce_heading_get_accessible (GtkWidget *widget)
-{
-  AtkObject *object;
-
-  object = (*GTK_WIDGET_CLASS (xfce_heading_parent_class)->get_accessible) (widget);
-  atk_object_set_role (object, ATK_ROLE_HEADER);
-
-  return object;
-}
-
-
-
-static PangoLayout*
-xfce_heading_make_layout (XfceHeading *heading)
-{
-  PangoAttribute *attribute;
-  PangoAttrList  *attr_list;
-  PangoLayout    *layout;
-  GString        *text;
-  gint            title_length = 0;
-
-  /* generate the full text */
-  text = g_string_sized_new (128);
-  if (G_LIKELY (heading->priv->title != NULL))
-    {
-      /* add the main title */
-      title_length = strlen (heading->priv->title);
-      g_string_append (text, heading->priv->title);
-    }
-  if (heading->priv->subtitle != NULL && *heading->priv->subtitle != '\0')
-    {
-      /* add an empty line between the title and the subtitle */
-      if (G_LIKELY (heading->priv->title != NULL))
-        g_string_append (text, "\n");
-
-      /* add the subtitle */
-      g_string_append (text, heading->priv->subtitle);
-    }
-
-  /* allocate and setup a new layout from the widget's context */
-  layout = gtk_widget_create_pango_layout (GTK_WIDGET (heading), text->str);
-
-  /* allocate an attribute list (large bold title) */
-  attr_list = pango_attr_list_new ();
-  attribute = pango_attr_scale_new (PANGO_SCALE_LARGE); /* large title */
-  attribute->start_index = 0;
-  attribute->end_index = title_length;
-  pango_attr_list_insert (attr_list, attribute);
-  attribute = pango_attr_weight_new (PANGO_WEIGHT_BOLD); /* bold title */
-  attribute->start_index = 0;
-  attribute->end_index = title_length;
-  pango_attr_list_insert (attr_list, attribute);
-  pango_layout_set_attributes (layout, attr_list);
-  pango_attr_list_unref (attr_list);
-
-  /* cleanup */
-  g_string_free (text, TRUE);
-
-  return layout;
-}
-
-
-  
-static GdkPixbuf*
-xfce_heading_make_pixbuf (XfceHeading *heading)
-{
-  GtkIconTheme *icon_theme;
-  GdkPixbuf    *pixbuf = NULL;
-  GdkScreen    *screen;
-
-  if (G_UNLIKELY (heading->priv->icon != NULL))
-    {
-      /* just use the specified icon */
-      pixbuf = g_object_ref (G_OBJECT (heading->priv->icon));
-    }
-  else if (G_LIKELY (heading->priv->icon_name != NULL))
-    {
-      /* determine the icon theme for the current screen */
-      screen = gtk_widget_get_screen (GTK_WIDGET (heading));
-      icon_theme = gtk_icon_theme_get_for_screen (screen);
-
-      /* try to load the icon from the icon theme */
-      pixbuf = gtk_icon_theme_load_icon (icon_theme, heading->priv->icon_name,
-                                         XFCE_HEADING_ICON_SIZE,
-                                         GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
-    }
-
-  return pixbuf;
-}
-
-
-
-/**
- * xfce_heading_new:
- *
- * Allocates a new #XfceHeading instance.
- *
- * Return value: the newly allocated #XfceHeading.
- *
- * Since: 4.4.0
- **/
-GtkWidget*
-xfce_heading_new (void)
-{
-  return g_object_new (XFCE_TYPE_HEADING, NULL);
-}
-
-
-
-/**
- * xfce_heading_get_icon:
- * @heading : a #XfceHeading.
- *
- * Returns the #GdkPixbuf that was set as icon for
- * @heading or %NULL if no icon is set. The returned
- * #GdkPixbuf object is owned by @heading.
- *
- * Return value: the icon for @heading, or %NULL.
- *
- * Since: 4.4.0
- **/
-GdkPixbuf*
-xfce_heading_get_icon (XfceHeading *heading)
-{
-  g_return_val_if_fail (XFCE_IS_HEADING (heading), NULL);
-  return heading->priv->icon;
-}
-
-
-
-/**
- * xfce_heading_set_icon:
- * @heading : a #XfceHeading.
- * @icon    : the new icon or %NULL.
- *
- * If @icon is not %NULL, @heading will display the new @icon
- * aside the title. Else, if @icon is %NULL no icon is displayed
- * unless an icon name was set with xfce_heading_set_icon_name().
- *
- * Since: 4.4.0
- **/
-void
-xfce_heading_set_icon (XfceHeading *heading,
-                       GdkPixbuf   *icon)
-{
-  g_return_if_fail (XFCE_IS_HEADING (heading));
-  g_return_if_fail (icon == NULL || GDK_IS_PIXBUF (icon));
-
-  /* check if we have a new icon */
-  if (G_LIKELY (heading->priv->icon != icon))
-    {
-      /* disconnect from the previous icon */
-      if (G_LIKELY (heading->priv->icon != NULL))
-        g_object_unref (G_OBJECT (heading->priv->icon));
-
-      /* activate the new icon */
-      heading->priv->icon = icon;
-
-      /* connect to the new icon */
-      if (G_LIKELY (icon != NULL))
-        g_object_ref (G_OBJECT (icon));
-
-      /* schedule a resize */
-      gtk_widget_queue_resize (GTK_WIDGET (heading));
-
-      /* notify listeners */
-      g_object_notify (G_OBJECT (heading), "icon");
-    }
-}
-
-
-
-/**
- * xfce_heading_get_icon_name:
- * @heading : a #XfceHeading.
- *
- * Returns the icon name previously set by a call to
- * xfce_heading_set_icon_name() or %NULL if no icon name
- * is set for @heading.
- *
- * Return value: the icon name for @heading, or %NULL.
- *
- * Since: 4.4.0
- **/
-G_CONST_RETURN gchar*
-xfce_heading_get_icon_name (XfceHeading *heading)
-{
-  g_return_val_if_fail (XFCE_IS_HEADING (heading), NULL);
-  return heading->priv->icon_name;
-}
-
-
-
-/**
- * xfce_heading_set_icon_name:
- * @heading   : a #XfceHeading.
- * @icon_name : the new icon name, or %NULL.
- *
- * If @icon_name is not %NULL and the "icon" property is set to
- * %NULL, see xfce_heading_set_icon(), the @heading will display
- * the name icon identified by the @icon_name.
- *
- * Since: 4.4.0
- **/
-void
-xfce_heading_set_icon_name (XfceHeading *heading,
-                            const gchar *icon_name)
-{
-  g_return_if_fail (XFCE_IS_HEADING (heading));
-
-  /* release the previous icon name */
-  g_free (heading->priv->icon_name);
-
-  /* activate the new icon name */
-  heading->priv->icon_name = g_strdup (icon_name);
-
-  /* schedule a resize */
-  gtk_widget_queue_resize (GTK_WIDGET (heading));
-
-  /* notify listeners */
-  g_object_notify (G_OBJECT (heading), "icon-name");
-}
-
-
-
-/**
- * xfce_heading_get_subtitle:
- * @heading : a #XfceHeading.
- *
- * Returns the sub title displayed below the
- * main title of the @heading, or %NULL if
- * no subtitle is set.
- *
- * Return value: the subtitle of @heading, or %NULL.
- *
- * Since: 4.4.0
- **/
-G_CONST_RETURN gchar*
-xfce_heading_get_subtitle (XfceHeading *heading)
-{
-  g_return_val_if_fail (XFCE_IS_HEADING (heading), NULL);
-  return heading->priv->subtitle;
-}
-
-
-
-/**
- * xfce_heading_set_subtitle:
- * @heading  : a #XfceHeading.
- * @subtitle : the new subtitle for @heading, or %NULL.
- *
- * If @subtitle is not %NULL and not the empty string, it
- * will be displayed by @heading below the main title.
- *
- * Since: 4.4.0
- **/
-void
-xfce_heading_set_subtitle (XfceHeading *heading,
-                           const gchar *subtitle)
-{
-  g_return_if_fail (XFCE_IS_HEADING (heading));
-  g_return_if_fail (subtitle == NULL || g_utf8_validate (subtitle, -1, NULL));
-
-  /* release the previous subtitle */
-  g_free (heading->priv->subtitle);
-
-  /* activate the new subtitle */
-  heading->priv->subtitle = g_strdup (subtitle);
-
-  /* schedule a resize */
-  gtk_widget_queue_resize (GTK_WIDGET (heading));
-
-  /* notify listeners */
-  g_object_notify (G_OBJECT (heading), "subtitle");
-}
-
-
-
-/**
- * xfce_heading_get_title:
- * @heading : a #XfceHeading.
- *
- * Returns the title displayed by the @heading.
- *
- * Return value: the title displayed by the @heading.
- *
- * Since: 4.4.0
- **/
-G_CONST_RETURN gchar*
-xfce_heading_get_title (XfceHeading *heading)
-{
-  g_return_val_if_fail (XFCE_IS_HEADING (heading), NULL);
-  return heading->priv->title;
-}
-
-
-
-/**
- * xfce_heading_set_title:
- * @heading : a #XfceHeading.
- * @title   : the new title for the @heading.
- *
- * Sets the title displayed by the @heading to the
- * specified @title.
- *
- * Since: 4.4.0
- **/
-void
-xfce_heading_set_title (XfceHeading *heading,
-                        const gchar *title)
-{
-  g_return_if_fail (XFCE_IS_HEADING (heading));
-  g_return_if_fail (title == NULL || g_utf8_validate (title, -1, NULL));
-
-  /* release the previous title */
-  g_free (heading->priv->title);
-
-  /* activate the new title */
-  heading->priv->title = g_strdup (title);
-
-  /* schedule a resize */
-  gtk_widget_queue_resize (GTK_WIDGET (heading));
-
-  /* notify listeners */
-  g_object_notify (G_OBJECT (heading), "title");
-}
-
-
diff --git a/thunar-volman/xfce-heading.h b/thunar-volman/xfce-heading.h
deleted file mode 100644
index 0ca1351..0000000
--- a/thunar-volman/xfce-heading.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2006 Benedikt Meurer <benny at 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 __XFCE_HEADING_H__
-#define __XFCE_HEADING_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-typedef struct _XfceHeadingPrivate XfceHeadingPrivate;
-typedef struct _XfceHeadingClass   XfceHeadingClass;
-typedef struct _XfceHeading        XfceHeading;
-
-#define XFCE_TYPE_HEADING             (xfce_heading_get_type ())
-#define XFCE_HEADING(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_HEADING, XfceHeading))
-#define XFCE_HEADING_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_HEADING, XfceHeadingClass))
-#define XFCE_IS_HEADING(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_HEADING))
-#define XFCE_IS_HEADING_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_HEADING))
-#define XFCE_HEADING_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_HEADING, XfceHeadingClass))
-
-struct _XfceHeadingClass
-{
-  /*< private >*/
-  GtkWidgetClass __parent__;
-
-  /* reserved for future expansion */
-  void (*reserved0) (void);
-  void (*reserved1) (void);
-  void (*reserved2) (void);
-  void (*reserved3) (void);
-  void (*reserved4) (void);
-  void (*reserved5) (void);
-};
-
-struct _XfceHeading
-{
-  /*< private >*/
-  GtkWidget           __parent__;
-  XfceHeadingPrivate *priv;
-};
-
-GType                 xfce_heading_get_type      (void) G_GNUC_CONST;
-
-GtkWidget            *xfce_heading_new           (void) G_GNUC_MALLOC;
-
-GdkPixbuf            *xfce_heading_get_icon      (XfceHeading *heading);
-void                  xfce_heading_set_icon      (XfceHeading *heading,
-                                                  GdkPixbuf   *icon);
-
-G_CONST_RETURN gchar *xfce_heading_get_icon_name (XfceHeading *heading);
-void                  xfce_heading_set_icon_name (XfceHeading *heading,
-                                                  const gchar *icon_name);
-
-G_CONST_RETURN gchar *xfce_heading_get_subtitle  (XfceHeading *heading);
-void                  xfce_heading_set_subtitle  (XfceHeading *heading,
-                                                  const gchar *subtitle);
-
-G_CONST_RETURN gchar *xfce_heading_get_title     (XfceHeading *heading);
-void                  xfce_heading_set_title     (XfceHeading *heading,
-                                                  const gchar *title);
-
-G_END_DECLS
-
-#endif /* !__XFCE_HEADING_H__ */
diff --git a/thunar-volman/xfce-titled-dialog.c b/thunar-volman/xfce-titled-dialog.c
deleted file mode 100644
index 9a12243..0000000
--- a/thunar-volman/xfce-titled-dialog.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2006 Benedikt Meurer <benny at 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_STDARG_H
-#include <stdarg.h>
-#endif
-
-#include <gdk/gdkkeysyms.h>
-
-#include "xfce-heading.h"
-#include "xfce-titled-dialog.h"
-
-
-
-#define XFCE_TITLED_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFCE_TYPE_TITLED_DIALOG, XfceTitledDialogPrivate))
-
-
-
-/* Property identifiers */
-enum
-{
-  PROP_0,
-  PROP_SUBTITLE,
-};
-
-
-
-static void xfce_titled_dialog_class_init     (XfceTitledDialogClass  *klass);
-static void xfce_titled_dialog_init           (XfceTitledDialog       *titled_dialog);
-static void xfce_titled_dialog_finalize       (GObject                *object);
-static void xfce_titled_dialog_get_property   (GObject                *object,
-                                               guint                   prop_id,
-                                               GValue                 *value,
-                                               GParamSpec             *pspec);
-static void xfce_titled_dialog_set_property   (GObject                *object,
-                                               guint                   prop_id,
-                                               const GValue           *value,
-                                               GParamSpec             *pspec);
-static void xfce_titled_dialog_close          (GtkDialog              *dialog);
-static void xfce_titled_dialog_update_heading (XfceTitledDialog       *titled_dialog);
-
-
-
-struct _XfceTitledDialogPrivate
-{
-  GtkWidget *heading;
-  gchar     *subtitle;
-};
-
-
-
-G_DEFINE_TYPE (XfceTitledDialog, xfce_titled_dialog, GTK_TYPE_DIALOG);
-
-
-
-static void
-xfce_titled_dialog_class_init (XfceTitledDialogClass *klass)
-{
-  GtkDialogClass *gtkdialog_class;
-  GtkBindingSet  *binding_set;
-  GObjectClass   *gobject_class;
-
-  /* add our private data to the class */
-  g_type_class_add_private (klass, sizeof (XfceTitledDialogPrivate));
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->finalize = xfce_titled_dialog_finalize;
-  gobject_class->get_property = xfce_titled_dialog_get_property;
-  gobject_class->set_property = xfce_titled_dialog_set_property;
-
-  gtkdialog_class = GTK_DIALOG_CLASS (klass);
-  gtkdialog_class->close = xfce_titled_dialog_close;
-
-  /**
-   * XfceTitledDialog:subtitle:
-   *
-   * The subtitle displayed below the main dialog title.
-   *
-   * Since: 4.4.0
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_SUBTITLE,
-                                   g_param_spec_string ("subtitle",
-                                                        "subtitle",
-                                                        "subtitle",
-                                                        NULL,
-                                                        G_PARAM_READWRITE));
-
-  /* connect additional key bindings to the GtkDialog::close action signal */
-  binding_set = gtk_binding_set_by_class (klass);
-  gtk_binding_entry_add_signal (binding_set, GDK_w, GDK_CONTROL_MASK, "close", 0);
-  gtk_binding_entry_add_signal (binding_set, GDK_W, GDK_CONTROL_MASK, "close", 0);
-}
-
-
-
-static void
-xfce_titled_dialog_init (XfceTitledDialog *titled_dialog)
-{
-  GtkWidget *line;
-  GtkWidget *vbox;
-
-  /* connect the private data */
-  titled_dialog->priv = XFCE_TITLED_DIALOG_GET_PRIVATE (titled_dialog);
-
-  /* remove the main dialog box from the window */
-  g_object_ref (G_OBJECT (GTK_DIALOG (titled_dialog)->vbox));
-  gtk_container_remove (GTK_CONTAINER (titled_dialog), GTK_DIALOG (titled_dialog)->vbox);
-
-  /* add a new vbox w/o border to the main window */
-  vbox = gtk_vbox_new (FALSE, 0);
-  gtk_container_add (GTK_CONTAINER (titled_dialog), vbox);
-  gtk_widget_show (vbox);
-
-  /* add the heading to the window */
-  titled_dialog->priv->heading = xfce_heading_new ();
-  gtk_box_pack_start (GTK_BOX (vbox), titled_dialog->priv->heading, FALSE, FALSE, 0);
-  gtk_widget_show (titled_dialog->priv->heading);
-
-  /* add the separator between header and content */
-  line = gtk_hseparator_new ();
-  gtk_box_pack_start (GTK_BOX (vbox), line, FALSE, FALSE, 0);
-  gtk_widget_show (line);
-
-  /* add the main dialog box to the new vbox */
-  gtk_box_pack_start (GTK_BOX (vbox), GTK_DIALOG (titled_dialog)->vbox, TRUE, TRUE, 0);
-  g_object_unref (G_OBJECT (GTK_DIALOG (titled_dialog)->vbox));
-
-  /* make sure to update the heading whenever one of the relevant window properties changes */
-  g_signal_connect (G_OBJECT (titled_dialog), "notify::icon", G_CALLBACK (xfce_titled_dialog_update_heading), NULL);
-  g_signal_connect (G_OBJECT (titled_dialog), "notify::icon-name", G_CALLBACK (xfce_titled_dialog_update_heading), NULL);
-  g_signal_connect (G_OBJECT (titled_dialog), "notify::title", G_CALLBACK (xfce_titled_dialog_update_heading), NULL);
-
-  /* initially update the heading properties */
-  xfce_titled_dialog_update_heading (titled_dialog);
-}
-
-
-
-
-static void
-xfce_titled_dialog_finalize (GObject *object)
-{
-  XfceTitledDialog *titled_dialog = XFCE_TITLED_DIALOG (object);
-
-  /* release the subtitle */
-  g_free (titled_dialog->priv->subtitle);
-
-  (*G_OBJECT_CLASS (xfce_titled_dialog_parent_class)->finalize) (object);
-}
-
-
-
-static void
-xfce_titled_dialog_get_property (GObject    *object,
-                                 guint       prop_id,
-                                 GValue     *value,
-                                 GParamSpec *pspec)
-{
-  XfceTitledDialog *titled_dialog = XFCE_TITLED_DIALOG (object);
-
-  switch (prop_id)
-    {
-    case PROP_SUBTITLE:
-      g_value_set_string (value, xfce_titled_dialog_get_subtitle (titled_dialog));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-
-
-static void
-xfce_titled_dialog_set_property (GObject      *object,
-                                 guint         prop_id,
-                                 const GValue *value,
-                                 GParamSpec   *pspec)
-{
-  XfceTitledDialog *titled_dialog = XFCE_TITLED_DIALOG (object);
-
-  switch (prop_id)
-    {
-    case PROP_SUBTITLE:
-      xfce_titled_dialog_set_subtitle (titled_dialog, g_value_get_string (value));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-
-
-static void
-xfce_titled_dialog_close (GtkDialog *dialog)
-{
-  GdkEvent *event;
-
-  /* verify that the dialog is realized */
-  if (G_LIKELY (GTK_WIDGET_REALIZED (dialog)))
-    {
-      /* send a delete event to the dialog */
-      event = gdk_event_new (GDK_DELETE);
-      event->any.window = g_object_ref (GTK_WIDGET (dialog)->window);
-      event->any.send_event = TRUE;
-      gtk_main_do_event (event);
-      gdk_event_free (event);
-    }
-}
-
-
-
-static void
-xfce_titled_dialog_update_heading (XfceTitledDialog *titled_dialog)
-{
-  /* update the heading properties using the window property values */
-  xfce_heading_set_icon (XFCE_HEADING (titled_dialog->priv->heading), gtk_window_get_icon (GTK_WINDOW (titled_dialog)));
-  xfce_heading_set_icon_name (XFCE_HEADING (titled_dialog->priv->heading), gtk_window_get_icon_name (GTK_WINDOW (titled_dialog)));
-  xfce_heading_set_title (XFCE_HEADING (titled_dialog->priv->heading), gtk_window_get_title (GTK_WINDOW (titled_dialog)));
-}
-
-
-
-/**
- * xfce_titled_dialog_new:
- *
- * Allocates a new #XfceTitledDialog instance.
- *
- * Return value: the newly allocated #XfceTitledDialog.
- *
- * Since: 4.4.0
- **/
-GtkWidget*
-xfce_titled_dialog_new (void)
-{
-  return g_object_new (XFCE_TYPE_TITLED_DIALOG, NULL);
-}
-
-
-
-/**
- * xfce_titled_dialog_new_with_buttons:
- * @title             : title of the dialog, or %NULL.
- * @parent            : transient parent window of the dialog, or %NULL.
- * @flags             : from #GtkDialogFlags.
- * @first_button_text : stock ID or text to go in first, or %NULL.
- * @...               : response ID for the first button, then additional buttons, ending with %NULL.
- *
- * See the documentation of gtk_dialog_new_with_buttons() for details about the
- * parameters and the returned dialog.
- *
- * Return value: the newly allocated #XfceTitledDialog.
- *
- * Since: 4.4.0
- **/
-GtkWidget*
-xfce_titled_dialog_new_with_buttons (const gchar   *title,
-                                     GtkWindow     *parent,
-                                     GtkDialogFlags flags,
-                                     const gchar   *first_button_text,
-                                     ...)
-{
-  const gchar *button_text;
-  GtkWidget   *dialog;
-  va_list      args;
-  gint         response_id;
-
-  /* allocate the dialog */
-  dialog = g_object_new (XFCE_TYPE_TITLED_DIALOG,
-                         "destroy-with-parent", ((flags & GTK_DIALOG_DESTROY_WITH_PARENT) != 0),
-                         "has-separator", ((flags & GTK_DIALOG_NO_SEPARATOR) == 0),
-                         "modal", ((flags & GTK_DIALOG_MODAL) != 0),
-                         "title", title,
-                         NULL);
-
-  /* set the transient parent (if any) */
-  if (G_LIKELY (parent != NULL))
-    gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
-
-  /* add all additional buttons */
-  va_start (args, first_button_text);
-  for (button_text = first_button_text; button_text != NULL; )
-    {
-      response_id = va_arg (args, gint);
-      gtk_dialog_add_button (GTK_DIALOG (dialog), button_text, response_id);
-      button_text = va_arg (args, const gchar *);
-    }
-  va_end (args);
-
-  return dialog;
-}
-
-
-
-/**
- * xfce_titled_dialog_get_subtitle:
- * @titled_dialog : a #XfceTitledDialog.
- *
- * Returns the subtitle of the @titled_dialog, or %NULL
- * if no subtitle is displayed in the @titled_dialog.
- *
- * Return value: the subtitle of @titled_dialog, or %NULL.
- *
- * Since: 4.4.0
- **/
-G_CONST_RETURN gchar*
-xfce_titled_dialog_get_subtitle (XfceTitledDialog *titled_dialog)
-{
-  g_return_val_if_fail (XFCE_IS_TITLED_DIALOG (titled_dialog), NULL);
-  return titled_dialog->priv->subtitle;
-}
-
-
-
-/**
- * xfce_titled_dialog_set_subtitle:
- * @titled_dialog : a #XfceTitledDialog.
- * @subtitle      : the new subtitle for the @titled_dialog, or %NULL.
- *
- * Sets the subtitle displayed by @titled_dialog to @subtitle; if
- * @subtitle is %NULL no subtitle will be displayed by the @titled_dialog.
- *
- * Since: 4.4.0
- **/
-void
-xfce_titled_dialog_set_subtitle (XfceTitledDialog *titled_dialog,
-                                 const gchar      *subtitle)
-{
-  g_return_if_fail (XFCE_IS_TITLED_DIALOG (titled_dialog));
-  g_return_if_fail (subtitle == NULL || g_utf8_validate (subtitle, -1, NULL));
-
-  /* release the previous subtitle */
-  g_free (titled_dialog->priv->subtitle);
-
-  /* activate the new subtitle */
-  titled_dialog->priv->subtitle = g_strdup (subtitle);
-
-  /* update the subtitle for the heading */
-  xfce_heading_set_subtitle (XFCE_HEADING (titled_dialog->priv->heading), subtitle);
-
-  /* notify listeners */
-  g_object_notify (G_OBJECT (titled_dialog), "subtitle");
-}
-
-
diff --git a/thunar-volman/xfce-titled-dialog.h b/thunar-volman/xfce-titled-dialog.h
deleted file mode 100644
index 5243a2e..0000000
--- a/thunar-volman/xfce-titled-dialog.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2006 Benedikt Meurer <benny at 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 __XFCE_TITLED_DIALOG_H__
-#define __XFCE_TITLED_DIALOG_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-typedef struct _XfceTitledDialogPrivate XfceTitledDialogPrivate;
-typedef struct _XfceTitledDialogClass   XfceTitledDialogClass;
-typedef struct _XfceTitledDialog        XfceTitledDialog;
-
-#define XFCE_TYPE_TITLED_DIALOG             (xfce_titled_dialog_get_type ())
-#define XFCE_TITLED_DIALOG(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_TITLED_DIALOG, XfceTitledDialog))
-#define XFCE_TITLED_DIALOG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_TITLED_DIALOG, XfceTitledDialogClass))
-#define XFCE_IS_TITLED_DIALOG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_TITLED_DIALOG))
-#define XFCE_IS_TITLED_DIALOG_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_TITLED_DIALOG))
-#define XFCE_TITLED_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_TITLED_DIALOG, XfceTitledDialogClass))
-
-struct _XfceTitledDialogClass
-{
-  /*< private >*/
-  GtkDialogClass __parent__;
-
-  /* reserved for future expansion */
-  void (*reserved0) (void);
-  void (*reserved1) (void);
-  void (*reserved2) (void);
-  void (*reserved3) (void);
-  void (*reserved4) (void);
-  void (*reserved5) (void);
-};
-
-struct _XfceTitledDialog
-{
-  /*< private >*/
-  GtkDialog                __parent__;
-  XfceTitledDialogPrivate *priv;
-};
-
-GType                 xfce_titled_dialog_get_type         (void) G_GNUC_CONST;
-
-GtkWidget            *xfce_titled_dialog_new              (void) G_GNUC_MALLOC;
-GtkWidget            *xfce_titled_dialog_new_with_buttons (const gchar      *title,
-                                                           GtkWindow        *parent,
-                                                           GtkDialogFlags    flags,
-                                                           const gchar      *first_button_text,
-                                                           ...) G_GNUC_MALLOC;
-
-G_CONST_RETURN gchar *xfce_titled_dialog_get_subtitle     (XfceTitledDialog *titled_dialog);
-void                  xfce_titled_dialog_set_subtitle     (XfceTitledDialog *titled_dialog,
-                                                           const gchar      *subtitle);
-
-G_END_DECLS
-
-#endif /* !__XFCE_TITLED_DIALOG_H__ */



More information about the Xfce4-commits mailing list