@@ -283,9 +283,19 @@ const vfsActionFactory = (core, proc, win, dialog, state) => {
283283 return [ ] ;
284284 } ;
285285
286- const writeRelative = f => vfs . writefile ( {
287- path : pathJoin ( state . currentPath . path , f . name )
288- } , f , { pid : proc . pid } ) ;
286+ const writeRelative = f => {
287+ const d = dialog ( 'progress' , f ) ;
288+
289+ return vfs . writefile ( {
290+ path : pathJoin ( state . currentPath . path , f . name )
291+ } , f , {
292+ pid : proc . pid ,
293+ onProgress : ( ev , p ) => d . setProgress ( p )
294+ } ) . then ( ( result ) => {
295+ d . destroy ( ) ;
296+ return result ;
297+ } ) ;
298+ } ;
289299
290300 const uploadBrowserFiles = ( files ) => {
291301 Promise . all ( files . map ( writeRelative ) )
@@ -436,6 +446,11 @@ const dialogFactory = (core, proc, win) => {
436446 action ( ( ) => vfs . unlink ( file , { pid : proc . pid } ) , true , __ ( 'MSG_DELETE_ERROR' ) ) ;
437447 } ) ) ;
438448
449+ const progressDialog = ( file ) => dialog ( 'progress' , {
450+ message : __ ( 'DIALOG_PROGRESS_MESSAGE' , file . name ) ,
451+ buttons : [ ]
452+ } , ( ) => { } ) ;
453+
439454 const errorDialog = ( error , message ) => dialog ( 'alert' , {
440455 type : 'error' ,
441456 error,
@@ -446,12 +461,13 @@ const dialogFactory = (core, proc, win) => {
446461 mkdir : mkdirDialog ,
447462 rename : renameDialog ,
448463 delete : deleteDialog ,
464+ progress : progressDialog ,
449465 error : errorDialog
450466 } ;
451467
452468 return ( name , ...args ) => {
453469 if ( dialogs [ name ] ) {
454- dialogs [ name ] ( ...args ) ;
470+ return dialogs [ name ] ( ...args ) ;
455471 } else {
456472 throw new Error ( `Invalid dialog: ${ name } ` ) ;
457473 }
0 commit comments