Index: thunar-volman/tvm-camera-device.h =================================================================== --- thunar-volman/tvm-camera-device.h (revision 4898) +++ thunar-volman/tvm-camera-device.h (working copy) @@ -22,7 +22,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS gboolean tvm_camera_device_added (TvmPreferences *preferences, LibHalContext *context, @@ -30,6 +30,6 @@ const gchar *capability, GError **error) G_GNUC_INTERNAL; -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_CAMERA_DEVICE_H__ */ Index: thunar-volman/tvm-block-device.h =================================================================== --- thunar-volman/tvm-block-device.h (revision 4898) +++ thunar-volman/tvm-block-device.h (working copy) @@ -22,7 +22,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS gboolean tvm_block_device_added (TvmPreferences *preferences, LibHalContext *context, @@ -30,6 +30,6 @@ const gchar *capability, GError **error) G_GNUC_INTERNAL; -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_BLOCK_DEVICE_H__ */ Index: thunar-volman/tvm-input-device.h =================================================================== --- thunar-volman/tvm-input-device.h (revision 4898) +++ thunar-volman/tvm-input-device.h (working copy) @@ -22,7 +22,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS gboolean tvm_input_device_added (TvmPreferences *preferences, LibHalContext *context, @@ -30,6 +30,6 @@ const gchar *capability, GError **error) G_GNUC_INTERNAL; -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_INPUT_DEVICE_H__ */ Index: thunar-volman/tvm-preferences-dialog.h =================================================================== --- thunar-volman/tvm-preferences-dialog.h (revision 4898) +++ thunar-volman/tvm-preferences-dialog.h (working copy) @@ -22,7 +22,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _TvmPreferencesDialogClass TvmPreferencesDialogClass; typedef struct _TvmPreferencesDialog TvmPreferencesDialog; @@ -38,6 +38,6 @@ GtkWidget *tvm_preferences_dialog_new (void) G_GNUC_INTERNAL G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_PREFERENCES_DIALOG_H__ */ Index: thunar-volman/tvm-device.h =================================================================== --- thunar-volman/tvm-device.h (revision 4898) +++ thunar-volman/tvm-device.h (working copy) @@ -26,7 +26,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS /** * TvmDeviceCallback: @@ -53,6 +53,6 @@ const gchar *udi, GError **error) G_GNUC_INTERNAL; -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_DEVICE_H__ */ Index: thunar-volman/tvm-pango-extensions.h =================================================================== --- thunar-volman/tvm-pango-extensions.h (revision 4898) +++ thunar-volman/tvm-pango-extensions.h (working copy) @@ -22,7 +22,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS PangoAttrList *tvm_pango_attr_list_big (void) G_GNUC_CONST G_GNUC_INTERNAL; PangoAttrList *tvm_pango_attr_list_big_bold (void) G_GNUC_CONST G_GNUC_INTERNAL; @@ -31,6 +31,6 @@ PangoAttrList *tvm_pango_attr_list_small_italic (void) G_GNUC_CONST G_GNUC_INTERNAL; PangoAttrList *tvm_pango_attr_list_underline_single (void) G_GNUC_CONST G_GNUC_INTERNAL; -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_PANGO_EXTENSIONS_H__ */ Index: thunar-volman/tvm-pda-device.h =================================================================== --- thunar-volman/tvm-pda-device.h (revision 4898) +++ thunar-volman/tvm-pda-device.h (working copy) @@ -22,7 +22,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS gboolean tvm_pda_device_added (TvmPreferences *preferences, LibHalContext *context, @@ -30,6 +30,6 @@ const gchar *capability, GError **error) G_GNUC_INTERNAL; -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_PDA_DEVICE_H__ */ Index: thunar-volman/tvm-preferences.h =================================================================== --- thunar-volman/tvm-preferences.h (revision 4898) +++ thunar-volman/tvm-preferences.h (working copy) @@ -22,7 +22,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _TvmPreferencesClass TvmPreferencesClass; typedef struct _TvmPreferences TvmPreferences; @@ -38,6 +38,6 @@ TvmPreferences *tvm_preferences_get (void); -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_PREFERENCES_H__ */ Index: thunar-volman/xfce-titled-dialog.h =================================================================== --- thunar-volman/xfce-titled-dialog.h (revision 4898) +++ thunar-volman/xfce-titled-dialog.h (working copy) @@ -23,7 +23,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _XfceTitledDialogPrivate XfceTitledDialogPrivate; typedef struct _XfceTitledDialogClass XfceTitledDialogClass; @@ -70,6 +70,6 @@ void xfce_titled_dialog_set_subtitle (XfceTitledDialog *titled_dialog, const gchar *subtitle); -G_END_DECLS; +G_END_DECLS #endif /* !__XFCE_TITLED_DIALOG_H__ */ Index: thunar-volman/tvm-run.h =================================================================== --- thunar-volman/tvm-run.h (revision 4898) +++ thunar-volman/tvm-run.h (working copy) @@ -22,7 +22,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS gboolean tvm_run_cdburner (TvmPreferences *preferences, LibHalContext *context, @@ -41,6 +41,6 @@ const gchar *mount_point, GError **error) G_GNUC_INTERNAL; -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_RUN_H__ */ Index: thunar-volman/tvm-command-entry.h =================================================================== --- thunar-volman/tvm-command-entry.h (revision 4898) +++ thunar-volman/tvm-command-entry.h (working copy) @@ -22,7 +22,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _TvmCommandEntryClass TvmCommandEntryClass; typedef struct _TvmCommandEntry TvmCommandEntry; @@ -56,6 +56,6 @@ void tvm_command_entry_set_command (TvmCommandEntry *command_entry, const gchar *command) G_GNUC_INTERNAL; -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_COMMAND_ENTRY_H__ */ Index: thunar-volman/xfce-heading.h =================================================================== --- thunar-volman/xfce-heading.h (revision 4898) +++ thunar-volman/xfce-heading.h (working copy) @@ -23,7 +23,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _XfceHeadingPrivate XfceHeadingPrivate; typedef struct _XfceHeadingClass XfceHeadingClass; @@ -77,6 +77,6 @@ void xfce_heading_set_title (XfceHeading *heading, const gchar *title); -G_END_DECLS; +G_END_DECLS #endif /* !__XFCE_HEADING_H__ */ Index: thunar-volman/Makefile.am =================================================================== --- thunar-volman/Makefile.am (revision 4898) +++ thunar-volman/Makefile.am (working copy) @@ -21,6 +21,8 @@ tvm-camera-device.h \ tvm-command-entry.c \ tvm-command-entry.h \ + tvm-crypto-volume.c \ + tvm-crypto-volume.h \ tvm-device.c \ tvm-device.h \ tvm-input-device.c \ Index: thunar-volman/tvm-printer-device.h =================================================================== --- thunar-volman/tvm-printer-device.h (revision 4898) +++ thunar-volman/tvm-printer-device.h (working copy) @@ -22,7 +22,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS gboolean tvm_printer_device_added (TvmPreferences *preferences, LibHalContext *context, @@ -30,6 +30,6 @@ const gchar *capability, GError **error) G_GNUC_INTERNAL; -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_PRINTER_DEVICE_H__ */ Index: thunar-volman/tvm-prompt.h =================================================================== --- thunar-volman/tvm-prompt.h (revision 4898) +++ thunar-volman/tvm-prompt.h (working copy) @@ -22,7 +22,7 @@ #include -G_BEGIN_DECLS; +G_BEGIN_DECLS enum { @@ -46,6 +46,6 @@ const gchar *first_button_text, ...) G_GNUC_INTERNAL G_GNUC_NULL_TERMINATED; -G_END_DECLS; +G_END_DECLS #endif /* !__TVM_PROMPT_H__ */ Index: thunar-volman/tvm-block-device.c =================================================================== --- thunar-volman/tvm-block-device.c (revision 4898) +++ thunar-volman/tvm-block-device.c (working copy) @@ -1,6 +1,6 @@ /* $Id$ */ /*- - * Copyright (c) 2007 Benedikt Meurer . + * Copyright (c) 2007-2008 Benedikt Meurer . * * 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 @@ -42,6 +42,7 @@ #include #include +#include #include #include @@ -609,6 +610,7 @@ gboolean autoplay; gboolean is_cdrom; gboolean has_filesystem; + gboolean has_crypto; gchar *storage_udi; gchar *drive_type; gchar *fsusage; @@ -749,20 +751,30 @@ libhal_free_string (storage_udi); } - /* make sure the volume has a mountable filesystem */ + /* determine the file system usage of the volume */ fsusage = libhal_device_get_property_string (context, udi, "volume.fsusage", NULL); - has_filesystem = (G_LIKELY (fsusage && strcmp (fsusage, "filesystem") == 0)); + has_crypto = (G_UNLIKELY (fsusage != NULL && strcmp (fsusage, "crypto") == 0)); + has_filesystem = (G_LIKELY (fsusage != NULL && strcmp (fsusage, "filesystem") == 0)); libhal_free_string (fsusage); - if (G_UNLIKELY (!has_filesystem)) - return FALSE; - /* 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; + /* 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); + /* try to mount the block device */ + return tvm_block_device_mount (preferences, context, udi, error); + } + + return FALSE; }