mirror of https://github.com/MidnightCommander/mc
Fri Apr 3 05:23:20 1998 Alex Tkachenko <alex@bcs.zp.ua>
* configure.in: ALL_LINGUAS test added, to allow specify list of languages to be installed by setting env variable before configure. If it is empty, it defaults to full list. * src/menu.h menu_entry.{hot_pos, is_dupped} dropped * src/menu.c: consistency fixes: pull-down menu items are now accessible either with arrow keys or with hotkeys, denoted with & (and highlighted). (key combinations, placed to the right of items intended to be used from outside the menus). Freeing menu entries removed as it no longer needed * src/main.c, edit/editmenu.c: menubar init code is changed to conform above fixes. * edit/edit.h: use of "Cancel" in error_dialogs replaced with "Dismiss", to avoid collisions in translation of "Cancel" in other places with this case. * src/boxes.c: select_format() and it's support removed, as it is obsoleted by input line history feature. display_init()/display_callback fixed to suite i18n changes. sort_box() - alike. * src/option.c: pause_options added &'s and gettext calls to expand statically assigned values. * src/widget.c: (radio_callback) hotkey recognition is changed to &-notation, rather than simple uppercase. * src/dlg.c: (dlg_try_hotkey) plain symbol comparison replaced with call to isalpha(), this fixes errorneous exit from input line, when button hotkey is 8-bit NLS char.
This commit is contained in:
parent
551dec7a7f
commit
26f6e92abf
|
@ -8,7 +8,10 @@ PACKAGE=mc
|
|||
VERSION=dummy
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
||||
AC_DEFINE_UNQUOTED(VERSION, "dummy")
|
||||
ALL_LINGUAS="fr es"
|
||||
|
||||
if test x$ALL_LINGUAS = x; then
|
||||
ALL_LINGUAS="fr es"
|
||||
fi
|
||||
|
||||
dnl This is path where we're looking for headers in addition to /usr/include
|
||||
dnl and whatever cpp defaults to.
|
||||
|
@ -939,7 +942,7 @@ INTLSUB=""
|
|||
if test x$USE_NLS = xyes; then
|
||||
if test $ac_cv_header_libintl_h = no; then
|
||||
CPPFLAGS="$CPPFLAGS -I\$(builddir)/intl"
|
||||
LIBS="-L\$(builddir)/intl $LIBS"
|
||||
LIBS="-L\$(builddir)/intl -lintl $LIBS"
|
||||
fi
|
||||
INTLSUB=intl
|
||||
fi
|
||||
|
|
|
@ -418,8 +418,8 @@ char *edit_init_error_msg = NULL;
|
|||
|
||||
# else /* ! _EDIT_C */
|
||||
|
||||
# define edit_error_dialog(h,s) query_dialog (h, s, 0, 1, "Cancel")
|
||||
# define edit_message_dialog(h,s) query_dialog (h, s, 0, 1, "Ok")
|
||||
# define edit_error_dialog(h,s) query_dialog (h, s, 0, 1, _("&Dismiss"))
|
||||
# define edit_message_dialog(h,s) query_dialog (h, s, 0, 1, _("&Ok"))
|
||||
extern char *edit_init_error_msg;
|
||||
|
||||
# endif /* ! _EDIT_C */
|
||||
|
|
141
edit/editmenu.c
141
edit/editmenu.c
|
@ -114,146 +114,145 @@ void menu_options (void) { edit_options_dialog (); }
|
|||
|
||||
static menu_entry FileMenu[] =
|
||||
{
|
||||
{' ', N_("Open/load... C-o"), 'O', 0, menu_load_cmd},
|
||||
{' ', N_("New C-n"), 'N', 0, menu_new_cmd},
|
||||
{' ', N_("&Open/load... C-o"), 'O', menu_load_cmd},
|
||||
{' ', N_("&New C-n"), 'N', menu_new_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Save F2"), 'S', 0, menu_save_cmd},
|
||||
{' ', N_("save As... F12"), 'A', 5, menu_save_as_cmd},
|
||||
{' ', N_("&Save F2"), 'S', menu_save_cmd},
|
||||
{' ', N_("save &As... F12"), 'A', menu_save_as_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Insert file... F15"), 'I', 0, menu_insert_file_cmd},
|
||||
{' ', N_("copy to File... C-f"), 'F', 8, menu_cut_cmd},
|
||||
{' ', N_("&Insert file... F15"), 'I', menu_insert_file_cmd},
|
||||
{' ', N_("copy to &File... C-f"), 'F', menu_cut_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("aBout... "), 'B', 1, edit_about_cmd},
|
||||
{' ', N_("a&Bout... "), 'B', edit_about_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Quit F10"), 'Q', 0, menu_quit_cmd}
|
||||
};
|
||||
{' ', N_("&Quit F10"), 'Q', menu_quit_cmd}
|
||||
};
|
||||
|
||||
static menu_entry FileMenuEmacs[] =
|
||||
{
|
||||
{' ', N_("Open/load... C-o"), 'O', 0, menu_load_cmd},
|
||||
{' ', N_("New C-x k"), 'N', 0, menu_new_cmd},
|
||||
{' ', N_("&Open/load... C-o"), 'O', menu_load_cmd},
|
||||
{' ', N_("&New C-x k"), 'N', menu_new_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Save F2"), 'S', 0, menu_save_cmd},
|
||||
{' ', N_("save As... F12"), 'A', 5, menu_save_as_cmd},
|
||||
{' ', N_("&Save F2"), 'S', menu_save_cmd},
|
||||
{' ', N_("save &As... F12"), 'A', menu_save_as_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Insert file... F15"), 'I', 0, menu_insert_file_cmd},
|
||||
{' ', N_("copy to File... "), 'F', 8, menu_cut_cmd},
|
||||
{' ', N_("&Insert file... F15"), 'I', menu_insert_file_cmd},
|
||||
{' ', N_("copy to &File... "), 'F', menu_cut_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("aBout... "), 'B', 1, edit_about_cmd},
|
||||
{' ', N_("a&Bout... "), 'B', edit_about_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Quit F10"), 'Q', 0, menu_quit_cmd}
|
||||
{' ', N_("&Quit F10"), 'Q', menu_quit_cmd}
|
||||
};
|
||||
|
||||
static menu_entry EditMenu[] =
|
||||
{
|
||||
{' ', N_("Toggle Mark F3"), 'T', 0, menu_mark_cmd},
|
||||
{' ', N_("&Toggle Mark F3"), 'T', menu_mark_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("toggle Ins/overw Ins"), 'I', 7, menu_ins_cmd},
|
||||
{' ', N_("toggle &Ins/overw Ins"), 'I', menu_ins_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Copy F5"), 'C', 0, menu_copy_cmd},
|
||||
{' ', N_("Move F6"), 'M', 0, menu_move_cmd},
|
||||
{' ', N_("Delete F8"), 'D', 0, menu_delete_cmd},
|
||||
{' ', N_("&Copy F5"), 'C', menu_copy_cmd},
|
||||
{' ', N_("&Move F6"), 'M', menu_move_cmd},
|
||||
{' ', N_("&Delete F8"), 'D', menu_delete_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Undo C-u"), 'U', 0, menu_undo_cmd},
|
||||
{' ', N_("&Undo C-u"), 'U', menu_undo_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Beginning C-PgUp"), 'B', 0, menu_beginning_cmd},
|
||||
{' ', N_("End C-PgDn"), 'E', 0, menu_end_cmd}
|
||||
{' ', N_("&Beginning C-PgUp"), 'B', menu_beginning_cmd},
|
||||
{' ', N_("&End C-PgDn"), 'E', menu_end_cmd}
|
||||
};
|
||||
|
||||
static menu_entry EditMenuEmacs[] =
|
||||
{
|
||||
{' ', N_("Toggle Mark F3"), 'T', 0, menu_mark_cmd},
|
||||
{' ', N_("&Toggle Mark F3"), 'T', menu_mark_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("toggle Ins/overw Ins"), 'I', 7, menu_ins_cmd},
|
||||
{' ', N_("toggle &Ins/overw Ins"), 'I', menu_ins_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Copy F5"), 'C', 0, menu_copy_cmd},
|
||||
{' ', N_("Move F6"), 'M', 0, menu_move_cmd},
|
||||
{' ', N_("Delete F8"), 'D', 0, menu_delete_cmd},
|
||||
{' ', N_("&Copy F5"), 'C', menu_copy_cmd},
|
||||
{' ', N_("&Move F6"), 'M', menu_move_cmd},
|
||||
{' ', N_("&Delete F8"), 'D', menu_delete_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Undo C-u"), 'U', 0, menu_undo_cmd},
|
||||
{' ', N_("&Undo C-u"), 'U', menu_undo_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Beginning C-PgUp"), 'B', 0, menu_beginning_cmd},
|
||||
{' ', N_("End C-PgDn"), 'E', 0, menu_end_cmd}
|
||||
{' ', N_("&Beginning C-PgUp"), 'B', menu_beginning_cmd},
|
||||
{' ', N_("&End C-PgDn"), 'E', menu_end_cmd}
|
||||
};
|
||||
|
||||
static menu_entry SearReplMenu[] =
|
||||
{
|
||||
{' ', N_("Search... F7"), 'S', 0, menu_search_cmd},
|
||||
{' ', N_("search Again F17"), 'A', 7, menu_search_again_cmd},
|
||||
{' ', N_("Replace... F4"), 'R', 0, menu_replace_cmd}
|
||||
{' ', N_("&Search... F7"), 'S', menu_search_cmd},
|
||||
{' ', N_("search &Again F17"), 'A', menu_search_again_cmd},
|
||||
{' ', N_("&Replace... F4"), 'R', menu_replace_cmd}
|
||||
};
|
||||
|
||||
static menu_entry SearReplMenuEmacs[] =
|
||||
{
|
||||
{' ', N_("Search... F7"), 'S', 0, menu_search_cmd},
|
||||
{' ', N_("search Again F17"), 'A', 7, menu_search_again_cmd},
|
||||
{' ', N_("Replace... F4"), 'R', 0, menu_replace_cmd}
|
||||
{' ', N_("&Search... F7"), 'S', menu_search_cmd},
|
||||
{' ', N_("search &Again F17"), 'A', menu_search_again_cmd},
|
||||
{' ', N_("&Replace... F4"), 'R', menu_replace_cmd}
|
||||
};
|
||||
|
||||
static menu_entry CmdMenu[] =
|
||||
{
|
||||
{' ', N_("Goto line... M-l"), 'G', 0, menu_goto_line},
|
||||
{' ', N_("&Goto line... M-l"), 'G', menu_goto_line},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("insert Literal... C-q"), 'L', 7, menu_lit_cmd},
|
||||
{' ', N_("insert &Literal... C-q"), 'L', menu_lit_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Refresh screen C-l"), 'R', 0, menu_refresh_cmd},
|
||||
{' ', N_("&Refresh screen C-l"), 'R', menu_refresh_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Start record macro C-r"), 'S', 0, menu_begin_record_cmd},
|
||||
{' ', N_("Finish record macro... C-r"), 'F', 0, menu_end_record_cmd},
|
||||
{' ', N_("Execute macro... C-a, KEY"), 'E', 0, menu_exec_macro_cmd},
|
||||
{' ', N_("Delete macro... "), 'o',11, menu_exec_macro_delete_cmd},
|
||||
{' ', N_("&Start record macro C-r"), 'S', menu_begin_record_cmd},
|
||||
{' ', N_("&Finish record macro... C-r"), 'F', menu_end_record_cmd},
|
||||
{' ', N_("&Execute macro... C-a, KEY"), 'E', menu_exec_macro_cmd},
|
||||
{' ', N_("delete macr&O... "), 'O', menu_exec_macro_delete_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("insert Date/time "), 'D', 7, menu_date_cmd},
|
||||
{' ', N_("insert &Date/time "), 'D', menu_date_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Format paragraph M-p"), 'a', 4, menu_format_paragraph},
|
||||
{' ', N_("'ispell' Spell Check C-p"), 'p', 3, menu_ispell_cmd},
|
||||
{' ', N_("Sort... M-t"), 't', 3, menu_sort_cmd},
|
||||
{' ', N_("'indent' C Formatter F19"), 'C', 9, menu_c_form_cmd},
|
||||
{' ', N_("Mail... "), 'M', 0, menu_mail_cmd}
|
||||
{' ', N_("format p&Aragraph M-p"), 'A', menu_format_paragraph},
|
||||
{' ', N_("'ispell' s&Pell check C-p"), 'P', menu_ispell_cmd},
|
||||
{' ', N_("sor&T... M-t"), 'T', menu_sort_cmd},
|
||||
{' ', N_("'indent' &C Formatter F19"), 'C', menu_c_form_cmd},
|
||||
{' ', N_("&Mail... "), 'M', menu_mail_cmd}
|
||||
};
|
||||
|
||||
static menu_entry CmdMenuEmacs[] =
|
||||
{
|
||||
{' ', N_("Goto line... M-l"), 'G', 0, menu_goto_line},
|
||||
{' ', N_("&Goto line... M-l"), 'G', menu_goto_line},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("insert Literal... C-q"), 'L', 7, menu_lit_cmd},
|
||||
{' ', N_("insert &Literal... C-q"), 'L', menu_lit_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Refresh screen C-l"), 'R', 0, menu_refresh_cmd},
|
||||
{' ', N_("&Refresh screen C-l"), 'R', menu_refresh_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Start record macro C-r"), 'S', 0, menu_begin_record_cmd},
|
||||
{' ', N_("Finish record macro... C-r"), 'F', 0, menu_end_record_cmd},
|
||||
{' ', N_("Execute macro... C-x e, KEY"), 'E', 0, menu_exec_macro_cmd},
|
||||
{' ', N_("Delete macro... "), 'o',11, menu_exec_macro_delete_cmd},
|
||||
{' ', N_("&Start record macro C-r"), 'S', menu_begin_record_cmd},
|
||||
{' ', N_("&Finish record macro... C-r"), 'F', menu_end_record_cmd},
|
||||
{' ', N_("&Execute macro... C-x e, KEY"), 'E', menu_exec_macro_cmd},
|
||||
{' ', N_("delete macr&O... "), 'o', menu_exec_macro_delete_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("insert Date/time "), 'D', 7, menu_date_cmd},
|
||||
{' ', N_("insert &Date/time "), 'D', menu_date_cmd},
|
||||
{' ', "", ' ', 0},
|
||||
{' ', N_("Format paragraph M-p"), 'a', 4, menu_format_paragraph},
|
||||
{' ', N_("'ispell' Spell Check M-$"), 'P', 3, menu_ispell_cmd},
|
||||
{' ', N_("Sort... M-t"), 'T', 3, menu_sort_cmd},
|
||||
{' ', N_("'indent' C Formatter F19"), 'C', 9, menu_c_form_cmd}
|
||||
{' ', N_("format p&Aragraph M-p"), 'a', menu_format_paragraph},
|
||||
{' ', N_("'ispell' s&Pell check M-$"), 'P', menu_ispell_cmd},
|
||||
{' ', N_("sor&T... M-t"), 'T', menu_sort_cmd},
|
||||
{' ', N_("'indent' &C Formatter F19"), 'C', menu_c_form_cmd}
|
||||
};
|
||||
|
||||
extern void menu_save_mode_cmd (void);
|
||||
|
||||
static menu_entry OptMenu[] =
|
||||
{
|
||||
{' ', N_("General... "), 'G', 0, menu_options},
|
||||
{' ', N_("Save mode..."), 'S', 0, menu_save_mode_cmd}
|
||||
{' ', N_("&General... "), 'G', menu_options},
|
||||
{' ', N_("&Save mode..."), 'S', menu_save_mode_cmd}
|
||||
#if 0
|
||||
{' ', N_("Layout..."), 'L', 0, menu_layout_cmd}
|
||||
{' ', N_("&Layout..."), 'L', menu_layout_cmd}
|
||||
#endif
|
||||
};
|
||||
|
||||
static menu_entry OptMenuEmacs[] =
|
||||
{
|
||||
{' ', N_("General... "), 'G', 0, menu_options},
|
||||
{' ', N_("Save mode..."), 'S', 0, menu_save_mode_cmd}
|
||||
{' ', N_("&General... "), 'G', menu_options},
|
||||
{' ', N_("&Save mode..."), 'S', menu_save_mode_cmd}
|
||||
#if 0
|
||||
{' ', N_("Layout..."), 'L', 0, menu_layout_cmd}
|
||||
{' ', N_("&Layout..."), 'L', menu_layout_cmd}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#define menu_entries(x) sizeof(x)/sizeof(menu_entry)
|
||||
|
||||
Menu EditMenuBar[N_menus];
|
||||
|
|
|
@ -1,3 +1,38 @@
|
|||
Fri Apr 3 05:23:20 1998 Alex Tkachenko <alex@bcs.zp.ua>
|
||||
|
||||
* configure.in: ALL_LINGUAS test added, to allow specify list
|
||||
of languages to be installed by setting env variable before
|
||||
configure. If it is empty, it defaults to full list.
|
||||
|
||||
* src/menu.h menu_entry.{hot_pos, is_dupped} dropped
|
||||
|
||||
* src/menu.c: consistency fixes: pull-down menu items are now
|
||||
accessible either with arrow keys or with hotkeys, denoted with &
|
||||
(and highlighted). (key combinations, placed to the right of items
|
||||
intended to be used from outside the menus). Freeing menu entries
|
||||
removed as it no longer needed
|
||||
|
||||
* src/main.c, edit/editmenu.c: menubar init code is changed to conform
|
||||
above fixes.
|
||||
|
||||
* edit/edit.h: use of "Cancel" in error_dialogs replaced with
|
||||
"Dismiss", to avoid collisions in translation of "Cancel" in other
|
||||
places with this case.
|
||||
|
||||
* src/boxes.c: select_format() and it's support removed, as it is
|
||||
obsoleted by input line history feature. display_init()/display_callback
|
||||
fixed to suite i18n changes. sort_box() - alike.
|
||||
|
||||
* src/option.c: pause_options added &'s and gettext calls to expand
|
||||
statically assigned values.
|
||||
|
||||
* src/widget.c: (radio_callback) hotkey recognition is changed to
|
||||
&-notation, rather than simple uppercase.
|
||||
|
||||
* src/dlg.c: (dlg_try_hotkey) plain symbol comparison replaced with
|
||||
call to isalpha(), this fixes errorneous exit from input line, when
|
||||
button hotkey is 8-bit NLS char.
|
||||
|
||||
Fri Apr 3 12:23:28 1998 Norbert Warmuth <k3190@fh-sw.de>
|
||||
|
||||
* TODO: Removed obsolete entries: Similar entries in tree view
|
||||
|
|
206
src/boxes.c
206
src/boxes.c
|
@ -50,8 +50,7 @@
|
|||
#include "layout.h" /* for get_nth_panel_name proto */
|
||||
#include "background.h" /* for background definitions */
|
||||
|
||||
#define DISPLAY_X 48
|
||||
#define DISPLAY_Y 15
|
||||
static int DISPLAY_X = 45, DISPLAY_Y = 14;
|
||||
|
||||
static Dlg_head *dd;
|
||||
static WRadio *my_radio;
|
||||
|
@ -62,59 +61,16 @@ static int current_mode;
|
|||
extern int ftpfs_always_use_proxy;
|
||||
|
||||
static char **displays_status;
|
||||
static char* display_title = N_(" Listing mode ");
|
||||
|
||||
/* Controls whether the array strings have been translated */
|
||||
static int i18n_displays_flag;
|
||||
static char *displays [LIST_TYPES] = {
|
||||
N_("Full file list"), N_("Brief file list"), N_("Long file list"),
|
||||
N_("User:")
|
||||
N_("&Full file list"), N_("&Brief file list"), N_("&Long file list"),
|
||||
N_("&User defined:")
|
||||
};
|
||||
|
||||
static char *formats_section = "Formats";
|
||||
|
||||
static char *select_format (WInput *i)
|
||||
{
|
||||
void *profile_keys;
|
||||
char *key;
|
||||
char *value;
|
||||
int in_list;
|
||||
Chooser *my_user_list;
|
||||
WListbox *p;
|
||||
|
||||
my_user_list = new_chooser (DISPLAY_Y - 4, DISPLAY_X - 4, _("Listing Mode..."),
|
||||
CHOOSE_EDITABLE);
|
||||
p = my_user_list->listbox;
|
||||
p->allow_duplicates = 0;
|
||||
|
||||
in_list = 0;
|
||||
profile_keys = profile_init_iterator (formats_section, profile_name);
|
||||
while (profile_keys){
|
||||
profile_keys = profile_iterator_next (profile_keys, &key, &value);
|
||||
listbox_add_item (p, 0, 0, value, 0);
|
||||
}
|
||||
listbox_add_item (my_user_list->listbox, 0, 0, i->buffer, 0);
|
||||
|
||||
value = 0;
|
||||
if (run_chooser (my_user_list) != B_CANCEL){
|
||||
char key [2];
|
||||
int count;
|
||||
WLEntry *e;
|
||||
|
||||
key [1] = 0;
|
||||
profile_clean_section (formats_section, profile_name);
|
||||
e = p->top;
|
||||
|
||||
for (count = 0 ; count < p->count; count++, e = e->next){
|
||||
key [0] = 'A' + count - 1;
|
||||
WritePrivateProfileString (formats_section, key, e->text,
|
||||
profile_name);
|
||||
}
|
||||
value = strdup (p->current->text);
|
||||
}
|
||||
|
||||
destroy_chooser (my_user_list);
|
||||
return value;
|
||||
}
|
||||
static int user_hotkey = 'u';
|
||||
|
||||
static int display_callback (struct Dlg_head *h, int id, int Msg)
|
||||
{
|
||||
|
@ -126,16 +82,12 @@ static int display_callback (struct Dlg_head *h, int id, int Msg)
|
|||
case DLG_DRAW:
|
||||
attrset (COLOR_NORMAL);
|
||||
dlg_erase (h);
|
||||
draw_box (h, 1, 1, DISPLAY_Y-2, DISPLAY_X-2);
|
||||
draw_box (h, 1, 2, DISPLAY_Y-2, DISPLAY_X-4);
|
||||
|
||||
attrset (COLOR_HOT_NORMAL);
|
||||
dlg_move (h, 1, (DISPLAY_X-17)/2);
|
||||
addstr (_(" Listing mode "));
|
||||
dlg_move (h, 1, (DISPLAY_X - strlen(display_title))/2);
|
||||
addstr (display_title);
|
||||
attrset (COLOR_NORMAL);
|
||||
dlg_move (h, 11, 3);
|
||||
addstr (_("On input lines, use C-v to get a listbox"));
|
||||
dlg_move (h, 12, 3);
|
||||
addstr (_("with other formats"));
|
||||
break;
|
||||
|
||||
case DLG_UNFOCUS:
|
||||
|
@ -166,22 +118,7 @@ static int display_callback (struct Dlg_head *h, int id, int Msg)
|
|||
}
|
||||
}
|
||||
|
||||
/* Handle the above C-v */
|
||||
if (id == XCTRL('v') &&
|
||||
((WInput *) h->current->widget == user ||
|
||||
(WInput *) h->current->widget == status)){
|
||||
|
||||
input = (WInput *) h->current->widget;
|
||||
|
||||
text = select_format (input);
|
||||
if (text){
|
||||
assign_text (input, text);
|
||||
input_set_point (input, 0);
|
||||
}
|
||||
return MSG_HANDLED;
|
||||
}
|
||||
|
||||
if ((id|0x20) == 'u' && h->current->widget != (Widget *) user
|
||||
if (tolower(id) == user_hotkey && h->current->widget != (Widget *) user
|
||||
&& h->current->widget != (Widget *) status){
|
||||
my_radio->sel = 3;
|
||||
dlg_select_widget (h, my_radio); /* force redraw */
|
||||
|
@ -196,13 +133,49 @@ static int display_callback (struct Dlg_head *h, int id, int Msg)
|
|||
static void display_init (int radio_sel, char *init_text,
|
||||
int _check_status, char ** _status)
|
||||
{
|
||||
char* user_mini_status = _("user &Mini status");
|
||||
char* ok_button = _("&Ok");
|
||||
char* cancel_button = _("&Cancel");
|
||||
|
||||
static int button_start = 30;
|
||||
|
||||
displays_status = _status;
|
||||
|
||||
if (!i18n_displays_flag){
|
||||
int i;
|
||||
int i, l, maxlen = 0;
|
||||
char* cp;
|
||||
|
||||
display_title = _(display_title);
|
||||
for (i = 0; i < LIST_TYPES; i++)
|
||||
{
|
||||
displays [i] = _(displays [i]);
|
||||
if ((l = strlen(displays [i])) > maxlen)
|
||||
maxlen = l;
|
||||
}
|
||||
|
||||
i = strlen (ok_button) + 5;
|
||||
l = strlen (cancel_button) + 3;
|
||||
l = max(i, l);
|
||||
|
||||
i = maxlen + l + 16;
|
||||
if (i > DISPLAY_X)
|
||||
DISPLAY_X = i;
|
||||
|
||||
i = strlen (user_mini_status) + 13;
|
||||
if (i > DISPLAY_X)
|
||||
DISPLAY_X = i;
|
||||
|
||||
i = strlen (display_title) + 8;
|
||||
if (i > DISPLAY_X)
|
||||
DISPLAY_X = i;
|
||||
|
||||
button_start = DISPLAY_X - l - 5;
|
||||
|
||||
/* get hotkey of user-defined format string */
|
||||
cp = strchr(displays[LIST_TYPES-1],'&');
|
||||
if (cp != NULL && *++cp != '\0')
|
||||
user_hotkey = tolower(*cp);
|
||||
|
||||
for (i = 0; i < LIST_TYPES; i++)
|
||||
displays [i] = _(displays [i]);
|
||||
i18n_displays_flag = 1;
|
||||
}
|
||||
dd = create_dlg (0, 0, DISPLAY_Y, DISPLAY_X, dialog_colors,
|
||||
|
@ -211,25 +184,27 @@ static void display_init (int radio_sel, char *init_text,
|
|||
|
||||
x_set_dialog_title (dd, _("Listing mode"));
|
||||
add_widgetl (dd,
|
||||
button_new (4, 32, B_CANCEL, NORMAL_BUTTON, _("&Cancel"), 0, 0, "cancel-button"),
|
||||
button_new (4, button_start, B_CANCEL,
|
||||
NORMAL_BUTTON, cancel_button, 0, 0, "cancel-button"),
|
||||
XV_WLAY_RIGHTOF);
|
||||
|
||||
add_widgetl (dd,
|
||||
button_new (3, 32, B_ENTER, DEFPUSH_BUTTON, _("&Ok"), 0, 0, "ok-button"),
|
||||
button_new (3, button_start, B_ENTER,
|
||||
DEFPUSH_BUTTON, ok_button, 0, 0, "ok-button"),
|
||||
XV_WLAY_CENTERROW);
|
||||
|
||||
status = input_new (9, 8, INPUT_COLOR, 34, _status [radio_sel], "mini-input");
|
||||
status = input_new (10, 9, INPUT_COLOR, DISPLAY_X-14, _status [radio_sel], "mini-input");
|
||||
add_widgetl (dd, status, XV_WLAY_RIGHTDOWN);
|
||||
input_set_point (status, 0);
|
||||
|
||||
check_status = check_new (8, 4, _check_status, _("user &Mini status"), "mini-status");
|
||||
check_status = check_new (9, 5, _check_status, user_mini_status, "mini-status");
|
||||
add_widgetl (dd, check_status, XV_WLAY_NEXTROW);
|
||||
|
||||
user = input_new (6, 14, INPUT_COLOR, 29, init_text, "user-fmt-input");
|
||||
user = input_new (7, 9, INPUT_COLOR, DISPLAY_X-14, init_text, "user-fmt-input");
|
||||
add_widgetl (dd, user, XV_WLAY_RIGHTDOWN);
|
||||
input_set_point (user, 0);
|
||||
|
||||
my_radio = radio_new (3, 4, LIST_TYPES, displays, 1, "radio");
|
||||
my_radio = radio_new (3, 5, LIST_TYPES, displays, 1, "radio");
|
||||
my_radio->sel = my_radio->pos = current_mode;
|
||||
add_widgetl (dd, my_radio, XV_WLAY_BELOWCLOSE);
|
||||
}
|
||||
|
@ -284,17 +259,61 @@ int display_box (WPanel *panel, char **userp, char **minip, int *use_msformat,
|
|||
return result;
|
||||
}
|
||||
|
||||
#define SORT_X 40
|
||||
#define SORT_Y 14
|
||||
int SORT_X = 40, SORT_Y = 14;
|
||||
|
||||
char *sort_orders_names [SORT_TYPES];
|
||||
|
||||
sortfn *sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive)
|
||||
{
|
||||
int i, r;
|
||||
int i, r, l;
|
||||
sortfn *result;
|
||||
WCheck *c, *case_sense;
|
||||
|
||||
char* ok_button = _("&Ok");
|
||||
char* cancel_button = _("&Cancel");
|
||||
char* reverse_label = _("&Reverse");
|
||||
char* case_label = _("case sensi&tive");
|
||||
char* sort_title = _("Sort order");
|
||||
|
||||
static int i18n_sort_flag = 0, check_pos = 0, button_pos = 0;
|
||||
|
||||
if (!i18n_sort_flag)
|
||||
{
|
||||
int maxlen = 0;
|
||||
for (i = SORT_TYPES-1; i >= 0; i--)
|
||||
{
|
||||
sort_orders_names [i] = _(sort_orders [i].sort_name);
|
||||
r = strlen (sort_orders_names [i]);
|
||||
if (r > maxlen)
|
||||
maxlen = r;
|
||||
}
|
||||
|
||||
check_pos = maxlen + 9;
|
||||
|
||||
r = strlen (reverse_label) + 4;
|
||||
i = strlen (case_label) + 4;
|
||||
if (i > r)
|
||||
r = i;
|
||||
|
||||
l = strlen (ok_button) + 6;
|
||||
i = strlen (cancel_button) + 4;
|
||||
if (i > l)
|
||||
l = i;
|
||||
|
||||
i = check_pos + max(r,l) + 2;
|
||||
|
||||
if (i > SORT_X)
|
||||
SORT_X = i;
|
||||
|
||||
i = strlen (sort_title) + 6;
|
||||
if (i > SORT_X)
|
||||
SORT_X = i;
|
||||
|
||||
button_pos = SORT_X - l - 2;
|
||||
|
||||
i18n_sort_flag = 1;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
|
||||
for (i = 0; i < SORT_TYPES; i++)
|
||||
|
@ -306,22 +325,21 @@ sortfn *sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive)
|
|||
dd = create_dlg (0, 0, SORT_Y, SORT_X, dialog_colors, common_dialog_callback,
|
||||
"[Left and Right Menus]", "sort", DLG_CENTER | DLG_GRID);
|
||||
|
||||
x_set_dialog_title (dd, _("Sort order"));
|
||||
x_set_dialog_title (dd, sort_title);
|
||||
|
||||
add_widgetl (dd, button_new (8, 23, B_CANCEL, NORMAL_BUTTON, _("&Cancel"), 0, 0, "cancel-button"),
|
||||
XV_WLAY_CENTERROW);
|
||||
add_widgetl (dd,
|
||||
button_new (10, button_pos, B_CANCEL, NORMAL_BUTTON, cancel_button,
|
||||
0, 0, "cancel-button"), XV_WLAY_CENTERROW);
|
||||
|
||||
add_widgetl (dd, button_new (7, 23, B_ENTER, DEFPUSH_BUTTON, _("&Ok"), 0, 0, "ok-button"),
|
||||
XV_WLAY_RIGHTDOWN);
|
||||
add_widgetl (dd,
|
||||
button_new (9, button_pos, B_ENTER, DEFPUSH_BUTTON, ok_button,
|
||||
0, 0, "ok-button"), XV_WLAY_RIGHTDOWN);
|
||||
|
||||
case_sense = check_new (4, 19, *case_sensitive, _("case sensi&tive"), "case-check");
|
||||
case_sense = check_new (4, check_pos, *case_sensitive, case_label, "case-check");
|
||||
add_widgetl (dd, case_sense, XV_WLAY_RIGHTDOWN);
|
||||
c = check_new (3, 19, *reverse, _("&Reverse"), "reverse-check");
|
||||
c = check_new (3, check_pos, *reverse, reverse_label, "reverse-check");
|
||||
add_widgetl (dd, c, XV_WLAY_RIGHTDOWN);
|
||||
|
||||
for (i = SORT_TYPES-1; i >= 0; i--){
|
||||
sort_orders_names [i] = sort_orders [i].sort_name;
|
||||
}
|
||||
my_radio = radio_new (3, 3, SORT_TYPES, sort_orders_names, 1, "radio-1");
|
||||
my_radio->sel = my_radio->pos = current_mode;
|
||||
|
||||
|
|
28
src/dir.c
28
src/dir.c
|
@ -53,22 +53,22 @@ static int case_sensitive = OS_SORT_CASE_SENSITIVE_DEFAULT;
|
|||
#define MY_ISDIR(x) ( (S_ISDIR (x->buf.st_mode) || x->f.link_to_dir) ? 1 : 0)
|
||||
|
||||
sort_orders_t sort_orders [SORT_TYPES_TOTAL] = {
|
||||
{ N_("Unsorted"), unsorted },
|
||||
{ N_("Name"), sort_name },
|
||||
{ N_("Extension"), sort_ext },
|
||||
{ N_("Modify time"), sort_time },
|
||||
{ N_("Access time"), sort_atime },
|
||||
{ N_("Change time"), sort_ctime },
|
||||
{ N_("Size"), sort_size },
|
||||
{ N_("Inode"), sort_inode },
|
||||
{ N_("&Unsorted"), unsorted },
|
||||
{ N_("&Name"), sort_name },
|
||||
{ N_("&Extension"), sort_ext },
|
||||
{ N_("&Modify time"), sort_time },
|
||||
{ N_("&Access time"), sort_atime },
|
||||
{ N_("&Change time"), sort_ctime },
|
||||
{ N_("&Size"), sort_size },
|
||||
{ N_("&Inode"), sort_inode },
|
||||
|
||||
/* New sort orders */
|
||||
{ N_("Type"), sort_type },
|
||||
{ N_("Links"), sort_links },
|
||||
{ N_("NGID"), sort_ngid },
|
||||
{ N_("NUID"), sort_nuid },
|
||||
{ N_("Owner"), sort_owner },
|
||||
{ N_("Group"), sort_group }
|
||||
{ N_("&Type"), sort_type },
|
||||
{ N_("&Links"), sort_links },
|
||||
{ N_("N&GID"), sort_ngid },
|
||||
{ N_("N&UID"), sort_nuid },
|
||||
{ N_("&Owner"), sort_owner },
|
||||
{ N_("&Group"), sort_group }
|
||||
};
|
||||
|
||||
#define string_sortcomp(a,b) (case_sensitive ? strcmp (a,b) : strcasecmp (a,b))
|
||||
|
|
|
@ -589,8 +589,8 @@ static int dlg_try_hotkey (Dlg_head *h, int d_key)
|
|||
*/
|
||||
|
||||
if (h->current->widget->options & W_IS_INPUT){
|
||||
if (d_key >= 'A' && d_key <= 'z')
|
||||
return 0;
|
||||
if(d_key < 255 && isalpha(d_key))
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* If it's an alt key, send the message */
|
||||
|
|
17
src/layout.c
17
src/layout.c
|
@ -150,7 +150,10 @@ static int height;
|
|||
|
||||
static Dlg_head *layout_dlg;
|
||||
|
||||
static char *s_split_direction [2] = {"Vertical", "Horizontal"};
|
||||
static char *s_split_direction [2] = {
|
||||
N_("&Vertical"),
|
||||
N_("&Horizontal")
|
||||
};
|
||||
WRadio *radio_widget;
|
||||
|
||||
static struct {
|
||||
|
@ -353,7 +356,17 @@ static int layout_callback (struct Dlg_head *h, int Id, int Msg)
|
|||
|
||||
static void init_layout (void)
|
||||
{
|
||||
int i;
|
||||
int i = sizeof (s_split_direction) / sizeof(char*) ;
|
||||
static int i18n_layt_flag = 0;
|
||||
|
||||
if (!i18n_layt_flag)
|
||||
{
|
||||
while (i--)
|
||||
{
|
||||
s_split_direction [i] = _(s_split_direction [i]);
|
||||
}
|
||||
i18n_layt_flag = 1;
|
||||
}
|
||||
|
||||
layout_dlg = create_dlg (0, 0, 15, 58, dialog_colors, layout_callback,
|
||||
"[Layout]", "layout", DLG_CENTER | DLG_GRID);
|
||||
|
|
123
src/main.c
123
src/main.c
|
@ -1181,72 +1181,73 @@ static void
|
|||
void init_menu () {};
|
||||
void done_menu () {};
|
||||
#else
|
||||
/* NOTICE: hotkeys specified here are overriden in menubar_paint_idx (alex) */
|
||||
static menu_entry PanelMenu [] = {
|
||||
{ ' ', N_("Listing mode..."), 'L', 0, listing_cmd },
|
||||
{ ' ', N_("Quick view C-x q"), 'Q', 0, quick_view_cmd },
|
||||
{ ' ', N_("Info C-x i"), 'I', 0, info_cmd },
|
||||
{ ' ', N_("Tree"), 'T', 0, tree_cmd },
|
||||
{ ' ', N_("&Listing mode..."), 'L', listing_cmd },
|
||||
{ ' ', N_("&Quick view C-x q"), 'Q', quick_view_cmd },
|
||||
{ ' ', N_("&Info C-x i"), 'I', info_cmd },
|
||||
{ ' ', N_("&Tree"), 'T', tree_cmd },
|
||||
{ ' ', "", ' ', 0 },
|
||||
{ ' ', N_("Sort order..."), 'S', 0, sort_cmd },
|
||||
{ ' ', N_("&Sort order..."), 'S', sort_cmd },
|
||||
{ ' ', "", ' ', 0 },
|
||||
{ ' ', N_("Filter..."), 'F', 0, filter_cmd },
|
||||
{ ' ', N_("&Filter..."), 'F', filter_cmd },
|
||||
#ifdef USE_NETCODE
|
||||
{ ' ', "", ' ', 0 },
|
||||
{ ' ', N_("Network link..."), 'N', 0, netlink_cmd },
|
||||
{ ' ', N_("FTP link..."), 'P', 2, ftplink_cmd },
|
||||
{ ' ', N_("&Network link..."), 'N', netlink_cmd },
|
||||
{ ' ', N_("FT&P link..."), 'P', ftplink_cmd },
|
||||
#endif
|
||||
{ ' ', "", ' ', 0 },
|
||||
#ifdef OS2_NT
|
||||
{ ' ', N_("Drive... M-d"), ALT('d'), 0, drive_cmd_a },
|
||||
{ ' ', N_("&Drive... M-d"), 'D', drive_cmd_a },
|
||||
#endif
|
||||
{ ' ', N_("Rescan C-r"), XCTRL('R'), 0, reread_cmd }
|
||||
{ ' ', N_("&Rescan C-r"), 'R', reread_cmd }
|
||||
};
|
||||
|
||||
static menu_entry RightMenu [] = {
|
||||
{ ' ', N_("Listing mode..."), 'L', 0, listing_cmd },
|
||||
{ ' ', N_("Quick view C-x q"), 'Q', 0, quick_view_cmd },
|
||||
{ ' ', N_("Info C-x i"), 'I', 0, info_cmd },
|
||||
{ ' ', N_("Tree"), 'T', 0, tree_cmd },
|
||||
{ ' ', N_("&Listing mode..."), 'L', listing_cmd },
|
||||
{ ' ', N_("&Quick view C-x q"), 'Q', quick_view_cmd },
|
||||
{ ' ', N_("&Info C-x i"), 'I', info_cmd },
|
||||
{ ' ', N_("&Tree"), 'T', tree_cmd },
|
||||
{ ' ', "", ' ', 0 },
|
||||
{ ' ', N_("Sort order..."), 'S', 0, sort_cmd },
|
||||
{ ' ', N_("&Sort order..."), 'S', sort_cmd },
|
||||
{ ' ', "", ' ', 0 },
|
||||
{ ' ', N_("Filter..."), 'F', 0, filter_cmd },
|
||||
{ ' ', N_("&Filter..."), 'F', filter_cmd },
|
||||
#ifdef USE_NETCODE
|
||||
{ ' ', "", ' ', 0 },
|
||||
{ ' ', N_("Network link..."), 'N', 0, netlink_cmd },
|
||||
{ ' ', N_("FTP link..."), 'P', 2, ftplink_cmd },
|
||||
{ ' ', N_("&Network link..."), 'N', netlink_cmd },
|
||||
{ ' ', N_("FT&P link..."), 'P', ftplink_cmd },
|
||||
#endif
|
||||
{ ' ', "", ' ', 0 },
|
||||
#ifdef OS2_NT
|
||||
{ ' ', N_("Drive... M-d"), ALT('d'), 0, drive_cmd_b },
|
||||
{ ' ', N_("&Drive... M-d"), 'D', drive_cmd_b },
|
||||
#endif
|
||||
{ ' ', N_("Rescan C-r"), XCTRL('R'), 0, reread_cmd }
|
||||
{ ' ', N_("&Rescan C-r"), 'R', reread_cmd }
|
||||
};
|
||||
|
||||
static menu_entry FileMenu [] = {
|
||||
{ ' ', N_("User menu F2"), KEY_F(2), 0, user_menu_cmd },
|
||||
{ ' ', N_("View F3"), KEY_F(3), 0, view_cmd },
|
||||
{ ' ', N_("Filtered view M-!"), ALT('!'), 0, filtered_view_cmd },
|
||||
{ ' ', N_("Edit F4"), KEY_F(4), 0, edit_cmd },
|
||||
{ ' ', N_("Copy F5"), KEY_F(5), 2, copy_cmd },
|
||||
{ ' ', N_("Chmod C-x c"), 'C', 0, chmod_cmd },
|
||||
{ ' ', N_("&User menu F2"), 'U', user_menu_cmd },
|
||||
{ ' ', N_("&View F3"), 'V', view_cmd },
|
||||
{ ' ', N_("&Filtered view M-!"), 'F', filtered_view_cmd },
|
||||
{ ' ', N_("&Edit F4"), 'E', edit_cmd },
|
||||
{ ' ', N_("&Copy F5"), 'C', copy_cmd },
|
||||
{ ' ', N_("c&Hmod C-x c"), 'H', chmod_cmd },
|
||||
#ifndef OS2_NT
|
||||
{ ' ', N_("Link C-x l"), 'L', 0, link_cmd },
|
||||
{ ' ', N_("SymLink C-x s"), 'S', 0, symlink_cmd },
|
||||
{ ' ', N_("Edit symlink C-x C-s"), 'Y', 6, edit_symlink_cmd },
|
||||
{ ' ', N_("Chown C-x o"), 'O', 2, chown_cmd },
|
||||
{ ' ', N_("Advanced chown "), 'A', 0, chown_advanced_cmd },
|
||||
{ ' ', N_("&Link C-x l"), 'L', link_cmd },
|
||||
{ ' ', N_("&SymLink C-x s"), 'S', symlink_cmd },
|
||||
{ ' ', N_("edit s&Ymlink C-x C-s"), 'Y', edit_symlink_cmd },
|
||||
{ ' ', N_("ch&Own C-x o"), 'O', chown_cmd },
|
||||
{ ' ', N_("&Advanced chown "), 'A', chown_advanced_cmd },
|
||||
#endif
|
||||
{ ' ', N_("Rename/Move F6"), KEY_F(6), 0, ren_cmd },
|
||||
{ ' ', N_("Mkdir F7"), KEY_F(7), 0, mkdir_cmd },
|
||||
{ ' ', N_("Delete F8"), KEY_F(8), 0, delete_cmd },
|
||||
{ ' ', N_("Quick cd M-c"), ALT('c'), 0, quick_cd_cmd },
|
||||
{ ' ', N_("&Rename/Move F6"), 'R', ren_cmd },
|
||||
{ ' ', N_("&Mkdir F7"), 'M', mkdir_cmd },
|
||||
{ ' ', N_("&Delete F8"), 'D', delete_cmd },
|
||||
{ ' ', N_("&Quick cd M-c"), 'Q', quick_cd_cmd },
|
||||
{ ' ', "", ' ', 0 },
|
||||
{ ' ', N_("Select group M-+"), ALT('+'), 7, select_cmd },
|
||||
{ ' ', N_("Unselect group M-\\"),ALT('\\'), 1, unselect_cmd },
|
||||
{ ' ', N_("Reverse selection M-*"), ALT('*'), 13, reverse_selection_cmd },
|
||||
{ ' ', N_("select &Group M-+"), 'G', select_cmd },
|
||||
{ ' ', N_("u&Nselect group M-\\"),'N', unselect_cmd },
|
||||
{ ' ', N_("reverse selec&Tion M-*"), 'T', reverse_selection_cmd },
|
||||
{ ' ', "", ' ', 0 },
|
||||
{ ' ', N_("Quit F10"), 'Q', 0, (callfn) quit_cmd }
|
||||
{ ' ', N_("e&Xit F10"), 'X', (callfn) quit_cmd }
|
||||
};
|
||||
|
||||
void external_panelize (void);
|
||||
|
@ -1255,51 +1256,51 @@ static menu_entry CmdMenu [] = {
|
|||
* as a panel still has some problems, I have not yet finished
|
||||
* the WTree widget port, sorry.
|
||||
*/
|
||||
{ ' ', N_("Directory tree"), 'D', 0, tree_box },
|
||||
{ ' ', N_("Find file M-?"), ALT('?'), 0, find_cmd },
|
||||
{ ' ', N_("&Directory tree"), 'D', tree_box },
|
||||
{ ' ', N_("&Find file M-?"), 'F', find_cmd },
|
||||
#ifndef HAVE_XVIEW
|
||||
{ ' ', N_("sWap panels C-u"), XCTRL('u'), 1, swap_cmd },
|
||||
{ ' ', N_("switch Panels on/off C-o"), XCTRL('o'), 7, view_other_cmd },
|
||||
{ ' ', N_("s&Wap panels C-u"), 'W', swap_cmd },
|
||||
{ ' ', N_("switch &Panels on/off C-o"), 'P', view_other_cmd },
|
||||
#endif
|
||||
{ ' ', N_("Compare directories C-x d"),'C', 0, compare_dirs_cmd },
|
||||
{ ' ', N_("eXternal panelize C-x !"),'X', 1, external_panelize },
|
||||
{ ' ', N_("&Compare directories C-x d"), 'C', compare_dirs_cmd },
|
||||
{ ' ', N_("e&Xternal panelize C-x !"), 'X', external_panelize },
|
||||
#ifdef HAVE_DUSUM
|
||||
{ ' ', N_("show directory sIzes"), 'I', 16, dirsizes_cmd },
|
||||
{ ' ', N_("show directory s&Izes"), 'I', dirsizes_cmd },
|
||||
#endif
|
||||
{ ' ', "", ' ', 0 },
|
||||
{ ' ', N_("command History"), 'H', 8, history_cmd },
|
||||
{ ' ', N_("Directory hotlist C-\\"), XCTRL('\\'), 13, quick_chdir_cmd },
|
||||
{ ' ', N_("command &History"), 'H', history_cmd },
|
||||
{ ' ', N_("di&Rectory hotlist C-\\"), 'R', quick_chdir_cmd },
|
||||
#ifdef USE_VFS
|
||||
{ ' ', N_("Active VFS list C-x a"), 'A', 0, reselect_vfs },
|
||||
{ ' ', N_("&Active VFS list C-x a"), 'A', reselect_vfs },
|
||||
#endif
|
||||
#ifdef WITH_BACKGROUND
|
||||
{ ' ', N_("Background jobs C-x j"), 'B', 0, jobs_cmd },
|
||||
{ ' ', N_("&Background jobs C-x j"), 'B', jobs_cmd },
|
||||
#endif
|
||||
{ ' ', "", ' ', 0 },
|
||||
#ifdef USE_EXT2FSLIB
|
||||
{ ' ', N_("Undelete files (ext2fs only)"),'U', 0, undelete_cmd },
|
||||
{ ' ', N_("&Undelete files (ext2fs only)"), 'U', undelete_cmd },
|
||||
#endif
|
||||
#ifdef VERSION_4
|
||||
{ ' ', N_("Listing format edit"), 'L', 0, listmode_cmd},
|
||||
{ ' ', N_("&Listing format edit"), 'L', listmode_cmd},
|
||||
#endif
|
||||
{ ' ', N_("Extension file edit"), 'E', 0, ext_cmd },
|
||||
{ ' ', N_("Menu file edit"), 'M', 0, menu_edit_cmd }
|
||||
{ ' ', N_("&Extension file edit"), 'E', ext_cmd },
|
||||
{ ' ', N_("&Menu file edit"), 'M', menu_edit_cmd }
|
||||
};
|
||||
|
||||
/* Must keep in sync with the constants in menu_cmd */
|
||||
static menu_entry OptMenu [] = {
|
||||
{ ' ', N_("Configuration..."), 'C', 0, configure_box },
|
||||
{ ' ', N_("Layout..."), 'L', 0, layout_cmd },
|
||||
{ ' ', N_("cOnfirmation..."), 'O', 1, confirm_box },
|
||||
{ ' ', N_("Display bits..."), 'D', 0, display_bits_box },
|
||||
{ ' ', N_("&Configuration..."), 'C', configure_box },
|
||||
{ ' ', N_("&Layout..."), 'L', layout_cmd },
|
||||
{ ' ', N_("c&Onfirmation..."), 'O', confirm_box },
|
||||
{ ' ', N_("&Display bits..."), 'D', display_bits_box },
|
||||
#if !defined(HAVE_X) && !defined(OS2_NT)
|
||||
{ ' ', N_("learn Keys..."), 'K', 6, learn_keys },
|
||||
{ ' ', N_("learn &Keys..."), 'K', learn_keys },
|
||||
#endif
|
||||
#ifdef USE_VFS
|
||||
{ ' ', N_("Virtual FS..."), 'V', 0, configure_vfs },
|
||||
{ ' ', N_("&Virtual FS..."), 'V', configure_vfs },
|
||||
#endif
|
||||
{ ' ', "", ' ', 0 },
|
||||
{ ' ', N_("Save setup"), 'S', 0, save_setup_cmd }
|
||||
{ ' ', N_("&Save setup"), 'S', save_setup_cmd }
|
||||
};
|
||||
|
||||
#define menu_entries(x) sizeof(x)/sizeof(menu_entry)
|
||||
|
|
93
src/menu.c
93
src/menu.c
|
@ -51,42 +51,17 @@ Menu create_menu (char *name, menu_entry *entries, int count)
|
|||
if (entries != (menu_entry*) 0)
|
||||
{
|
||||
register menu_entry* mp;
|
||||
register char* cp;
|
||||
for (mp = entries; count--; mp++)
|
||||
{
|
||||
mp->string_dupped = 0;
|
||||
|
||||
if (mp->text[0] == '\0')
|
||||
continue;
|
||||
|
||||
cp = _(mp->text);
|
||||
|
||||
if (mp->text != cp){
|
||||
char tmpbuf[80]; /* hope it's long enough for menu entries */
|
||||
register char *src = cp, *dest = tmpbuf;
|
||||
while (*src)
|
||||
{
|
||||
if (*src == '&' && *++src)
|
||||
{
|
||||
/* Preserve non-ascii hotkeys */
|
||||
if (mp->hot_key <= 256)
|
||||
mp->hot_key = *src;
|
||||
mp->hot_pos = src-cp-1;
|
||||
continue;
|
||||
}
|
||||
*dest++ = *src++;
|
||||
}
|
||||
*dest = '\0';
|
||||
mp->text = strdup(tmpbuf);
|
||||
mp->string_dupped = 1;
|
||||
}
|
||||
mp->text = _(mp->text);
|
||||
}
|
||||
}
|
||||
menu->name = _(name);
|
||||
#else
|
||||
menu->name = name;
|
||||
}
|
||||
#endif /* ENABLE_NLS */
|
||||
|
||||
menu->name = _(name);
|
||||
menu->start_x = 0;
|
||||
return menu;
|
||||
}
|
||||
|
@ -120,16 +95,24 @@ static void menubar_paint_idx (WMenu *menubar, int idx, int color)
|
|||
hline (slow_terminal ? ' ' : ACS_HLINE, menubar->max_entry_len);
|
||||
} else {
|
||||
char *text = menu->entries [idx].text;
|
||||
int hotkey = menu->entries [idx].hot_key;
|
||||
int hotpos = menu->entries [idx].hot_pos;
|
||||
|
||||
printw ("%c%-s", menu->entries [idx].first_letter, text);
|
||||
|
||||
if (!slow_terminal){
|
||||
widget_move (&menubar->widget, y, x+hotpos+1);
|
||||
attrset (color == MENU_SELECTED_COLOR ?
|
||||
MENU_HOTSEL_COLOR : MENU_HOT_COLOR);
|
||||
addch (text[hotpos]);
|
||||
addch(menu->entries [idx].first_letter);
|
||||
for (text = menu->entries [idx].text; *text; text++)
|
||||
{
|
||||
if (*text == '&')
|
||||
{
|
||||
++text;
|
||||
menu->entries [idx].hot_key = tolower(*text);
|
||||
if (!slow_terminal)
|
||||
{
|
||||
attrset (color == MENU_SELECTED_COLOR ?
|
||||
MENU_HOTSEL_COLOR : MENU_HOT_COLOR);
|
||||
addch(*text);
|
||||
attrset(color);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
addch(*text);
|
||||
}
|
||||
}
|
||||
widget_move (&menubar->widget, y, x + 1);
|
||||
|
@ -265,7 +248,7 @@ static int menubar_handle_key (WMenu *menubar, int key)
|
|||
int i;
|
||||
|
||||
/* Lowercase */
|
||||
if (key < 256 && ISASCII (key)) /* Linux libc.so.5.x.x bug fix */
|
||||
if (key < 256 && isalpha (key)) /* Linux libc.so.5.x.x bug fix */
|
||||
key = tolower (key);
|
||||
|
||||
if (is_abort_char (key)){
|
||||
|
@ -308,36 +291,19 @@ static int menubar_handle_key (WMenu *menubar, int key)
|
|||
const int selected = menubar->selected;
|
||||
const Menu menu = menubar->menu [selected];
|
||||
const int items = menu->count;
|
||||
char l;
|
||||
int m;
|
||||
char m;
|
||||
|
||||
for (i = 0; i < items; i++){
|
||||
if (!menu->entries [i].call_back)
|
||||
continue;
|
||||
|
||||
m = menu->entries [i].hot_key;
|
||||
if (m < 256 && ISASCII (m))
|
||||
m = tolower (m);
|
||||
if (key != m)
|
||||
{
|
||||
m = tolower (menu->entries[i].text[menu->entries[i].hot_pos]);
|
||||
if (key != m)
|
||||
continue;
|
||||
}
|
||||
if (key != menu->entries [i].hot_key)
|
||||
continue;
|
||||
|
||||
menubar_execute (menubar, i);
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < items; i++){
|
||||
l = tolower (menu->entries [i].text [0]);
|
||||
if (l != key)
|
||||
continue;
|
||||
|
||||
menubar_execute (menubar, i);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (key == KEY_ENTER || key == '\n'){
|
||||
menubar_execute (menubar, menubar->subsel);
|
||||
return 1;
|
||||
|
@ -527,17 +493,6 @@ menubar_arrange(WMenu* menubar)
|
|||
void
|
||||
destroy_menu (Menu menu)
|
||||
{
|
||||
int i;
|
||||
menu_entry *e;
|
||||
|
||||
for (i = 0, e = menu->entries; i < menu->count; i++){
|
||||
#ifdef ENABLE_NLS
|
||||
/* Separators are NULLS */
|
||||
if (e->string_dupped)
|
||||
free (e->text);
|
||||
#endif
|
||||
e++;
|
||||
}
|
||||
free (menu);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,7 @@ typedef struct {
|
|||
char first_letter;
|
||||
char *text;
|
||||
int hot_key;
|
||||
int hot_pos;
|
||||
callfn call_back;
|
||||
int string_dupped;
|
||||
} menu_entry;
|
||||
|
||||
#ifdef HAVE_XVIEW
|
||||
|
|
17
src/option.c
17
src/option.c
|
@ -106,9 +106,9 @@ static struct {
|
|||
static WRadio *pause_radio;
|
||||
|
||||
static char *pause_options [3] = {
|
||||
N_("Never"),
|
||||
N_("on dumb Terminals"),
|
||||
N_("alwaYs") };
|
||||
N_("&Never"),
|
||||
N_("on dumb &Terminals"),
|
||||
N_("alwa&Ys") };
|
||||
|
||||
static int configure_callback (struct Dlg_head *h, int Id, int Msg)
|
||||
{
|
||||
|
@ -144,6 +144,17 @@ static int configure_callback (struct Dlg_head *h, int Id, int Msg)
|
|||
static void init_configure (void)
|
||||
{
|
||||
int i;
|
||||
static int i18n_config_flag = 0;
|
||||
|
||||
if (!i18n_config_flag)
|
||||
{
|
||||
i = sizeof(pause_options)/sizeof(char*);
|
||||
|
||||
while (i--)
|
||||
pause_options [i] = _(pause_options [i]);
|
||||
|
||||
i18n_config_flag = 1;
|
||||
}
|
||||
|
||||
conf_dlg = create_dlg (0, 0, 19, 64, dialog_colors,
|
||||
configure_callback, "[Options Menu]",
|
||||
|
|
56
src/widget.c
56
src/widget.c
|
@ -82,8 +82,7 @@ button_callback (Dlg_head *h, WButton *b, int Msg, int Par)
|
|||
return x_create_button (h, h->wdata, b);
|
||||
#ifndef HAVE_XVIEW
|
||||
case WIDGET_HOTKEY:
|
||||
if (b->hotkey == Par ||
|
||||
(b->hotkey >= 'a' && b->hotkey <= 'z' && b->hotkey-32 == Par)){
|
||||
if (b->hotkey == Par || toupper(b->hotkey) == Par){
|
||||
button_callback (h, b, WIDGET_KEY, ' '); /* to make action */
|
||||
return 1;
|
||||
} else
|
||||
|
@ -282,18 +281,21 @@ radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
|
|||
|
||||
#ifndef HAVE_XVIEW
|
||||
case WIDGET_HOTKEY:
|
||||
if (r->upper_letter_is_hotkey){
|
||||
int i;
|
||||
char *s;
|
||||
|
||||
for (i = 0; i < r->count; i++){
|
||||
for (s = r->texts [i]; *s; s++){
|
||||
if (!(*s >= 'A' && *s <= 'Z' && (0x20|*s) == (0x20|Par)))
|
||||
continue;
|
||||
r->pos = i;
|
||||
radio_callback (h, r, WIDGET_KEY, ' '); /* Take action */
|
||||
return 1;
|
||||
}
|
||||
{
|
||||
int i, lp = tolower(Par);
|
||||
char *cp;
|
||||
for (i = 0; i < r->count; i++)
|
||||
{
|
||||
cp = strchr(r->texts [i],'&');
|
||||
if (cp != NULL && cp[1] != '\0')
|
||||
{
|
||||
int c = tolower(cp[1]);
|
||||
if (c != lp)
|
||||
continue;
|
||||
r->pos = i;
|
||||
radio_callback (h, r, WIDGET_KEY, ' '); /* Take action */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -344,23 +346,23 @@ radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
|
|||
case WIDGET_FOCUS:
|
||||
case WIDGET_DRAW:
|
||||
for (i = 0; i < r->count; i++){
|
||||
register char* cp;
|
||||
attrset ((i==r->pos && Msg==WIDGET_FOCUS) ? FOCUSC :NORMALC);
|
||||
widget_move (&r->widget, i, 0);
|
||||
printw ("(%c) %s", (r->sel == i) ? '*' : ' ', r->texts[i]);
|
||||
|
||||
/* Draw the hotkey */
|
||||
if (r->upper_letter_is_hotkey){
|
||||
char *t = r->texts [i];
|
||||
|
||||
while (*t && !(*t >= 'A' && *t <= 'Z'))
|
||||
t++;
|
||||
if (*t){
|
||||
widget_move (&r->widget, i, 4+t - r->texts [i]);
|
||||
attrset ((i==r->pos && Msg==WIDGET_FOCUS)
|
||||
? HOT_FOCUSC :HOT_NORMALC);
|
||||
addch (*t);
|
||||
printw("(%c) ", (r->sel == i) ? '*' : ' ');
|
||||
for (cp = r->texts[i]; *cp; cp++)
|
||||
{
|
||||
if (*cp == '&')
|
||||
{
|
||||
attrset ((i==r->pos && Msg==WIDGET_FOCUS)
|
||||
? HOT_FOCUSC : HOT_NORMALC);
|
||||
addch(*++cp);
|
||||
attrset ((i==r->pos && Msg==WIDGET_FOCUS) ? FOCUSC : NORMALC);
|
||||
}
|
||||
else
|
||||
addch(*cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue