Get the global bindings working on gnome/mc

Miguel.
This commit is contained in:
Miguel de Icaza 1998-05-05 05:49:57 +00:00
parent 0096abca47
commit 55fa825b8b
6 changed files with 86 additions and 58 deletions

View File

@ -1 +1 @@
#define VERSION "4.1.32" #define VERSION "4.1.33"

View File

@ -1,5 +1,8 @@
1998-05-04 Miguel de Icaza <miguel@nuclecu.unam.mx> 1998-05-04 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gmain.c (dialog_panel_callback): Call midnight_callback to get
the main bindings working.
* gdesktop.c (perform_drop_manually): Use p to walk the dropped * gdesktop.c (perform_drop_manually): Use p to walk the dropped
data. This is an important bug fix. data. This is an important bug fix.

View File

@ -392,6 +392,10 @@ dialog_panel_callback (struct Dlg_head *h, int id, int msg)
dh = dh->next; dh = dh->next;
} while (dh != h->current); } while (dh != h->current);
} }
if (msg == DLG_UNHANDLED_KEY || msg == DLG_HOTKEY_HANDLED)
return midnight_callback (h, id, msg);
return default_dlg_callback (h, id, msg); return default_dlg_callback (h, id, msg);
} }

View File

@ -1,6 +1,6 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Date: 1998-05-04 02:53:24-0500\n" "Date: 1998-05-04 12:45:28-0500\n"
"From: Miguel de Icaza,computo,622-4680 <miguel@metropolis.nuclecu.unam.mx>\n" "From: Miguel de Icaza,computo,622-4680 <miguel@metropolis.nuclecu.unam.mx>\n"
"Content-Type: text/plain; charset=\n" "Content-Type: text/plain; charset=\n"
"Xgettext-Options: --default-domain=mc --directory=.. --add-comments --keyword=_ --keyword=N_ --files-from=./POTFILES.in\n" "Xgettext-Options: --default-domain=mc --directory=.. --add-comments --keyword=_ --keyword=N_ --files-from=./POTFILES.in\n"
@ -2782,145 +2782,145 @@ msgstr ""
msgid "Menu" msgid "Menu"
msgstr "" msgstr ""
#: src/main.c:1887 #: src/main.c:1884
msgid "Thank you for using GNU Midnight Commander" msgid "Thank you for using GNU Midnight Commander"
msgstr "" msgstr ""
#: src/main.c:2233 #: src/main.c:2246
msgid "with mouse support on xterm%s.\n" msgid "with mouse support on xterm%s.\n"
msgstr "" msgstr ""
#: src/main.c:2234 #: src/main.c:2247
msgid " and the Linux console" msgid " and the Linux console"
msgstr "" msgstr ""
#: src/main.c:2325 #: src/main.c:2338
msgid "The TERM environment variable is unset!\n" msgid "The TERM environment variable is unset!\n"
msgstr "" msgstr ""
#: src/main.c:2577 #: src/main.c:2590
msgid "Library directory for the Midnight Commander: %s\n" msgid "Library directory for the Midnight Commander: %s\n"
msgstr "" msgstr ""
#: src/main.c:2582 #: src/main.c:2595
msgid "Option -m is obsolete. Please look at Display Bits... in the Option's menu\n" msgid "Option -m is obsolete. Please look at Display Bits... in the Option's menu\n"
msgstr "" msgstr ""
#: src/main.c:2645 #: src/main.c:2658
msgid "[DEVEL-ONLY: Debug the background code]" msgid "[DEVEL-ONLY: Debug the background code]"
msgstr "" msgstr ""
#: src/main.c:2648 #: src/main.c:2661
msgid "Create command file to set default directory upon exit." msgid "Create command file to set default directory upon exit."
msgstr "" msgstr ""
#: src/main.c:2650 #: src/main.c:2663
msgid "Force color mode." msgid "Force color mode."
msgstr "" msgstr ""
#: src/main.c:2651 #: src/main.c:2664
msgid "Specify colors (use --help-colors to get a list)." msgid "Specify colors (use --help-colors to get a list)."
msgstr "" msgstr ""
#: src/main.c:2653 #: src/main.c:2666
msgid "[DEVEL-ONLY: Debug the subshell." msgid "[DEVEL-ONLY: Debug the subshell."
msgstr "" msgstr ""
#: src/main.c:2655 #: src/main.c:2668
msgid "Startup the internal editor." msgid "Startup the internal editor."
msgstr "" msgstr ""
#: src/main.c:2656 #: src/main.c:2669
msgid "Shows this help message." msgid "Shows this help message."
msgstr "" msgstr ""
#: src/main.c:2657 #: src/main.c:2670
msgid "Help on how to specify colors." msgid "Help on how to specify colors."
msgstr "" msgstr ""
#: src/main.c:2659 #: src/main.c:2672
msgid "Log ftpfs commands to the file." msgid "Log ftpfs commands to the file."
msgstr "" msgstr ""
#: src/main.c:2661 #: src/main.c:2674
msgid "Prints out the configured paths." msgid "Prints out the configured paths."
msgstr "" msgstr ""
#: src/main.c:2663 #: src/main.c:2676
msgid "Force black and white display." msgid "Force black and white display."
msgstr "" msgstr ""
#: src/main.c:2664 #: src/main.c:2677
msgid "Disable mouse support." msgid "Disable mouse support."
msgstr "" msgstr ""
#: src/main.c:2666 #: src/main.c:2679
msgid "Force the concurrent subshell mode" msgid "Force the concurrent subshell mode"
msgstr "" msgstr ""
#: src/main.c:2667 #: src/main.c:2680
msgid "Disable the concurrent subshell mode." msgid "Disable the concurrent subshell mode."
msgstr "" msgstr ""
#: src/main.c:2668 #: src/main.c:2681
msgid "Force subshell execution." msgid "Force subshell execution."
msgstr "" msgstr ""
#: src/main.c:2670 #: src/main.c:2683
msgid "At exit, print the last working directory." msgid "At exit, print the last working directory."
msgstr "" msgstr ""
#: src/main.c:2671 #: src/main.c:2684
msgid "Reset softkeys (HP terminals only) to their terminfo/termcap default." msgid "Reset softkeys (HP terminals only) to their terminfo/termcap default."
msgstr "" msgstr ""
#: src/main.c:2672 #: src/main.c:2685
msgid "Disables verbose operation (for slow terminals)." msgid "Disables verbose operation (for slow terminals)."
msgstr "" msgstr ""
#: src/main.c:2674 #: src/main.c:2687
msgid "Use simple symbols for line drawing." msgid "Use simple symbols for line drawing."
msgstr "" msgstr ""
#: src/main.c:2679 #: src/main.c:2692
msgid "Activate support for the TERMCAP variable." msgid "Activate support for the TERMCAP variable."
msgstr "" msgstr ""
#: src/main.c:2681 #: src/main.c:2694
msgid "Report versionand configuration options." msgid "Report versionand configuration options."
msgstr "" msgstr ""
#: src/main.c:2682 #: src/main.c:2695
msgid "Start up into the viewer mode." msgid "Start up into the viewer mode."
msgstr "" msgstr ""
#: src/main.c:2683 #: src/main.c:2696
msgid "Force xterm mouse support and screen save/restore" msgid "Force xterm mouse support and screen save/restore"
msgstr "" msgstr ""
#: src/main.c:2684 #: src/main.c:2697
msgid "Geometry for the window" msgid "Geometry for the window"
msgstr "" msgstr ""
#: src/main.c:2685 #: src/main.c:2698
msgid "No windows opened at startup" msgid "No windows opened at startup"
msgstr "" msgstr ""
#: src/main.c:2762 #: src/main.c:2775
msgid "[this dir] [other dir]" msgid "[this dir] [other dir]"
msgstr "" msgstr ""
#: src/main.c:3004 #: src/main.c:3017
msgid "" msgid ""
"Couldn't open tty line. You have to run mc without the -P flag.\n" "Couldn't open tty line. You have to run mc without the -P flag.\n"
"On some systems you may want to run # `which mc`\n" "On some systems you may want to run # `which mc`\n"
msgstr "" msgstr ""
#: src/main.c:3092 #: src/main.c:3105
msgid " Notice " msgid " Notice "
msgstr "" msgstr ""
#: src/main.c:3093 #: src/main.c:3106
msgid "" msgid ""
" The Midnight Commander configuration files \n" " The Midnight Commander configuration files \n"
" are now stored in the ~/.mc directory, the \n" " are now stored in the ~/.mc directory, the \n"

