Ability to save in mid-session! Simplest possible resolution to all
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 28 Dec 2004 16:46:30 +0000 (16:46 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 28 Dec 2004 16:46:30 +0000 (16:46 +0000)
the difficult questions about when it's sensible to offer the option
of saving to the slot we loaded from: _we never do_. The user must
always explicitly specify a slot to save to.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5035 cda61777-01e9-0310-a592-d414129be87e

config.c
windows/windlg.c

index 0704da3..6d918c2 100644 (file)
--- a/config.c
+++ b/config.c
@@ -845,39 +845,42 @@ void setup_config_box(struct controlbox *b, struct sesslist *sesslist,
                              "SSH", 's', I(PROT_SSH),
                              NULL);
        }
-
-       s = ctrl_getset(b, "Session", "savedsessions",
-                       "Load, save or delete a stored session");
-       ctrl_columns(s, 2, 75, 25);
-       ssd->sesslist = sesslist;
-       ssd->editbox = ctrl_editbox(s, "Saved Sessions", 'e', 100,
-                                   HELPCTX(session_saved),
-                                   sessionsaver_handler, P(ssd), P(NULL));
-       ssd->editbox->generic.column = 0;
-       /* Reset columns so that the buttons are alongside the list, rather
-        * 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));
-       ssd->loadbutton->generic.column = 1;
-       ssd->savebutton = ctrl_pushbutton(s, "Save", 'v',
-                                         HELPCTX(session_saved),
-                                         sessionsaver_handler, P(ssd));
-       ssd->savebutton->generic.column = 1;
-       ssd->delbutton = ctrl_pushbutton(s, "Delete", 'd',
-                                        HELPCTX(session_saved),
-                                        sessionsaver_handler, P(ssd));
-       ssd->delbutton->generic.column = 1;
-       ctrl_columns(s, 1, 100);
     }
 
+    /*
+     * The Load/Save panel is available even in mid-session.
+     */
+    s = ctrl_getset(b, "Session", "savedsessions",
+                   "Load, save or delete a stored session");
+    ctrl_columns(s, 2, 75, 25);
+    ssd->sesslist = sesslist;
+    ssd->editbox = ctrl_editbox(s, "Saved Sessions", 'e', 100,
+                               HELPCTX(session_saved),
+                               sessionsaver_handler, P(ssd), P(NULL));
+    ssd->editbox->generic.column = 0;
+    /* Reset columns so that the buttons are alongside the list, rather
+     * 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));
+    ssd->loadbutton->generic.column = 1;
+    ssd->savebutton = ctrl_pushbutton(s, "Save", 'v',
+                                     HELPCTX(session_saved),
+                                     sessionsaver_handler, P(ssd));
+    ssd->savebutton->generic.column = 1;
+    ssd->delbutton = ctrl_pushbutton(s, "Delete", 'd',
+                                    HELPCTX(session_saved),
+                                    sessionsaver_handler, P(ssd));
+    ssd->delbutton->generic.column = 1;
+    ctrl_columns(s, 1, 100);
+
     s = ctrl_getset(b, "Session", "otheropts", NULL);
     c = ctrl_radiobuttons(s, "Close window on exit:", 'w', 4,
                          HELPCTX(session_coe),
index 65018b1..285691b 100644 (file)
@@ -632,7 +632,7 @@ int do_reconfig(HWND hwnd)
     backup_cfg = cfg;                 /* structure copy */
 
     ctrlbox = ctrl_new_box();
-    setup_config_box(ctrlbox, NULL, TRUE, cfg.protocol);
+    setup_config_box(ctrlbox, &sesslist, TRUE, cfg.protocol);
     win_setup_config_box(ctrlbox, &dp.hwnd, (help_path != NULL), TRUE);
     dp_init(&dp);
     winctrl_init(&ctrls_base);