diff --git a/gnome/ChangeLog b/gnome/ChangeLog index bfcf7516d..b1721c865 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,8 @@ +1999-03-18 Miguel de Icaza + + * gdesktop.c (desktop_icon_info_open): Fix condition. Should not + open a new panel if it fails to mount the device. + Thu Mar 18 14:59:12 1999 Timur Bakeyev * gnome-open-dialog.c (read_directory): s/basename/x_basename/g diff --git a/gnome/gdesktop.c b/gnome/gdesktop.c index b695a97e6..3cc6c1bb3 100644 --- a/gnome/gdesktop.c +++ b/gnome/gdesktop.c @@ -1003,20 +1003,21 @@ do_mount_umount (char *filename, gboolean is_mount) return FALSE; if (op){ + gboolean success = TRUE; char *command; FILE *f; command = g_strconcat (op, " ", buffer, NULL); open_error_pipe (); f = popen (command, "r"); - if (f == NULL) - close_error_pipe (1, _("While running the mount/umount command")); - else - close_error_pipe (0, 0); + if (f == NULL){ + success = !close_error_pipe (1, _("While running the mount/umount command")); + } else + success = !close_error_pipe (0, 0); pclose (f); g_free (buffer); - return TRUE; + return success; } g_free (buffer); return FALSE; @@ -1140,6 +1141,8 @@ desktop_icon_info_open (DesktopIconInfo *dii) if (!is_mounted){ if (try_to_mount (filename, fe)) launch = TRUE; + else + launch = FALSE; } else launch = TRUE; diff --git a/src/ChangeLog b/src/ChangeLog index 059c1f682..c6b732d29 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +1999-03-18 Miguel de Icaza + + * utilunix.c (close_error_pipe): Inform parent of the return value + of any command here. This allows the desktop to launch a terminal + only if it succeeded in mounting the directory. + Thu Mar 18 16:09:09 1999 Timur Bakeyev * panel.h, screen.c: Add an ability to center justify fields in diff --git a/src/main.c b/src/main.c index 7d406e650..7000625d1 100644 --- a/src/main.c +++ b/src/main.c @@ -2751,7 +2751,7 @@ handle_args (int argc, char *argv []) gtk_widget_push_visual (gdk_imlib_get_visual ()); gtk_widget_push_colormap (gdk_imlib_get_colormap ()); - poptResetContext (ctx); +/* poptResetContext (ctx); */ #else ctx = poptGetContext ("mc", argc, argv, argument_table, 0); #endif diff --git a/src/util.h b/src/util.h index 64b97c501..768b67aeb 100644 --- a/src/util.h +++ b/src/util.h @@ -102,7 +102,7 @@ int regexp_match (char *pattern, char *string, int match_type); /* Error pipes */ void open_error_pipe (void); void check_error_pipe (void); -void close_error_pipe (int error, char *text); +int close_error_pipe (int error, char *text); /* Process spawning */ void my_putenv (char*, char*); diff --git a/src/utilunix.c b/src/utilunix.c index 29adb5455..acb38b293 100644 --- a/src/utilunix.c +++ b/src/utilunix.c @@ -396,7 +396,11 @@ void open_error_pipe (void) close (error_pipe[1]); } -void close_error_pipe (int error, char *text) +/* + * Returns true if an error was displayed + */ +int +close_error_pipe (int error, char *text) { char *title; char msg[MAX_PIPE_SIZE]; @@ -417,9 +421,9 @@ void close_error_pipe (int error, char *text) close (error_pipe[0]); } if (error < 0) - return; /* Just ignore error message */ + return 0; /* Just ignore error message */ if (text == NULL){ - if (len == 0) return; /* Nothing to show */ + if (len == 0) return 0; /* Nothing to show */ /* Show message from pipe */ message (error, title, msg); @@ -427,6 +431,7 @@ void close_error_pipe (int error, char *text) /* Show given text and possible message from pipe */ message (error, title, " %s \n %s ", text, msg); } + return 1; } /* Checks for messages in the error pipe,