Index: src/manager.c
===================================================================
RCS file: /cvs/gnome/gnome-volume-manager/src/manager.c,v
retrieving revision 1.115
diff -u -p -r1.115 manager.c
--- src/manager.c 12 Jan 2006 21:33:50 -0000 1.115
+++ src/manager.c 17 Jan 2006 17:31:23 -0000
@@ -1291,7 +1291,7 @@ gvm_device_mounted (const char *udi)
* @return TRUE iff the mount was succesful
*/
static gboolean
-gvm_device_mount (const char *udi, int apply_policy)
+gvm_device_mount (const char *udi, int apply_policy, gboolean no_ui)
{
char *mount_point, *fstype, *options[2], **poptions;
struct _MountPolicy *policy;
@@ -1315,8 +1315,12 @@ gvm_device_mount (const char *udi, int a
policy->apply = apply_policy;
g_hash_table_insert (mount_table, policy->udi, policy);
-
- command = g_strdup_printf ("%s --hal-udi=%%h", gnome_mount);
+
+ if (no_ui) {
+ command = g_strdup_printf ("%s --no-ui --hal-udi=%%h", gnome_mount);
+ } else {
+ command = g_strdup_printf ("%s --hal-udi=%%h", gnome_mount);
+ }
retval = gvm_run_command (command, udi, NULL, NULL);
g_free (command);
@@ -1456,7 +1460,7 @@ cda_extra_cb (GvmPromptCtx *ctx, int act
switch (action) {
case GVM_RESPONSE_BROWSE:
if (!gvm_udi_is_subfs_mount (ctx->udi))
- gvm_device_mount (ctx->udi, TRUE);
+ gvm_device_mount (ctx->udi, TRUE, FALSE);
break;
case GVM_RESPONSE_PLAY:
gvm_run_cdplayer (ctx->udi, ctx->device, NULL);
@@ -1491,7 +1495,7 @@ gvm_ask_mixed (const char *udi)
gvm_prompt (ctx, 0, NULL);
} else if (config.automount_media) {
if (!gvm_udi_is_subfs_mount (udi))
- gvm_device_mount (udi, TRUE);
+ gvm_device_mount (udi, TRUE, FALSE);
} else if (config.autoplay_cda) {
gvm_run_cdplayer (udi, device, NULL);
}
@@ -1626,7 +1630,7 @@ gvm_cdrom_policy (const char *udi)
gvm_ask_mixed (udi);
} else if (has_data) {
if (config.automount_media && !gvm_udi_is_subfs_mount (udi))
- gvm_device_mount (udi, TRUE);
+ gvm_device_mount (udi, TRUE, FALSE);
} else if (is_blank) {
if ((type = gvm_cdrom_media_is_writable (udi)))
gvm_run_cdburner (udi, type, device, NULL);
@@ -1784,7 +1788,7 @@ block_device_added (const char *udi, con
if (config.automount_drives && mountable) {
if (!gvm_udi_is_subfs_mount (udi)) {
if (gvm_automount_enabled (udi)) {
- gvm_device_mount (udi, TRUE);
+ gvm_device_mount (udi, TRUE, FALSE);
} else {
dbg ("storage.automount_enabled_hint set to false on %s, not mounting\n", udi);
}
@@ -2340,7 +2344,8 @@ mount_all (LibHalContext *ctx)
/* mount the device */
if ((dev = libhal_device_get_property_string (ctx, udi, "block.device", &error))) {
dbg ("mount_all: mounting %s\n", dev);
- gvm_device_mount (udi, FALSE);
+ /* don't make the mount program put up error dialogs */
+ gvm_device_mount (udi, FALSE, TRUE);
libhal_free_string (dev);
} else {
warn ("mount_all: no device for udi=%s: %s", udi, error.message);