summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-08-30 08:13:25 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-08-30 08:13:25 +0300
commit5a29dceb33d08c1d8d0c4e5bb28d62129e895a0c (patch)
tree7468cd6a4ffec54a932349930dfae38faf9e82ee /src/ui
parentb61d11ad95b13154fe0d8f28cdced09254ccf7e5 (diff)
Fixed value input dialog cancel behavior
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/util.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 11f41f6a..6aa6ccc9 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -557,11 +557,13 @@ void makeFilePath_Widget(iWidget * parent,
557 557
558static void acceptValueInput_(iWidget *dlg) { 558static void acceptValueInput_(iWidget *dlg) {
559 const iInputWidget *input = findChild_Widget(dlg, "input"); 559 const iInputWidget *input = findChild_Widget(dlg, "input");
560 const iString *val = text_InputWidget(input); 560 if (!isEmpty_String(id_Widget(dlg))) {
561 postCommandf_App("%s arg:%d value:%s", 561 const iString *val = text_InputWidget(input);
562 cstr_String(id_Widget(dlg)), 562 postCommandf_App("%s arg:%d value:%s",
563 toInt_String(val), 563 cstr_String(id_Widget(dlg)),
564 cstr_String(val)); 564 toInt_String(val),
565 cstr_String(val));
566 }
565} 567}
566 568
567static void updateValueInputWidth_(iWidget *dlg) { 569static void updateValueInputWidth_(iWidget *dlg) {
@@ -588,6 +590,7 @@ iBool valueInputHandler_(iWidget *dlg, const char *cmd) {
588 } 590 }
589 else { 591 else {
590 postCommandf_App("valueinput.cancelled id:%s", cstr_String(id_Widget(dlg))); 592 postCommandf_App("valueinput.cancelled id:%s", cstr_String(id_Widget(dlg)));
593 setId_Widget(dlg, ""); /* no further commands to emit */
591 } 594 }
592 destroy_Widget(dlg); 595 destroy_Widget(dlg);
593 return iTrue; 596 return iTrue;
@@ -596,6 +599,7 @@ iBool valueInputHandler_(iWidget *dlg, const char *cmd) {
596 } 599 }
597 else if (equal_Command(cmd, "cancel")) { 600 else if (equal_Command(cmd, "cancel")) {
598 postCommandf_App("valueinput.cancelled id:%s", cstr_String(id_Widget(dlg))); 601 postCommandf_App("valueinput.cancelled id:%s", cstr_String(id_Widget(dlg)));
602 setId_Widget(dlg, ""); /* no further commands to emit */
599 destroy_Widget(dlg); 603 destroy_Widget(dlg);
600 return iTrue; 604 return iTrue;
601 } 605 }