mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
Do not popup a window if it fails to mount the device.
Reported by Tim Janik. Miguel.
This commit is contained in:
parent
79846ffaab
commit
256467b407
@ -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>
|
Thu Mar 18 14:59:12 1999 Timur Bakeyev <mc@bat.ru>
|
||||||
|
|
||||||
* gnome-open-dialog.c (read_directory): s/basename/x_basename/g
|
* gnome-open-dialog.c (read_directory): s/basename/x_basename/g
|
||||||
|
@ -1003,20 +1003,21 @@ do_mount_umount (char *filename, gboolean is_mount)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (op){
|
if (op){
|
||||||
|
gboolean success = TRUE;
|
||||||
char *command;
|
char *command;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
command = g_strconcat (op, " ", buffer, NULL);
|
command = g_strconcat (op, " ", buffer, NULL);
|
||||||
open_error_pipe ();
|
open_error_pipe ();
|
||||||
f = popen (command, "r");
|
f = popen (command, "r");
|
||||||
if (f == NULL)
|
if (f == NULL){
|
||||||
close_error_pipe (1, _("While running the mount/umount command"));
|
success = !close_error_pipe (1, _("While running the mount/umount command"));
|
||||||
else
|
} else
|
||||||
close_error_pipe (0, 0);
|
success = !close_error_pipe (0, 0);
|
||||||
pclose (f);
|
pclose (f);
|
||||||
|
|
||||||
g_free (buffer);
|
g_free (buffer);
|
||||||
return TRUE;
|
return success;
|
||||||
}
|
}
|
||||||
g_free (buffer);
|
g_free (buffer);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1140,6 +1141,8 @@ desktop_icon_info_open (DesktopIconInfo *dii)
|
|||||||
if (!is_mounted){
|
if (!is_mounted){
|
||||||
if (try_to_mount (filename, fe))
|
if (try_to_mount (filename, fe))
|
||||||
launch = TRUE;
|
launch = TRUE;
|
||||||
|
else
|
||||||
|
launch = FALSE;
|
||||||
} else
|
} else
|
||||||
launch = TRUE;
|
launch = TRUE;
|
||||||
|
|
||||||
|
@ -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>
|
Thu Mar 18 16:09:09 1999 Timur Bakeyev <mc@bat.ru>
|
||||||
|
|
||||||
* panel.h, screen.c: Add an ability to center justify fields in
|
* panel.h, screen.c: Add an ability to center justify fields in
|
||||||
|
@ -2751,7 +2751,7 @@ handle_args (int argc, char *argv [])
|
|||||||
gtk_widget_push_visual (gdk_imlib_get_visual ());
|
gtk_widget_push_visual (gdk_imlib_get_visual ());
|
||||||
gtk_widget_push_colormap (gdk_imlib_get_colormap ());
|
gtk_widget_push_colormap (gdk_imlib_get_colormap ());
|
||||||
|
|
||||||
poptResetContext (ctx);
|
/* poptResetContext (ctx); */
|
||||||
#else
|
#else
|
||||||
ctx = poptGetContext ("mc", argc, argv, argument_table, 0);
|
ctx = poptGetContext ("mc", argc, argv, argument_table, 0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -102,7 +102,7 @@ int regexp_match (char *pattern, char *string, int match_type);
|
|||||||
/* Error pipes */
|
/* Error pipes */
|
||||||
void open_error_pipe (void);
|
void open_error_pipe (void);
|
||||||
void check_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 */
|
/* Process spawning */
|
||||||
void my_putenv (char*, char*);
|
void my_putenv (char*, char*);
|
||||||
|
@ -396,7 +396,11 @@ void open_error_pipe (void)
|
|||||||
close (error_pipe[1]);
|
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 *title;
|
||||||
char msg[MAX_PIPE_SIZE];
|
char msg[MAX_PIPE_SIZE];
|
||||||
@ -417,9 +421,9 @@ void close_error_pipe (int error, char *text)
|
|||||||
close (error_pipe[0]);
|
close (error_pipe[0]);
|
||||||
}
|
}
|
||||||
if (error < 0)
|
if (error < 0)
|
||||||
return; /* Just ignore error message */
|
return 0; /* Just ignore error message */
|
||||||
if (text == NULL){
|
if (text == NULL){
|
||||||
if (len == 0) return; /* Nothing to show */
|
if (len == 0) return 0; /* Nothing to show */
|
||||||
|
|
||||||
/* Show message from pipe */
|
/* Show message from pipe */
|
||||||
message (error, title, msg);
|
message (error, title, msg);
|
||||||
@ -427,6 +431,7 @@ void close_error_pipe (int error, char *text)
|
|||||||
/* Show given text and possible message from pipe */
|
/* Show given text and possible message from pipe */
|
||||||
message (error, title, " %s \n %s ", text, msg);
|
message (error, title, " %s \n %s ", text, msg);
|
||||||
}
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks for messages in the error pipe,
|
/* Checks for messages in the error pipe,
|
||||||
|
Loading…
Reference in New Issue
Block a user