Browse Source

Thu Dec 24 18:30:53 1998 Norbert Warmuth <nwarmuth@privat.circular.de>

* configure.in: Deleted du checks

* INSTALL: Deleted --with-dusum documentation.

* doc/mc.sgml, mc.1.in: Completed documentation about the Options/
Configuration dialog. Added Advanced chown subsection. Deleted
variables from the Special settings section which are now covered
by the configuration dialog.

* gnome/layout: Adapted for the new option Compute Totals in the
Configuration dialog.

* screen.c (recalculate_panel_summary): new function which recalculates
the summary information for the mini-status.

* screen.c (panel_reload): use recalculate_panel_summary

* screen.c (do_file_mark): Honour that dirsizes computed is now a
per entry flag.

* option.c: Added Compute Totals to the configuration dialog.

* file.c (compute_dir_size): made non static

(panel_operate_flags): Don't compute directory sizes if verbose
operation are off.

* cmd.c (dirsizes_cmd): Rewritten to use compute_dir_size as suggested
by Miguel, i.e. get rid of du. Now the dirsizes_cmd honours a
selection and computes sizes only for marked directories. Possible
improvement: add a dialog (or C-C?) to abort computation.

* dir.h (file_entry), panel.h (WPanel): Made the dirsizes computed
flag a per file flag.

* dir.c, find.c, panelize.c, screen.c: Adapted to new file_entry and
WPanel structure.

* features.inc: Deleted DUSUM information

* mc.hlp: remade because of changes in doc/mc.1.in
Norbert Warmuth 26 years ago
parent
commit
23cc8d469c
10 changed files with 275 additions and 274 deletions
  1. 11 0
      ChangeLog
  2. 0 5
      INSTALL
  3. 0 11
      acconfig.h
  4. 0 33
      configure.in
  5. 109 66
      doc/mc.1.in
  6. 74 49
      doc/mc.sgml
  7. 5 0
      gnome/ChangeLog
  8. 21 17
      gnome/layout
  9. 36 0
      src/ChangeLog
  10. 19 93
      src/cmd.c

+ 11 - 0
ChangeLog

@@ -1,3 +1,14 @@
+Thu Dec 24 18:30:53 1998  Norbert Warmuth  <nwarmuth@privat.circular.de>
+
+	* configure.in: Deleted du checks
+
+	* INSTALL: Deleted --with-dusum documentation.
+
+	* doc/mc.sgml, mc.1.in: Completed documentation about the Options/
+	Configuration dialog. Added Advanced chown subsection. Deleted
+	variables from the Special settings section which are now covered
+	by the configuration dialog.
+
 Mon Dec 21 22:26:34 1998  Norbert Warmuth  <nwarmuth@privat.circular.de>
 
 	* doc/mc.sgml, mc.1.in: Deleted obsolete information about

+ 0 - 5
INSTALL

@@ -162,11 +162,6 @@ installed the gpm package.
      Default is somewhere in your XView binaries directory,
      $OPENWINHOME/bin.
 
-`--without-dusum'
-     This option disables a feature of the Midnight Commander, which is
-     forking the du command with the -s option when you want to calculate
-     directory sizes.
-
 `--without-vfs'
      This option disables the Virtual File System switch code in the
      Midnight Commander and uses the standard file system calls for

+ 0 - 11
acconfig.h

@@ -129,17 +129,6 @@
  */
 #undef NEED_EXTRA_DIRENT_BUFFER
 
-/* Define if you want the du -s summary */
-#undef HAVE_DUSUM
-
-/* Define if your du does handle -b correctly */
-#undef DUSUM_USEB
-
-/* Define to size of chunks du is displaying its information.
- * If DUSUM_USEB is defined, this should be 1
- */
-#define DUSUM_FACTOR 512
-
 /* Define this one if you want termnet support */
 #undef USE_TERMNET
 

+ 0 - 33
configure.in

@@ -634,39 +634,6 @@ if test x$ac_cv_grep_stdin = xyes; then
 fi
 AC_MSG_RESULT($ac_cv_grep_stdin)
 
