updated: [881ff40] Merge branch 'mc-4.6'



The following commit has been merged in the master branch:
commit 881ff40b3d926d0ecab2f93b7256c1420e7910eb
Merge: 481b0a34ea8a803418cb4bdf505feaad96c7749c 74dadcc25881b1565a375a869e06ee61a5587a05
Author: Patrick Winnertz <winnie debian org>
Date:   Mon Jan 26 10:30:14 2009 +0100

    Merge branch 'mc-4.6'

diff --combined ChangeLog
index 460647f,e0fca55..c27399b
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,3 -1,9 +1,9 @@@
+ 2009-01-25 Ilia Maslakov <il smind gmail com>
+ 
+ 	* src/boxes.c, src/boxes.h, src/dir.c, src/dir.h:
+ 	* src/main.c, src/panel.h, src/screen.c, src/setup.c:
+ 	  - Add support for showing executables at first in the panel view
+ 
  2009-01-25 Enrico Weigelt <weigelt metux de>
  
  	* edit/editcmd.c, src/cmd.c, src/ext.c, src/history.h:
@@@ -17,19 -23,10 +23,19 @@@
  	  - prevent . to match a newline (\n)
  	  - match from start of line and not from cursor position
  
 +2009-01-24  Enrico Weigelt, metux IT service <weigelt metux de>
 +
 +	* syntax/Syntax, syntax/nemerle.syntax: Added syntax rules 
 +	  for Nemerle source files
 +
 +2009-01-19 Patrick Winnertz <winnie debian org>
 +
 +	* edit/edit.h: Add two more ints
 +	* src/setup.c: Add keybinding to disable tab highlighting
 +
  2009-01-18 Patrick Winnertz <winnie debian org>
  
 -	* edit/editdraw.c: Moved var into if clause as it's only used
 -	there
 +	* edit/editdraw.c: Moved var into if clause as it's only used there
  	* edit/editlock.c: Removed unnecessary arguement to if condition
  	* src/cmd.c: Removed unused pointer
  	* src/hotlist.c: Removed unused function save_group
