From: pcanterino <> Date: Mon, 10 Nov 2003 18:27:59 +0000 (+0000) Subject: In directory listing, when a file cannot be viewed or edited, a tool tip on the ... X-Git-Tag: version_1_1 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/e7d91227055ce4f15477dc60c4d54a844928878d In directory listing, when a file cannot be viewed or edited, a tool tip on the "View" or "Edit" link will show the reason why it is so. --- diff --git a/modules/Command.pm b/modules/Command.pm index 44419ba..0a368e9 100644 --- a/modules/Command.pm +++ b/modules/Command.pm @@ -6,7 +6,7 @@ package Command; # Execute Dev-Editor's commands # # Author: Patrick Canterino -# Last modified: 2003-10-30 +# Last modified: 2003-11-10 # use strict; @@ -120,19 +120,47 @@ sub exec_show($$$) $output .= $stat[7]; $output .= " "; $output .= strftime($config->{'timeformat'},localtime($stat[9])); - $output .= ($in_use) ? " (IN USE) " : (not -T $phys_path) ? " (BINARY) " : " " x 10; + $output .= " " x 10; $output .= encode_entities($file); $output .= " " x ($max_name_len - length($file))."\t ("; - $output .= (-r $phys_path && -T $phys_path) - ? "View" - : 'View'; + # Link "View" + + if(-r $phys_path && -T $phys_path) + { + $output .= "View"; + } + else + { + $output .= 'Edit" - : 'Edit'; + # Link "Edit" + + if(-w $phys_path && -r $phys_path && -T $phys_path && not $in_use) + { + $output .= "Edit"; + } + else + { + $output .= 'Do other stuff)\n"; }