-
-dnl
-dnl HAVE_DUSUM is on by default, only if you have a strange du, you can
-dnl turn it off by --without-dusum
-dnl
-have_dusum=yes
-AC_MSG_CHECKING(for du arguments)
-AC_ARG_WITH(dusum, 
-	[--with-dusum               Support the du -s summaries],[
-	if test x$withval = xno; then
-		have_dusum=no
-	fi
-])
-if test x$have_dusum = xyes; then
-    AC_DEFINE(HAVE_DUSUM)
-    AC_CACHE_VAL(ac_cv_dusum, [
-    du -s -b $srcdir/configure >/dev/null 2>&1
-    if test $? = 0; then
-        ac_cv_dusum='dusum_useb=yes; dusum_factor=1'
-    else
-	ac_cv_dusum='dusum_useb=; dusum_factor=512'
-    fi
-])
-    eval "$ac_cv_dusum"
-    if test x$dusum_useb = xyes; then
-	AC_DEFINE(DUSUM_USEB)
-	AC_MSG_RESULT(-b)
-    else
-	AC_MSG_RESULT(block size $dusum_factor)
-    fi
-    AC_DEFINE_UNQUOTED(DUSUM_FACTOR, $dusum_factor)
-fi
-
 dnl
 dnl The termnet support
 dnl

+ 109 - 66
doc/mc.1.in

@@ -1451,6 +1451,10 @@ Comments are started with '#'. The additional comment lines must start
 with '#', space or tab.
 .PP
 .SH "  Options Menu"
+The Midnight Commander has some options that may be toggled on and
+off in several dialogs which are accessible from this menue. Options 
+are enabled if they have an asterisk or "x" in front of them. 
+.PP
 The
 .\"LINK2"
 Configuration
@@ -1500,19 +1504,8 @@ command saves the current settings of the Left, Right and Options
 menus. A small number of other settings is saved, too.
 .PP
 .SH "    Configuration"
-The program has some options that may be toggled on and off from the
-Configuration dialog. Options are enabled if they have an asterisk or
-"x" in front of them. These options are divided into three groups:
-Screen Colors, Panel Options and Other Options.
-.PP
-.B Screen Colors
-.PP
-You can select whether your display supports color or not. Normally
-this information is in the terminfo database. If you want to know
-how to change individual colors see the section on
-.\"LINK2"
-Colors.
-.\"Colors"
+The options in this dialog are divided into three groups:
+Panel Options, Pause after run and Other Options.
 .PP
 .B Panel Options
 .PP
@@ -1528,9 +1521,13 @@ a dot (like ls -a).
 By default when you mark a file (with either C-t or the Insert key)
 the selection bar will move down.
 .PP
-.I Show Mini-Status.
-If enabled, show one line of status information at the bottom of
-the panels about the currently selected item.
+.I Drop down menues.
+When this option is enabled, when you press the 
+.B F9
+key, the pull down menus will be activated, else, you will
+only be presented with the menu title, and you will have
+to select the entry with the arrow keys or the first
+letter and from there select your option in the menu.
 .PP
 .I Mix all files.
 When this option is enabled, all files and directories are shown mixed
@@ -1547,16 +1544,8 @@ i-node for a file in the directory (file size changes, mode or owner
 changes, etc) the display is not updated. In these cases, if you have
 the option on, you have to rescan the directory manually (with C-r).
 .PP
-.B Other Options
-.PP
-.I Verbose operation.
-This toggles whether the file Copy, Rename and Delete operations are
-verbose (i.e., display a dialog box for each operation). If you have a
-slow terminal, you may wish to disable the verbose operation. It is
-automatically turned off if the speed of your terminal is less than
-9600 bps.
+.B Pause after run
 .PP
-.I Pause after run.
 After executing your commands, the Midnight Commander can pause, so
 that you can examine the output of the command.  There are three
 possible settings for this variable:
@@ -1574,6 +1563,24 @@ not an xterm or the Linux console).
 .I Always
 The program will pause after executing all of your commands.
 .PP
+.B Other Options
+.PP
+.I Verbose operation.
+This toggles whether the file Copy, Rename and Delete operations are
+verbose (i.e., display a dialog box for each operation). If you have a
+slow terminal, you may wish to disable the verbose operation. It is
+automatically turned off if the speed of your terminal is less than
+9600 bps.
+.PP
+.I Compute totals.
+If this option is enabled, the Midnight
+Commander computes total byte sizes and total number of files
+prior to any Copy, Rename and Delete operations. This will
+provide you with a more accurate progress bar at the expense
+of some speed. This option has no effect, if 
+.I Verbose operation
+is disabled.
+.PP
 .I Shell Patterns.
 By default the Select, Unselect and Filter commands will use shell-like
 regular expressions. The following conversions are performed to achieve
