mc not working

2005-12-28 Thread Michał Jęczalik

Hello,

I've compiled mc 4.6.1. When I try to run it, it hangs at this moment:

ioctl(1, SNDCTL_TMR_TIMEBASE, 0xb9f0) = -1 ENOTTY (Inappropriate ioctl 
for device)


When I press ctrl+z, mc's blue screen can be seen for a moment, but only 
once.


I thought it depends on the screen library, but no - the problem persist 
whether I choose slang or ncurses.


What's wrong?
--
Samotnik Michał Jęczalik, +48.695.64.75.14
www.zagle.org.pl   - rejsy morskie

___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: mc not working

2005-12-28 Thread Michał Jęczalik

On Wed, 28 Dec 2005, Michał Jęczalik wrote:


Hello,

I've compiled mc 4.6.1. When I try to run it, it hangs at this moment:

ioctl(1, SNDCTL_TMR_TIMEBASE, 0xb9f0) = -1 ENOTTY (Inappropriate ioctl 
for device)


When I press ctrl+z, mc's blue screen can be seen for a moment, but only 
once.


I thought it depends on the screen library, but no - the problem persist 
whether I choose slang or ncurses.


What's wrong?


Linux 2.4.31, slang 1.4.9...
--
Samotnik Michał Jęczalik, +48.695.64.75.14
www.zagle.org.pl   - rejsy morskie

___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: Fearure request

2005-12-28 Thread Jindrich Novy
Hello Sergei,

On Wed, 2005-11-16 at 01:06 +0200, Sergei Trofimovich wrote:
   It would be great to see in the bottom 
   of window free space of current directory. (df /path/to/dir)

the following patch adds support for displaying an amount of free
space figured by stat-ing the current directory. The free space is
displayed like this:

3509M (16%) of 21G

in the status separator line on each panel. I consider this feature
helpful as well.

Cheers,
Jindrich

-- 
Jindrich Novy [EMAIL PROTECTED], http://people.redhat.com/jnovy/
(o_   _o)
//\  The worst evil in the world is refusal to think. //\
V_/_ _\_V

--- mc-4.6.1a/src/screen.c.showfree	2005-12-27 10:45:05.0 +0100
+++ mc-4.6.1a/src/screen.c	2005-12-27 12:52:58.0 +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 ();
 }
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


[RFE][PATCH] Display free space on device in panels (was: Fearure request)

2005-12-28 Thread Jindrich Novy
Hello Sergei, mc-devel,

On Wed, 2005-12-28 at 15:33 +0100, Jindrich Novy wrote:
 the following patch adds support for displaying an amount of free
 space figured by stat-ing the current directory. The free space is
 displayed like this:
 
 3509M (16%) of 21G
 
 in the status separator line on each panel. I consider this feature
 helpful as well.

The previous patch contained a mistake that it only displayed free space
calculated from incorrect panel and tried to stat even non-local
filesystems. The attached patch does the same, but better.

Jindrich

-- 
Jindrich Novy [EMAIL PROTECTED], http://people.redhat.com/jnovy/
(o_   _o)
//\  The worst evil in the world is refusal to think. //\
V_/_ _\_V

--- mc-4.6.1a/src/screen.c.showfree	2005-12-28 16:49:52.0 +0100
+++ mc-4.6.1a/src/screen.c	2005-12-28 17:14:45.0 +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]) )
 
@@ -106,6 +107,12 @@ int filetype_mode = 1;
 /* The hook list for the select file function */
 Hook *select_file_hook = 0;
 
+/* Old current working directory for displaying free space */
+char *old_cwd = NULL;
+
+/* Used to figure out how many free space we have */
+struct my_statfs myfs_stats;
+
 static cb_ret_t panel_callback (Widget *, widget_msg_t msg, int parm);
 static int panel_event (Gpm_Event *event, void *);
 static void paint_frame (WPanel *panel);
@@ -851,6 +858,41 @@ paint_dir (WPanel *panel)
 standend ();
 }
 
+
+static void
+show_free_space(WPanel *panel)
+{
+struct stat st;
+
+/* Don't try to stat non-local fs */
+if (strlen(panel-cwd) = 2  panel-cwd[0] == '/'  panel-cwd[1] == '#')
+	return;
+
+if (old_cwd == NULL || strcmp(old_cwd, panel-cwd)) {
+	init_my_statfs();
+	if (old_cwd != NULL) g_free(old_cwd);
+	old_cwd = g_strdup(panel-cwd);
+}
+
+my_statfs (myfs_stats, panel-cwd);
+st = panel-dir.list [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
 mini_info_separator (WPanel *panel)
 {
@@ -866,6 +908,7 @@ mini_info_separator (WPanel *panel)
 hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR,
 	   panel-widget.cols - 2);
 #endif/* !HAVE_SLANG */
+show_free_space (panel);
 }
 
 static void
@@ -929,6 +972,8 @@ show_dir (WPanel *panel)
 widget_move (panel-widget, 0, panel-widget.cols - 3);
 addstr (v);
 
+mini_info_separator (panel);
+
 if (panel-active)
 	standend ();
 }
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


[patch #4741] Syntax Support for config files (conf,ini,cfg,...)

2005-12-28 Thread Sorin Sbarnea

URL:
  http://savannah.gnu.org/patch/?func=detailitemitem_id=4741

 Summary: Syntax Support for config files (conf,ini,cfg,...)
 Project: GNU Midnight Commander
Submitted by: sorin
Submitted on: Wed 12/28/05 at 21:06
Category: None
Priority: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open

___

Details:

Syntax Support for config files (conf,ini,cfg,...)





___

File Attachments:


---
Date: Wed 12/28/05 at 21:06  Name: Syntax.patch  Size: 523B   By: sorin
Syntax Patch file  for inclusion of conf.syntax
http://savannah.gnu.org/patch/download.php?item_id=4741item_file_id=5673

___

Reply to this item at:

  http://savannah.gnu.org/patch/?func=detailitemitem_id=4741

___
  Message sent via/by Savannah
  http://savannah.gnu.org/

___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


[patch #4741] Syntax Support for config files (conf,ini,cfg,...)

2005-12-28 Thread Sorin Sbarnea

Additional Item Attachment, patch #4741 (project mc):

File name: conf.syntaxSize:1 KB
conf.syntax - just add me to cvs
http://savannah.gnu.org/patch/download.php?item_id=4741item_file_id=5674

___

Reply to this item at:

  http://savannah.gnu.org/patch/?func=detailitemitem_id=4741

___
  Message sent via/by Savannah
  http://savannah.gnu.org/

___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel