- display free space on a device assigned to current directory in main

panels
- correctly diplay characters in mcview for non-UTF-8 LANG set (#174004)
    thanks to Dmitry Butskoy
This commit is contained in:
Jindrich Novy 2005-12-28 14:21:04 +00:00
parent f2e742d6ef
commit ead0eeaff7
3 changed files with 74 additions and 2 deletions

64
mc-showfree.patch Normal file
View File

@ -0,0 +1,64 @@
--- mc-4.6.1a/src/screen.c.showfree 2005-12-27 10:45:05.000000000 +0100
+++ mc-4.6.1a/src/screen.c 2005-12-27 12:52:58.000000000 +0100
@@ -49,6 +49,7 @@
#define WANT_WIDGETS
#include "main.h" /* the_menubar */
#include "unixcompat.h"
+#include "mountlist.h" /* my_statfs */
#define ELEMENTS(arr) ( sizeof(arr) / sizeof((arr)[0]) )
@@ -851,6 +852,9 @@ paint_dir (WPanel *panel)
standend ();
}
+static int initialized;
+static struct my_statfs myfs_stats;
+
static void
mini_info_separator (WPanel *panel)
{
@@ -866,6 +870,34 @@ mini_info_separator (WPanel *panel)
hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR,
panel->widget.cols - 2);
#endif /* !HAVE_SLANG */
+
+
+ {
+ struct stat st;
+
+ if (!initialized) {
+ initialized = 1;
+ init_my_statfs();
+ }
+
+ my_statfs (&myfs_stats, current_panel->cwd);
+ st = current_panel->dir.list [current_panel->selected].st;
+
+ if (myfs_stats.avail > 0 || myfs_stats.total > 0) {
+ char buffer1 [6], buffer2[6], *tmp;
+ size_trunc_len (buffer1, 5, myfs_stats.avail, 1);
+ size_trunc_len (buffer2, 5, myfs_stats.total, 1);
+ tmp = g_strdup_printf (_("%s (%d%%) of %s"), buffer1, myfs_stats.total ?
+ (int)(100 * (double)myfs_stats.avail / myfs_stats.total) : 0,
+ buffer2);
+ widget_move (&panel->widget, panel->widget.lines-3, panel->widget.cols-2-strlen(tmp));
+ if (panel->active)
+ attrset (REVERSE_COLOR);
+ addstr (tmp);
+ attrset (NORMAL_COLOR);
+ g_free (tmp);
+ }
+ }
}
static void
@@ -929,6 +961,8 @@ show_dir (WPanel *panel)
widget_move (&panel->widget, 0, panel->widget.cols - 3);
addstr ("v");
+ mini_info_separator (panel);
+
if (panel->active)
standend ();
}

View File

@ -674,7 +674,7 @@
tty_print_char (c);
+#else
+ wc = convert_to_display_c (wc);
+ if (!is_printable (wc))
+ if (!iswprint (wc))
+ wc = '.';
+ tty_print_char (wc);
+#endif

10
mc.spec
View File

@ -1,7 +1,7 @@
Summary: User-friendly text console file manager and visual shell.
Name: mc
Version: 4.6.1a
Release: 5.1
Release: 6
Epoch: 1
License: GPL
Group: System Environment/Shells
@ -22,6 +22,7 @@ Patch7: mc-utf8-look-and-feel.patch
Patch8: mc-phpfix.patch
Patch9: mc-concat.patch
Patch10: mc-ministatus.patch
Patch11: mc-showfree.patch
%description
Midnight Commander is a visual shell much like a file manager, only
@ -44,6 +45,7 @@ specific files.
%patch8 -p1 -b .phpfix
%patch9 -p1 -b .concat
%patch10 -p1 -b .ministatus
%patch11 -p1 -b .showfree
# convert files in /lib to UTF-8
pushd lib
@ -181,6 +183,12 @@ rm -rf $RPM_BUILD_ROOT
%dir %{_datadir}/mc
%changelog
* Wed Dec 28 2005 Jindrich Novy <jnovy@redhat.com> 4.6.1a-6
- display free space on a device assigned to current directory in
main panels
- correctly diplay characters in mcview for non-UTF-8 LANG set (#174004)
thanks to Dmitry Butskoy
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt