Commit caa2ecc78505d54f40b3a60e50331495de25c11f
1 parent
03b37315
Exists in
master
and in
5 other branches
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,22 +81,28 @@ LIB3270_EXPORT int lib3270_set_color_type(H3270 *hSession, unsigned short colort | ||
| 81 | { | 81 | { |
| 82 | CHECK_SESSION_HANDLE(hSession); | 82 | CHECK_SESSION_HANDLE(hSession); |
| 83 | 83 | ||
| 84 | + if(hSession->cstate != LIB3270_NOT_CONNECTED) | ||
| 85 | + return EBUSY; | ||
| 86 | + | ||
| 84 | switch(colortype) | 87 | switch(colortype) |
| 85 | { | 88 | { |
| 86 | case 0: | 89 | case 0: |
| 87 | case 16: | 90 | case 16: |
| 88 | hSession->colors = 16; | 91 | hSession->colors = 16; |
| 89 | hSession->mono = 0; | 92 | hSession->mono = 0; |
| 93 | + hSession->m3279 = 1; | ||
| 90 | break; | 94 | break; |
| 91 | 95 | ||
| 92 | case 8: | 96 | case 8: |
| 93 | hSession->colors = 8; | 97 | hSession->colors = 8; |
| 94 | hSession->mono = 0; | 98 | hSession->mono = 0; |
| 99 | + hSession->m3279 = 1; | ||
| 95 | break; | 100 | break; |
| 96 | 101 | ||
| 97 | case 2: | 102 | case 2: |
| 98 | hSession->colors = 16; | 103 | hSession->colors = 16; |
| 99 | hSession->mono = 1; | 104 | hSession->mono = 1; |
| 105 | + hSession->m3279 = 0; | ||
| 100 | break; | 106 | break; |
| 101 | 107 | ||
| 102 | default: | 108 | default: |
src/lib3270/telnet.c
| @@ -684,6 +684,8 @@ int net_connect(H3270 *session, const char *host, char *portname, Boolean ls, Bo | @@ -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 | /* set up temporary termtype | 689 | /* set up temporary termtype |
| 688 | if (session->termname == CN && session->std_ds_host) | 690 | if (session->termname == CN && session->std_ds_host) |
| 689 | { | 691 | { |