From bbd7c82c7da273408ea965a9db368a35f8236943 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 17 Feb 2022 13:41:59 +0200 Subject: Save text entered in the input prompt Use the same mechanism as in the Upload dialog to keep the text entered in the input prompt safe, in case the dialog is accidentally closed or the app crashes. --- src/ui/util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ui/util.c') diff --git a/src/ui/util.c b/src/ui/util.c index 94e4b00c..de755b3f 100644 --- a/src/ui/util.c +++ b/src/ui/util.c @@ -1712,13 +1712,14 @@ iLabelWidget *addDialogTitle_Widget(iWidget *dlg, const char *text, const char * } static void acceptValueInput_(iWidget *dlg) { - const iInputWidget *input = findChild_Widget(dlg, "input"); + iInputWidget *input = findChild_Widget(dlg, "input"); if (!isEmpty_String(id_Widget(dlg))) { const iString *val = text_InputWidget(input); postCommandf_App("%s arg:%d value:%s", cstr_String(id_Widget(dlg)), toInt_String(val), cstr_String(val)); + setBackupFileName_InputWidget(input, NULL); } } @@ -1782,6 +1783,7 @@ iBool valueInputHandler_(iWidget *dlg, const char *cmd) { else if (equal_Command(cmd, "valueinput.set")) { iInputWidget *input = findChild_Widget(dlg, "input"); setTextUndoableCStr_InputWidget(input, suffixPtr_Command(cmd, "text"), iTrue); + deselect_InputWidget(input); validate_InputWidget(input); return iTrue; } -- cgit v1.2.3