From 1b11c7959bf711db4cf2c4503faf55ab81b30730 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Wed, 2 May 2012 17:41:23 +0000 Subject: [PATCH] fix dustbin delete of same-named file, remove toggle ENC option git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@991 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- var/mongoose/cgi-bin/browse/assets.jim | 1 - var/mongoose/cgi-bin/browse/browse.js | 30 +++++++++++++------------- var/mongoose/cgi-bin/browse/delete.jim | 8 +++++-- var/mongoose/lib/ts.class | 5 ++++- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index 17f2021..62fe80a 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 0.9.7 +Version: 0.9.7-1 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.0.1),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73),jim-cgi(>=0.5),service-control(>=1.2),busybox(>=1.19.3-1),lsof,epg(>=1.0.9),hmt(>=1.1.6),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts diff --git a/var/mongoose/cgi-bin/browse/assets.jim b/var/mongoose/cgi-bin/browse/assets.jim index d73abda..33aec3a 100755 --- a/var/mongoose/cgi-bin/browse/assets.jim +++ b/var/mongoose/cgi-bin/browse/assets.jim @@ -30,7 +30,6 @@ if $nicesplice { } puts {
  • Toggle Lock
  • -
  • Toggle Enc
  • Toggle New
  • diff --git a/var/mongoose/cgi-bin/browse/browse.js b/var/mongoose/cgi-bin/browse/browse.js index 75beeb8..43873c4 100755 --- a/var/mongoose/cgi-bin/browse/browse.js +++ b/var/mongoose/cgi-bin/browse/browse.js @@ -202,16 +202,16 @@ function preparemenu(el, menu) { if (el.attr('type') == 'ts') { - if (el.attr('def') == 'HD') - { - $(menu).enableContextMenuItems('#enc'); - if (el.attr('encd') == 1) - $(menu).changeContextMenuItem('#enc', - 'Remove Enc'); - else - $(menu).changeContextMenuItem('#enc', - 'Set Enc'); - } +// if (el.attr('def') == 'HD') +// { +// $(menu).enableContextMenuItems('#enc'); +// if (el.attr('encd') == 1) +// $(menu).changeContextMenuItem('#enc', +// 'Remove Enc'); +// else +// $(menu).changeContextMenuItem('#enc', +// 'Set Enc'); +// } if (el.attr('bx') > 0) $(menu).enableContextMenuItems('#crop'); @@ -262,7 +262,7 @@ function preparemenu(el, menu) { $(menu).enableContextMenuItems('#delete'); $(menu).disableContextMenuItems('#lock'); - $(menu).disableContextMenuItems('#enc'); + //$(menu).disableContextMenuItems('#enc'); $(menu).disableContextMenuItems('#new'); $(menu).disableContextMenuItems('#decrypt'); $(menu).disableContextMenuItems('#audio'); @@ -319,10 +319,10 @@ var menuclick = function(action, el, pos) file, type, id); break; - case 'enc': - confirm_action('change the ENC flag on', enc_callback, - file, type, id); - break; +// case 'enc': +// confirm_action('change the ENC flag on', enc_callback, +// file, type, id); +// break; case 'new': confirm_action('change the New flag on', new_callback, diff --git a/var/mongoose/cgi-bin/browse/delete.jim b/var/mongoose/cgi-bin/browse/delete.jim index e1af184..c62f74f 100755 --- a/var/mongoose/cgi-bin/browse/delete.jim +++ b/var/mongoose/cgi-bin/browse/delete.jim @@ -56,7 +56,11 @@ foreach file [cgi_get files] { puts -nonewline "Directory..." if {$ldustbin ne ""} { set ndir "[bindir $file]/[file tail $file]" - while {[file isdirectory $ndir]} { append ndir "_" } + if {$force} { + while {[file isdirectory $ndir]} { + append ndir "_" + } + } file rename $file $ndir touch $ndir } else { @@ -70,7 +74,7 @@ foreach file [cgi_get files] { # Check TS validity if {![catch {$ts get file}]} { if {$ldustbin ne ""} { - $ts move [bindir $file] 1 + $ts move [bindir $file] 1 1 } else { if {[$ts delete]} { puts "Successfully deleted $file." diff --git a/var/mongoose/lib/ts.class b/var/mongoose/lib/ts.class index 1bc954e..5a2110d 100644 --- a/var/mongoose/lib/ts.class +++ b/var/mongoose/lib/ts.class @@ -132,11 +132,14 @@ ts method delete {} { return 1 } -ts method move {dst {touch 0}} { +ts method move {dst {touch 0} {force 0}} { set root [file rootname $file] regsub -all {([\\["$])} $root {\\\1} root foreach f [glob -nocomplain "${root}.*"] { set nf "$dst/[file tail $f]" + while {[file exists $nf]} { + set nf "$dst/_[file tail $nf]" + } file rename $f $nf if {$touch} { exec /mod/bin/busybox/touch $nf