- if (!midsession) {
- s = ctrl_getset(b, "Connection", "data", "Data to send to the server");
- ctrl_editbox(s, "Terminal-type string", 't', 50,
- HELPCTX(connection_termtype),
- dlg_stdeditbox_handler, I(offsetof(Config,termtype)),
- I(sizeof(((Config *)0)->termtype)));
- ctrl_editbox(s, "Auto-login username", 'u', 50,
- HELPCTX(connection_username),
- dlg_stdeditbox_handler, I(offsetof(Config,username)),
- I(sizeof(((Config *)0)->username)));
- }
+ if (!midsession) {
+ s = ctrl_getset(b, "Connection", "data",
+ "Data to send to the server");
+ ctrl_editbox(s, "Terminal-type string", 't', 50,
+ HELPCTX(connection_termtype),
+ dlg_stdeditbox_handler, I(offsetof(Config,termtype)),
+ I(sizeof(((Config *)0)->termtype)));
+ ctrl_editbox(s, "Terminal speeds", 's', 50,
+ HELPCTX(connection_termspeed),
+ dlg_stdeditbox_handler, I(offsetof(Config,termspeed)),
+ I(sizeof(((Config *)0)->termspeed)));
+ ctrl_editbox(s, "Auto-login username", 'u', 50,
+ HELPCTX(connection_username),
+ dlg_stdeditbox_handler, I(offsetof(Config,username)),
+ I(sizeof(((Config *)0)->username)));
+
+ ctrl_text(s, "Environment variables:", HELPCTX(telnet_environ));
+ ctrl_columns(s, 2, 80, 20);
+ ed = (struct environ_data *)
+ ctrl_alloc(b, sizeof(struct environ_data));
+ ed->varbox = ctrl_editbox(s, "Variable", 'v', 60,
+ HELPCTX(telnet_environ),
+ environ_handler, P(ed), P(NULL));
+ ed->varbox->generic.column = 0;
+ ed->valbox = ctrl_editbox(s, "Value", 'l', 60,
+ HELPCTX(telnet_environ),
+ environ_handler, P(ed), P(NULL));
+ ed->valbox->generic.column = 0;
+ ed->addbutton = ctrl_pushbutton(s, "Add", 'd',
+ HELPCTX(telnet_environ),
+ environ_handler, P(ed));
+ ed->addbutton->generic.column = 1;
+ ed->rembutton = ctrl_pushbutton(s, "Remove", 'r',
+ HELPCTX(telnet_environ),
+ environ_handler, P(ed));
+ ed->rembutton->generic.column = 1;
+ ctrl_columns(s, 1, 100);
+ ed->listbox = ctrl_listbox(s, NULL, NO_SHORTCUT,
+ HELPCTX(telnet_environ),
+ environ_handler, P(ed));
+ ed->listbox->listbox.height = 3;
+ ed->listbox->listbox.ncols = 2;
+ ed->listbox->listbox.percentages = snewn(2, int);
+ ed->listbox->listbox.percentages[0] = 30;
+ ed->listbox->listbox.percentages[1] = 70;
+ }