@@ -1615,9 +1622,47 @@ command is used.  See the section on the
 internal file viewer.
 .\"Internal File Viewer"
 .PP
-.I Confirm Delete.
-This option is toggled on by default, and will cause the Midnight
-Commander to ask for confirmation when deleting a single file. 
+.I Complete: show all.
+By default the Midnight Commander
+pops up all possible 
+.\"LINK2"
+completions
+.\"Completion"
+if the completion is
+ambiguous if you press 
+.B M-Tab
+for the second time, for the
+first time it just completes as much as possible and in
+the case of ambiguity beeps. If you want to see all the
+possible completions already after the first
+.B M-Tab
+pressing, enable this option.
+.PP
+.I Rotating dash.
+If this option is enabled, the 
+Midnight Commander shows a rotating dash in the upper right corner
+as a work in progress indicator.
+.PP
+.I Lynx-like motion.
+If this option is enabled, 
+you may use the arrows keys to automatically chdir if the
+current selection is a subdirectory and the shell command
+line is empty. By default, this setting is off.
+.PP
+.I Advanced chown.
+If this option is enabled, the 
+.\"LINK2"
+Advanced Chown
+.\"Advanced Chown"
+command will be invoked if you run the 
+.\"LINK2"
+Chmod
+.\"Chmod"
+ or 
+.\"LINK2"
+Chown
+.\"Chown"
+command.
 .PP
 .I Cd follows links.
 This option, if set, causes the Midnight Commander to follow the
@@ -1628,6 +1673,16 @@ real directory structure, so cd .. if you've entered that directory
 through a link will move you to the current directory's real parent
 and not to the directory where the link was present.
 .PP
+.I Safe delete.
+If this option is enabled, deleting files 
+unintentionally will get more difficult. The default
+selection in the confirmation dialog changes from the "Yes"
+to the "No" button and deletion of non empty direcories has to be 
+confirmed by entering the word 
+.I yes
+\&. 
+By default this option is disabled.
+.PP
 .SH "    Display bits"
 This is used to configure the range of visible characters on the
 screen.  This setting may be 7-bits if your terminal/curses supports
@@ -1745,6 +1800,12 @@ can specify whether the area is split to the panels in vertical or
 horizontal direction. The split can be equal or you can specify an
 unequal split.
 .PP
+If the 
+.I Show Mini-Status
+option is enabled, one line of status
+information about the currently selected item is showed at the bottom 
+of the panels.
+.PP
 .SH "    Save Setup"
 At startup the Midnight Commander will try to load initialization
 information from the ~/.mc/ini file. If this file doesn't exist,
@@ -2053,6 +2114,18 @@ cancel the Chmod command
 The Chown command is used to change the owner/group of a file. The hot
 key for this command is C-x o.
 .PP
+.SH "Advanced Chown"
+The Advanced Chown command is the 
+.\"LINK2"
+Chmod
+.\"Chmod"
+and 
+.\"LINK2"
+Chown
+.\"Chown"
+command combined into one window. You can change the permissions and 
+owner/group of files at once.
+.PP
 .SH "File Operations"
 When you copy, move or delete files the Midnight Commander shows the
 file operations dialog. It shows the files currently being operated on
@@ -2431,10 +2504,12 @@ Filename, username, variable and hostname completion works on all input
 lines, command completion is command line specific.
 If the completion is ambiguous (there are more different possibilities),
 MC beeps and the following action depends on the setting of the
+.I Complete: show all
+option in the
 .\"LINK2"
-show_all_if_ambiguous
-.\"Special Settings"
-variable in the Initialization file. If it is nonzero, a list of all
+Configuration
+.\"Configuration">
+dialog. If it is enabled, a list of all
 possibilities pops up next to the current position and you can select with
 the arrow keys and
 .B Enter
@@ -2450,9 +2525,9 @@ canceling keys
 .B F10
 and left and right arrow keys. If
 .\"LINK2"
-show_all_if_ambiguous
-.\"Special Settings"
-is set to zero, the dialog pops up only if you press
+Complete: show all
+.\"Configuration"
+is disabled, the dialog pops up only if you press
 .B M-Tab
 for the second time, for the first time MC just beeps.
 .PP
