2003-03-14 21:35:01 +03:00
|
|
|
/*
|
|
|
|
* uxcfg.c - the Unix-specific parts of the PuTTY configuration
|
|
|
|
* box.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "putty.h"
|
|
|
|
#include "dialog.h"
|
|
|
|
#include "storage.h"
|
|
|
|
|
2006-08-29 13:18:09 +04:00
|
|
|
void unix_setup_config_box(struct controlbox *b, int midsession, int protocol)
|
2003-03-14 21:35:01 +03:00
|
|
|
{
|
2005-02-14 10:41:41 +03:00
|
|
|
struct controlset *s;
|
2003-03-14 21:35:01 +03:00
|
|
|
union control *c;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The Config structure contains two Unix-specific elements
|
|
|
|
* which are not configured in here: stamp_utmp and
|
|
|
|
* login_shell. This is because pterm does not put up a
|
|
|
|
* configuration box right at the start, which is the only time
|
|
|
|
* when these elements would be useful to configure.
|
|
|
|
*/
|
|
|
|
|
2003-04-05 20:12:52 +04:00
|
|
|
/*
|
|
|
|
* On Unix, we don't have a drop-down list for the printer
|
|
|
|
* control.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "Terminal", "printing", "Remote-controlled printing");
|
|
|
|
assert(s->ncontrols == 1 && s->ctrls[0]->generic.type == CTRL_EDITBOX);
|
|
|
|
s->ctrls[0]->editbox.has_list = 0;
|
|
|
|
|
2003-05-06 23:52:31 +04:00
|
|
|
/*
|
|
|
|
* Unix supports a local-command proxy. This also means we must
|
|
|
|
* adjust the text on the `Telnet command' control.
|
|
|
|
*/
|
2003-05-07 17:14:48 +04:00
|
|
|
if (!midsession) {
|
2003-05-06 23:52:31 +04:00
|
|
|
int i;
|
2003-05-07 17:14:48 +04:00
|
|
|
s = ctrl_getset(b, "Connection/Proxy", "basics", NULL);
|
2003-05-06 23:52:31 +04:00
|
|
|
for (i = 0; i < s->ncontrols; i++) {
|
|
|
|
c = s->ctrls[i];
|
|
|
|
if (c->generic.type == CTRL_RADIO &&
|
|
|
|
c->generic.context.i == offsetof(Config, proxy_type)) {
|
|
|
|
assert(c->generic.handler == dlg_stdradiobutton_handler);
|
|
|
|
c->radio.nbuttons++;
|
|
|
|
c->radio.buttons =
|
|
|
|
sresize(c->radio.buttons, c->radio.nbuttons, char *);
|
|
|
|
c->radio.buttons[c->radio.nbuttons-1] =
|
|
|
|
dupstr("Local");
|
|
|
|
c->radio.buttondata =
|
|
|
|
sresize(c->radio.buttondata, c->radio.nbuttons, intorptr);
|
|
|
|
c->radio.buttondata[c->radio.nbuttons-1] = I(PROXY_CMD);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-05-07 16:07:23 +04:00
|
|
|
|
2003-05-06 23:52:31 +04:00
|
|
|
for (i = 0; i < s->ncontrols; i++) {
|
|
|
|
c = s->ctrls[i];
|
|
|
|
if (c->generic.type == CTRL_EDITBOX &&
|
|
|
|
c->generic.context.i ==
|
|
|
|
offsetof(Config, proxy_telnet_command)) {
|
|
|
|
assert(c->generic.handler == dlg_stdeditbox_handler);
|
|
|
|
sfree(c->generic.label);
|
|
|
|
c->generic.label = dupstr("Telnet command, or local"
|
|
|
|
" proxy command");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-08-28 18:29:02 +04:00
|
|
|
/*
|
|
|
|
* Serial back end is available on Unix. However, we have to
|
|
|
|
* mask out a couple of the configuration options: mark and
|
|
|
|
* space parity are not conveniently supported, and neither is
|
|
|
|
* DSR/DTR flow control.
|
|
|
|
*/
|
2006-08-29 13:18:09 +04:00
|
|
|
if (!midsession || (protocol == PROT_SERIAL))
|
|
|
|
ser_setup_config_box(b, midsession, 0x07, 0x07);
|
2003-03-14 21:35:01 +03:00
|
|
|
}
|