@@@ -53,39 -50,10 +59,39 @@@
  	* AUTHORS: Added Enrico Weigelt, Slava Zanko and 
  	Patrick Winnertz as authors 
  
 +2009-01-11 Enrico Weigelt, metux ITS <weigelt metux de>
 +
 +	* FAQ HACKING README man/*: new HQ url
 +	* syntax/awk.syntax: added awk syntax file
 +	* configure.ac: replaced obsolete autoconf macros AC_GNU_SOURCE 
 +	  AC_AIX AC_MINIX by AC_USE_SYSTEM_EXTENSIONS
 +
  2009-01-11 Patrick Winnertz <winnie debian org>
  
  	* syntax/pascal.syntax: Added syntax highlighting for 
 -	some delphi keywords
 +	  some delphi keywords
 +
 +2009-01-10  Enrico Weigelt, metux ITS <weigelt metux de>
 +
 +	* syntax/Makefile.am syntax/Syntax syntax/haskell.syntax:
 +	added syntax definition for Haskell (taken from rhclub-tree)
 +	* syntax: added ebuild Syntax defition (taken from rhclub-tree)
 +
 +2009-01-10  Enrico Weigelt, metux ITS <weigelt metux de>
 +
 +	* edit/editcmd.c:
 +	* src/achown.c src/background.c src/boxes.c src/chmod.c:
 +	* src/chown.c src/cmd.c src/command.c src/dir.c src/execute.c:
 +	* src/ext.c src/file.c src/filegui.c src/find.c src/help.c:
 +	* src/learn.c src/main.c src/panelize.c src/screen.c:
 +	* src/selcodepage.c src/subshell.c src/tree.c src/user.c:
 +	* src/utilunix.c src/view.c:
 +	* vfs/cpio.c vfs/direntry.c vfs/extfs.c vfs/fish.c vfs/ftpfs.c:
 +	* vfs/mcfs.c vfs/sfs.c vfs/smbfs.c vfs/tar.c vfs/undelfs.c:
 +	* vfs/utilvfs.c vfs/vfs.c:
 +	
 +	Changed message type codes on calls to message(), query_dialog(),
 +	close_error_pipe() from numeric IDs to symbols D_ERROR, D_NORMAL
  
  2008-12-18  Roland Illig  <roland illig gmx de>
  
@@@ -263,7 -231,7 +269,7 @@@
  
  	* doc/mc.1.in: Document `fish_directory_timeout'.
  
 -2006-02-18  David Martin  <<dmartina excite com>
 +2006-02-18  David Martin  <dmartina excite com>
  
  	* doc/es/mc.1.in: Cleanup. Fix key naming.
  
diff --combined src/boxes.c
index e672df9,b7652d8..5c66f3d
--- a/src/boxes.c
+++ b/src/boxes.c
@@@ -266,22 -266,23 +266,23 @@@ display_box (WPanel *panel, char **user
      return result;
  }
  
- static int SORT_X = 40, SORT_Y = 14;
+ static int SORT_X = 60, SORT_Y = 14;
  
  static const char *sort_orders_names [SORT_TYPES];
  
  sortfn *
- sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive)
+ sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive, int *exec_first)
  {
      int i, r, l;
      sortfn *result;
-     WCheck *c, *case_sense;
+     WCheck *c, *case_sense, *exec_ff;
  
      const char *ok_button = _("&OK");
      const char *cancel_button = _("&Cancel");
      const char *reverse_label = _("&Reverse");
      const char *case_label = _("case sensi&tive");
      const char *sort_title = _("Sort order");
+     const char *exec_label = _("Executable first");
  
      static int i18n_sort_flag = 0, check_pos = 0, button_pos = 0;
  
@@@ -339,6 -340,8 +340,8 @@@
  		button_new (9, button_pos, B_ENTER, DEFPUSH_BUTTON,
  			    ok_button, 0));
  
+     exec_ff = check_new (5, check_pos, *exec_first, exec_label);
+     add_widget (dd, exec_ff);
      case_sense = check_new (4, check_pos, *case_sensitive, case_label);
      add_widget (dd, case_sense);
      c = check_new (3, check_pos, *reverse, reverse_label);
@@@ -355,6 -358,7 +358,7 @@@
  	result = (sortfn *) sort_orders[my_radio->sel].sort_fn;
  	*reverse = c->state & C_BOOL;
  	*case_sensitive = case_sense->state & C_BOOL;
+ 	*exec_first = exec_ff->state & C_BOOL;
      } else
  	result = sort_fn;
      destroy_dlg (dd);
@@@ -629,7 -633,7 +633,7 @@@ display_bits_box (void
  	errmsg =
  	    init_translation_table (source_codepage, display_codepage);
  	if (errmsg)
 -	    message (1, MSG_ERROR, "%s", errmsg);
 +	    message (D_ERROR, MSG_ERROR, "%s", errmsg);
  #ifndef HAVE_SLANG
  	meta (stdscr, display_codepage != 0);
  #else
diff --combined src/dir.c
index 471a044,fab6041..847af66
--- a/src/dir.c
+++ b/src/dir.c
@@@ -46,7 -46,10 +46,10 @@@ static int reverse = 1
  /* Are the files sorted case sensitively? */
  static int case_sensitive = OS_SORT_CASE_SENSITIVE_DEFAULT;
  