@@ -2811,13 +2886,6 @@ If you press F3 on a directory, normally MC enters that directory. If
 this flag is set to 1, then MC will ask for confirmation before
 changing the directory if you have files tagged.
 .PP
-.I drop_menus.
-.IP
-If this variable is set, when you press the F9 key, the pull down
-menus will be activated, else, you will only be presented with the
-menu title, and you will have to select the entry with the arrow keys
-or the first letter and from there select your option in the menu.
-.PP
 .I ftpfs_retry_seconds.
 .IP
 This value is the number of seconds the Midnight Commander will wait
@@ -2854,17 +2922,6 @@ line on the panels.
 Controls if scrolling with the mouse is done by pages or line by line
 on the internal file viewer.
 .PP
-.I navigate_with_arrows.
-.IP
-If this setting is turned on, then you may use the arrows keys to
-automatically chdir if the current selection is a subdirectory and
-the shell command line is empty.  By default, this setting is off.
-.PP
-.I nice_rotating_dash
-.IP
-When on, this flag causes the commander to show a rotating dash as a
-work in progress indicator.
-.PP
 .I old_esc_mode
 .IP
 By default the Midnight Commander treats the ESC key as a key prefix
@@ -2899,20 +2956,6 @@ When you use the C-o keystroke to go back to the user screen, if this
 one is set, you will get a fresh shell.  Otherwise, pressing any key
 will bring you back to the Midnight Commander.
 .PP
-.I show_all_if_ambiguous.
-.IP
-By default the Midnight Commander pops up all possible
-.\"LINK2"
-completions
-.\"Completion"
-if the completion is ambiguous if you press
-.B M-Tab
-for the second time, for the first time it just completes as much as
-possible and in the case of ambiguity beeps. If you want to see all the
-possible completions already after the first
-.B M-Tab
-pressing, set this option to 1.
-.PP
 .I torben_fj_mode
 .IP
 If this flag is set, then the home and end keys will work slightly

+ 74 - 49
doc/mc.sgml

@@ -1182,6 +1182,10 @@ Comments are started with <tt/&num;/. The additional comment
 lines must start with <tt/&num;/, space or tab.
 
 <sect1>Options Menu<label id="Options Menu">
+<p>
+The Midnight Commander has some options that may be toggled on and
+off in several dialogs which are accessible from this menue. Options 
+are enabled if they have an asterisk or "x" in front of them. 
 
 <p>
 The <lnk name="Configuration" id="Configuration"> command pops up a dialog from which you
@@ -1211,16 +1215,8 @@ settings is saved, too.
 <sect2>Configuration<label id="Configuration">
 
 <p>
-The program has some options that may be toggled on and
-off from the Configuration dialog. Options are enabled if
-they have an asterisk or "x" in front of them. These
-options are divided into three groups: Screen Colors,
-Panel Options and Other Options.
-
-<bf/Screen Colors/ You can select whether your display supports color or not.
-Normally this information is in the terminfo database. If
-you want to know how to change individual colors see the
-section on <lnk name="Colors" id="Colors">.
+The options in this dialog are divided into three groups: Panel Options 
+Pause after run and Other Options.
 
 <bf/Panel Options/
 
@@ -1233,9 +1229,11 @@ show all files that start with a dot (like <tt/ls -a/).
 <tag/Mark moves down/ By default when you mark a file (with
 either <tt/C-t/ or the Insert key) the selection bar will move
 down.
-<tag/Show Mini-Status/ If enabled, show one line of status
-information at the bottom of the panels about the
-currently selected item.
+<tag/Drop down menues/ When this option is enabled, when you press the <tt/F9/
+key, the pull down menus will be activated, else, you will
+only be presented with the menu title, and you will have
+to select the entry with the arrow keys or the first
+letter and from there select your option in the menu.
 <tag/Mix all files/ When this option is enabled, all files and
 directories are shown mixed together. If the option is
 off, directories (and links to directories) are shown at
@@ -1253,16 +1251,9 @@ option on, you have to rescan the directory manually (with
 <tt/C-r/).
 </descrip>
 
-<bf/Other Options/
-
+<bf/Pause after run/
 <descrip>
-<tag/Verbose operation/ This toggles whether the file Copy,
-Rename and Delete operations are verbose (i.e. display a
-dialog box for each operation). If you have a slow
-terminal, you may wish to disable the verbose operation.
-It is automatically turned off if the speed of your
-terminal is less than 9600 bps.
-<tag/Pause after run/ After executing your commands, the
+After executing your commands, the
 Midnight Commander can pause, so that you can examine the
 output of the command. There are three possible settings
 for this variable: <em/Never/ Means that you do not want to see
