From fafae464ec7a1911a49ca379caa7d73defd07512 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 29 Jan 2019 11:32:13 -0200 Subject: [PATCH] Updating widget. --- src/dialogs/hostselect.c | 8 -------- src/testprogram/testprogram.c | 1 + src/v3270/print.c | 34 +++++++++++++++++++++++++++++++--- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/dialogs/hostselect.c b/src/dialogs/hostselect.c index 28c12e4..f49c70e 100644 --- a/src/dialogs/hostselect.c +++ b/src/dialogs/hostselect.c @@ -100,12 +100,6 @@ static void V3270HostSelectWidget_class_init(G_GNUC_UNUSED V3270HostSelectWidget { } -/* -static void toggle_ssl(GtkToggleButton *button, V3270HostSelectWidget *dialog) -{ -} -*/ - static void systype_changed(GtkComboBox *widget, V3270HostSelectWidget *dialog) { GValue value = { 0, }; @@ -166,8 +160,6 @@ static void V3270HostSelectWidget_init(V3270HostSelectWidget *widget) widget->input.ssl = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_mnemonic(_( "_Secure connection." ))); gtk_widget_set_tooltip_text(GTK_WIDGET(widget->input.ssl),_( "Check for SSL secure connection." )); - //g_signal_connect(G_OBJECT(widget->input.ssl),"toggled",G_CALLBACK(toggle_ssl),widget); - // Extended options GtkWidget * expander = gtk_expander_new_with_mnemonic(_( "_Host options")); diff --git a/src/testprogram/testprogram.c b/src/testprogram/testprogram.c index 83024ac..ea22566 100644 --- a/src/testprogram/testprogram.c +++ b/src/testprogram/testprogram.c @@ -88,6 +88,7 @@ static void trace_window_destroy(G_GNUC_UNUSED GtkWidget *widget, H3270 *hSessio lib3270_set_toggle(hSession,LIB3270_TOGGLE_SCREEN_TRACE,0); lib3270_set_toggle(hSession,LIB3270_TOGGLE_EVENT_TRACE,0); lib3270_set_toggle(hSession,LIB3270_TOGGLE_NETWORK_TRACE,0); + lib3270_set_toggle(hSession,LIB3270_TOGGLE_SSL_TRACE,0); } static void color_scheme_changed(GtkWidget G_GNUC_UNUSED(*widget), const GdkRGBA *colors, GtkWidget *terminal) { diff --git a/src/v3270/print.c b/src/v3270/print.c index 124447e..5d4ab6a 100644 --- a/src/v3270/print.c +++ b/src/v3270/print.c @@ -48,7 +48,7 @@ struct _V3270PrintOperation { GtkPrintOperation parent; - GdkRGBA color[V3270_COLOR_COUNT]; + GdkRGBA colors[V3270_COLOR_COUNT]; LIB3270_PRINT_MODE mode; v3270 * widget; H3270 * session; @@ -79,6 +79,32 @@ } #ifndef _WIN32 + static void color_scheme_changed(GtkWidget G_GNUC_UNUSED(*widget), const GdkRGBA *colors, V3270PrintOperation *operation) { + + debug("%s=%p",__FUNCTION__,colors); + + int f; + for(f=0;fcolors[f] = colors[f]; + + } + + void font_name_changed(GtkComboBox *widget, V3270PrintOperation *operation) + { + GValue value = { 0, }; + GtkTreeIter iter; + + if(!gtk_combo_box_get_active_iter(widget,&iter)) + return; + + gtk_tree_model_get_value(gtk_combo_box_get_model(widget),&iter,0,&value); + + g_free(operation->font.name); + operation->font.name = g_value_dup_string(&value); + + debug("%s=%s",__FUNCTION__,operation->font.name); + } + static GtkWidget * create_custom_widget(GtkPrintOperation *prt) { static const gchar * text[] = @@ -104,7 +130,9 @@ gtk_grid_set_row_spacing(grid,5); gtk_grid_set_column_spacing(grid,5); - v3270_color_scheme_set_rgba(color,operation->color); + v3270_color_scheme_set_rgba(color,operation->colors); + g_signal_connect(G_OBJECT(color),"update-colors",G_CALLBACK(color_scheme_changed),operation); + g_signal_connect(G_OBJECT(font),"changed",G_CALLBACK(font_name_changed),operation); for(f=0;fshow_selection = FALSE; widget->font.name = g_strdup(v3270_default_font); - v3270_set_mono_color_table(widget->color,"#000000","#FFFFFF"); + v3270_set_mono_color_table(widget->colors,"#000000","#FFFFFF"); } -- libgit2 0.21.2