Commit caa2ecc78505d54f40b3a60e50331495de25c11f

Authored by perry.werneck@gmail.com
1 parent 03b37315

Ajustando tipo de terminal de acordo com a tabela de cores

Showing 2 changed files with 8 additions and 0 deletions   Show diff stats
src/lib3270/options.c
... ... @@ -81,22 +81,28 @@ LIB3270_EXPORT int lib3270_set_color_type(H3270 *hSession, unsigned short colort
81 81 {
82 82 CHECK_SESSION_HANDLE(hSession);
83 83  
  84 + if(hSession->cstate != LIB3270_NOT_CONNECTED)
  85 + return EBUSY;
  86 +
84 87 switch(colortype)
85 88 {
86 89 case 0:
87 90 case 16:
88 91 hSession->colors = 16;
89 92 hSession->mono = 0;
  93 + hSession->m3279 = 1;
90 94 break;
91 95  
92 96 case 8:
93 97 hSession->colors = 8;
94 98 hSession->mono = 0;
  99 + hSession->m3279 = 1;
95 100 break;
96 101  
97 102 case 2:
98 103 hSession->colors = 16;
99 104 hSession->mono = 1;
  105 + hSession->m3279 = 0;
100 106 break;
101 107  
102 108 default:
... ...
src/lib3270/telnet.c
... ... @@ -684,6 +684,8 @@ int net_connect(H3270 *session, const char *host, char *portname, Boolean ls, Bo
684 684  
685 685 }
686 686  
  687 + snprintf(session->full_model_name,LIB3270_FULL_MODEL_NAME_LENGTH,"IBM-327%c-%d",session->m3279 ? '9' : '8', session->model_num);
  688 +
687 689 /* set up temporary termtype
688 690 if (session->termname == CN && session->std_ds_host)
689 691 {
... ...