Commit 1bee10c47674d67b83721ed68fe984ae01679117

Authored by perry.werneck@gmail.com
1 parent 5aaeda65

Convertendo toggles em propriedades gtk

Showing 1 changed file with 31 additions and 42 deletions   Show diff stats
@@ -55,39 +55,40 @@ @@ -55,39 +55,40 @@
55 #include "togglesc.h" 55 #include "togglesc.h"
56 #include "api.h" 56 #include "api.h"
57 57
58 -static const struct _toggle 58 +static const struct _toggle_info
59 { 59 {
60 - const char *name;  
61 - const char *description; 60 + const char * name;
  61 + const char def;
  62 + const char * description;
62 } 63 }
63 toggle_info[LIB3270_TOGGLE_COUNT] = 64 toggle_info[LIB3270_TOGGLE_COUNT] =
64 { 65 {
65 - { "monocase", N_( "" ) },  
66 - { "cursorblink", N_( "" ) },  
67 - { "showtiming", N_( "" ) },  
68 - { "cursorpos", N_( "" ) },  
69 - { "dstrace", N_( "" ) },  
70 - { "linewrap", N_( "" ) },  
71 - { "blankfill", N_( "" ) },  
72 - { "screentrace", N_( "" ) },  
73 - { "eventtrace", N_( "" ) },  
74 - { "marginedpaste", N_( "" ) },  
75 - { "rectselect", N_( "" ) },  
76 - { "crosshair", N_( "" ) },  
77 - { "fullscreen", N_( "" ) },  
78 - { "reconnect", N_( "" ) },  
79 - { "insert", N_( "" ) },  
80 - { "smartpaste", N_( "" ) },  
81 - { "bold", N_( "" ) },  
82 - { "keepselected", N_( "" ) },  
83 - { "underline", N_( "" ) },  
84 - { "autoconnect", N_( "" ) },  
85 - { "kpalternative", N_( "Keypad +/- move to next/previous field" ) },  
86 - { "beep", N_( "Beep on errors" ) },  
87 - { "fieldattr", N_( "Show Field attribute" ) },  
88 - { "altscreen", N_( "Auto resize on altscreen" ) },  
89 - { "keepalive", N_( "Enable network keep-alive with SO_KEEPALIVE" ) },  
90 - { "nettrace", N_( "Enable network in/out trace" ) }, 66 + { "monocase", False, N_( "Uppercase mode." ) },
  67 + { "cursorblink", True, N_( "" ) },
  68 + { "showtiming", False, N_( "" ) },
  69 + { "cursorpos", True, N_( "Display the cursor location in the OIA (the status line)." ) },
  70 + { "dstrace", False, N_( "" ) },
  71 + { "linewrap", False, N_( "" ) },
  72 + { "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" ) },
  73 + { "screentrace", False, N_( "" ) },
  74 + { "eventtrace", False, N_( "" ) },
  75 + { "marginedpaste", False, N_( "" ) },
  76 + { "rectselect", False, N_( "" ) },
  77 + { "crosshair", False, N_( "" ) },
  78 + { "fullscreen", False, N_( "" ) },
  79 + { "reconnect", False, N_( "" ) },
  80 + { "insert", False, N_( "" ) },
  81 + { "smartpaste", False, N_( "" ) },
  82 + { "bold", False, N_( "" ) },
  83 + { "keepselected", False, N_( "" ) },
  84 + { "underline", False, N_( "" ) },
  85 + { "autoconnect", False, N_( "" ) },
  86 + { "kpalternative", False, N_( "Keypad +/- move to next/previous field" ) },
  87 + { "beep", True, N_( "Beep on errors" ) },
  88 + { "fieldattr", False, N_( "Show Field attribute" ) },
  89 + { "altscreen", True, N_( "Auto resize on altscreen" ) },
  90 + { "keepalive", True, N_( "Enable network keep-alive with SO_KEEPALIVE" ) },
  91 + { "nettrace", False, N_( "Enable network in/out trace" ) },
91 }; 92 };
92 93
93 LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *session, LIB3270_TOGGLE ix) 94 LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *session, LIB3270_TOGGLE ix)
@@ -202,23 +203,11 @@ void initialize_toggles(H3270 *session) @@ -202,23 +203,11 @@ void initialize_toggles(H3270 *session)
202 session->toggle[LIB3270_TOGGLE_MONOCASE].upcall = toggle_redraw; 203 session->toggle[LIB3270_TOGGLE_MONOCASE].upcall = toggle_redraw;
203 session->toggle[LIB3270_TOGGLE_UNDERLINE].upcall = toggle_redraw; 204 session->toggle[LIB3270_TOGGLE_UNDERLINE].upcall = toggle_redraw;
204 session->toggle[LIB3270_TOGGLE_ALTSCREEN].upcall = toggle_altscreen; 205 session->toggle[LIB3270_TOGGLE_ALTSCREEN].upcall = toggle_altscreen;
205 - session->toggle[LIB3270_TOGGLE_ALTSCREEN].upcall = toggle_altscreen;  
206 session->toggle[LIB3270_TOGGLE_KEEP_ALIVE].upcall = toggle_keepalive; 206 session->toggle[LIB3270_TOGGLE_KEEP_ALIVE].upcall = toggle_keepalive;
207 207
208 - static const LIB3270_TOGGLE active_by_default[] =  
209 - {  
210 - LIB3270_TOGGLE_CURSOR_BLINK,  
211 - LIB3270_TOGGLE_CURSOR_POS,  
212 - LIB3270_TOGGLE_BEEP,  
213 - LIB3270_TOGGLE_ALTSCREEN,  
214 - LIB3270_TOGGLE_KEEP_ALIVE  
215 - };  
216 -  
217 - for(f=0;f< (sizeof(active_by_default)/sizeof(active_by_default[0])); f++)  
218 - session->toggle[active_by_default[f]].value = True;  
219 -  
220 for(f=0;f<LIB3270_TOGGLE_COUNT;f++) 208 for(f=0;f<LIB3270_TOGGLE_COUNT;f++)
221 { 209 {
  210 + session->toggle[f].value = toggle_info[f].def;
222 if(session->toggle[f].value) 211 if(session->toggle[f].value)
223 session->toggle[f].upcall(session,&session->toggle[f],TT_INITIAL); 212 session->toggle[f].upcall(session,&session->toggle[f],TT_INITIAL);
224 } 213 }