Inhibit the Serial configuration panel in mid-session if the session
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 29 Aug 2006 09:18:09 +0000 (09:18 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 29 Aug 2006 09:18:09 +0000 (09:18 +0000)
isn't a serial one. In particular, this causes pterm not to fail an
assertion if you select `Change Settings'. Ahem.

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

unix/gtkdlg.c
unix/unix.h
unix/uxcfg.c
windows/wincfg.c
windows/windlg.c
windows/winstuff.h

index b2725e4..b5b75ef 100644 (file)
@@ -2055,7 +2055,7 @@ int do_config_box(const char *title, Config *cfg, int midsession,
 
     ctrlbox = ctrl_new_box();
     setup_config_box(ctrlbox, midsession, cfg->protocol, protcfginfo);
-    unix_setup_config_box(ctrlbox, midsession);
+    unix_setup_config_box(ctrlbox, midsession, cfg->protocol);
     gtk_setup_config_box(ctrlbox, midsession, window);
 
     gtk_window_set_title(GTK_WINDOW(window), title);
index ff665b9..8235897 100644 (file)
@@ -105,7 +105,7 @@ void uxsel_input_remove(int id);
 
 /* uxcfg.c */
 struct controlbox;
-void unix_setup_config_box(struct controlbox *b, int midsession);
+void unix_setup_config_box(struct controlbox *b, int midsession, int protocol);
 
 /* gtkcfg.c */
 void gtk_setup_config_box(struct controlbox *b, int midsession, void *window);
index de8e886..c7d8d5f 100644 (file)
@@ -10,7 +10,7 @@
 #include "dialog.h"
 #include "storage.h"
 
-void unix_setup_config_box(struct controlbox *b, int midsession)
+void unix_setup_config_box(struct controlbox *b, int midsession, int protocol)
 {
     struct controlset *s;
     union control *c;
@@ -75,5 +75,6 @@ void unix_setup_config_box(struct controlbox *b, int midsession)
      * space parity are not conveniently supported, and neither is
      * DSR/DTR flow control.
      */
-    ser_setup_config_box(b, midsession, 0x07, 0x07);
+    if (!midsession || (protocol == PROT_SERIAL))
+        ser_setup_config_box(b, midsession, 0x07, 0x07);
 }
index 574e1e8..bc6102d 100644 (file)
@@ -31,7 +31,7 @@ static void help_handler(union control *ctrl, void *dlg,
 }
 
 void win_setup_config_box(struct controlbox *b, HWND *hwndp, int has_help,
-                         int midsession)
+                         int midsession, int protocol)
 {
     struct controlset *s;
     union control *c;
@@ -375,5 +375,6 @@ void win_setup_config_box(struct controlbox *b, HWND *hwndp, int has_help,
     /*
      * Serial back end is available on Windows.
      */
-    ser_setup_config_box(b, midsession, 0x1F, 0x0F);
+    if (!midsession || (protocol == PROT_SERIAL))
+        ser_setup_config_box(b, midsession, 0x1F, 0x0F);
 }
index 3f02801..9d98623 100644 (file)
@@ -653,7 +653,7 @@ int do_config(void)
 
     ctrlbox = ctrl_new_box();
     setup_config_box(ctrlbox, FALSE, 0, 0);
-    win_setup_config_box(ctrlbox, &dp.hwnd, (help_path != NULL), FALSE);
+    win_setup_config_box(ctrlbox, &dp.hwnd, (help_path != NULL), FALSE, 0);
     dp_init(&dp);
     winctrl_init(&ctrls_base);
     winctrl_init(&ctrls_panel);
@@ -685,7 +685,8 @@ int do_reconfig(HWND hwnd, int protcfginfo)
 
     ctrlbox = ctrl_new_box();
     setup_config_box(ctrlbox, TRUE, cfg.protocol, protcfginfo);
-    win_setup_config_box(ctrlbox, &dp.hwnd, (help_path != NULL), TRUE);
+    win_setup_config_box(ctrlbox, &dp.hwnd, (help_path != NULL), TRUE,
+                         cfg.protocol);
     dp_init(&dp);
     winctrl_init(&ctrls_base);
     winctrl_init(&ctrls_panel);
index 2cc0bb9..4436972 100644 (file)
@@ -373,7 +373,7 @@ void dp_cleanup(struct dlgparam *dp);
  * Exports from wincfg.c.
  */
 void win_setup_config_box(struct controlbox *b, HWND *hwndp, int has_help,
-                         int midsession);
+                         int midsession, int protocol);
 
 /*
  * Exports from windlg.c.