mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-14 01:27:35 -05:00
Big sprawling dialog-box commit covering all sorts of things.
Buttons now have an `iscancel' flag to go with `isdefault'; dlg_last_focused() now explicitly passes the control it _doesn't_ care about (`I want the last control that had focus and isn't this one'); and in the GTK implementation, various fixes have happened, notably including arrow keys working sensibly in list boxes and the treeview and short font aliases being expanded correctly to initialise the font selectors. [originally from svn r2958]
This commit is contained in:
13
config.c
13
config.c
@ -328,7 +328,7 @@ static void sessionsaver_handler(union control *ctrl, void *dlg,
|
||||
* there was a session selected in that which had a
|
||||
* valid host name in it, then load it and go.
|
||||
*/
|
||||
if (dlg_last_focused(dlg) == ssd->listbox && !*cfg->host) {
|
||||
if (dlg_last_focused(ctrl, dlg) == ssd->listbox && !*cfg->host) {
|
||||
Config cfg2;
|
||||
if (!load_selected_session(ssd, savedsession, dlg, &cfg2)) {
|
||||
dlg_beep(dlg);
|
||||
@ -700,6 +700,7 @@ void setup_config_box(struct controlbox *b, struct sesslist *sesslist,
|
||||
ssd->okbutton->generic.column = 3;
|
||||
ssd->cancelbutton = ctrl_pushbutton(s, "Cancel", 'c', HELPCTX(no_help),
|
||||
sessionsaver_handler, P(ssd));
|
||||
ssd->cancelbutton->button.iscancel = TRUE;
|
||||
ssd->cancelbutton->generic.column = 4;
|
||||
/* We carefully don't close the 5-column part, so that platform-
|
||||
* specific add-ons can put extra buttons alongside Open and Cancel. */
|
||||
@ -754,6 +755,11 @@ void setup_config_box(struct controlbox *b, struct sesslist *sesslist,
|
||||
* than alongside that edit box. */
|
||||
ctrl_columns(s, 1, 100);
|
||||
ctrl_columns(s, 2, 75, 25);
|
||||
ssd->listbox = ctrl_listbox(s, NULL, NO_SHORTCUT,
|
||||
HELPCTX(session_saved),
|
||||
sessionsaver_handler, P(ssd));
|
||||
ssd->listbox->generic.column = 0;
|
||||
ssd->listbox->listbox.height = 7;
|
||||
ssd->loadbutton = ctrl_pushbutton(s, "Load", 'l',
|
||||
HELPCTX(session_saved),
|
||||
sessionsaver_handler, P(ssd));
|
||||
@ -766,11 +772,6 @@ void setup_config_box(struct controlbox *b, struct sesslist *sesslist,
|
||||
HELPCTX(session_saved),
|
||||
sessionsaver_handler, P(ssd));
|
||||
ssd->delbutton->generic.column = 1;
|
||||
ssd->listbox = ctrl_listbox(s, NULL, NO_SHORTCUT,
|
||||
HELPCTX(session_saved),
|
||||
sessionsaver_handler, P(ssd));
|
||||
ssd->listbox->generic.column = 0;
|
||||
ssd->listbox->listbox.height = 7;
|
||||
ctrl_columns(s, 1, 100);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user