From 047b412e3c82c20c9c30933e0b756dacb73cba35 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Mon, 18 Sep 2017 11:09:16 +0300 Subject: [PATCH] add editor find/replace action labels - for buggins/dlangide#306 --- src/dlangui/widgets/editors.d | 13 +++++++------ views/DLANGUI_VERSION | 2 +- views/res/i18n/std_en.ini | 4 ++++ views/res/i18n/std_ru.ini | 4 ++++ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index 49a3a287..62fabe25 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -221,16 +221,17 @@ const Action ACTION_EDITOR_TOGGLE_BLOCK_COMMENT = (new Action(EditorActions.Togg const Action ACTION_EDITOR_TOGGLE_BOOKMARK = (new Action(EditorActions.ToggleBookmark, "ACTION_EDITOR_TOGGLE_BOOKMARK"c, null, KeyCode.KEY_B, KeyFlag.Control | KeyFlag.Shift)); const Action ACTION_EDITOR_GOTO_NEXT_BOOKMARK = (new Action(EditorActions.GoToNextBookmark, "ACTION_EDITOR_GOTO_NEXT_BOOKMARK"c, null, KeyCode.DOWN, KeyFlag.Control | KeyFlag.Shift | KeyFlag.Alt)); const Action ACTION_EDITOR_GOTO_PREVIOUS_BOOKMARK = (new Action(EditorActions.GoToPreviousBookmark, "ACTION_EDITOR_GOTO_PREVIOUS_BOOKMARK"c, null, KeyCode.UP, KeyFlag.Control | KeyFlag.Shift | KeyFlag.Alt)); -const Action ACTION_EDITOR_FIND = (new Action(EditorActions.Find, KeyCode.KEY_F, KeyFlag.Control)); -const Action ACTION_EDITOR_FIND_NEXT = (new Action(EditorActions.FindNext, KeyCode.F3, 0)); -const Action ACTION_EDITOR_FIND_PREV = (new Action(EditorActions.FindPrev, KeyCode.F3, KeyFlag.Shift)); -const Action ACTION_EDITOR_REPLACE = (new Action(EditorActions.Replace, KeyCode.KEY_H, KeyFlag.Control)); +const Action ACTION_EDITOR_FIND = (new Action(EditorActions.Find, "ACTION_EDITOR_FIND"c, null, KeyCode.KEY_F, KeyFlag.Control)); +const Action ACTION_EDITOR_FIND_NEXT = (new Action(EditorActions.FindNext, "ACTION_EDITOR_FIND_NEXT"c, null, KeyCode.F3, 0)); +const Action ACTION_EDITOR_FIND_PREV = (new Action(EditorActions.FindPrev, "ACTION_EDITOR_FIND_PREV"c, null, KeyCode.F3, KeyFlag.Shift)); +const Action ACTION_EDITOR_REPLACE = (new Action(EditorActions.Replace, "ACTION_EDITOR_REPLACE"c, null, KeyCode.KEY_H, KeyFlag.Control)); const Action[] STD_EDITOR_ACTIONS = [ACTION_EDITOR_INSERT_NEW_LINE, ACTION_EDITOR_PREPEND_NEW_LINE, ACTION_EDITOR_APPEND_NEW_LINE, ACTION_EDITOR_DELETE_LINE, ACTION_EDITOR_TOGGLE_REPLACE_MODE, ACTION_EDITOR_SELECT_ALL, ACTION_EDITOR_TOGGLE_LINE_COMMENT, ACTION_EDITOR_TOGGLE_BLOCK_COMMENT, ACTION_EDITOR_TOGGLE_BOOKMARK, ACTION_EDITOR_GOTO_NEXT_BOOKMARK, ACTION_EDITOR_GOTO_PREVIOUS_BOOKMARK, - + ACTION_EDITOR_FIND, ACTION_EDITOR_REPLACE, ACTION_EDITOR_FIND_NEXT, ACTION_EDITOR_FIND_PREV, + ACTION_EDITOR_FIND_NEXT, ACTION_EDITOR_FIND_PREV ]; /// base for all editor widgets @@ -657,7 +658,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction case Find: case FindNext: case FindPrev: - return true; + return _content.multiline; default: return super.isActionEnabled(action); } diff --git a/views/DLANGUI_VERSION b/views/DLANGUI_VERSION index e9ac3a9a..9a4773d9 100644 --- a/views/DLANGUI_VERSION +++ b/views/DLANGUI_VERSION @@ -1 +1 @@ -v0.9.138 \ No newline at end of file +v0.9.139 \ No newline at end of file diff --git a/views/res/i18n/std_en.ini b/views/res/i18n/std_en.ini index 82d9ad4d..3c37e68a 100644 --- a/views/res/i18n/std_en.ini +++ b/views/res/i18n/std_en.ini @@ -27,6 +27,10 @@ CONFIRM_OVERWRITE_FILE_NAMED_%s_QUESTION=A file named "%s" already exists. Do yo ACTION_EDITOR_TOGGLE_BOOKMARK=Toggle bookmark ACTION_EDITOR_GOTO_NEXT_BOOKMARK=Go to next bookmark ACTION_EDITOR_GOTO_PREVIOUS_BOOKMARK=Go to previous bookmark +ACTION_EDITOR_FIND=Find... +ACTION_EDITOR_REPLACE=Replace... +ACTION_EDITOR_FIND_NEXT=Find next +ACTION_EDITOR_FIND_PREV=Find previous ACTION_FILE_SHOW_IN_FILE_MANAGER=Show in file manager diff --git a/views/res/i18n/std_ru.ini b/views/res/i18n/std_ru.ini index be76809c..2ecc20f1 100644 --- a/views/res/i18n/std_ru.ini +++ b/views/res/i18n/std_ru.ini @@ -25,6 +25,10 @@ CREATE_FOLDER_ERROR_MESSAGE=Не удалось создать папку ACTION_EDITOR_TOGGLE_BOOKMARK=Переключить закладку ACTION_EDITOR_GOTO_NEXT_BOOKMARK=Перейти к следующей закладке ACTION_EDITOR_GOTO_PREVIOUS_BOOKMARK=Перейти к предыдущей закладке +ACTION_EDITOR_FIND=Найти... +ACTION_EDITOR_REPLACE=Заменить... +ACTION_EDITOR_FIND_NEXT=Найти следующий +ACTION_EDITOR_FIND_PREV=Найти предыдущий ACTION_FILE_SHOW_IN_FILE_MANAGER=Показать в файловом менеджере