1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-14 09:37:34 -05:00

Unix can't sensibly enumerate printers (since they're defined as

being lpr commands), so the Unix config box now replaces the printer
combo box with an ordinary edit box.

[originally from svn r3063]
This commit is contained in:
Simon Tatham
2003-04-05 16:12:52 +00:00
parent 30497ff683
commit 09c9f31289
5 changed files with 34 additions and 22 deletions

View File

@ -133,12 +133,18 @@ static void printerbox_handler(union control *ctrl, void *dlg,
printer_enum *pe;
dlg_update_start(ctrl, dlg);
dlg_listbox_clear(ctrl, dlg);
dlg_listbox_add(ctrl, dlg, PRINTER_DISABLED_STRING);
pe = printer_start_enum(&nprinters);
for (i = 0; i < nprinters; i++)
dlg_listbox_add(ctrl, dlg, printer_get_name(pe, i));
printer_finish_enum(pe);
/*
* Some backends may wish to disable the drop-down list on
* this edit box. Be prepared for this.
*/
if (ctrl->editbox.has_list) {
dlg_listbox_clear(ctrl, dlg);
dlg_listbox_add(ctrl, dlg, PRINTER_DISABLED_STRING);
pe = printer_start_enum(&nprinters);
for (i = 0; i < nprinters; i++)
dlg_listbox_add(ctrl, dlg, printer_get_name(pe, i));
printer_finish_enum(pe);
}
dlg_editbox_set(ctrl, dlg,
(*cfg->printer ? cfg->printer :
PRINTER_DISABLED_STRING));