Fix confirmation box when dragging a file on unsaved image.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1571 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2010-08-13 19:45:25 +00:00
parent c83cd8c339
commit bd20d85cc9

View File

@ -662,14 +662,14 @@ void Main_handler(void)
else if (Drop_file_name) else if (Drop_file_name)
{ {
// A file was dragged into Grafx2's window // A file was dragged into Grafx2's window
Upload_infos_page_main(Main_backups->Pages);
if ( (!Main_image_is_modified) || Confirmation_box("Discard unsaved changes ?") ) if ( (!Main_image_is_modified) || Confirmation_box("Discard unsaved changes ?") )
{ {
T_IO_Context context; T_IO_Context context;
char* flimit; char* flimit;
byte old_cursor_shape; byte old_cursor_shape;
Upload_infos_page_main(Main_backups->Pages);
flimit = Find_last_slash(Drop_file_name); flimit = Find_last_slash(Drop_file_name);
*(flimit++) = '\0'; *(flimit++) = '\0';
@ -680,18 +680,30 @@ void Main_handler(void)
Init_context_layered_image(&context, flimit, Drop_file_name); Init_context_layered_image(&context, flimit, Drop_file_name);
Load_image(&context); Load_image(&context);
Destroy_context(&context); if (File_error!=1)
{
Compute_limits();
Compute_paintbrush_coordinates();
Redraw_layered_image(); Redraw_layered_image();
Hide_cursor();
Cursor_shape=old_cursor_shape;
Display_cursor();
End_of_modification(); End_of_modification();
Display_all_screen(); Display_all_screen();
Main_image_is_modified=0;
}
Destroy_context(&context);
Compute_optimal_menu_colors(Main_palette);
Display_menu();
if (Config.Display_image_limits)
Display_image_limits();
Hide_cursor();
Cursor_shape=old_cursor_shape;
Display_all_screen();
Display_cursor();
}
free(Drop_file_name); free(Drop_file_name);
Drop_file_name=NULL; Drop_file_name=NULL;
} }
}
if(Get_input()) if(Get_input())
{ {