From b2152ae22ad9fd9dfcda473de6d259d38669b3d0 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 27 Jul 2011 14:51:19 +0400 Subject: [PATCH] Handle CK_Shell, CK_LearnKeys, CK_OptionsSaveMode and CK_SaveSetup actions in dialog level instead of widget one. Signed-off-by: Andrew Borodin --- src/editor/edit-impl.h | 2 +- src/editor/edit.c | 13 ------------- src/editor/editcmd.c | 2 +- src/editor/editwidget.c | 14 ++++++++++++++ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/editor/edit-impl.h b/src/editor/edit-impl.h index f014f696b..e28104dc2 100644 --- a/src/editor/edit-impl.h +++ b/src/editor/edit-impl.h @@ -183,7 +183,7 @@ gboolean edit_drop_hotkey_menu (Dlg_head * h, int key); void edit_menu_cmd (Dlg_head * h); void user_menu (WEdit * edit, const char *menu_file, int selected_entry); void edit_init_menu (struct WMenuBar *menubar); -void menu_save_mode_cmd (void); +void edit_save_mode_cmd (void); gboolean edit_translate_key (WEdit * edit, long x_key, int *cmd, int *ch); int edit_get_byte (WEdit * edit, long byte_index); int edit_get_utf (WEdit * edit, long byte_index, int *char_width); diff --git a/src/editor/edit.c b/src/editor/edit.c index 7a1c00912..f2786d696 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -61,7 +61,6 @@ #include "lib/charsets.h" /* get_codepage_id */ #endif -#include "src/filemanager/cmd.h" /* view_other_cmd() */ #include "src/filemanager/usermenu.h" /* user_menu_cmd() */ #include "src/setup.h" /* option_tab_spacing */ @@ -4128,18 +4127,9 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) case CK_Refresh: edit_refresh_cmd (edit); break; - case CK_SaveSetup: - save_setup_cmd (); - break; - case CK_LearnKeys: - learn_keys (); - break; case CK_Options: edit_options_dialog (edit); break; - case CK_OptionsSaveMode: - menu_save_mode_cmd (); - break; case CK_Date: { char s[BUF_MEDIUM]; @@ -4178,9 +4168,6 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) case CK_Mail: edit_mail_dialog (edit); break; - case CK_Shell: - view_other_cmd (); - break; #ifdef HAVE_CHARSET case CK_SelectCodepage: edit_select_codepage_cmd (edit); diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c index 9acac2ccb..84b1116b6 100644 --- a/src/editor/editcmd.c +++ b/src/editor/editcmd.c @@ -1562,7 +1562,7 @@ edit_refresh_cmd (WEdit * edit) /* --------------------------------------------------------------------------------------------- */ void -menu_save_mode_cmd (void) +edit_save_mode_cmd (void) { /* diaog sizes */ const int DLG_X = 38; diff --git a/src/editor/editwidget.c b/src/editor/editwidget.c index e8106a5ad..d5b10e70e 100644 --- a/src/editor/editwidget.c +++ b/src/editor/editwidget.c @@ -56,6 +56,8 @@ #include "src/keybind-defaults.h" #include "src/main.h" /* home_dir */ +#include "src/filemanager/cmd.h" /* view_other_cmd(), save_setup_cmd() */ +#include "src/learn.h" /* learn_keys() */ #include "edit-impl.h" #include "editwidget.h" @@ -501,11 +503,23 @@ edit_dialog_command_execute (Dlg_head * h, unsigned long command) case CK_About: edit_about (); break; + case CK_Shell: + view_other_cmd (); + break; + case CK_LearnKeys: + learn_keys (); + break; case CK_WindowMove: case CK_WindowResize: if (edit_widget_is_editor ((Widget *) h->current->data)) edit_handle_move_resize ((WEdit *) h->current->data, command); break; + case CK_OptionsSaveMode: + edit_save_mode_cmd (); + break; + case CK_SaveSetup: + save_setup_cmd (); + break; default: ret = MSG_NOT_HANDLED; break;