diff --git a/src/lang/cn.rs b/src/lang/cn.rs index c91e9cb84..ec30ee83d 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -62,7 +62,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Login Error", "登录错误"), ("Successful", "成功"), ("Connected, waiting for image...", "已连接,等待画面传输..."), - ("Name", "文件名"), + ("Name", "名称"), ("Type", "类型"), ("Modified", "修改时间"), ("Size", "大小"), diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 161a6e010..897e4c187 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -62,7 +62,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Login Error", "Eraro de konektado"), ("Successful", "Sukceso"), ("Connected, waiting for image...", "Konektita, atendante bildon..."), - ("Name", "Nomo de dosiero"), + ("Name", "Nomo"), ("Type", ""), ("Modified", "Modifita"), ("Size", "Grandeco"), diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 0551e2d9e..028853909 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -62,7 +62,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Login Error", "Erreur de connexion"), ("Successful", "Succès"), ("Connected, waiting for image...", "Connecté, en attente de transmission d'image..."), - ("Name", "Nom du fichier"), + ("Name", "Nom"), ("Type", "Taper"), ("Modified", "Modifié"), ("Size", "Taille"), diff --git a/src/ui/file_transfer.tis b/src/ui/file_transfer.tis index 0223e6d87..d66a8688e 100644 --- a/src/ui/file_transfer.tis +++ b/src/ui/file_transfer.tis @@ -120,7 +120,8 @@ class JobTable: Reactor.Component { is_remote: is_remote }); this.job_map[id] = this.jobs[this.jobs.length - 1]; handler.send_files(id, path, to, show_hidden, is_remote); - this.update(); + var self = this; + self.timer(30ms, function() { self.update(); }); } function addDelDir(path, is_remote) { @@ -128,19 +129,70 @@ class JobTable: Reactor.Component { jobIdCounter += 1; this.jobs.push({ type: "del-dir", id: id, path: path, is_remote: is_remote }); this.job_map[id] = this.jobs[this.jobs.length - 1]; - handler.remove_dir_all(id, path, is_remote); + this.update(); + } + + function addDelFile(path, is_remote) { + var id = jobIdCounter; + jobIdCounter += 1; + this.jobs.push({ type: "del-file", id: id, path: path, is_remote: is_remote }); + this.job_map[id] = this.jobs[this.jobs.length - 1]; + this.update(); + } + + function confirmDeletePolling(is_remote) { + for(var i=0;i \
" + translate('Are you sure you want to delete this file?') + "
\ " + path + " \ ", function(res=null) { - if (res) { - handler.remove_file(jobIdCounter, path, 0, is_remote); + if (!res) { + file_transfer.job_table.updateJobStatus(id, -1, "cancel"); + file_transfer.job_table.cancelDeletePolling(); + } else if (res.skip) { + file_transfer.job_table.updateJobStatus(id, -1, "cancel"); + file_transfer.job_table.confirmDeletePolling(is_remote); + } else { + handler.remove_file(id, path, 0, is_remote); if (is_remote) file_transfer.remote_folder_view.table.resetCurrent(); else file_transfer.local_folder_view.table.resetCurrent(); - deleting_single_file_jobs[jobIdCounter] = { is_remote: is_remote, path: path }; - jobIdCounter += 1; + deleting_single_file_jobs[id] = { is_remote: is_remote, path: path }; + file_transfer.job_table.confirmDeletePolling(is_remote); } }); } @@ -626,19 +689,30 @@ handler.confirmDeleteFiles = function(id, i, name) { msgbox("custom-skip", "Confirm Delete", "
\
" + translate('Deleting') + " #" + (i + 1) + " / " + n + " " + translate('files') + ".
\
" + translate('Are you sure you want to delete this file?') + "
\ - " + name + "
\ + " + file_path + " \
" + translate('Do this for all conflicts') + "
\ ", function(res=null) { if (!res) { jt.updateJobStatus(id, i - 1, "cancel"); + file_transfer.job_table.cancelDeletePolling(); } else if (res.skip) { - if (res.remember) jt.updateJobStatus(id, i, "cancel"); - else handler.jobDone(id, i); + if (res.remember){ + jt.updateJobStatus(id, i, "cancel"); + } else{ + handler.jobDone(id, i); + } + file_transfer.job_table.confirmDeletePolling(job.is_remote); } else { job.no_confirm = res.remember; - if (job.no_confirm) handler.set_no_confirm(id); + if (job.no_confirm){ + handler.set_no_confirm(id); + file_transfer.job_table.confirmDeletePolling(job.is_remote); + } handler.remove_file(id, file_path, i, job.is_remote); } + if(i+1 >= n){ + file_transfer.job_table.confirmDeletePolling(job.is_remote); + } }); } diff --git a/src/ui/grid.tis b/src/ui/grid.tis index 82d385746..6560521ca 100644 --- a/src/ui/grid.tis +++ b/src/ui/grid.tis @@ -45,11 +45,11 @@ class Grid: Behavior { } function resetCurrent() { - var prev = this.getCurrentRow(); - if (prev) - { - prev.state.current = false; // drop state flag - prev.state.checked = false; // drop state flag + var rows = this.getCurrentRows(); + for (var i = 0; i < rows.length; ++i) { + var row = rows[i]; + row.state.current = false; + row.state.checked = false; } } diff --git a/src/ui/msgbox.tis b/src/ui/msgbox.tis index 98ba8e970..5662b1891 100644 --- a/src/ui/msgbox.tis +++ b/src/ui/msgbox.tis @@ -145,6 +145,7 @@ class MsgboxComponent: Reactor.Component { var values = this.getValues(); values.skip = true; if (this.callback) this.callback(values); + if (this.close) this.close(); } event click $(button#submit) { @@ -164,7 +165,7 @@ class MsgboxComponent: Reactor.Component { var self = this; var err = this.callback(values, function(a=1, b='') { self.show_progress(a, b); }); if (!err) { - this.close(); + if (this.close) this.close(); return; } if (err && err.trim()) this.show_progress(false, err);