head 1.12; access; symbols; locks; strict; comment @# @; 1.12 date 2003.01.31.15.54.56; author swiergot; state Exp; branches; next 1.11; 1.11 date 2003.01.30.16.50.36; author swiergot; state Exp; branches; next 1.10; 1.10 date 2003.01.30.16.18.31; author swiergot; state Exp; branches; next 1.9; 1.9 date 2003.01.30.15.25.14; author swiergot; state Exp; branches; next 1.8; 1.8 date 2003.01.28.21.24.04; author swiergot; state Exp; branches; next 1.7; 1.7 date 2003.01.28.21.18.09; author swiergot; state Exp; branches; next 1.6; 1.6 date 2003.01.28.20.43.07; author swiergot; state Exp; branches; next 1.5; 1.5 date 2003.01.28.20.11.51; author swiergot; state Exp; branches; next 1.4; 1.4 date 2003.01.28.18.47.59; author swiergot; state Exp; branches; next 1.3; 1.3 date 2003.01.28.18.01.24; author swiergot; state Exp; branches; next 1.2; 1.2 date 2003.01.28.17.51.11; author swiergot; state Exp; branches; next 1.1; 1.1 date 2003.01.28.17.28.36; author swiergot; state Exp; branches; next ; desc @@ 1.12 log @- Fixed dotdot_in_rootdir patch. @ text @diff -ruN mc-4.6.0-pre3.orig/src/dir.c mc-4.6.0-pre3/src/dir.c --- mc-4.6.0-pre3.orig/src/dir.c 2003-01-21 03:25:50.000000000 +0100 +++ mc-4.6.0-pre3/src/dir.c 2003-01-30 17:15:07.000000000 +0100 @@@@ -28,6 +28,7 @@@@ #include "dir.h" #include "wtools.h" #include "tree.h" +#include "layout.h" /* dotdot_in_rootdir */ /* If true show files starting with a dot */ int show_dot_files = 1; @@@@ -503,8 +504,9 @@@@ } if (next_free) { - /* Add ".." except the root directory */ - if (strcmp (vfs_canon ("."), "/") != 0) + /* Add ".." except the root directory or including the root + directory if dotdot_in_rootdir is set */ + if (dotdot_in_rootdir || (strcmp (vfs_canon ("."), "/") != 0)) add_dotdot_to_list (list, next_free++); do_sort (list, sort, next_free - 1, reverse, case_sensitive); } else { @@@@ -655,8 +657,9 @@@@ tree_store_end_check (); g_hash_table_destroy (marked_files); if (next_free) { - /* Add ".." except the root directory */ - if (strcmp (vfs_canon ("."), "/") != 0) + /* Add ".." except the root directory or including the root + directory if dotdot_in_rootdir is set */ + if (dotdot_in_rootdir || (strcmp (vfs_canon ("."), "/") != 0)) add_dotdot_to_list (list, next_free++); do_sort (list, sort, next_free - 1, rev, case_sensitive); } else diff -ruN mc-4.6.0-pre3.orig/src/layout.c mc-4.6.0-pre3/src/layout.c --- mc-4.6.0-pre3.orig/src/layout.c 2002-12-28 06:11:40.000000000 +0100 +++ mc-4.6.0-pre3/src/layout.c 2003-01-31 16:55:07.000000000 +0100 @@@@ -104,6 +104,9 @@@@ /* The starting line for the output of the subprogram */ int output_start_y = 0; +/* Controls whether to show .. in root directory */ +int dotdot_in_rootdir = 0; + /* The maximum number of views managed by the set_display_type routine */ /* Must be at least two (for current and other). Please note that until */ /* Janne gets around this, we will only manage two of them :-) */ @@@@ -132,6 +135,7 @@@@ static int _xterm_title; static int _permission_mode; static int _filetype_mode; +static int _dotdot_in_rootdir; static int height; @@@@ -170,6 +174,7 @@@@ { N_("&Equal split"), &equal_split, 0, "eq" }, { N_("pe&Rmissions"), &permission_mode, 0, "pr" }, { N_("&File types"), &filetype_mode, 0, "ft" }, + { N_("&Show .. in /"), &dotdot_in_rootdir, 0, "dd" }, { 0, 0, 0, 0 } }; @@@@ -296,9 +301,9 @@@@ if (old_output_lines != _output_lines){ old_output_lines = _output_lines; attrset (COLOR_NORMAL); - dlg_move (h, 9, 16 + first_width); + dlg_move (h, 10, 16 + first_width); addstr (output_lines_label); - dlg_move (h, 9, 10 + first_width); + dlg_move (h, 10, 10 + first_width); printw ("%02d", _output_lines); } } @@@@ -313,6 +318,7 @@@@ _keybar_visible = check_options [2].widget->state & C_BOOL; _message_visible = check_options [1].widget->state & C_BOOL; _xterm_title = check_options [0].widget->state & C_BOOL; + _dotdot_in_rootdir = check_options [9].widget->state & C_BOOL; if (console_flag){ int minimum; if (_output_lines < 0) @@@@ -340,7 +346,7 @@@@ if (old_output_lines != _output_lines){ old_output_lines = _output_lines; attrset (COLOR_NORMAL); - dlg_move (h, 9, 10 + first_width); + dlg_move (h, 10, 10 + first_width); printw ("%02d", _output_lines); } } @@@@ -380,7 +386,7 @@@@ first_width = l1; } - for (i = 0; i <= 8; i++) + for (i = 0; i <= 9; i++) { check_options[i].text = _(check_options[i].text); l1 = strlen (check_options[i].text) + 7; @@@@ -405,6 +411,10 @@@@ if (l1 > second_width) second_width = l1; } + check_options[9].text = _(check_options[9].text); + l1 = strlen (check_options[9].text) + 7; + if (l1 > second_width) + second_width = l1; if (console_flag) { l1 = strlen (output_lines_label) + 13; @@@@ -445,15 +455,17 @@@@ button_new (BY, b1, B_ENTER, DEFPUSH_BUTTON, ok_button, 0, 0, "o")); if (console_flag){ add_widget (layout_dlg, - button_new (9, 12 + first_width, B_MINUS, NARROW_BUTTON, "&-", + button_new (10, 12 + first_width, B_MINUS, NARROW_BUTTON, "&-", bminus_cback, 0, NULL)); add_widget (layout_dlg, - button_new (9, 7 + first_width, B_PLUS, NARROW_BUTTON, "&+", + button_new (10, 7 + first_width, B_PLUS, NARROW_BUTTON, "&+", bplus_cback, 0, NULL)); } #define XTRACT(i) *check_options[i].variable, check_options[i].text, check_options[i].tkname + check_options [9].widget = check_new (9, 7 + first_width, XTRACT(9)); + add_widget (layout_dlg, check_options [9].widget); for (i = 0; i < 6; i++){ check_options [i].widget = check_new (8 - i, 7 + first_width, XTRACT(i)); add_widget (layout_dlg, check_options [i].widget); @@@@ -471,6 +483,7 @@@@ _keybar_visible = keybar_visible; _message_visible = message_visible; _xterm_title = xterm_title; + _dotdot_in_rootdir = dotdot_in_rootdir; bright_widget = button_new(6, 15, B_2RIGHT, NARROW_BUTTON, "&>", b2right_cback, 0, ">"); add_widget (layout_dlg, bright_widget); bleft_widget = button_new (6, 9, B_2LEFT, NARROW_BUTTON, "&<", b2left_cback, 0, "<"); diff -ruN mc-4.6.0-pre3.orig/src/layout.h mc-4.6.0-pre3/src/layout.h --- mc-4.6.0-pre3.orig/src/layout.h 2002-12-26 17:20:51.000000000 +0100 +++ mc-4.6.0-pre3/src/layout.h 2003-01-30 17:15:07.000000000 +0100 @@@@ -35,6 +35,7 @@@@ extern int output_start_y; extern int message_visible; extern int xterm_title; +extern int dotdot_in_rootdir; extern int horizontal_split; extern int nice_rotating_dash; diff -ruN mc-4.6.0-pre3.orig/src/setup.c mc-4.6.0-pre3/src/setup.c --- mc-4.6.0-pre3.orig/src/setup.c 2002-12-27 14:39:25.000000000 +0100 +++ mc-4.6.0-pre3/src/setup.c 2003-01-30 17:15:07.000000000 +0100 @@@@ -213,6 +213,7 @@@@ { "nice_rotating_dash", &nice_rotating_dash }, { "horizontal_split", &horizontal_split }, + { "dotdot_in_rootdir", &dotdot_in_rootdir }, { 0, 0 } }; @ 1.11 log @- Fixed dotdot_in_rootdir patch. @ text @d38 1 a38 1 +++ mc-4.6.0-pre3/src/layout.c 2003-01-30 17:51:35.000000000 +0100 d114 1 a114 1 @@@@ -445,10 +455,10 @@@@ d127 5 a131 1 @@@@ -458,6 +468,8 @@@@ a133 6 } + check_options [9].widget = check_new (9, 7 + first_width, XTRACT(9)); + add_widget (layout_dlg, check_options [9].widget); check_options [8].widget = check_new (10, 6, XTRACT(8)); add_widget (layout_dlg, check_options [8].widget); check_options [7].widget = check_new (9, 6, XTRACT(7)); @ 1.10 log @- Fixed dotdot_in_rootdir patch. - Splited dotdot_in_rootdir_po patch into two patches - for pot file and for pl.po file. @ text @d38 1 a38 1 +++ mc-4.6.0-pre3/src/layout.c 2003-01-30 17:15:29.000000000 +0100 d65 12 d85 9 @ 1.9 log @- Fixed dotdot_in_rootdir patch. @ text @d3 1 a3 1 +++ mc-4.6.0-pre3/src/dir.c 2003-01-28 18:44:49.000000000 +0100 d38 1 a38 1 +++ mc-4.6.0-pre3/src/layout.c 2003-01-28 22:24:25.000000000 +0100 d93 13 d125 1 a125 1 +++ mc-4.6.0-pre3/src/layout.h 2003-01-28 18:34:46.000000000 +0100 d136 1 a136 1 +++ mc-4.6.0-pre3/src/setup.c 2003-01-28 18:17:27.000000000 +0100 @ 1.8 log @- Fixed dotdot_in_rootdir patch. @ text @d69 1 a69 1 + _dotdot_in_rootdir = check_options [10].widget->state & C_BOOL; @ 1.7 log @- Removed po diffs from dotdot_in_rootdir patch. @ text @d38 1 a38 1 +++ mc-4.6.0-pre3/src/layout.c 2003-01-28 21:43:33.000000000 +0100 d93 2 a94 6 @@@@ -455,9 +465,11 @@@@ #define XTRACT(i) *check_options[i].variable, check_options[i].text, check_options[i].tkname for (i = 0; i < 6; i++){ - check_options [i].widget = check_new (8 - i, 7 + first_width, XTRACT(i)); + check_options [i].widget = check_new (9 - i, 7 + first_width, XTRACT(i)); d97 1 a97 1 + check_options [9].widget = check_new (3, 7 + first_width, XTRACT(9)); @ 1.6 log @- Fixed dotdot_in_rootdir patch. @ text @a0 28 diff -ruN mc-4.6.0-pre3.orig/po/mc.pot mc-4.6.0-pre3/po/mc.pot --- mc-4.6.0-pre3.orig/po/mc.pot 2003-01-22 08:46:54.000000000 +0100 +++ mc-4.6.0-pre3/po/mc.pot 2003-01-28 18:40:59.000000000 +0100 @@@@ -2370,6 +2370,10 @@@@ msgid "&File types" msgstr "" +#: src/layout.c:176 +msgid "&Show .. in /" +msgstr "" + #: src/layout.c:362 src/learn.c:61 src/learn.c:176 src/option.c:147 msgid "&Save" msgstr "" diff -ruN mc-4.6.0-pre3.orig/po/pl.po mc-4.6.0-pre3/po/pl.po --- mc-4.6.0-pre3.orig/po/pl.po 2003-01-22 08:47:00.000000000 +0100 +++ mc-4.6.0-pre3/po/pl.po 2003-01-28 18:40:04.000000000 +0100 @@@@ -2490,6 +2490,10 @@@@ msgid "&File types" msgstr "Typy plików" +#: src/layout.c:176 +msgid "&Show .. in /" +msgstr "Pokazuj .. w /" + #: src/layout.c:362 src/learn.c:61 src/learn.c:176 src/option.c:147 msgid "&Save" msgstr "&Zapisz" @ 1.5 log @- Fixed dotdot_in_rootdir patch. @ text @d1 28 d66 1 a66 1 +++ mc-4.6.0-pre3/src/layout.c 2003-01-28 21:10:02.000000000 +0100 d121 6 a126 2 @@@@ -458,6 +468,8 @@@@ check_options [i].widget = check_new (8 - i, 7 + first_width, XTRACT(i)); d129 1 a129 1 + check_options [9].widget = check_new (2, 7 + first_width, XTRACT(9)); @ 1.4 log @- Fixed a stupid typo in dotdot_in_rootdir patch. @ text @d38 1 a38 1 +++ mc-4.6.0-pre3/src/layout.c 2003-01-28 18:48:49.000000000 +0100 d73 30 a102 1 @@@@ -471,6 +477,7 @@@@ @ 1.3 log @- Splitted out diffs relevant to po files from dotdot_in_rootdir patch. - Added dotdot_in_rootdir_po patch but disabled for now as one of translation files causes compile-time problems. @ text @d61 1 a61 1 + { N_("&Show .. in /"), &dotdot_in_rootrir, 0, "dd" }, @ 1.2 log @- Renamed dotdot_in_root_dir patch to dotdot_in_rootdir. - Improved dotdot_in_rootdir patch. Now it is possible to set a proper configuration option to tell mc whether it should show .. in /. @ text @a0 28 diff -ruN mc-4.6.0-pre3.orig/po/mc.pot mc-4.6.0-pre3/po/mc.pot --- mc-4.6.0-pre3.orig/po/mc.pot 2003-01-22 08:46:54.000000000 +0100 +++ mc-4.6.0-pre3/po/mc.pot 2003-01-28 18:40:59.000000000 +0100 @@@@ -2370,6 +2370,10 @@@@ msgid "&File types" msgstr "" +#: src/layout.c:176 +msgid "&Show .. in /" +msgstr "" + #: src/layout.c:362 src/learn.c:61 src/learn.c:176 src/option.c:147 msgid "&Save" msgstr "" diff -ruN mc-4.6.0-pre3.orig/po/pl.po mc-4.6.0-pre3/po/pl.po --- mc-4.6.0-pre3.orig/po/pl.po 2003-01-22 08:47:00.000000000 +0100 +++ mc-4.6.0-pre3/po/pl.po 2003-01-28 18:40:04.000000000 +0100 @@@@ -2490,6 +2490,10 @@@@ msgid "&File types" msgstr "Typy plików" +#: src/layout.c:176 +msgid "&Show .. in /" +msgstr "Pokazuj .. w /" + #: src/layout.c:362 src/learn.c:61 src/learn.c:176 src/option.c:147 msgid "&Save" msgstr "&Zapisz" @ 1.1 log @*** empty log message *** @ text @d1 28 d31 10 a40 2 +++ mc-4.6.0-pre3/src/dir.c 2003-01-28 18:27:12.000000000 +0100 @@@@ -503,8 +503,9 @@@@ d52 1 a52 1 @@@@ -655,8 +656,9 @@@@ d64 6 a69 6 diff -ruN mc-4.6.0-pre3.orig/src/main.c mc-4.6.0-pre3/src/main.c --- mc-4.6.0-pre3.orig/src/main.c 2003-01-21 03:25:51.000000000 +0100 +++ mc-4.6.0-pre3/src/main.c 2003-01-28 18:19:05.000000000 +0100 @@@@ -211,6 +211,9 @@@@ /* Controls screen clearing before an exec */ int clear_before_exec = 1; d74 10 a83 2 /* Asks for confirmation before deleting a file */ int confirm_delete = 1; d85 31 a115 7 diff -ruN mc-4.6.0-pre3.orig/src/main.h mc-4.6.0-pre3/src/main.h --- mc-4.6.0-pre3.orig/src/main.h 2002-12-26 17:20:51.000000000 +0100 +++ mc-4.6.0-pre3/src/main.h 2003-01-28 18:19:29.000000000 +0100 @@@@ -77,6 +77,7 @@@@ extern int searching; extern int vfs_use_limit; extern int alternate_plus_minus; d117 3 a119 3 extern int only_leading_plus_minus; extern int output_starts_shell; extern int midnight_shutdown; @ .