mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Lowercase version of BackendVtable's displayname.
The current 'displayname' field is designed for presenting in the config UI, so it starts with a capital letter even when it's not a proper noun. If I want to name the backend in the middle of a sentence, I'll need a version that starts with lowercase where appropriate. The old field is renamed displayname_tc, to avoid ambiguity.
This commit is contained in:
parent
efb6589411
commit
5374444879
4
config.c
4
config.c
@ -312,7 +312,7 @@ static void config_protocols_handler(union control *ctrl, dlgparam *dlg,
|
||||
for (size_t i = n_ui_backends;
|
||||
i < PROTOCOL_LIMIT && backends[i]; i++) {
|
||||
dlg_listbox_addwithid(ctrl, dlg,
|
||||
backends[i]->displayname,
|
||||
backends[i]->displayname_tc,
|
||||
backends[i]->protocol);
|
||||
if (backends[i]->protocol == curproto)
|
||||
curentry = i - n_ui_backends;
|
||||
@ -1793,7 +1793,7 @@ void setup_config_box(struct controlbox *b, bool midsession,
|
||||
for (size_t i = 0; i < n_ui_backends; i++) {
|
||||
assert(backends[i]);
|
||||
c->radio.buttons[c->radio.nbuttons] =
|
||||
dupstr(backends[i]->displayname);
|
||||
dupstr(backends[i]->displayname_tc);
|
||||
c->radio.shortcuts[c->radio.nbuttons] =
|
||||
(backends[i]->protocol == PROT_SSH ? 's' :
|
||||
backends[i]->protocol == PROT_SERIAL ? 'r' :
|
||||
|
@ -338,7 +338,8 @@ const BackendVtable raw_backend = {
|
||||
.unthrottle = raw_unthrottle,
|
||||
.cfg_info = raw_cfg_info,
|
||||
.id = "raw",
|
||||
.displayname = "Raw",
|
||||
.displayname_tc = "Raw",
|
||||
.displayname_lc = "raw",
|
||||
.protocol = PROT_RAW,
|
||||
.default_port = 0,
|
||||
};
|
||||
|
@ -445,7 +445,8 @@ const BackendVtable rlogin_backend = {
|
||||
.unthrottle = rlogin_unthrottle,
|
||||
.cfg_info = rlogin_cfg_info,
|
||||
.id = "rlogin",
|
||||
.displayname = "Rlogin",
|
||||
.displayname_tc = "Rlogin",
|
||||
.displayname_lc = "Rlogin", /* proper name, so capitalise it anyway */
|
||||
.protocol = PROT_RLOGIN,
|
||||
.default_port = 513,
|
||||
};
|
||||
|
@ -936,7 +936,8 @@ const BackendVtable supdup_backend = {
|
||||
.unthrottle = supdup_unthrottle,
|
||||
.cfg_info = supdup_cfg_info,
|
||||
.id = "supdup",
|
||||
.displayname = "SUPDUP",
|
||||
.displayname_tc = "SUPDUP",
|
||||
.displayname_lc = "SUPDUP", /* proper name, so capitalise it anyway */
|
||||
.protocol = PROT_SUPDUP,
|
||||
.default_port = 0137,
|
||||
.flags = BACKEND_RESIZE_FORBIDDEN | BACKEND_NEEDS_TERMINAL,
|
||||
|
@ -1082,7 +1082,8 @@ const BackendVtable telnet_backend = {
|
||||
.unthrottle = telnet_unthrottle,
|
||||
.cfg_info = telnet_cfg_info,
|
||||
.id = "telnet",
|
||||
.displayname = "Telnet",
|
||||
.displayname_tc = "Telnet",
|
||||
.displayname_lc = "Telnet", /* proper name, so capitalise it anyway */
|
||||
.protocol = PROT_TELNET,
|
||||
.default_port = 23,
|
||||
};
|
||||
|
@ -71,7 +71,8 @@ const BackendVtable null_backend = {
|
||||
.unthrottle = null_unthrottle,
|
||||
.cfg_info = null_cfg_info,
|
||||
.id = "null",
|
||||
.displayname = "null",
|
||||
.displayname_tc = "Null",
|
||||
.displayname_lc = "null",
|
||||
.protocol = -1,
|
||||
.default_port = 0,
|
||||
};
|
||||
@ -93,7 +94,8 @@ const BackendVtable loop_backend = {
|
||||
.unthrottle = null_unthrottle,
|
||||
.cfg_info = null_cfg_info,
|
||||
.id = "loop",
|
||||
.displayname = "loop",
|
||||
.displayname_tc = "Loop",
|
||||
.displayname_lc = "loop",
|
||||
.protocol = -1,
|
||||
.default_port = 0,
|
||||
};
|
||||
|
7
putty.h
7
putty.h
@ -681,9 +681,10 @@ struct BackendVtable {
|
||||
char *(*close_warn_text)(Backend *be);
|
||||
|
||||
/* 'id' is a machine-readable name for the backend, used in
|
||||
* saved-session storage. 'displayname' is a human-readable name
|
||||
* for error messages. */
|
||||
const char *id, *displayname;
|
||||
* saved-session storage. 'displayname_tc' and 'displayname_lc'
|
||||
* are human-readable names, one in title-case for config boxes,
|
||||
* and one in lower-case for use in mid-sentence. */
|
||||
const char *id, *displayname_tc, *displayname_lc;
|
||||
|
||||
int protocol;
|
||||
int default_port;
|
||||
|
@ -1248,7 +1248,8 @@ const BackendVtable ssh_backend = {
|
||||
.test_for_upstream = ssh_test_for_upstream,
|
||||
.close_warn_text = ssh_close_warn_text,
|
||||
.id = "ssh",
|
||||
.displayname = "SSH",
|
||||
.displayname_tc = "SSH",
|
||||
.displayname_lc = "SSH", /* proper name, so capitalise it anyway */
|
||||
.protocol = PROT_SSH,
|
||||
.flags = BACKEND_SUPPORTS_NC_HOST | BACKEND_NOTIFIES_SESSION_START,
|
||||
.default_port = 22,
|
||||
@ -1273,7 +1274,8 @@ const BackendVtable sshconn_backend = {
|
||||
.test_for_upstream = ssh_test_for_upstream,
|
||||
.close_warn_text = ssh_close_warn_text,
|
||||
.id = "ssh-connection",
|
||||
.displayname = "Bare ssh-connection",
|
||||
.displayname_tc = "Bare ssh-connection",
|
||||
.displayname_lc = "bare ssh-connection",
|
||||
.protocol = PROT_SSHCONN,
|
||||
.flags = BACKEND_SUPPORTS_NC_HOST | BACKEND_NOTIFIES_SESSION_START,
|
||||
};
|
||||
|
@ -835,7 +835,7 @@ int main(int argc, char **argv)
|
||||
if (backvt->flags & BACKEND_NEEDS_TERMINAL) {
|
||||
fprintf(stderr,
|
||||
"Plink doesn't support %s, which needs terminal emulation\n",
|
||||
backvt->displayname);
|
||||
backvt->displayname_lc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -912,7 +912,7 @@ int main(int argc, char **argv)
|
||||
if (just_test_share_exists) {
|
||||
if (!backvt->test_for_upstream) {
|
||||
fprintf(stderr, "Connection sharing not supported for this "
|
||||
"connection type (%s)'\n", backvt->displayname);
|
||||
"connection type (%s)'\n", backvt->displayname_lc);
|
||||
return 1;
|
||||
}
|
||||
if (backvt->test_for_upstream(conf_get_str(conf, CONF_host),
|
||||
|
@ -1597,6 +1597,7 @@ const BackendVtable pty_backend = {
|
||||
.unthrottle = pty_unthrottle,
|
||||
.cfg_info = pty_cfg_info,
|
||||
.id = "pty",
|
||||
.displayname = "pty",
|
||||
.displayname_tc = "pty",
|
||||
.displayname_lc = "pty",
|
||||
.protocol = -1,
|
||||
};
|
||||
|
@ -583,7 +583,8 @@ const BackendVtable serial_backend = {
|
||||
.unthrottle = serial_unthrottle,
|
||||
.cfg_info = serial_cfg_info,
|
||||
.id = "serial",
|
||||
.displayname = "Serial",
|
||||
.displayname_tc = "Serial",
|
||||
.displayname_lc = "serial",
|
||||
.protocol = PROT_SERIAL,
|
||||
.serial_parity_mask = ((1 << SER_PAR_NONE) |
|
||||
(1 << SER_PAR_ODD) |
|
||||
|
@ -385,6 +385,7 @@ const BackendVtable conpty_backend = {
|
||||
.unthrottle = conpty_unthrottle,
|
||||
.cfg_info = conpty_cfg_info,
|
||||
.id = "conpty",
|
||||
.displayname = "ConPTY",
|
||||
.displayname_tc = "ConPTY",
|
||||
.displayname_lc = "ConPTY", /* proper name, so capitalise it anyway */
|
||||
.protocol = -1,
|
||||
};
|
||||
|
@ -415,7 +415,7 @@ int main(int argc, char **argv)
|
||||
if (vt->flags & BACKEND_NEEDS_TERMINAL) {
|
||||
fprintf(stderr,
|
||||
"Plink doesn't support %s, which needs terminal emulation\n",
|
||||
vt->displayname);
|
||||
vt->displayname_lc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ int main(int argc, char **argv)
|
||||
if (just_test_share_exists) {
|
||||
if (!vt->test_for_upstream) {
|
||||
fprintf(stderr, "Connection sharing not supported for this "
|
||||
"connection type (%s)'\n", vt->displayname);
|
||||
"connection type (%s)'\n", vt->displayname_lc);
|
||||
return 1;
|
||||
}
|
||||
if (vt->test_for_upstream(conf_get_str(conf, CONF_host),
|
||||
|
@ -452,7 +452,8 @@ const BackendVtable serial_backend = {
|
||||
.unthrottle = serial_unthrottle,
|
||||
.cfg_info = serial_cfg_info,
|
||||
.id = "serial",
|
||||
.displayname = "Serial",
|
||||
.displayname_tc = "Serial",
|
||||
.displayname_lc = "serial",
|
||||
.protocol = PROT_SERIAL,
|
||||
.serial_parity_mask = ((1 << SER_PAR_NONE) |
|
||||
(1 << SER_PAR_ODD) |
|
||||
|
Loading…
Reference in New Issue
Block a user