(editcmd_dialog_raw_key_query): take gboolean instead of int.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2012-08-12 19:26:01 +04:00
parent 3b96b9b8b8
commit 603d136db4
3 changed files with 14 additions and 8 deletions

View File

@ -1800,7 +1800,7 @@ edit_delete_macro_cmd (WEdit * edit)
{
int hotkey;
hotkey = editcmd_dialog_raw_key_query (_("Delete macro"), _("Press macro hotkey:"), 1);
hotkey = editcmd_dialog_raw_key_query (_("Delete macro"), _("Press macro hotkey:"), TRUE);
if (hotkey != 0 && !edit_delete_macro (edit, hotkey))
message (D_ERROR, _("Delete macro"), _("Macro not deleted"));
@ -1857,7 +1857,8 @@ edit_store_macro_cmd (WEdit * edit)
gboolean have_macro = FALSE;
char *skeyname = NULL;
hotkey = editcmd_dialog_raw_key_query (_("Save macro"), _("Press the macro's new hotkey:"), 1);
hotkey =
editcmd_dialog_raw_key_query (_("Save macro"), _("Press the macro's new hotkey:"), TRUE);
if (hotkey == ESC_CHAR)
return FALSE;
@ -3338,8 +3339,10 @@ edit_select_codepage_cmd (WEdit * edit)
void
edit_insert_literal_cmd (WEdit * edit)
{
int char_for_insertion = editcmd_dialog_raw_key_query (_("Insert literal"),
_("Press any key:"), 0);
int char_for_insertion;
char_for_insertion = editcmd_dialog_raw_key_query (_("Insert literal"),
_("Press any key:"), FALSE);
edit_execute_key_command (edit, -1, ascii_alpha_to_cntrl (char_for_insertion));
}

View File

@ -337,11 +337,14 @@ editcmd_dialog_search_show (WEdit * edit)
and Esc are cannot returned */
int
editcmd_dialog_raw_key_query (const char *heading, const char *query, int cancel)
editcmd_dialog_raw_key_query (const char *heading, const char *query, gboolean cancel)
{
int w = str_term_width1 (query) + 7;
int w;
struct Dlg_head *raw_dlg;
struct Dlg_head *raw_dlg =
w = str_term_width1 (query) + 7;
raw_dlg =
create_dlg (TRUE, 0, 0, 7, w, dialog_colors, editcmd_dialog_raw_key_query_cb,
NULL, heading, DLG_CENTER | DLG_TRYUP | DLG_WANT_TAB);
add_widget (raw_dlg, input_new (3 - cancel, w - 5, input_get_default_colors (),

View File

@ -29,7 +29,7 @@ void editcmd_dialog_replace_show (WEdit *, const char *, const char *, char **,
gboolean editcmd_dialog_search_show (WEdit * edit);
int editcmd_dialog_raw_key_query (const char *, const char *, int);
int editcmd_dialog_raw_key_query (const char *heading, const char *query, gboolean cancel);
void editcmd_dialog_completion_show (WEdit *, int, int, struct selection *, int);