2003-03-06 01:07:40 +03:00
|
|
|
/*
|
|
|
|
* wincfg.c - the Windows-specific parts of the PuTTY configuration
|
|
|
|
* box.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "putty.h"
|
|
|
|
#include "dialog.h"
|
|
|
|
#include "storage.h"
|
|
|
|
|
|
|
|
static void about_handler(union control *ctrl, void *dlg,
|
|
|
|
void *data, int event)
|
|
|
|
{
|
|
|
|
HWND *hwndp = (HWND *)ctrl->generic.context.p;
|
|
|
|
|
|
|
|
if (event == EVENT_ACTION) {
|
|
|
|
modal_about_box(*hwndp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void help_handler(union control *ctrl, void *dlg,
|
|
|
|
void *data, int event)
|
|
|
|
{
|
|
|
|
HWND *hwndp = (HWND *)ctrl->generic.context.p;
|
|
|
|
|
|
|
|
if (event == EVENT_ACTION) {
|
|
|
|
show_help(*hwndp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-29 17:11:25 +03:00
|
|
|
static void variable_pitch_handler(union control *ctrl, void *dlg,
|
|
|
|
void *data, int event)
|
|
|
|
{
|
|
|
|
if (event == EVENT_REFRESH) {
|
|
|
|
dlg_checkbox_set(ctrl, dlg, !dlg_get_fixed_pitch_flag(dlg));
|
|
|
|
} else if (event == EVENT_VALCHANGE) {
|
|
|
|
dlg_set_fixed_pitch_flag(dlg, !dlg_checkbox_get(ctrl, dlg));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-06 01:07:40 +03:00
|
|
|
void win_setup_config_box(struct controlbox *b, HWND *hwndp, int has_help,
|
2006-08-29 13:18:09 +04:00
|
|
|
int midsession, int protocol)
|
2003-03-06 01:07:40 +03:00
|
|
|
{
|
|
|
|
struct controlset *s;
|
|
|
|
union control *c;
|
2003-04-06 18:11:33 +04:00
|
|
|
char *str;
|
2003-03-06 01:07:40 +03:00
|
|
|
|
|
|
|
if (!midsession) {
|
|
|
|
/*
|
|
|
|
* Add the About and Help buttons to the standard panel.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "", "", "");
|
|
|
|
c = ctrl_pushbutton(s, "About", 'a', HELPCTX(no_help),
|
|
|
|
about_handler, P(hwndp));
|
|
|
|
c->generic.column = 0;
|
|
|
|
if (has_help) {
|
|
|
|
c = ctrl_pushbutton(s, "Help", 'h', HELPCTX(no_help),
|
|
|
|
help_handler, P(hwndp));
|
|
|
|
c->generic.column = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-14 21:35:01 +03:00
|
|
|
/*
|
|
|
|
* Full-screen mode is a Windows peculiarity; hence
|
|
|
|
* scrollbar_in_fullscreen is as well.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "Window", "scrollback",
|
|
|
|
"Control the scrollback in the window");
|
|
|
|
ctrl_checkbox(s, "Display scrollbar in full screen mode", 'i',
|
|
|
|
HELPCTX(window_scrollback),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler,
|
|
|
|
I(CONF_scrollbar_in_fullscreen));
|
2003-03-14 21:35:01 +03:00
|
|
|
/*
|
|
|
|
* Really this wants to go just after `Display scrollbar'. See
|
|
|
|
* if we can find that control, and do some shuffling.
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < s->ncontrols; i++) {
|
|
|
|
c = s->ctrls[i];
|
|
|
|
if (c->generic.type == CTRL_CHECKBOX &&
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
c->generic.context.i == CONF_scrollbar) {
|
2003-03-14 21:35:01 +03:00
|
|
|
/*
|
|
|
|
* Control i is the scrollbar checkbox.
|
|
|
|
* Control s->ncontrols-1 is the scrollbar-in-FS one.
|
|
|
|
*/
|
|
|
|
if (i < s->ncontrols-2) {
|
|
|
|
c = s->ctrls[s->ncontrols-1];
|
|
|
|
memmove(s->ctrls+i+2, s->ctrls+i+1,
|
|
|
|
(s->ncontrols-i-2)*sizeof(union control *));
|
|
|
|
s->ctrls[i+1] = c;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-06 01:07:40 +03:00
|
|
|
/*
|
|
|
|
* Windows has the AltGr key, which has various Windows-
|
|
|
|
* specific options.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "Terminal/Keyboard", "features",
|
|
|
|
"Enable extra keyboard features:");
|
|
|
|
ctrl_checkbox(s, "AltGr acts as Compose key", 't',
|
|
|
|
HELPCTX(keyboard_compose),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler, I(CONF_compose_key));
|
2003-03-06 01:07:40 +03:00
|
|
|
ctrl_checkbox(s, "Control-Alt is different from AltGr", 'd',
|
|
|
|
HELPCTX(keyboard_ctrlalt),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler, I(CONF_ctrlaltkeys));
|
2003-03-06 01:07:40 +03:00
|
|
|
|
|
|
|
/*
|
2003-05-24 16:31:32 +04:00
|
|
|
* Windows allows an arbitrary .WAV to be played as a bell, and
|
|
|
|
* also the use of the PC speaker. For this we must search the
|
|
|
|
* existing controlset for the radio-button set controlling the
|
|
|
|
* `beep' option, and add extra buttons to it.
|
2003-03-06 01:07:40 +03:00
|
|
|
*
|
|
|
|
* Note that although this _looks_ like a hideous hack, it's
|
|
|
|
* actually all above board. The well-defined interface to the
|
|
|
|
* per-platform dialog box code is the _data structures_ `union
|
|
|
|
* control', `struct controlset' and so on; so code like this
|
|
|
|
* that reaches into those data structures and changes bits of
|
|
|
|
* them is perfectly legitimate and crosses no boundaries. All
|
|
|
|
* the ctrl_* routines that create most of the controls are
|
|
|
|
* convenient shortcuts provided on the cross-platform side of
|
|
|
|
* the interface, and template creation code is under no actual
|
|
|
|
* obligation to use them.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "Terminal/Bell", "style", "Set the style of bell");
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < s->ncontrols; i++) {
|
|
|
|
c = s->ctrls[i];
|
|
|
|
if (c->generic.type == CTRL_RADIO &&
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
c->generic.context.i == CONF_beep) {
|
|
|
|
assert(c->generic.handler == conf_radiobutton_handler);
|
2003-05-24 16:31:32 +04:00
|
|
|
c->radio.nbuttons += 2;
|
2003-03-06 01:07:40 +03:00
|
|
|
c->radio.buttons =
|
2003-03-29 19:14:26 +03:00
|
|
|
sresize(c->radio.buttons, c->radio.nbuttons, char *);
|
2003-03-06 01:07:40 +03:00
|
|
|
c->radio.buttons[c->radio.nbuttons-1] =
|
|
|
|
dupstr("Play a custom sound file");
|
2003-05-24 16:31:32 +04:00
|
|
|
c->radio.buttons[c->radio.nbuttons-2] =
|
|
|
|
dupstr("Beep using the PC speaker");
|
2003-03-06 01:07:40 +03:00
|
|
|
c->radio.buttondata =
|
2003-03-29 19:14:26 +03:00
|
|
|
sresize(c->radio.buttondata, c->radio.nbuttons, intorptr);
|
2003-03-06 01:07:40 +03:00
|
|
|
c->radio.buttondata[c->radio.nbuttons-1] = I(BELL_WAVEFILE);
|
2003-05-24 16:31:32 +04:00
|
|
|
c->radio.buttondata[c->radio.nbuttons-2] = I(BELL_PCSPEAKER);
|
2003-03-06 01:07:40 +03:00
|
|
|
if (c->radio.shortcuts) {
|
|
|
|
c->radio.shortcuts =
|
2003-03-29 19:14:26 +03:00
|
|
|
sresize(c->radio.shortcuts, c->radio.nbuttons, char);
|
2003-03-06 01:07:40 +03:00
|
|
|
c->radio.shortcuts[c->radio.nbuttons-1] = NO_SHORTCUT;
|
2003-05-24 16:31:32 +04:00
|
|
|
c->radio.shortcuts[c->radio.nbuttons-2] = NO_SHORTCUT;
|
2003-03-06 01:07:40 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctrl_filesel(s, "Custom sound file to play as a bell:", NO_SHORTCUT,
|
|
|
|
FILTER_WAVE_FILES, FALSE, "Select bell sound file",
|
|
|
|
HELPCTX(bell_style),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_filesel_handler, I(CONF_bell_wavefile));
|
2003-03-06 01:07:40 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* While we've got this box open, taskbar flashing on a bell is
|
|
|
|
* also Windows-specific.
|
|
|
|
*/
|
|
|
|
ctrl_radiobuttons(s, "Taskbar/caption indication on bell:", 'i', 3,
|
|
|
|
HELPCTX(bell_taskbar),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_radiobutton_handler,
|
|
|
|
I(CONF_beep_ind),
|
2003-03-06 01:07:40 +03:00
|
|
|
"Disabled", I(B_IND_DISABLED),
|
|
|
|
"Flashing", I(B_IND_FLASH),
|
|
|
|
"Steady", I(B_IND_STEADY), NULL);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The sunken-edge border is a Windows GUI feature.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "Window/Appearance", "border",
|
|
|
|
"Adjust the window border");
|
|
|
|
ctrl_checkbox(s, "Sunken-edge border (slightly thicker)", 's',
|
|
|
|
HELPCTX(appearance_border),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler, I(CONF_sunken_edge));
|
2003-03-06 01:07:40 +03:00
|
|
|
|
2006-01-12 02:42:02 +03:00
|
|
|
/*
|
|
|
|
* Configurable font quality settings for Windows.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "Window/Appearance", "font",
|
|
|
|
"Font settings");
|
2010-12-29 17:11:25 +03:00
|
|
|
ctrl_checkbox(s, "Allow selection of variable-pitch fonts", NO_SHORTCUT,
|
|
|
|
HELPCTX(appearance_font), variable_pitch_handler, I(0));
|
2006-01-12 02:42:02 +03:00
|
|
|
ctrl_radiobuttons(s, "Font quality:", 'q', 2,
|
|
|
|
HELPCTX(appearance_font),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_radiobutton_handler,
|
|
|
|
I(CONF_font_quality),
|
2006-01-12 02:42:02 +03:00
|
|
|
"Antialiased", I(FQ_ANTIALIASED),
|
|
|
|
"Non-Antialiased", I(FQ_NONANTIALIASED),
|
|
|
|
"ClearType", I(FQ_CLEARTYPE),
|
|
|
|
"Default", I(FQ_DEFAULT), NULL);
|
|
|
|
|
2003-03-06 01:07:40 +03:00
|
|
|
/*
|
|
|
|
* Cyrillic Lock is a horrid misfeature even on Windows, and
|
|
|
|
* the least we can do is ensure it never makes it to any other
|
|
|
|
* platform (at least unless someone fixes it!).
|
|
|
|
*/
|
2005-03-23 02:20:23 +03:00
|
|
|
s = ctrl_getset(b, "Window/Translation", "tweaks", NULL);
|
2003-03-06 01:07:40 +03:00
|
|
|
ctrl_checkbox(s, "Caps Lock acts as Cyrillic switch", 's',
|
|
|
|
HELPCTX(translation_cyrillic),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler,
|
|
|
|
I(CONF_xlat_capslockcyr));
|
2003-03-06 01:07:40 +03:00
|
|
|
|
2004-11-29 12:23:11 +03:00
|
|
|
/*
|
|
|
|
* On Windows we can use but not enumerate translation tables
|
|
|
|
* from the operating system. Briefly document this.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "Window/Translation", "trans",
|
|
|
|
"Character set translation on received data");
|
|
|
|
ctrl_text(s, "(Codepages supported by Windows but not listed here, "
|
|
|
|
"such as CP866 on many systems, can be entered manually)",
|
|
|
|
HELPCTX(translation_codepage));
|
|
|
|
|
2003-03-06 01:07:40 +03:00
|
|
|
/*
|
|
|
|
* Windows has the weird OEM font mode, which gives us some
|
|
|
|
* additional options when working with line-drawing
|
|
|
|
* characters.
|
|
|
|
*/
|
2003-04-06 18:11:33 +04:00
|
|
|
str = dupprintf("Adjust how %s displays line drawing characters", appname);
|
|
|
|
s = ctrl_getset(b, "Window/Translation", "linedraw", str);
|
|
|
|
sfree(str);
|
2003-03-06 01:07:40 +03:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < s->ncontrols; i++) {
|
|
|
|
c = s->ctrls[i];
|
|
|
|
if (c->generic.type == CTRL_RADIO &&
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
c->generic.context.i == CONF_vtmode) {
|
|
|
|
assert(c->generic.handler == conf_radiobutton_handler);
|
2003-04-26 18:22:42 +04:00
|
|
|
c->radio.nbuttons += 3;
|
2003-03-06 01:07:40 +03:00
|
|
|
c->radio.buttons =
|
2003-03-29 19:14:26 +03:00
|
|
|
sresize(c->radio.buttons, c->radio.nbuttons, char *);
|
2003-04-26 18:22:42 +04:00
|
|
|
c->radio.buttons[c->radio.nbuttons-3] =
|
|
|
|
dupstr("Font has XWindows encoding");
|
2003-03-06 01:07:40 +03:00
|
|
|
c->radio.buttons[c->radio.nbuttons-2] =
|
|
|
|
dupstr("Use font in both ANSI and OEM modes");
|
|
|
|
c->radio.buttons[c->radio.nbuttons-1] =
|
|
|
|
dupstr("Use font in OEM mode only");
|
|
|
|
c->radio.buttondata =
|
2003-03-29 19:14:26 +03:00
|
|
|
sresize(c->radio.buttondata, c->radio.nbuttons, intorptr);
|
2003-04-26 18:22:42 +04:00
|
|
|
c->radio.buttondata[c->radio.nbuttons-3] = I(VT_XWINDOWS);
|
2003-03-06 01:07:40 +03:00
|
|
|
c->radio.buttondata[c->radio.nbuttons-2] = I(VT_OEMANSI);
|
|
|
|
c->radio.buttondata[c->radio.nbuttons-1] = I(VT_OEMONLY);
|
|
|
|
if (!c->radio.shortcuts) {
|
|
|
|
int j;
|
2003-03-29 19:14:26 +03:00
|
|
|
c->radio.shortcuts = snewn(c->radio.nbuttons, char);
|
2003-03-06 01:07:40 +03:00
|
|
|
for (j = 0; j < c->radio.nbuttons; j++)
|
|
|
|
c->radio.shortcuts[j] = NO_SHORTCUT;
|
|
|
|
} else {
|
2003-03-29 19:14:26 +03:00
|
|
|
c->radio.shortcuts = sresize(c->radio.shortcuts,
|
|
|
|
c->radio.nbuttons, char);
|
2003-03-06 01:07:40 +03:00
|
|
|
}
|
2003-04-26 18:22:42 +04:00
|
|
|
c->radio.shortcuts[c->radio.nbuttons-3] = 'x';
|
2003-03-06 01:07:40 +03:00
|
|
|
c->radio.shortcuts[c->radio.nbuttons-2] = 'b';
|
|
|
|
c->radio.shortcuts[c->radio.nbuttons-1] = 'e';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* RTF paste is Windows-specific.
|
|
|
|
*/
|
2003-11-20 21:33:22 +03:00
|
|
|
s = ctrl_getset(b, "Window/Selection", "format",
|
|
|
|
"Formatting of pasted characters");
|
2003-03-06 01:07:40 +03:00
|
|
|
ctrl_checkbox(s, "Paste to clipboard in RTF as well as plain text", 'f',
|
|
|
|
HELPCTX(selection_rtf),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler, I(CONF_rtf_paste));
|
2003-03-06 01:07:40 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Windows often has no middle button, so we supply a selection
|
|
|
|
* mode in which the more critical Paste action is available on
|
|
|
|
* the right button instead.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "Window/Selection", "mouse",
|
|
|
|
"Control use of mouse");
|
2003-11-20 21:41:12 +03:00
|
|
|
ctrl_radiobuttons(s, "Action of mouse buttons:", 'm', 1,
|
2003-03-06 01:07:40 +03:00
|
|
|
HELPCTX(selection_buttons),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_radiobutton_handler,
|
|
|
|
I(CONF_mouse_is_xterm),
|
2003-11-20 21:41:12 +03:00
|
|
|
"Windows (Middle extends, Right brings up menu)", I(2),
|
|
|
|
"Compromise (Middle extends, Right pastes)", I(0),
|
|
|
|
"xterm (Right extends, Middle pastes)", I(1), NULL);
|
2003-03-06 01:07:40 +03:00
|
|
|
/*
|
|
|
|
* This really ought to go at the _top_ of its box, not the
|
|
|
|
* bottom, so we'll just do some shuffling now we've set it
|
|
|
|
* up...
|
|
|
|
*/
|
|
|
|
c = s->ctrls[s->ncontrols-1]; /* this should be the new control */
|
|
|
|
memmove(s->ctrls+1, s->ctrls, (s->ncontrols-1)*sizeof(union control *));
|
|
|
|
s->ctrls[0] = c;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Logical palettes don't even make sense anywhere except Windows.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "Window/Colours", "general",
|
|
|
|
"General options for colour usage");
|
|
|
|
ctrl_checkbox(s, "Attempt to use logical palettes", 'l',
|
|
|
|
HELPCTX(colours_logpal),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler, I(CONF_try_palette));
|
2003-09-04 00:14:38 +04:00
|
|
|
ctrl_checkbox(s, "Use system colours", 's',
|
|
|
|
HELPCTX(colours_system),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler, I(CONF_system_colour));
|
2003-09-04 00:14:38 +04:00
|
|
|
|
2003-03-06 01:07:40 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Resize-by-changing-font is a Windows insanity.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "Window", "size", "Set the size of the window");
|
|
|
|
ctrl_radiobuttons(s, "When window is resized:", 'z', 1,
|
|
|
|
HELPCTX(window_resize),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_radiobutton_handler,
|
|
|
|
I(CONF_resize_action),
|
2003-03-06 01:07:40 +03:00
|
|
|
"Change the number of rows and columns", I(RESIZE_TERM),
|
|
|
|
"Change the size of the font", I(RESIZE_FONT),
|
|
|
|
"Change font size only when maximised", I(RESIZE_EITHER),
|
|
|
|
"Forbid resizing completely", I(RESIZE_DISABLED), NULL);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Most of the Window/Behaviour stuff is there to mimic Windows
|
|
|
|
* conventions which PuTTY can optionally disregard. Hence,
|
|
|
|
* most of these options are Windows-specific.
|
|
|
|
*/
|
|
|
|
s = ctrl_getset(b, "Window/Behaviour", "main", NULL);
|
|
|
|
ctrl_checkbox(s, "Window closes on ALT-F4", '4',
|
|
|
|
HELPCTX(behaviour_altf4),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler, I(CONF_alt_f4));
|
2003-03-06 01:07:40 +03:00
|
|
|
ctrl_checkbox(s, "System menu appears on ALT-Space", 'y',
|
|
|
|
HELPCTX(behaviour_altspace),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler, I(CONF_alt_space));
|
2003-03-06 01:07:40 +03:00
|
|
|
ctrl_checkbox(s, "System menu appears on ALT alone", 'l',
|
|
|
|
HELPCTX(behaviour_altonly),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler, I(CONF_alt_only));
|
2003-03-06 01:07:40 +03:00
|
|
|
ctrl_checkbox(s, "Ensure window is always on top", 'e',
|
|
|
|
HELPCTX(behaviour_alwaysontop),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler, I(CONF_alwaysontop));
|
2003-03-06 01:07:40 +03:00
|
|
|
ctrl_checkbox(s, "Full screen on Alt-Enter", 'f',
|
|
|
|
HELPCTX(behaviour_altenter),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_checkbox_handler,
|
|
|
|
I(CONF_fullscreenonaltenter));
|
2006-08-26 14:20:16 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Windows supports a local-command proxy. This also means we
|
|
|
|
* must adjust the text on the `Telnet command' control.
|
|
|
|
*/
|
|
|
|
if (!midsession) {
|
|
|
|
int i;
|
|
|
|
s = ctrl_getset(b, "Connection/Proxy", "basics", NULL);
|
|
|
|
for (i = 0; i < s->ncontrols; i++) {
|
|
|
|
c = s->ctrls[i];
|
|
|
|
if (c->generic.type == CTRL_RADIO &&
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
c->generic.context.i == CONF_proxy_type) {
|
|
|
|
assert(c->generic.handler == conf_radiobutton_handler);
|
2006-08-26 14:20:16 +04:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < s->ncontrols; i++) {
|
|
|
|
c = s->ctrls[i];
|
|
|
|
if (c->generic.type == CTRL_EDITBOX &&
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
c->generic.context.i == CONF_proxy_telnet_command) {
|
|
|
|
assert(c->generic.handler == conf_editbox_handler);
|
2006-08-26 14:20:16 +04:00
|
|
|
sfree(c->generic.label);
|
|
|
|
c->generic.label = dupstr("Telnet command, or local"
|
|
|
|
" proxy command");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-08-28 14:35:12 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Serial back end is available on Windows.
|
|
|
|
*/
|
2006-08-29 13:18:09 +04:00
|
|
|
if (!midsession || (protocol == PROT_SERIAL))
|
|
|
|
ser_setup_config_box(b, midsession, 0x1F, 0x0F);
|
2008-11-17 21:38:09 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* $XAUTHORITY is not reliable on Windows, so we provide a
|
|
|
|
* means to override it.
|
|
|
|
*/
|
2009-02-04 00:22:52 +03:00
|
|
|
if (!midsession && backend_from_proto(PROT_SSH)) {
|
2008-11-25 21:43:52 +03:00
|
|
|
s = ctrl_getset(b, "Connection/SSH/X11", "x11", "X11 forwarding");
|
|
|
|
ctrl_filesel(s, "X authority file for local display", 't',
|
|
|
|
NULL, FALSE, "Select X authority file",
|
|
|
|
HELPCTX(ssh_tunnels_xauthority),
|
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.
User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).
One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.
[originally from svn r9214]
2011-07-14 22:52:21 +04:00
|
|
|
conf_filesel_handler, I(CONF_xauthfile));
|
2008-11-25 21:43:52 +03:00
|
|
|
}
|
2003-03-06 01:07:40 +03:00
|
|
|
}
|