Commit d369c05fabafba747707c5ebfc9e3df806a7035e

Authored by perry.werneck@gmail.com
1 parent 81583857

Incluindo descrição e label dos toggles na biblioteca

pw3270.cbp
... ... @@ -457,6 +457,7 @@
457 457 <Unit filename="ui/10functions.xml" />
458 458 <Unit filename="ui/10keypad.xml" />
459 459 <Unit filename="ui/80rexx.xml" />
  460 + <Unit filename="ui/98trace.xml" />
460 461 <Unit filename="ui/99debug.xml" />
461 462 <Unit filename="updateChangeLog.sh" />
462 463 <Extensions>
... ...
src/include/lib3270.h
... ... @@ -630,14 +630,22 @@
630 630 LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE ix);
631 631  
632 632 /**
633   - * Get a small text description of the toggle.
  633 + * Get a long description of the toggle.
634 634 *
635   - * @return Constant string with the toggle name.
  635 + * @return Constant string with the toggle description.
636 636 *
637 637 */
638 638 LIB3270_EXPORT const char * lib3270_get_toggle_description(LIB3270_TOGGLE ix);
639 639  
640 640 /**
  641 + * Get a short description of the toggle (for menus).
  642 + *
  643 + * @return Constant string with the toggle label.
  644 + *
  645 + */
  646 + LIB3270_EXPORT const char * lib3270_get_toggle_label(LIB3270_TOGGLE ix);
  647 +
  648 + /**
641 649 * Revert toggle status.
642 650 *
643 651 * @param h Session handle.
... ...
src/lib3270/toggles.c
... ... @@ -59,36 +59,167 @@ static const struct _toggle_info
59 59 {
60 60 const char * name;
61 61 const char def;
  62 + const char * label;
62 63 const char * description;
63 64 }
64 65 toggle_info[LIB3270_TOGGLE_COUNT] =
65 66 {
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" ) },
  67 + {
  68 + "monocase",
  69 + False,
  70 + N_( "Monocase" ),
  71 + N_( "If set, the terminal operates in uppercase-only mode" )
  72 + },
  73 + {
  74 + "cursorblink",
  75 + True,
  76 + N_( "Blinking Cursor" ),
  77 + N_( "If set, the cursor blinks" )
  78 + },
  79 + {
  80 + "showtiming",
  81 + True,
  82 + N_( "Show timer when processing" ),
  83 + N_( "If set, the time taken by the host to process an AID is displayed on the status line" )
  84 + },
  85 + {
  86 + "cursorpos",
  87 + True,
  88 + N_( "Track Cursor" ),
  89 + N_( "Display the cursor location in the OIA (the status line)" )
  90 + },
  91 + {
  92 + "dstrace",
  93 + False,
  94 + N_( "Trace Data Stream" ),
  95 + N_( "" )
  96 + },
  97 + {
  98 + "linewrap",
  99 + False,
  100 + N_( "" ),
  101 + N_( "" )
  102 + },
  103 + {
  104 + "blankfill",
  105 + False,
  106 + N_( "Blank Fill" ),
  107 + 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" )
  108 + },
  109 + {
  110 + "screentrace",
  111 + False,
  112 + N_( "Trace screen contents" ),
  113 + N_( "" )
  114 + },
  115 + {
  116 + "eventtrace",
  117 + False,
  118 + N_( "Trace interface events" ),
  119 + N_( "" )
  120 + },
  121 + {
  122 + "marginedpaste",
  123 + False,
  124 + N_( "Paste with left margin" ),
  125 + N_( "If set, puts restrictions on how pasted text is placed on the screen. The position of the cursor at the time the paste operation is begun is used as a left margin. No pasted text will fill any area of the screen to the left of that position. This option is useful for pasting into certain IBM editors that use the left side of the screen for control information." )
  126 + },
  127 + {
  128 + "rectselect",
  129 + False,
  130 + N_( "Select by rectangles" ),
  131 + N_( "If set, the terminal will always select rectangular areas of the screen. Otherwise, it selects continuous regions of the screen" )
  132 + },
  133 + {
  134 + "crosshair",
  135 + False,
  136 + N_( "Cross hair cursor" ),
  137 + N_( "If set, the terminal will display a crosshair over the cursor: lines extending the full width and height of the screen, centered over the cursor position. This makes locating the cursor on the screen much easier" )
  138 + },
  139 + {
  140 + "fullscreen",
  141 + False,
  142 + N_( "Full Screen" ),
  143 + N_( "" )
  144 + },
  145 + {
  146 + "reconnect",
  147 + False,
  148 + N_( "Auto-Reconnect" ),
  149 + N_( "" )
  150 + },
  151 + {
  152 + "insert",
  153 + False,
  154 + N_( "" ),
  155 + N_( "" )
  156 + },
  157 + {
  158 + "smartpaste",
  159 + False,
  160 + N_( "Smart paste" ),
  161 + N_( "" )
  162 + },
  163 + {
  164 + "bold",
  165 + False,
  166 + N_( "Bold" ),
  167 + N_( "" )
  168 + },
  169 + {
  170 + "keepselected",
  171 + False,
  172 + N_( "Keep selected" ),
  173 + N_( "" )
  174 + },
  175 + {
  176 + "underline",
  177 + False,
  178 + N_( "Show Underline" ),
  179 + N_( "" )
  180 + },
  181 + {
  182 + "autoconnect",
  183 + False,
  184 + N_( "Connect on startup" ),
  185 + N_( "" )
  186 + },
  187 + {
  188 + "kpalternative",
  189 + False,
  190 + N_( "Use +/- for field navigation" ),
  191 + N_( "Keypad +/- move to next/previous field" )
  192 + },
  193 + {
  194 + "beep",
  195 + True,
  196 + N_( "Alert sound" ),
  197 + N_( "Beep on errors" )
  198 + },
  199 + {
  200 + "fieldattr",
  201 + False,
  202 + N_( "" ),
  203 + N_( "Show Field attribute" )
  204 + },
  205 + {
  206 + "altscreen",
  207 + True,
  208 + N_( "Resize on alternate screen" ),
  209 + N_( "Auto resize on altscreen" )
  210 + },
  211 + {
  212 + "keepalive",
  213 + True,
  214 + N_( "Network keep alive" ),
  215 + N_( "Enable network keep-alive with SO_KEEPALIVE" )
  216 + },
  217 + {
  218 + "nettrace",
  219 + False,
  220 + N_( "Trace network data flow" ),
  221 + N_( "Enable network in/out trace" )
  222 + },
92 223 };
93 224  
94 225 LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *session, LIB3270_TOGGLE ix)
... ... @@ -230,6 +361,13 @@ void shutdown_toggles(H3270 *session)
230 361 #endif
231 362 }
232 363  
  364 +LIB3270_EXPORT const char * lib3270_get_toggle_label(LIB3270_TOGGLE_ID ix)
  365 +{
  366 + if(ix < N_TOGGLES)
  367 + return toggle_info[ix].label;
  368 + return "";
  369 +}
  370 +
233 371 LIB3270_EXPORT const char * lib3270_get_toggle_description(LIB3270_TOGGLE_ID ix)
234 372 {
235 373 if(ix < N_TOGGLES)
... ...
src/pw3270/actions.c
... ... @@ -786,7 +786,12 @@ GtkAction * ui_get_action(GtkWidget *widget, const gchar *name, GHashTable *hash
786 786 case ACTION_TYPE_TOGGLE:
787 787 action = new_toggle(nm,names,values);
788 788 if(id < LIB3270_TOGGLE_COUNT)
  789 + {
  790 + const gchar *tooltip = lib3270_get_toggle_description(id);
  791 + if(tooltip && *tooltip)
  792 + gtk_action_set_tooltip(GTK_ACTION(action),tooltip);
789 793 toggle_action[id] = action;
  794 + }
790 795 g_object_set_data(G_OBJECT(action),"toggle_id",GINT_TO_POINTER(id));
791 796 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action),(lib3270_get_toggle(v3270_get_session(widget),id) != 0));
792 797 g_signal_connect(action,"toggled",G_CALLBACK(lib3270_toggle_action),widget);
... ...
ui/98trace.xml
... ... @@ -33,10 +33,10 @@
33 33  
34 34 <menu name='View' >
35 35 <menu name='TraceOptions' label='Trace' >
36   - <menuitem action='toggle' id='dstrace' label='DS Trace' />
37   - <menuitem action='toggle' id='screentrace' label='Screen Trace' />
38   - <menuitem action='toggle' id='nettrace' label='Network Trace' />
39   - <menuitem action='toggle' id='eventtrace' label='Event Trace' />
  36 + <menuitem action='toggle' id='dstrace' label='Trace Data Stream' />
  37 + <menuitem action='toggle' id='screentrace' label='Trace screen contents' />
  38 + <menuitem action='toggle' id='nettrace' label='Trace network data flow' />
  39 + <menuitem action='toggle' id='eventtrace' label='Trace user interface events' />
40 40 <menuitem action='toggle' id='fieldattr' label='View Field Delimiters' />
41 41 </menu>
42 42 </menu>
... ...