Commit 9ad60a5be0dd7c4e6c041a870f84374b8814027e
1 parent
936dc49a
Exists in
master
and in
1 other branch
Updating print dialog.
Showing
3 changed files
with
27 additions
and
4 deletions
Show diff stats
src/dialogs/print/begin.c
@@ -39,6 +39,13 @@ | @@ -39,6 +39,13 @@ | ||
39 | trace("%s",__FUNCTION__); | 39 | trace("%s",__FUNCTION__); |
40 | 40 | ||
41 | // Setup FONT | 41 | // Setup FONT |
42 | + if(!operation->font.name) | ||
43 | + { | ||
44 | + operation->font.name = g_strdup("monospace"); | ||
45 | + debug("No font, assuming %s !!!!!!!!!!!!!!!!!!!!!!!!!!",operation->font.name); | ||
46 | + g_warning("No font, assuming %s",operation->font.name); | ||
47 | + } | ||
48 | + | ||
42 | PangoFontDescription * fontDescription = pango_font_description_from_string(operation->font.name); | 49 | PangoFontDescription * fontDescription = pango_font_description_from_string(operation->font.name); |
43 | 50 | ||
44 | cairo_select_font_face( | 51 | cairo_select_font_face( |
src/dialogs/print/print.c
@@ -125,8 +125,17 @@ | @@ -125,8 +125,17 @@ | ||
125 | 125 | ||
126 | static void custom_widget_apply(GtkPrintOperation *prt, GtkWidget *widget) | 126 | static void custom_widget_apply(GtkPrintOperation *prt, GtkWidget *widget) |
127 | { | 127 | { |
128 | + v3270_print_operation_apply_settings(prt,gtk_bin_get_child(GTK_BIN(widget))); | ||
129 | + } | ||
130 | + | ||
131 | +#endif // !_WIN32 | ||
132 | + | ||
133 | + void v3270_print_operation_apply_settings(GtkPrintOperation *prt, GtkWidget *settings) | ||
134 | + { | ||
135 | + g_return_if_fail(GTK_IS_V3270_PRINT_OPERATION(prt)); | ||
136 | + g_return_if_fail(GTK_IS_V3270_PRINT_SETTINGS(settings)); | ||
137 | + | ||
128 | V3270PrintOperation * operation = GTK_V3270_PRINT_OPERATION(prt); | 138 | V3270PrintOperation * operation = GTK_V3270_PRINT_OPERATION(prt); |
129 | - GtkWidget * settings = gtk_bin_get_child(GTK_BIN(widget)); | ||
130 | 139 | ||
131 | // Setup options. | 140 | // Setup options. |
132 | operation->show_selection = v3270_print_settings_get_show_selection(settings); | 141 | operation->show_selection = v3270_print_settings_get_show_selection(settings); |
@@ -135,7 +144,6 @@ | @@ -135,7 +144,6 @@ | ||
135 | v3270_print_settings_get_rgba(settings, operation->settings.colors, V3270_COLOR_COUNT); | 144 | v3270_print_settings_get_rgba(settings, operation->settings.colors, V3270_COLOR_COUNT); |
136 | 145 | ||
137 | } | 146 | } |
138 | -#endif // !_WIN32 | ||
139 | 147 | ||
140 | static void V3270PrintOperation_class_init(V3270PrintOperationClass *klass) | 148 | static void V3270PrintOperation_class_init(V3270PrintOperationClass *klass) |
141 | { | 149 | { |
@@ -163,11 +171,17 @@ | @@ -163,11 +171,17 @@ | ||
163 | 171 | ||
164 | // Setup defaults | 172 | // Setup defaults |
165 | widget->mode = LIB3270_CONTENT_ALL; | 173 | widget->mode = LIB3270_CONTENT_ALL; |
166 | -// widget->show_selection = FALSE; | ||
167 | -// widget->font.name = NULL; // g_strdup(v3270_default_font); | 174 | + widget->show_selection = FALSE; |
175 | + widget->font.name = NULL; // g_strdup(v3270_default_font); | ||
168 | 176 | ||
169 | } | 177 | } |
170 | 178 | ||
179 | + GtkWidget * v3270_print_operation_get_terminal(GtkPrintOperation *operation) | ||
180 | + { | ||
181 | + g_return_val_if_fail(GTK_IS_V3270_PRINT_OPERATION(operation),NULL); | ||
182 | + return GTK_WIDGET(GTK_V3270_PRINT_OPERATION(operation)->widget); | ||
183 | + } | ||
184 | + | ||
171 | GtkPrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTENT_OPTION mode) | 185 | GtkPrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_CONTENT_OPTION mode) |
172 | { | 186 | { |
173 | g_return_val_if_fail(GTK_IS_V3270(widget),NULL); | 187 | g_return_val_if_fail(GTK_IS_V3270(widget),NULL); |
src/include/v3270/print.h
@@ -64,6 +64,8 @@ | @@ -64,6 +64,8 @@ | ||
64 | 64 | ||
65 | LIB3270_EXPORT GType V3270PrintOperation_get_type(void); | 65 | LIB3270_EXPORT GType V3270PrintOperation_get_type(void); |
66 | LIB3270_EXPORT GtkPrintOperation * 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 | + LIB3270_EXPORT GtkWidget * v3270_print_operation_get_terminal(GtkPrintOperation *operation); | ||
68 | + LIB3270_EXPORT void v3270_print_operation_apply_settings(GtkPrintOperation *operation, GtkWidget *settings); | ||
67 | 69 | ||
68 | LIB3270_EXPORT GtkTreeModel * v3270_font_family_model_new(GtkWidget *widget, const gchar *selected, GtkTreeIter * active); | 70 | LIB3270_EXPORT GtkTreeModel * v3270_font_family_model_new(GtkWidget *widget, const gchar *selected, GtkTreeIter * active); |
69 | 71 |