@@ -1274,6 +1265,24 @@ showing the output of the last command executed (any
 terminal that is not an <bf/xterm/ or the Linux console).
 <em/Always/ The program will pause after executing all of your
 commands.
+</descrip>
+
+<bf/Other Options/
+
+<descrip>
+
+<tag/Verbose operation/ This toggles whether the file Copy,
+Rename and Delete operations are verbose (i.e. display a
+dialog box for each operation). If you have a slow
+terminal, you may wish to disable the verbose operation.
+It is automatically turned off if the speed of your
+terminal is less than 9600 bps.
+<tag/Compute totals/ If this option is enabled, the Midnight
+Commander computes total byte sizes and total number of files
+prior to any Copy, Rename and Delete operations. This will
+provide you with a more accurate progress bar at the expense
+of some speed. This option has no effect, if <em/Verbose operation/
+is disabled.
 <tag/Shell Patterns/ By default the Select, Unselect and Filter
 commands will use shell-like regular expressions. The
 following conversions are performed to achieve this: the
@@ -1299,9 +1308,24 @@ is disabled, the pager specified in the <tt/PAGER/ environment
 variable is used. If no pager is specified, the <bf/view/
 command is used. See the section on the <lnk name="internal file
 viewer" id="Internal File Viewer">.
-<tag/Confirm Delete/ This option is toggled on by default, and
-will cause the Midnight Commander to ask for confirmation
-when deleting a single file.
+<tag/Complete: show all/ By default the Midnight Commander
+pops up all possible <lnk name="completions" id="Completion"> if the completion is
+ambiguous if you press <tt/M-Tab/ for the second time, for the
+first time it just completes as much as possible and in
+the case of ambiguity beeps. If you want to see all the
+possible completions already after the first <tt/M-Tab/
+pressing, enable this option.
+<tag/Rotating dash/ If this option is enabled, the 
+Midnight Commander shows a rotating dash in the upper right corner
+as a work in progress indicator.
+<tag/Lynx-like motion/ If this option is enabled, 
+you may use the arrows keys to automatically chdir if the
+current selection is a subdirectory and the shell command
+line is empty. By default, this setting is off.
+<tag/Advanced chown/ If this option is enabled, the 
+<lnk name="Advanced Chown" id="Advanced Chown"> 
+command will be invoked if you run the 
+<lnk name="Chmod" id="Chmod"> or <lnk name="Chown" id="Chown"> command.
 <tag/Cd follows links/ This option, if set, causes the Midnight
 Commander to follow the logical chain of directories when
 changing current directory either in the panels, or using
@@ -1311,6 +1335,12 @@ directory structure, so <tt/cd ../ if you've entered that
 directory through a link will move you to the current
 directory's real parent and not to the directory where the
 link was present.
+<tag/Safe delete/ If this option is enabled, deleting files 
+unintentionally will get more difficult. The default
+selection in the confirmation dialog changes from the "Yes"
+to the "No" button and deletion of non empty direcories has to be 
+confirmed by entering the word <em/yes/. By default this
+option is disabled.
 </descrip>
 
 <sect2>Display bits<label id="Display bits">
@@ -1437,6 +1467,10 @@ panels. You can specify whether the area is split to the
 panels in vertical or horizontal direction. The split can
 be equal or you can specify an unequal split.
 
+If the <em/Show Mini-Status/ option is enabled, one line of status
+information about the currently selected item is showed at the bottom 
+of the panels.
+
 <sect2>Save Setup<label id="Save Setup">
 
 <p>
@@ -1691,6 +1725,15 @@ selected files
 The Chown command is used to change the owner/group of a
 file. The hot key for this command is <tt/C-x o/.
 
+<sect>Advanced Chown<label id="Advanced Chown">
+
+<p>
+The Advanced Chown command is the <lnk name="Chmod" id="Chmod">
+and <lnk name="Chown" id="Chown"> command combined into one
+window. You can change the permissions and owner/group of
+files at once.
+
+
 <sect>File Operations<label id="File Operations">
 
 <p>
@@ -2052,9 +2095,9 @@ Filename, username, variable and hostname completion works
 on all input lines, command completion is command line
 specific. If the completion is ambiguous (there are more
 different possibilities), MC beeps and the following
