config-unix.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * config-unix.c - the Unix-specific parts of the PuTTY configuration
  3. * box.
  4. */
  5. #include <assert.h>
  6. #include <stdlib.h>
  7. #include "putty.h"
  8. #include "dialog.h"
  9. #include "storage.h"
  10. void unix_setup_config_box(struct controlbox *b, bool midsession, int protocol)
  11. {
  12. struct controlset *s;
  13. dlgcontrol *c;
  14. /*
  15. * The Conf structure contains two Unix-specific elements which
  16. * are not configured in here: stamp_utmp and login_shell. This
  17. * is because pterm does not put up a configuration box right at
  18. * the start, which is the only time when these elements would
  19. * be useful to configure.
  20. */
  21. /*
  22. * On Unix, we don't have a drop-down list for the printer
  23. * control.
  24. */
  25. s = ctrl_getset(b, "Terminal", "printing", "Remote-controlled printing");
  26. assert(s->ncontrols == 1 && s->ctrls[0]->type == CTRL_EDITBOX);
  27. s->ctrls[0]->editbox.has_list = false;
  28. /*
  29. * Unix supports a local-command proxy.
  30. */
  31. if (!midsession) {
  32. int i;
  33. s = ctrl_getset(b, "Connection/Proxy", "basics", NULL);
  34. for (i = 0; i < s->ncontrols; i++) {
  35. c = s->ctrls[i];
  36. if (c->type == CTRL_LISTBOX &&
  37. c->handler == proxy_type_handler) {
  38. c->context.i |= PROXY_UI_FLAG_LOCAL;
  39. break;
  40. }
  41. }
  42. }
  43. }