diff --git a/src/include/lib3270.h b/src/include/lib3270.h index 7d66e8c..350e451 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -119,12 +119,6 @@ LIB3270_TOGGLE_KEEP_ALIVE, /**< Enable network keep-alive with SO_KEEPALIVE */ LIB3270_TOGGLE_NETWORK_TRACE, /**< Enable network in/out trace */ - -// LIB3270_TOGGLE_ALT_CURSOR, -// LIB3270_TOGGLE_AID_WAIT, -// LIB3270_TOGGLE_SCROLL_BAR, -// LIB3270_TOGGLE_KEYPAD, - LIB3270_TOGGLE_COUNT } LIB3270_TOGGLE; diff --git a/src/lib3270/toggles.c b/src/lib3270/toggles.c index da0c4c8..9f6fd43 100644 --- a/src/lib3270/toggles.c +++ b/src/lib3270/toggles.c @@ -55,39 +55,40 @@ #include "togglesc.h" #include "api.h" -static const struct _toggle +static const struct _toggle_info { - const char *name; - const char *description; + const char * name; + const char def; + const char * description; } toggle_info[LIB3270_TOGGLE_COUNT] = { - { "monocase", N_( "" ) }, - { "cursorblink", N_( "" ) }, - { "showtiming", N_( "" ) }, - { "cursorpos", N_( "" ) }, - { "dstrace", N_( "" ) }, - { "linewrap", N_( "" ) }, - { "blankfill", N_( "" ) }, - { "screentrace", N_( "" ) }, - { "eventtrace", N_( "" ) }, - { "marginedpaste", N_( "" ) }, - { "rectselect", N_( "" ) }, - { "crosshair", N_( "" ) }, - { "fullscreen", N_( "" ) }, - { "reconnect", N_( "" ) }, - { "insert", N_( "" ) }, - { "smartpaste", N_( "" ) }, - { "bold", N_( "" ) }, - { "keepselected", N_( "" ) }, - { "underline", N_( "" ) }, - { "autoconnect", N_( "" ) }, - { "kpalternative", N_( "Keypad +/- move to next/previous field" ) }, - { "beep", N_( "Beep on errors" ) }, - { "fieldattr", N_( "Show Field attribute" ) }, - { "altscreen", N_( "Auto resize on altscreen" ) }, - { "keepalive", N_( "Enable network keep-alive with SO_KEEPALIVE" ) }, - { "nettrace", N_( "Enable network in/out trace" ) }, + { "monocase", False, N_( "Uppercase mode." ) }, + { "cursorblink", True, N_( "" ) }, + { "showtiming", False, N_( "" ) }, + { "cursorpos", True, N_( "Display the cursor location in the OIA (the status line)." ) }, + { "dstrace", False, N_( "" ) }, + { "linewrap", False, N_( "" ) }, + { "blankfill", False, N_( "Automatically convert trailing blanks in a field to NULLs in order to insert a character, and will automatically convert leading NULLs to blanks so that input data is not squeezed to the left" ) }, + { "screentrace", False, N_( "" ) }, + { "eventtrace", False, N_( "" ) }, + { "marginedpaste", False, N_( "" ) }, + { "rectselect", False, N_( "" ) }, + { "crosshair", False, N_( "" ) }, + { "fullscreen", False, N_( "" ) }, + { "reconnect", False, N_( "" ) }, + { "insert", False, N_( "" ) }, + { "smartpaste", False, N_( "" ) }, + { "bold", False, N_( "" ) }, + { "keepselected", False, N_( "" ) }, + { "underline", False, N_( "" ) }, + { "autoconnect", False, N_( "" ) }, + { "kpalternative", False, N_( "Keypad +/- move to next/previous field" ) }, + { "beep", True, N_( "Beep on errors" ) }, + { "fieldattr", False, N_( "Show Field attribute" ) }, + { "altscreen", True, N_( "Auto resize on altscreen" ) }, + { "keepalive", True, N_( "Enable network keep-alive with SO_KEEPALIVE" ) }, + { "nettrace", False, N_( "Enable network in/out trace" ) }, }; LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *session, LIB3270_TOGGLE ix) @@ -202,23 +203,11 @@ void initialize_toggles(H3270 *session) session->toggle[LIB3270_TOGGLE_MONOCASE].upcall = toggle_redraw; session->toggle[LIB3270_TOGGLE_UNDERLINE].upcall = toggle_redraw; session->toggle[LIB3270_TOGGLE_ALTSCREEN].upcall = toggle_altscreen; - session->toggle[LIB3270_TOGGLE_ALTSCREEN].upcall = toggle_altscreen; session->toggle[LIB3270_TOGGLE_KEEP_ALIVE].upcall = toggle_keepalive; - static const LIB3270_TOGGLE active_by_default[] = - { - LIB3270_TOGGLE_CURSOR_BLINK, - LIB3270_TOGGLE_CURSOR_POS, - LIB3270_TOGGLE_BEEP, - LIB3270_TOGGLE_ALTSCREEN, - LIB3270_TOGGLE_KEEP_ALIVE - }; - - for(f=0;f< (sizeof(active_by_default)/sizeof(active_by_default[0])); f++) - session->toggle[active_by_default[f]].value = True; - for(f=0;ftoggle[f].value = toggle_info[f].def; if(session->toggle[f].value) session->toggle[f].upcall(session,&session->toggle[f],TT_INITIAL); } diff --git a/src/pw3270/v3270/widget.c b/src/pw3270/v3270/widget.c index 600a9e2..dba5911 100644 --- a/src/pw3270/v3270/widget.c +++ b/src/pw3270/v3270/widget.c @@ -75,10 +75,6 @@ /* Construct */ PROP_TYPE, - /* Normal Props */ - PROP_FULLSCREEN, - - /* Toggle - always the last one, the real values are PROP_TOGGLE+LIB3270_TOGGLE */ PROP_TOGGLE }; @@ -321,12 +317,6 @@ static void v3270_set_property(GObject *object, guint prop_id, const GValue *val switch (prop_id) { - case PROP_FULLSCREEN: - if(g_value_get_boolean (value)) - gtk_window_fullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(object)))); - else - gtk_window_unfullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(object)))); - break; default: if(prop_id < (PROP_TOGGLE + LIB3270_TOGGLE_COUNT)) @@ -345,10 +335,6 @@ static void v3270_get_property(GObject *object,guint prop_id, GValue *value, GPa switch (prop_id) { - case PROP_FULLSCREEN: - #warning Get the correct value - g_value_set_boolean(value,FALSE); - break; default: if(prop_id < (PROP_TOGGLE + LIB3270_TOGGLE_COUNT)) @@ -630,10 +616,6 @@ static void v3270_class_init(v3270Class *klass) gobject_class->set_property = v3270_set_property; gobject_class->get_property = v3270_get_property; - v3270_properties[PROP_FULLSCREEN] = g_param_spec_boolean("fullscreen","Fullscreen","If TRUE, the toplevel window was set to fullscreen",FALSE,G_PARAM_WRITABLE|G_PARAM_READABLE); - g_object_class_install_property(gobject_class,PROP_FULLSCREEN,v3270_properties[PROP_FULLSCREEN]); - - // Toggle properties int f; @@ -760,6 +742,13 @@ static void set_timer(H3270 *session, unsigned char on) static void update_toggle(H3270 *session, LIB3270_TOGGLE ix, unsigned char value, LIB3270_TOGGLE_TYPE reason, const char *name) { + if(ix == LIB3270_TOGGLE_FULL_SCREEN) + { + if(value) + gtk_window_fullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(session->widget)))); + else + gtk_window_unfullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(session->widget)))); + } g_object_notify_by_pspec(G_OBJECT(session->widget), v3270_properties[PROP_TOGGLE+ix]); g_signal_emit(GTK_WIDGET(session->widget), v3270_widget_signal[SIGNAL_TOGGLE_CHANGED], 0, (guint) ix, (gboolean) (value != 0), (gchar *) name); } diff --git a/src/pw3270/window.c b/src/pw3270/window.c index 6cfa3e6..f118235 100644 --- a/src/pw3270/window.c +++ b/src/pw3270/window.c @@ -511,14 +511,6 @@ set_boolean_to_config("toggle",nm,toggled); g_free(nm); - if(id == LIB3270_TOGGLE_FULL_SCREEN) - { - if(toggled) - gtk_window_fullscreen(GTK_WINDOW(toplevel)); - else - gtk_window_unfullscreen(GTK_WINDOW(toplevel)); - } - if(list[id]) gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(list[id]),toggled); -- libgit2 0.21.2