From e7d91227055ce4f15477dc60c4d54a844928878d Mon Sep 17 00:00:00 2001 From: pcanterino <> Date: Mon, 10 Nov 2003 18:27:59 +0000 Subject: [PATCH] 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. --- modules/Command.pm | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) 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"; } -- 2.34.1