From 936dc49a4c0faab8353e01199eeedaebc32b120e Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 31 Jul 2019 11:14:23 -0300 Subject: [PATCH] Changing return type of the print operation to a more compatible one. --- src/dialogs/print/convenience.c | 10 +++++----- src/dialogs/print/print.c | 4 ++-- src/include/v3270/print.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dialogs/print/convenience.c b/src/dialogs/print/convenience.c index 940a4fa..ac320b6 100644 --- a/src/dialogs/print/convenience.c +++ b/src/dialogs/print/convenience.c @@ -74,14 +74,14 @@ lib3270_trace_event(v3270_get_session(widget),"print action activated (type=%d)",(int) mode); // Print operation. - V3270PrintOperation * operation = v3270_print_operation_new(widget, mode); + GtkPrintOperation * operation = v3270_print_operation_new(widget, mode); - gtk_print_operation_set_show_progress(GTK_PRINT_OPERATION(operation),TRUE); + gtk_print_operation_set_show_progress(operation,TRUE); if(error) { gtk_print_operation_run( - GTK_PRINT_OPERATION(operation), + operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW(gtk_widget_get_toplevel(widget)), error @@ -95,7 +95,7 @@ GError *err = NULL; gtk_print_operation_run( - GTK_PRINT_OPERATION(operation), + operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW(gtk_widget_get_toplevel(widget)), &err @@ -112,7 +112,7 @@ gtk_window_set_title(GTK_WINDOW(popup),_("Operation has failed")); - gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(popup),"%s",strerror(ENOTCONN)); + gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(popup),"%s",err->message); gtk_dialog_run(GTK_DIALOG(popup)); gtk_widget_destroy(popup); diff --git a/src/dialogs/print/print.c b/src/dialogs/print/print.c index b976349..04e5449 100644 --- a/src/dialogs/print/print.c +++ b/src/dialogs/print/print.c @@ -168,7 +168,7 @@ } -V3270PrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTENT_OPTION mode) +GtkPrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTENT_OPTION mode) { g_return_val_if_fail(GTK_IS_V3270(widget),NULL); @@ -218,6 +218,6 @@ V3270PrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTE operation->contents.height += selection->bounds.height; } - return operation; + return GTK_PRINT_OPERATION(operation); } diff --git a/src/include/v3270/print.h b/src/include/v3270/print.h index 940d810..f8b0a38 100644 --- a/src/include/v3270/print.h +++ b/src/include/v3270/print.h @@ -63,7 +63,7 @@ /*--[ Prototipes ]-----------------------------------------------------------------------------------*/ LIB3270_EXPORT GType V3270PrintOperation_get_type(void); - LIB3270_EXPORT V3270PrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTENT_OPTION mode); + LIB3270_EXPORT GtkPrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTENT_OPTION mode); LIB3270_EXPORT GtkTreeModel * v3270_font_family_model_new(GtkWidget *widget, const gchar *selected, GtkTreeIter * active); -- libgit2 0.21.2