Commit 936dc49a4c0faab8353e01199eeedaebc32b120e

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

Changing return type of the print operation to a more compatible one.

src/dialogs/print/convenience.c
... ... @@ -74,14 +74,14 @@
74 74 lib3270_trace_event(v3270_get_session(widget),"print action activated (type=%d)",(int) mode);
75 75  
76 76 // Print operation.
77   - V3270PrintOperation * operation = v3270_print_operation_new(widget, mode);
  77 + GtkPrintOperation * operation = v3270_print_operation_new(widget, mode);
78 78  
79   - gtk_print_operation_set_show_progress(GTK_PRINT_OPERATION(operation),TRUE);
  79 + gtk_print_operation_set_show_progress(operation,TRUE);
80 80  
81 81 if(error)
82 82 {
83 83 gtk_print_operation_run(
84   - GTK_PRINT_OPERATION(operation),
  84 + operation,
85 85 GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
86 86 GTK_WINDOW(gtk_widget_get_toplevel(widget)),
87 87 error
... ... @@ -95,7 +95,7 @@
95 95 GError *err = NULL;
96 96  
97 97 gtk_print_operation_run(
98   - GTK_PRINT_OPERATION(operation),
  98 + operation,
99 99 GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
100 100 GTK_WINDOW(gtk_widget_get_toplevel(widget)),
101 101 &err
... ... @@ -112,7 +112,7 @@
112 112  
113 113 gtk_window_set_title(GTK_WINDOW(popup),_("Operation has failed"));
114 114  
115   - gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(popup),"%s",strerror(ENOTCONN));
  115 + gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(popup),"%s",err->message);
116 116  
117 117 gtk_dialog_run(GTK_DIALOG(popup));
118 118 gtk_widget_destroy(popup);
... ...
src/dialogs/print/print.c
... ... @@ -168,7 +168,7 @@
168 168  
169 169 }
170 170  
171   -V3270PrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTENT_OPTION mode)
  171 +GtkPrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTENT_OPTION mode)
172 172 {
173 173 g_return_val_if_fail(GTK_IS_V3270(widget),NULL);
174 174  
... ... @@ -218,6 +218,6 @@ V3270PrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTE
218 218 operation->contents.height += selection->bounds.height;
219 219 }
220 220  
221   - return operation;
  221 + return GTK_PRINT_OPERATION(operation);
222 222 }
223 223  
... ...
src/include/v3270/print.h
... ... @@ -63,7 +63,7 @@
63 63 /*--[ Prototipes ]-----------------------------------------------------------------------------------*/
64 64  
65 65 LIB3270_EXPORT GType V3270PrintOperation_get_type(void);
66   - LIB3270_EXPORT V3270PrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTENT_OPTION mode);
  66 + LIB3270_EXPORT GtkPrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTENT_OPTION mode);
67 67  
68 68 LIB3270_EXPORT GtkTreeModel * v3270_font_family_model_new(GtkWidget *widget, const gchar *selected, GtkTreeIter * active);
69 69  
... ...