Commit aefafc4ef331b483f1502308190ecf07a17aadc3

Authored by Perry Werneck
1 parent bd3a838b
Exists in master and in 1 other branch develop

Updating callback table.

src/dialogs/popups.c
@@ -43,10 +43,13 @@ @@ -43,10 +43,13 @@
43 // Check if the dialog is enabled 43 // Check if the dialog is enabled
44 gboolean allow_disabling = (popup->name && GTK_IS_V3270(widget)); 44 gboolean allow_disabling = (popup->name && GTK_IS_V3270(widget));
45 45
  46 + debug("%s: name=%s allow-disabling: %s", __FUNCTION__, popup->name, allow_disabling ? "Yes" : "No");
  47 +
46 if(allow_disabling) { 48 if(allow_disabling) {
47 49
48 GtkResponseType response = 0; 50 GtkResponseType response = 0;
49 51
  52 + debug("Emitting %s","V3270_SIGNAL_LOAD_POPUP_RESPONSE");
50 v3270_signal_emit( 53 v3270_signal_emit(
51 widget, 54 widget,
52 V3270_SIGNAL_LOAD_POPUP_RESPONSE, 55 V3270_SIGNAL_LOAD_POPUP_RESPONSE,
@@ -54,6 +57,8 @@ @@ -54,6 +57,8 @@
54 &response 57 &response
55 ); 58 );
56 59
  60 + debug("Got response %d",(int) response);
  61 +
57 if(response && response != GTK_RESPONSE_NONE) 62 if(response && response != GTK_RESPONSE_NONE)
58 return response; 63 return response;
59 64
src/terminal/callbacks.c
@@ -276,6 +276,7 @@ static void update_selection(H3270 *session, G_GNUC_UNUSED int start, G_GNUC_UNU @@ -276,6 +276,7 @@ static void update_selection(H3270 *session, G_GNUC_UNUSED int start, G_GNUC_UNU
276 276
277 } 277 }
278 278
  279 +/*
279 static void message(H3270 *session, LIB3270_NOTIFY type , const char *title, const char *message, const char *text) 280 static void message(H3270 *session, LIB3270_NOTIFY type , const char *title, const char *message, const char *text)
280 { 281 {
281 LIB3270_POPUP popup = { 282 LIB3270_POPUP popup = {
@@ -288,6 +289,7 @@ static void message(H3270 *session, LIB3270_NOTIFY type , const char *title, con @@ -288,6 +289,7 @@ static void message(H3270 *session, LIB3270_NOTIFY type , const char *title, con
288 v3270_popup_dialog_show(GTK_WIDGET(lib3270_get_user_data(session)),&popup,0); 289 v3270_popup_dialog_show(GTK_WIDGET(lib3270_get_user_data(session)),&popup,0);
289 290
290 } 291 }
  292 +*/
291 293
292 static int print(H3270 *session, LIB3270_CONTENT_OPTION mode) 294 static int print(H3270 *session, LIB3270_CONTENT_OPTION mode)
293 { 295 {
@@ -324,6 +326,7 @@ static int load(H3270 *session, const char *filename) @@ -324,6 +326,7 @@ static int load(H3270 *session, const char *filename)
324 return 0; 326 return 0;
325 } 327 }
326 328
  329 +/*
327 static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list args) 330 static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list args)
328 { 331 {
329 LIB3270_POPUP popup = { 332 LIB3270_POPUP popup = {
@@ -342,6 +345,7 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title @@ -342,6 +345,7 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title
342 v3270_popup_dialog_show(GTK_WIDGET(lib3270_get_user_data(session)),&popup,0); 345 v3270_popup_dialog_show(GTK_WIDGET(lib3270_get_user_data(session)),&popup,0);
343 346
344 } 347 }
  348 + */
345 349
346 static gboolean bg_update_ssl(H3270 *session) 350 static gboolean bg_update_ssl(H3270 *session)
347 { 351 {
@@ -432,7 +436,7 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title @@ -432,7 +436,7 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title
432 } 436 }
433 */ 437 */
434 438
435 - static int popup_show(H3270 *hSession, const LIB3270_POPUP *popup, unsigned char wait) { 439 + static int popup(H3270 *hSession, const LIB3270_POPUP *popup, unsigned char wait) {
436 440
437 GtkResponseType response = v3270_popup_dialog_show( 441 GtkResponseType response = v3270_popup_dialog_show(
438 GTK_WIDGET(lib3270_get_user_data(hSession)), 442 GTK_WIDGET(lib3270_get_user_data(hSession)),
@@ -442,7 +446,7 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title @@ -442,7 +446,7 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title
442 if(response == GTK_RESPONSE_OK || response == GTK_RESPONSE_APPLY) 446 if(response == GTK_RESPONSE_OK || response == GTK_RESPONSE_APPLY)
443 return 0; 447 return 0;
444 448
445 - return -1; 449 + return errno = ECANCELED;
446 450
447 } 451 }
448 452
@@ -450,8 +454,6 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title @@ -450,8 +454,6 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title
450 { 454 {
451 struct lib3270_session_callbacks *cbk; 455 struct lib3270_session_callbacks *cbk;
452 456
453 - lib3270_set_popup_handler(widget->host, popup_handler);  
454 -  
455 cbk = lib3270_get_session_callbacks(widget->host,sizeof(struct lib3270_session_callbacks)); 457 cbk = lib3270_get_session_callbacks(widget->host,sizeof(struct lib3270_session_callbacks));
456 if(!cbk) 458 if(!cbk)
457 { 459 {
@@ -479,14 +481,11 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title @@ -479,14 +481,11 @@ static void popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title
479 cbk->update_model = update_model; 481 cbk->update_model = update_model;
480 cbk->changed = changed; 482 cbk->changed = changed;
481 cbk->ctlr_done = ctlr_done; 483 cbk->ctlr_done = ctlr_done;
482 - cbk->message = message;  
483 cbk->update_ssl = update_ssl; 484 cbk->update_ssl = update_ssl;
484 cbk->print = print; 485 cbk->print = print;
485 cbk->save = save; 486 cbk->save = save;
486 cbk->load = load; 487 cbk->load = load;
487 -  
488 -// cbk->popup_ssl_error = popup_ssl_error;  
489 - cbk->popup_show = popup_show; 488 + cbk->popup = popup;
490 489
491 } 490 }
492 491
src/testprogram/toolbar.c
@@ -190,6 +190,7 @@ @@ -190,6 +190,7 @@
190 static void popup_clicked(GtkButton *button, GtkWidget *terminal) 190 static void popup_clicked(GtkButton *button, GtkWidget *terminal)
191 { 191 {
192 192
  193 + /*
193 static const LIB3270_POPUP popup = { 194 static const LIB3270_POPUP popup = {
194 .name = "sample_popup", 195 .name = "sample_popup",
195 .type = LIB3270_NOTIFY_INFO, 196 .type = LIB3270_NOTIFY_INFO,
@@ -197,7 +198,8 @@ @@ -197,7 +198,8 @@
197 .body = "This it the body of the message, can be used for a bigger explanation" 198 .body = "This it the body of the message, can be used for a bigger explanation"
198 }; 199 };
199 200
200 - lib3270_popup_show(v3270_get_session(terminal), &popup, 1); 201 + lib3270_popup(v3270_get_session(terminal), &popup, 1);
  202 + */
201 203
202 } 204 }
203 205