Commit fafae464ec7a1911a49ca379caa7d73defd07512
1 parent
bb29dd36
Exists in
master
and in
1 other branch
Updating widget.
Showing
3 changed files
with
32 additions
and
11 deletions
Show diff stats
src/dialogs/hostselect.c
| @@ -100,12 +100,6 @@ static void V3270HostSelectWidget_class_init(G_GNUC_UNUSED V3270HostSelectWidget | @@ -100,12 +100,6 @@ static void V3270HostSelectWidget_class_init(G_GNUC_UNUSED V3270HostSelectWidget | ||
| 100 | { | 100 | { |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | -/* | ||
| 104 | -static void toggle_ssl(GtkToggleButton *button, V3270HostSelectWidget *dialog) | ||
| 105 | -{ | ||
| 106 | -} | ||
| 107 | -*/ | ||
| 108 | - | ||
| 109 | static void systype_changed(GtkComboBox *widget, V3270HostSelectWidget *dialog) | 103 | static void systype_changed(GtkComboBox *widget, V3270HostSelectWidget *dialog) |
| 110 | { | 104 | { |
| 111 | GValue value = { 0, }; | 105 | GValue value = { 0, }; |
| @@ -166,8 +160,6 @@ static void V3270HostSelectWidget_init(V3270HostSelectWidget *widget) | @@ -166,8 +160,6 @@ static void V3270HostSelectWidget_init(V3270HostSelectWidget *widget) | ||
| 166 | widget->input.ssl = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_mnemonic(_( "_Secure connection." ))); | 160 | widget->input.ssl = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_mnemonic(_( "_Secure connection." ))); |
| 167 | gtk_widget_set_tooltip_text(GTK_WIDGET(widget->input.ssl),_( "Check for SSL secure connection." )); | 161 | gtk_widget_set_tooltip_text(GTK_WIDGET(widget->input.ssl),_( "Check for SSL secure connection." )); |
| 168 | 162 | ||
| 169 | - //g_signal_connect(G_OBJECT(widget->input.ssl),"toggled",G_CALLBACK(toggle_ssl),widget); | ||
| 170 | - | ||
| 171 | // Extended options | 163 | // Extended options |
| 172 | GtkWidget * expander = gtk_expander_new_with_mnemonic(_( "_Host options")); | 164 | GtkWidget * expander = gtk_expander_new_with_mnemonic(_( "_Host options")); |
| 173 | 165 |
src/testprogram/testprogram.c
| @@ -88,6 +88,7 @@ static void trace_window_destroy(G_GNUC_UNUSED GtkWidget *widget, H3270 *hSessio | @@ -88,6 +88,7 @@ static void trace_window_destroy(G_GNUC_UNUSED GtkWidget *widget, H3270 *hSessio | ||
| 88 | lib3270_set_toggle(hSession,LIB3270_TOGGLE_SCREEN_TRACE,0); | 88 | lib3270_set_toggle(hSession,LIB3270_TOGGLE_SCREEN_TRACE,0); |
| 89 | lib3270_set_toggle(hSession,LIB3270_TOGGLE_EVENT_TRACE,0); | 89 | lib3270_set_toggle(hSession,LIB3270_TOGGLE_EVENT_TRACE,0); |
| 90 | lib3270_set_toggle(hSession,LIB3270_TOGGLE_NETWORK_TRACE,0); | 90 | lib3270_set_toggle(hSession,LIB3270_TOGGLE_NETWORK_TRACE,0); |
| 91 | + lib3270_set_toggle(hSession,LIB3270_TOGGLE_SSL_TRACE,0); | ||
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | static void color_scheme_changed(GtkWidget G_GNUC_UNUSED(*widget), const GdkRGBA *colors, GtkWidget *terminal) { | 94 | static void color_scheme_changed(GtkWidget G_GNUC_UNUSED(*widget), const GdkRGBA *colors, GtkWidget *terminal) { |
src/v3270/print.c
| @@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
| 48 | struct _V3270PrintOperation | 48 | struct _V3270PrintOperation |
| 49 | { | 49 | { |
| 50 | GtkPrintOperation parent; | 50 | GtkPrintOperation parent; |
| 51 | - GdkRGBA color[V3270_COLOR_COUNT]; | 51 | + GdkRGBA colors[V3270_COLOR_COUNT]; |
| 52 | LIB3270_PRINT_MODE mode; | 52 | LIB3270_PRINT_MODE mode; |
| 53 | v3270 * widget; | 53 | v3270 * widget; |
| 54 | H3270 * session; | 54 | H3270 * session; |
| @@ -79,6 +79,32 @@ | @@ -79,6 +79,32 @@ | ||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | #ifndef _WIN32 | 81 | #ifndef _WIN32 |
| 82 | + static void color_scheme_changed(GtkWidget G_GNUC_UNUSED(*widget), const GdkRGBA *colors, V3270PrintOperation *operation) { | ||
| 83 | + | ||
| 84 | + debug("%s=%p",__FUNCTION__,colors); | ||
| 85 | + | ||
| 86 | + int f; | ||
| 87 | + for(f=0;f<V3270_COLOR_COUNT;f++) | ||
| 88 | + operation->colors[f] = colors[f]; | ||
| 89 | + | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + void font_name_changed(GtkComboBox *widget, V3270PrintOperation *operation) | ||
| 93 | + { | ||
| 94 | + GValue value = { 0, }; | ||
| 95 | + GtkTreeIter iter; | ||
| 96 | + | ||
| 97 | + if(!gtk_combo_box_get_active_iter(widget,&iter)) | ||
| 98 | + return; | ||
| 99 | + | ||
| 100 | + gtk_tree_model_get_value(gtk_combo_box_get_model(widget),&iter,0,&value); | ||
| 101 | + | ||
| 102 | + g_free(operation->font.name); | ||
| 103 | + operation->font.name = g_value_dup_string(&value); | ||
| 104 | + | ||
| 105 | + debug("%s=%s",__FUNCTION__,operation->font.name); | ||
| 106 | + } | ||
| 107 | + | ||
| 82 | static GtkWidget * create_custom_widget(GtkPrintOperation *prt) | 108 | static GtkWidget * create_custom_widget(GtkPrintOperation *prt) |
| 83 | { | 109 | { |
| 84 | static const gchar * text[] = | 110 | static const gchar * text[] = |
| @@ -104,7 +130,9 @@ | @@ -104,7 +130,9 @@ | ||
| 104 | gtk_grid_set_row_spacing(grid,5); | 130 | gtk_grid_set_row_spacing(grid,5); |
| 105 | gtk_grid_set_column_spacing(grid,5); | 131 | gtk_grid_set_column_spacing(grid,5); |
| 106 | 132 | ||
| 107 | - v3270_color_scheme_set_rgba(color,operation->color); | 133 | + v3270_color_scheme_set_rgba(color,operation->colors); |
| 134 | + g_signal_connect(G_OBJECT(color),"update-colors",G_CALLBACK(color_scheme_changed),operation); | ||
| 135 | + g_signal_connect(G_OBJECT(font),"changed",G_CALLBACK(font_name_changed),operation); | ||
| 108 | 136 | ||
| 109 | for(f=0;f<G_N_ELEMENTS(text);f++) | 137 | for(f=0;f<G_N_ELEMENTS(text);f++) |
| 110 | { | 138 | { |
| @@ -179,7 +207,7 @@ | @@ -179,7 +207,7 @@ | ||
| 179 | widget->show_selection = FALSE; | 207 | widget->show_selection = FALSE; |
| 180 | widget->font.name = g_strdup(v3270_default_font); | 208 | widget->font.name = g_strdup(v3270_default_font); |
| 181 | 209 | ||
| 182 | - v3270_set_mono_color_table(widget->color,"#000000","#FFFFFF"); | 210 | + v3270_set_mono_color_table(widget->colors,"#000000","#FFFFFF"); |
| 183 | 211 | ||
| 184 | } | 212 | } |
| 185 | 213 |