-action depends on the setting of the <em/show_all_if_ambiguous/
-<lnk name="variable" id="Special Settings">
-in the Initialization file. If it is nonzero, a
+action depends on the setting of the <em/Complete: show all/
+option in the <lnk name="Configuration" id="Configuration">
+dialog. If it is enabled, a
 list of all possibilities pops up next to the current
 position and you can select with the arrow keys and <tt/Enter/
 the correct entry. You can also type the first letters in
@@ -2065,8 +2108,9 @@ listbox, otherwise the first item which matches all the
 previous characters will be highlighted. As soon as there
 is no ambiguity, dialog disappears, but you can hide it by
 canceling keys <tt/Esc,/ <tt/F10/ and left and right arrow keys. If
-<em/show_all_if_ambiguous/
-<lnk name="variable" id="Special Settings"> is set to zero, the dialog pops up
+<em/Complete: show all/
+<lnk name="Configuration" id="Configuration"> is disabled, 
+the dialog pops up
 only if you press <tt/M-Tab/ for the second time, for the first
 time MC just beeps.
 
@@ -2390,12 +2434,6 @@ of the field clear_before_exec to 0.
 MC enters that directory. If this flag is set to 1, then
 MC will ask for confirmation before changing the directory
 if you have files tagged.
-<tag/drop_menus/ If this variable is set, when you press the <tt/F9/
-key, the pull down menus will be activated, else, you will
-only be presented with the menu title, and you will have
-to select the entry with the arrow keys or the first
-letter and from there select your option in the menu.
-
 <tag/ftpfs_retry_seconds/
 This value is the number of seconds the Midnight Commander will wait
 before attempting a reconnection to an ftp server that has denied the
@@ -2421,12 +2459,6 @@ mouse is done by pages or line by line on the panels.
 <tag/mouse_move_pages_viewer/ Controls if scrolling with the
 mouse is done by pages or line by line on the internal
 file viewer.
-<tag/navigate_with_arrows/ If this setting is turned on, then
-you may use the arrows keys to automatically chdir if the
-current selection is a subdirectory and the shell command
-line is empty. By default, this setting is off.
-<tag/nice_rotating_dash/ When on, this flag causes the commander
-to show a rotating dash as a work in progress indicator.
 <tag/old_esc_mode/ By default the Midnight Commander treats the
 <tt/ESC/ key as a key prefix (old_esc_mode=0), if you set this
 option (old_esc_mode=1), then the <tt/ESC/ key will act as a
@@ -2451,13 +2483,6 @@ This variable only works if you are not using the subshell support.
 When you use the C-o keystroke to go back to the user screen, if this
 one is set, you will get a fresh shell.  Otherwise, pressing any key
 will bring you back to the Midnight Commander.
-<tag/show_all_if_ambiguous/ By default the Midnight Commander
-pops up all possible <lnk name="completions" id="Completion"> if the completion is
-ambiguous if you press <tt/M-Tab/ for the second time, for the
-first time it just completes as much as possible and in
-the case of ambiguity beeps. If you want to see all the
-possible completions already after the first <tt/M-Tab/
-pressing, set this option to 1.
 <tag/torben_fj_mode/ If this flag is set, then the home and end
 keys will work slightly different on the panels, instead
 of moving the selection to the first and last files in the

+ 5 - 0
gnome/ChangeLog

@@ -1,3 +1,8 @@
+Thu Dec 24 18:38:45 1998  Norbert Warmuth  <nwarmuth@privat.circular.de>
+
+	* layout: Adapted for the new option Compute Totals in the
+	Configuration dialog.
+
 1998-12-22  Jonathan Blandford  <jrb@redhat.com>
 
 	* gdialogs.c (file_progress_query_replace_policy): new function.

+ 21 - 17
gnome/layout

@@ -136,19 +136,19 @@ flags=snew
 text=Directory path
 
 [option-Widget-button-ok]
-geometry=2,15,1,1
+geometry=2,16,1,1
 flags=
 
 [option-Widget-safe-del]
-geometry=5,13,1,1
+geometry=5,14,1,1
 flags=w
 
 [option-Widget-shell-patt]
-geometry=5,3,1,1
+geometry=5,4,1,1
 flags=w
 
 [option-Widget-auto-save]
