Do not popup a window if it fails to mount the device.

Reported by Tim Janik.

Miguel.
This commit is contained in:
Miguel de Icaza 1999-03-18 18:43:52 +00:00
parent 79846ffaab
commit 256467b407
6 changed files with 29 additions and 10 deletions

View File

@ -1,3 +1,8 @@
1999-03-18 Miguel de Icaza <miguel@nuclecu.unam.mx>
* 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 <mc@bat.ru>
* gnome-open-dialog.c (read_directory): s/basename/x_basename/g

View File

@ -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;

View File

@ -1,3 +1,9 @@
1999-03-18 Miguel de Icaza <miguel@nuclecu.unam.mx>
* 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 <mc@bat.ru>
* panel.h, screen.c: Add an ability to center justify fields in

View File

@ -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

View File

@ -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*);

View File

@ -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,