aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2013-03-31 09:58:47 +0000
committerSimon Tatham <anakin@pobox.com>2013-03-31 09:58:47 +0000
commit3603131ac1875335c1370c2c7f2cb72787b29af8 (patch)
tree1043afbc8fe07e7a6772f0b7bd990f84cf20129a
parent9826ecd5c3b79320823cd762880c302253e88d06 (diff)
downloadpuzzles-3603131ac1875335c1370c2c7f2cb72787b29af8.zip
puzzles-3603131ac1875335c1370c2c7f2cb72787b29af8.tar.gz
puzzles-3603131ac1875335c1370c2c7f2cb72787b29af8.tar.bz2
puzzles-3603131ac1875335c1370c2c7f2cb72787b29af8.tar.xz
Don't forget to restore the correct selection in the dropdown list if
the user cancels a configuration dialog. [originally from svn r9789]
-rw-r--r--emcc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/emcc.c b/emcc.c
index 35ffeec..4116fd1 100644
--- a/emcc.c
+++ b/emcc.c
@@ -581,8 +581,21 @@ static void cfg_end(int use_results)
}
} else {
/*
- * User hit Cancel. Just close the dialog.
+ * User hit Cancel. Close the dialog, but also we must still
+ * reselect the right element of the dropdown list.
+ *
+ * (Because: imagine you have a preset selected, and then you
+ * select Custom from the list, but change your mind and hit
+ * Esc. The Custom option will now still be selected in the
+ * list, whereas obviously it should show the preset you still
+ * _actually_ have selected. Worse still, it'll be the visible
+ * rather than invisible Custom option - see the comment in
+ * js_add_preset in emcclib.js - so you won't even be able to
+ * select Custom without a faffy workaround.)
*/
+ int preset = midend_which_preset(me);
+ js_select_preset(preset < 0 ? custom_preset : preset);
+
free_cfg(cfg);
js_dialog_cleanup();
}