Commit b2e41aad3dd66ef5003f093a065dac0199fafb4c
1 parent
01f8a2b9
Exists in
master
and in
5 other branches
Implementando mecanismo para imprimir o conteudo do terminal sem interacao com o usuario
Showing
1 changed file
with
8 additions
and
14 deletions
Show diff stats
src/pw3270/print.c
| ... | ... | @@ -394,12 +394,11 @@ static gchar * enum_to_string(GType type, guint enum_value) |
| 394 | 394 | } |
| 395 | 395 | #endif // WIN32 |
| 396 | 396 | |
| 397 | - static GtkPrintOperation * begin_print_operation(GtkAction *action, GtkWidget *widget, PRINT_INFO **info) | |
| 397 | + static GtkPrintOperation * begin_print_operation(GObject *obj, GtkWidget *widget, PRINT_INFO **info) | |
| 398 | 398 | { |
| 399 | 399 | GtkPrintOperation * print = gtk_print_operation_new(); |
| 400 | 400 | GtkPrintSettings * settings = gtk_print_settings_new(); |
| 401 | 401 | GtkPageSetup * setup = gtk_page_setup_new(); |
| 402 | - const gchar * attr; | |
| 403 | 402 | |
| 404 | 403 | *info = g_new0(PRINT_INFO,1); |
| 405 | 404 | (*info)->session = v3270_get_session(widget); |
| ... | ... | @@ -408,16 +407,11 @@ static gchar * enum_to_string(GType type, guint enum_value) |
| 408 | 407 | // Basic setup |
| 409 | 408 | gtk_print_operation_set_allow_async(print,TRUE); |
| 410 | 409 | |
| 411 | - attr = (const gchar *) g_object_get_data(G_OBJECT(action),"jobname"); | |
| 412 | - if(attr) | |
| 410 | + if(obj) | |
| 413 | 411 | { |
| 414 | - gtk_print_operation_set_job_name(print,attr); | |
| 415 | - } | |
| 416 | - else | |
| 417 | - { | |
| 418 | - gchar *ptr = g_strconcat(PACKAGE_NAME,".",gtk_action_get_name(action),NULL); | |
| 419 | - gtk_print_operation_set_job_name(print,ptr); | |
| 420 | - g_free(ptr); | |
| 412 | + const gchar * attr = (const gchar *) g_object_get_data(obj,"jobname"); | |
| 413 | + if(attr) | |
| 414 | + gtk_print_operation_set_job_name(print,attr); | |
| 421 | 415 | } |
| 422 | 416 | |
| 423 | 417 | gtk_print_operation_set_custom_tab_label(print,_( "Options" )); |
| ... | ... | @@ -492,7 +486,7 @@ static gchar * enum_to_string(GType type, guint enum_value) |
| 492 | 486 | void print_all_action(GtkAction *action, GtkWidget *widget) |
| 493 | 487 | { |
| 494 | 488 | PRINT_INFO * info = NULL; |
| 495 | - GtkPrintOperation * print = begin_print_operation(action,widget,&info); | |
| 489 | + GtkPrintOperation * print = begin_print_operation(G_OBJECT(action),widget,&info); | |
| 496 | 490 | |
| 497 | 491 | #ifdef X3270_TRACE |
| 498 | 492 | lib3270_trace_event(NULL,"Action %s activated on widget %p\n",gtk_action_get_name(action),widget); |
| ... | ... | @@ -515,7 +509,7 @@ static gchar * enum_to_string(GType type, guint enum_value) |
| 515 | 509 | { |
| 516 | 510 | PRINT_INFO * info = NULL; |
| 517 | 511 | int start, end, rows; |
| 518 | - GtkPrintOperation * print = begin_print_operation(action,widget,&info);; | |
| 512 | + GtkPrintOperation * print = begin_print_operation(G_OBJECT(action),widget,&info);; | |
| 519 | 513 | |
| 520 | 514 | #ifdef X3270_TRACE |
| 521 | 515 | lib3270_trace_event(NULL,"Action %s activated on widget %p\n",gtk_action_get_name(action),widget); |
| ... | ... | @@ -584,7 +578,7 @@ static gchar * enum_to_string(GType type, guint enum_value) |
| 584 | 578 | if(!text) |
| 585 | 579 | return; |
| 586 | 580 | |
| 587 | - print = begin_print_operation(action,widget,&info); | |
| 581 | + print = begin_print_operation(G_OBJECT(action),widget,&info); | |
| 588 | 582 | info->text = g_strsplit(text,"\n",-1); |
| 589 | 583 | info->rows = g_strv_length(info->text); |
| 590 | 584 | ... | ... |