- #define MY_ISDIR(x) ( (S_ISDIR (x->st.st_mode) || x->f.link_to_dir) ? 1 : 0)
+ /* Are the exec_bit files top in list*/
+ static int exec_first = 1;
+ 
+ #define MY_ISDIR(x) ( (is_exe (x->st.st_mode) && !(S_ISDIR (x->st.st_mode) || x->f.link_to_dir) && (exec_first == 1)) ? 1 : ( (S_ISDIR (x->st.st_mode) || x->f.link_to_dir) ? 2 : 0) )
  
  sort_orders_t sort_orders [SORT_TYPES_TOTAL] = {
      { N_("&Unsorted"),    unsorted },
@@@ -226,7 -229,7 +229,7 @@@ sort_size (const file_entry *a, const f
  
  
  void
- do_sort (dir_list *list, sortfn *sort, int top, int reverse_f, int case_sensitive_f)
+ do_sort (dir_list *list, sortfn *sort, int top, int reverse_f, int case_sensitive_f, int exec_first_f)
  {
      int dot_dot_found = 0;
  
@@@ -240,6 -243,7 +243,7 @@@
  
      reverse = reverse_f ? -1 : 1;
      case_sensitive = case_sensitive_f;
+     exec_first = exec_first_f;
      qsort (&(list->list) [dot_dot_found],
  	   top + 1 - dot_dot_found, sizeof (file_entry), sort);
  }
@@@ -382,7 -386,7 +386,7 @@@ handle_path (dir_list *list, const cha
  
  int
  do_load_dir (const char *path, dir_list *list, sortfn *sort, int reverse,
- 	     int case_sensitive, const char *filter)
+ 	     int case_sensitive, int exec_ff, const char *filter)
  {
      DIR *dirp;
      struct dirent *dp;
@@@ -397,7 -401,7 +401,7 @@@
  
      dirp = mc_opendir (path);
      if (!dirp) {
 -	message (1, MSG_ERROR, _("Cannot read directory contents"));
 +	message (D_ERROR, MSG_ERROR, _("Cannot read directory contents"));
  	return next_free;
      }
      tree_store_start_check (path);
@@@ -428,7 -432,7 +432,7 @@@
      }
  
      if (next_free) {
- 	do_sort (list, sort, next_free - 1, reverse, case_sensitive);
+ 	do_sort (list, sort, next_free - 1, reverse, case_sensitive, exec_ff);
      }
  
      mc_closedir (dirp);
@@@ -484,7 -488,7 +488,7 @@@ alloc_dir_copy (int size
  /* If filter is null, then it is a match */
  int
  do_reload_dir (const char *path, dir_list *list, sortfn *sort, int count,
- 	       int rev, int case_sensitive, const char *filter)
+ 	       int rev, int case_sensitive, int exec_ff, const char *filter)
  {
      DIR *dirp;
      struct dirent *dp;
@@@ -496,7 -500,7 +500,7 @@@
  
      dirp = mc_opendir (path);
      if (!dirp) {
 -	message (1, MSG_ERROR, _("Cannot read directory contents"));
 +	message (D_ERROR, MSG_ERROR, _("Cannot read directory contents"));
  	clean_dir (list, count);
  	return set_zero_dir (list);
      }
@@@ -581,7 -585,7 +585,7 @@@
      tree_store_end_check ();
      g_hash_table_destroy (marked_files);
      if (next_free) {
- 	do_sort (list, sort, next_free - 1, rev, case_sensitive);
+ 	do_sort (list, sort, next_free - 1, rev, case_sensitive, exec_ff);
      }
      clean_dir (&dir_copy, count);
      return next_free;
diff --combined src/main.c
index cb83bae,14a13b7..68c9988
--- a/src/main.c
+++ b/src/main.c
@@@ -425,7 -425,7 +425,7 @@@ voi
  do_possible_cd (const char *new_dir)
  {
      if (!do_cd (new_dir, cd_exact))
 -	message (1, _("Warning"),
 +	message (D_ERROR, _("Warning"),
  		 _(" The Commander can't change to the directory that \n"
  		   " the subshell claims you are in.  Perhaps you have \n"
  		   " deleted your working directory, or given yourself \n"
@@@ -471,7 -471,7 +471,7 @@@ quit_cmd_internal (int quiet
      } else {
  	if (query_dialog
  	    (_(" The Midnight Commander "),
 -	     _(" Do you really want to quit the Midnight Commander? "), 0,
 +	     _(" Do you really want to quit the Midnight Commander? "), D_NORMAL,
  	     2, _("&Yes"), _("&No")) == 0)
  	    q = 1;
      }
@@@ -609,7 -609,8 +609,8 @@@ _do_panel_cd (WPanel *panel, const cha
      panel_clean_dir (panel);
      panel->count =
  	do_load_dir (panel->cwd, &panel->dir, panel->sort_type,
- 		     panel->reverse, panel->case_sensitive, panel->filter);
+ 		     panel->reverse, panel->case_sensitive,
+ 		     panel->exec_first, panel->filter);
      try_to_select (panel, get_parent_dir_name (panel->cwd, olddir));
      load_hint (0);
      panel->dirty = 1;
@@@ -685,7 -686,7 +686,7 @@@ directory_history_list (WPanel *panel
      if (_do_panel_cd (panel, s, cd_exact))
  	directory_history_add (panel, panel->cwd);
      else
 -	message (1, MSG_ERROR, _("Cannot change directory"));
 +	message (D_ERROR, MSG_ERROR, _("Cannot change directory"));
      g_free (s);
  }
  
@@@ -759,7 -760,9 +760,9 @@@ sort_cmd (void
  	return;
  
      p = MENU_PANEL;
-     sort_order = sort_box (p->sort_type, &p->reverse, &p->case_sensitive);
+     sort_order = sort_box (p->sort_type, &p->reverse,
+ 			   &p->case_sensitive,
+ 			   &p->exec_first);
  
      panel_set_sort_order (p, sort_order);
  
@@@ -990,7 -993,7 +993,7 @@@ toggle_fast_reload (void
  {
      fast_reload = !fast_reload;
      if (fast_reload_w == 0 && fast_reload) {
 -	message (0, _(" Information "),
 +	message (D_NORMAL, _(" Information "),
  		 _
  		 (" Using the fast reload option may not reflect the exact \n"
  		  " directory contents. In this case you'll need to do a   \n"
diff --combined src/screen.c
index 48adcaa,d1121d8..a1ae531
--- a/src/screen.c
+++ b/src/screen.c
@@@ -47,7 -47,7 +47,7 @@@
  #include "execute.h"
  #include "widget.h"
  #include "menu.h"		/* menubar_visible */
 -#define WANT_WIDGETS
 +#include "main-widgets.h"
  #include "main.h"		/* the_menubar */
  #include "unixcompat.h"
  
@@@ -1054,7 -1054,8 +1054,8 @@@ panel_new (const char *panel_name
      /* Load the default format */
      panel->count =
  	do_load_dir (panel->cwd, &panel->dir, panel->sort_type,
- 		     panel->reverse, panel->case_sensitive, panel->filter);
+ 		     panel->reverse, panel->case_sensitive,
+ 		     panel->exec_first, panel->filter);
      return panel;
  }
  
@@@ -1088,7 -1089,7 +1089,7 @@@ panel_reload (WPanel *panel
      panel->count =
  	do_reload_dir (panel->cwd, &panel->dir, panel->sort_type,
  		       panel->count, panel->reverse, panel->case_sensitive,
- 		       panel->filter);
+ 		       panel->exec_first, panel->filter);
  
      panel->dirty = 1;
      if (panel->selected >= panel->count)
@@@ -1964,7 -1965,7 +1965,7 @@@ do_enter_on_file_entry (file_entry *fe
      if (S_ISDIR (fe->st.st_mode) || link_isdir (fe)
  	|| (fe->st.st_mode == 0)) {
  	if (!do_cd (fe->fname, cd_exact))
 -	    message (1, MSG_ERROR, _("Cannot change directory"));
 +	    message (D_ERROR, MSG_ERROR, _("Cannot change directory"));
  	return 1;
      }
  
@@@ -1983,7 -1984,7 +1984,7 @@@
      if (confirm_execute) {
  	if (query_dialog
  	    (_(" The Midnight Commander "),
 -	     _(" Do you really want to execute? "), 0, 2, _("&Yes"),
 +	     _(" Do you really want to execute? "), D_NORMAL, 2, _("&Yes"),
  	     _("&No")) != 0)
  	    return 1;
      }
@@@ -2251,7 -2252,7 +2252,7 @@@ panel_callback (Widget *w, widget_msg_
  	panel->active = 1;
  	if (mc_chdir (panel->cwd) != 0) {
  	    char *cwd = strip_password (g_strdup (panel->cwd), 1);
 -	    message (1, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "),
 +	    message (D_ERROR, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "),
  		     cwd, unix_error_string (errno));
  	    g_free(cwd);
  	} else
@@@ -2464,7 -2465,8 +2465,8 @@@ panel_re_sort (WPanel *panel
  
      filename = g_strdup (selection (panel)->fname);
      unselect_item (panel);
-     do_sort (&panel->dir, panel->sort_type, panel->count-1, panel->reverse, panel->case_sensitive);
+     do_sort (&panel->dir, panel->sort_type, panel->count-1, panel->reverse,
+              panel->case_sensitive, panel->exec_first);
      panel->selected = -1;
      for (i = panel->count; i; i--){
  	if (!strcmp (panel->dir.list [i-1].fname, filename)){
diff --combined src/setup.c
index f26566a,ef42496..3e24e60
--- a/src/setup.c
+++ b/src/setup.c
@@@ -216,8 -216,6 +216,8 @@@ static const struct 
      { "editor_option_typewriter_wrap", &option_typewriter_wrap },
      { "editor_edit_confirm_save", &edit_confirm_save },
      { "editor_syntax_highlighting", &option_syntax_highlighting },
 +    { "editor_visible_tabs", &visible_tabs },
 +    { "editor_visible_spaces", &visible_tws },
  #endif /* USE_INTERNAL_EDIT */
  
      { "nice_rotating_dash", &nice_rotating_dash },
@@@ -247,6 -245,8 +247,8 @@@ panel_save_setup (struct WPanel *panel
      save_string (section, "reverse", buffer, profile_name);
      g_snprintf (buffer, sizeof (buffer), "%d", panel->case_sensitive);
      save_string (section, "case_sensitive", buffer, profile_name);
+     g_snprintf (buffer, sizeof (buffer), "%d", panel->exec_first);
+     save_string (section, "exec_first", buffer, profile_name);
      for (i = 0; sort_names [i].key; i++)
  	if (sort_names [i].sort_type == (sortfn *) panel->sort_type){
  	    save_string (section, "sort_order",
@@@ -388,6 -388,7 +390,7 @@@ panel_load_setup (WPanel *panel, const 
  
      panel->reverse = load_int (section, "reverse", 0);
      panel->case_sensitive = load_int (section, "case_sensitive", OS_SORT_CASE_SENSITIVE_DEFAULT);
+     panel->exec_first = load_int (section, "exec_first", 0);
  
      /* Load sort order */
      load_string (section, "sort_order", "name", buffer, sizeof (buffer));

-- 
Midnight Commander Development


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]