-geometry=5,4,1,1
+geometry=5,5,1,1
 flags=w
 
 [option-Widget-drop-menus]
@@ -156,15 +156,15 @@ geometry=2,5,2,1
 flags=w
 
 [option-Widget-edit-int]
-geometry=5,6,1,1
+geometry=5,7,1,1
 flags=w
 
 [option-Widget-button-save]
-geometry=3,15,2,1
+geometry=3,16,2,1
 flags=ew
 
 [option-Widget-lynx]
-geometry=5,10,1,1
+geometry=5,11,1,1
 flags=w
 
 [option-Widget-fast-reload]
@@ -172,15 +172,15 @@ geometry=2,7,1,1
 flags=w
 
 [option-Widget-view-int]
-geometry=5,7,1,1
+geometry=5,8,1,1
 flags=w
 
 [option-Widget-completion]
-geometry=5,8,1,1
+geometry=5,9,1,1
 flags=w
 
 [option-Widget-achown]
-geometry=5,11,1,1
+geometry=5,12,1,1
 flags=w
 
 [option-Widget-show-hidden]
@@ -195,24 +195,28 @@ flags=w
 geometry=5,2,1,1
 flags=w
 
+[option-Widget-compute-totals]
+geometry=5,3,1,1
+flags=w
+
 [option-Widget-mix-files]
 geometry=2,6,2,1
 flags=w
 
 [option-Widget-auto-menus]
-geometry=5,5,1,1
+geometry=5,6,1,1
 flags=w
 
 [option-Widget-button-cancel]
-geometry=5,15,1,1
+geometry=5,16,1,1
 flags=
 
 [option-Widget-dummy]
-geometry=5,9,1,1
-flags=
+geometry=5,10,1,1
+flags=w
 
 [option-Widget-cd-follow]
-geometry=5,12,1,1
+geometry=5,13,1,1
 flags=w
 
 [option-Widget-show-backup]
@@ -220,11 +224,11 @@ geometry=2,2,2,1
 flags=w
 
 [option-Widget-pause-radio]
-geometry=2,10,2,5
+geometry=2,11,2,5
 flags=nw
 
 [option-Frame-Frame-1]
-geometry=4,0,4,15
+geometry=4,0,4,16
 flags=snew
 text=Other options
 

+ 36 - 0
src/ChangeLog

@@ -1,3 +1,39 @@
+Thu Dec 24 19:00:05 1998  Norbert Warmuth  <nwarmuth@privat.circular.de>
+
+	* screen.c (recalculate_panel_summary): new function which recalculates
+	the summary information for the mini-status.
+
+	* screen.c (panel_reload): use recalculate_panel_summary
+
+	* screen.c (do_file_mark): Honour that dirsizes computed is now a
+	per entry flag.
+
+Thu Dec 24 18:53:16 1998  Norbert Warmuth  <nwarmuth@privat.circular.de>
+
+	* option.c: Added Compute Totals to the configuration dialog.
+
+	* file.c (compute_dir_size): made non static
+
+	(panel_operate_flags): Don't compute directory sizes if verbose
+	operation are off.
+
+Thu Dec 24 18:42:52 1998  Norbert Warmuth  <nwarmuth@privat.circular.de>
+
+	* cmd.c (dirsizes_cmd): Rewritten to use compute_dir_size as suggested
+	by Miguel, i.e. get rid of du. Now the dirsizes_cmd honours a
+	selection and computes sizes only for marked directories. Possible
+	improvement: add a dialog (or C-C?) to abort computation.
+
+	* dir.h (file_entry), panel.h (WPanel): Made the dirsizes computed 
+	flag a per file flag.
+
+	* dir.c, find.c, panelize.c, screen.c: Adapted to new file_entry and 
+	WPanel structure.
+
+	* features.inc: Deleted DUSUM information
+
+	* mc.hlp: remade because of changes in doc/mc.1.in	
+
 1998-12-22  Jonathan Blandford  <jrb@redhat.com>
 
 	* file.c: add a HAVE_GNOME only function

+ 19 - 93
src/cmd.c

@@ -1346,102 +1346,28 @@ void quick_cd_cmd (void)
         free (p);
 }
 
-#ifdef SCO_FLAVOR
-#undef DUSUM_USEB
-#undef DUSUM_FACTOR
-#endif /* SCO_FLAVOR */
-
-#ifdef HAVE_DUSUM
-void dirsizes_cmd (void)
+void 
+dirsizes_cmd (void)
 {
     WPanel *panel = cpanel;
-    int i, j = 0;
-    char *cmd, *p, *q, *r;
-    FILE *f;
-#ifdef DUSUM_USEB
-#   define dirsizes_command "du -s -b "
-#else
-#   define dirsizes_command "du -s "
-#endif
-#ifndef DUSUM_FACTOR
-#    define DUSUM_FACTOR 512
-#endif
-
-    if (!vfs_current_is_local ()) {
-	message (1, MSG_ERROR, _("You can not scan disk usage on non-local filesystem. Sorry.") );
-        return;
-    }
-    for (i = 0; i < panel->count; i++)
-        if (S_ISDIR (panel->dir.list [i].buf.st_mode))
-            j += strlen (panel->dir.list [i].fname) + 1;
-    if (!j)
-        return;
-    /* worst case: name_quote doubles every filename, i.e. use
-       2 * j to be save */
-    cmd = xmalloc (strlen (dirsizes_command) + 2 * j + 1, "dirsizes_cmd");
-    strcpy (cmd, dirsizes_command);
-    p = strchr (cmd, 0);
-    for (i = 0; i < panel->count; i++)
-        if (S_ISDIR (panel->dir.list [i].buf.st_mode) && 
-            strcmp (panel->dir.list [i].fname, "..")) {
-            /* The quotes will be removed from the shell when invoking
-               du, i.e. no need to remove quotes when reading the
-               directory sizes from du. */
-            strcpy (p, r = name_quote (panel->dir.list [i].fname, 0));
-            free (r);
-            p = strchr (p, 0);
-            *(p++) = ' ';
-        }
-    *(--p) = 0;
-    open_error_pipe ();
-    f = popen (cmd, "r");
-    free (cmd);
-    if (f != NULL) {
-        /* Assume that du will display the directories in the order 
-         * I've passed to it :( 
-         */
-        i = 0;
-        p = xmalloc (1024, "dirsizes_cmd");
-        while (fgets (p, 1024, f)) {
-            j = atoi (p) * DUSUM_FACTOR;
-            for (q = p; *q && *q != ' ' && *q != '\t'; q++);
-            while (*q == ' ' || *q == '\t')
-                q++;
-            r = strchr (q, '\n');
-            if (r == NULL)
-                r = strchr (q, 0);
-    	    for (; i < panel->count; i++)
-                if (S_ISDIR (panel->dir.list [i].buf.st_mode))
-                    if (!strncmp (q, panel->dir.list [i].fname,
-                        r - q)) {
-                        if (panel->dir.list [i].f.marked)
-                            panel->total += j - 
-			    ((panel->has_dir_sizes) ? panel->dir.list [i].buf.st_size : 0); 
-                        panel->dir.list [i].buf.st_size = j;
-                        break;
-                    }
-            if (i == panel->count)
-                break;
-        }
-	free (p);
-        if (pclose (f) < 0)
-#ifndef SCO_FLAVOR
-	    message (0, _("Show directory sizes"), _("Pipe close failed"));
-	else
-#else /* SCO_FLAVOR */
- 	/* 
- 	**	SCO reports about error while all seems to be ok. Just ignore it...
- 	**	(alex@bcs.zaporizhzhe.ua)
- 	*/
- 	;
-#endif /* SCO_FLAVOR */
-	    panel->has_dir_sizes = 1;
-	close_error_pipe (0, 0);
-	paint_panel (panel);
-    } else
-        close_error_pipe (1, _("Cannot invoke du command."));
+    int i;
+    long marked;
+    double total;
+
+    for (i = 0; i < panel->count; i++) 
+	if (S_ISDIR (panel->dir.list [i].buf.st_mode) &&
+	         ((panel->dirs_marked && panel->dir.list [i].f.marked) || 
+                   !panel->dirs_marked) &&
+	         strcmp (panel->dir.list [i].fname, "..") != 0) {
+	    total = 0.0l;
+	    compute_dir_size (panel->dir.list [i].fname, &marked, &total);
+            panel->dir.list [i].buf.st_size = (long)total;
+	    panel->dir.list [i].f.dir_size_computed = 1;
+	}
+	
+    recalculate_panel_summary (panel);
+    paint_panel (panel);
 }
-#endif
 
 void
 save_setup_cmd (void)

Some files were not shown because too many files changed in this diff