Commit 25ddfbb78a3ab460f278483c918aed60ba0a8f58
1 parent
8108ab5c
Exists in
master
and in
5 other branches
Corrigindo mensagem de host-not-found, salvando na configuracao quando o widget …
…e criado com um nome de host
Showing
4 changed files
with
29 additions
and
27 deletions
Show diff stats
src/lib3270/iocalls.c
| ... | ... | @@ -529,8 +529,7 @@ static int internal_event_dispatcher(H3270 *hSession, int block) |
| 529 | 529 | |
| 530 | 530 | static int internal_callthread(int(*callback)(H3270 *, void *), H3270 *session, void *parm) |
| 531 | 531 | { |
| 532 | - callback(session,parm); | |
| 533 | - return 0; | |
| 532 | + return callback(session,parm); | |
| 534 | 533 | } |
| 535 | 534 | |
| 536 | 535 | static int internal_wait(H3270 *hSession, int seconds) |
| ... | ... | @@ -697,20 +696,18 @@ LIB3270_EXPORT int lib3270_register_handlers(const struct lib3270_callbacks *cbk |
| 697 | 696 | |
| 698 | 697 | LIB3270_EXPORT int lib3270_call_thread(int(*callback)(H3270 *h, void *), H3270 *h, void *parm) |
| 699 | 698 | { |
| 700 | -// int rc; | |
| 699 | + int rc; | |
| 701 | 700 | CHECK_SESSION_HANDLE(h); |
| 702 | 701 | |
| 703 | - if(h->set_timer) | |
| 704 | - h->set_timer(h,1); | |
| 702 | + h->set_timer(h,1); | |
| 705 | 703 | |
| 706 | 704 | lib3270_main_iterate(h,0); |
| 707 | - callthread(callback,h,parm); | |
| 705 | + rc = callthread(callback,h,parm); | |
| 708 | 706 | lib3270_main_iterate(h,0); |
| 709 | 707 | |
| 710 | - if(h->set_timer) | |
| 711 | - h->set_timer(h,0); | |
| 708 | + h->set_timer(h,0); | |
| 712 | 709 | |
| 713 | - return 0; | |
| 710 | + return rc; | |
| 714 | 711 | } |
| 715 | 712 | |
| 716 | 713 | LIB3270_EXPORT void lib3270_main_iterate(H3270 *hSession, int block) | ... | ... |
src/lib3270/session.c
| ... | ... | @@ -155,6 +155,10 @@ static void update_ssl(H3270 *session, LIB3270_SSL_STATE state) |
| 155 | 155 | { |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | +static void set_timer(H3270 *session, unsigned char on) | |
| 159 | +{ | |
| 160 | +} | |
| 161 | + | |
| 158 | 162 | static void screen_disp(H3270 *session) |
| 159 | 163 | { |
| 160 | 164 | CHECK_SESSION_HANDLE(session); |
| ... | ... | @@ -198,6 +202,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model) |
| 198 | 202 | hSession->set_width = nop_int; |
| 199 | 203 | hSession->update_status = (void (*)(H3270 *, LIB3270_STATUS)) nop_int; |
| 200 | 204 | hSession->autostart = nop; |
| 205 | + hSession->set_timer = set_timer; | |
| 201 | 206 | |
| 202 | 207 | // Set the defaults. |
| 203 | 208 | hSession->extended = 1; | ... | ... |
src/pw3270/uiparser/action.c
| ... | ... | @@ -140,18 +140,6 @@ |
| 140 | 140 | dt->keypad[dt->pos++] = widget; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - static void disable_keypad(GtkWidget *terminal, GtkWidget **keypad) | |
| 144 | - { | |
| 145 | - while(*keypad) | |
| 146 | - gtk_widget_set_sensitive(*(keypad++),FALSE); | |
| 147 | - } | |
| 148 | - | |
| 149 | - static void enable_keypad(GtkWidget *terminal, const gchar *dunno, GtkWidget **keypad) | |
| 150 | - { | |
| 151 | - while(*keypad) | |
| 152 | - gtk_widget_set_sensitive(*(keypad++),TRUE); | |
| 153 | - } | |
| 154 | - | |
| 155 | 143 | void ui_setup_keypads(GHashTable *keypads, GtkWidget *window, GtkWidget *widget) |
| 156 | 144 | { |
| 157 | 145 | struct list_data dt; |
| ... | ... | @@ -166,8 +154,5 @@ |
| 166 | 154 | dt.keypad = g_new0(GtkWidget *,dt.total+1); |
| 167 | 155 | g_hash_table_foreach(keypads,(GHFunc) insert_keypad, &dt); |
| 168 | 156 | |
| 169 | - g_signal_connect(widget,"disconnected",G_CALLBACK(disable_keypad),dt.keypad); | |
| 170 | - g_signal_connect(widget,"connected",G_CALLBACK(enable_keypad),dt.keypad); | |
| 171 | - | |
| 172 | - g_object_set_data_full(G_OBJECT(widget),"keypads",dt.keypad,g_free); | |
| 157 | + g_object_set_data_full(G_OBJECT(window),"keypads",dt.keypad,g_free); | |
| 173 | 158 | } | ... | ... |
src/pw3270/window.c
| ... | ... | @@ -182,6 +182,7 @@ |
| 182 | 182 | |
| 183 | 183 | if(host) |
| 184 | 184 | { |
| 185 | + set_string_to_config("host","uri","%s",host); | |
| 185 | 186 | pw3270_set_host(widget,host); |
| 186 | 187 | } |
| 187 | 188 | else |
| ... | ... | @@ -318,7 +319,8 @@ |
| 318 | 319 | |
| 319 | 320 | static void disconnected(GtkWidget *terminal, GtkWidget * window) |
| 320 | 321 | { |
| 321 | - GtkActionGroup **group = g_object_get_data(G_OBJECT(window),"action_groups"); | |
| 322 | + GtkActionGroup **group = g_object_get_data(G_OBJECT(window),"action_groups"); | |
| 323 | + GtkWidget **keypad = g_object_get_data(G_OBJECT(window),"keypads"); | |
| 322 | 324 | |
| 323 | 325 | if(group) |
| 324 | 326 | { |
| ... | ... | @@ -327,13 +329,20 @@ |
| 327 | 329 | gtk_action_group_set_sensitive(group[ACTION_GROUP_OFFLINE],TRUE); |
| 328 | 330 | } |
| 329 | 331 | |
| 332 | + if(keypad) | |
| 333 | + { | |
| 334 | + while(*keypad) | |
| 335 | + gtk_widget_set_sensitive(*(keypad++),FALSE); | |
| 336 | + } | |
| 337 | + | |
| 330 | 338 | gtk_window_set_title(GTK_WINDOW(window),v3270_get_session_name(terminal)); |
| 331 | 339 | } |
| 332 | 340 | |
| 333 | 341 | static void connected(GtkWidget *terminal, const gchar *host, GtkWidget * window) |
| 334 | 342 | { |
| 335 | 343 | gchar * title; |
| 336 | - GtkActionGroup **group = g_object_get_data(G_OBJECT(window),"action_groups"); | |
| 344 | + GtkActionGroup **group = g_object_get_data(G_OBJECT(window),"action_groups"); | |
| 345 | + GtkWidget **keypad = g_object_get_data(G_OBJECT(window),"keypads"); | |
| 337 | 346 | |
| 338 | 347 | if(group) |
| 339 | 348 | { |
| ... | ... | @@ -342,6 +351,12 @@ |
| 342 | 351 | gtk_action_group_set_sensitive(group[ACTION_GROUP_PASTE],TRUE); |
| 343 | 352 | } |
| 344 | 353 | |
| 354 | + if(keypad) | |
| 355 | + { | |
| 356 | + while(*keypad) | |
| 357 | + gtk_widget_set_sensitive(*(keypad++),TRUE); | |
| 358 | + } | |
| 359 | + | |
| 345 | 360 | set_string_to_config("host","uri","%s",host); |
| 346 | 361 | |
| 347 | 362 | title = g_strdup_printf("%s - %s",v3270_get_session_name(terminal),host); | ... | ... |