View File

@ -1,3 +1,11 @@
1998-05-04 Miguel de Icaza <miguel@nuclecu.unam.mx>
* main.c (ctl_x_cmd): Implement ctl-x handling as a state of the
key press events. Drop the usage of mi_getch to acomplish this
task.
(midnight_callback): Deal with the current map depending on the
c-x state.
Mon May 4 10:21:31 1998 Norbert Warmuth <k3190@fh-sw.de> Mon May 4 10:21:31 1998 Norbert Warmuth <k3190@fh-sw.de>
* background.c (message_1s1d): the unprocessed string with %d was * background.c (message_1s1d): the unprocessed string with %d was

View File

@ -1682,10 +1682,12 @@ static key_map ctl_x_map [] = {
{ 'a', reselect_vfs }, { 'a', reselect_vfs },
#endif #endif
{ 'd', compare_dirs_cmd }, { 'd', compare_dirs_cmd },
#ifndef HAVE_GNOME
{ 'p', copy_current_pathname }, { 'p', copy_current_pathname },
{ XCTRL('p'), copy_other_pathname }, { XCTRL('p'), copy_other_pathname },
{ 't', copy_current_tagged }, { 't', copy_current_tagged },
{ XCTRL('t'), copy_other_tagged }, { XCTRL('t'), copy_other_tagged },
#endif
{ 'c', chmod_cmd }, { 'c', chmod_cmd },
#ifndef OS2_NT #ifndef OS2_NT
{ 'o', chown_cmd }, { 'o', chown_cmd },
@ -1711,17 +1713,11 @@ static key_map ctl_x_map [] = {
{ 0, 0 } { 0, 0 }
}; };
static int ctl_x_map_enabled = 0;
static void ctl_x_cmd (int ignore) static void ctl_x_cmd (int ignore)
{ {
int i; ctl_x_map_enabled = 1;
int key = mi_getch ();
for (i = 0; ctl_x_map [i].key_code; i++){
if (key == ctl_x_map [i].key_code){
(*ctl_x_map [i].fn)(key);
break;
}
}
} }
static void nothing () static void nothing ()
@ -1729,6 +1725,7 @@ static void nothing ()
} }
static key_map default_map [] = { static key_map default_map [] = {
#ifndef HAVE_GNOME
{ KEY_F(19), menu_last_selected_cmd }, { KEY_F(19), menu_last_selected_cmd },
{ KEY_F(20), (key_callback) quiet_quit_cmd }, { KEY_F(20), (key_callback) quiet_quit_cmd },
@ -1743,15 +1740,15 @@ static key_map default_map [] = {
/* To access the directory hotlist */ /* To access the directory hotlist */
{ XCTRL('\\'), quick_chdir_cmd }, { XCTRL('\\'), quick_chdir_cmd },
/* Suspend */
{ XCTRL('z'), suspend_cmd },
#endif
/* The filtered view command */ /* The filtered view command */
{ ALT('!'), filtered_view_cmd_cpanel }, { ALT('!'), filtered_view_cmd_cpanel },
/* Find file */ /* Find file */
{ ALT('?'), find_cmd }, { ALT('?'), find_cmd },
/* Suspend */
{ XCTRL('z'), suspend_cmd },
/* Panel refresh */ /* Panel refresh */
{ XCTRL('r'), reread_cmd }, { XCTRL('r'), reread_cmd },
@ -1932,6 +1929,15 @@ int midnight_callback (struct Dlg_head *h, int id, int msg)
return MSG_HANDLED; return MSG_HANDLED;
case DLG_KEY: case DLG_KEY:
if (ctl_x_map_enabled){
ctl_x_map_enabled = 0;
for (i = 0; ctl_x_map [i].key_code; i++)
if (id == ctl_x_map [i].key_code){
(*ctl_x_map [i].fn)(id);
return MSG_HANDLED;
}
}
if (id == KEY_F(10) && !the_menubar->active){ if (id == KEY_F(10) && !the_menubar->active){
quit_cmd (); quit_cmd ();
return MSG_HANDLED; return MSG_HANDLED;
@ -2005,16 +2011,23 @@ int midnight_callback (struct Dlg_head *h, int id, int msg)
if (v) if (v)
return v; return v;
} }
for (i = 0; default_map [i].key_code; i++){ if (ctl_x_map_enabled){
if (id == default_map [i].key_code){ ctl_x_map_enabled = 0;
(*default_map [i].fn)(id); for (i = 0; ctl_x_map [i].key_code; i++)
break; if (id == ctl_x_map [i].key_code){
} (*ctl_x_map [i].fn)(id);
return MSG_HANDLED;
}
} else {
for (i = 0; default_map [i].key_code; i++){
if (id == default_map [i].key_code){
(*default_map [i].fn)(id);
return MSG_HANDLED;
}
}
} }
if (default_map [i].key_code) return MSG_NOT_HANDLED;
return MSG_HANDLED;
else
return MSG_NOT_HANDLED;
#endif #endif
#ifndef HAVE_X #ifndef HAVE_X
/* We handle the special case of the output lines */ /* We handle the special case of the output lines */