Commit 15408549e52e504cb1f7147cd21244072b3d2acd

Authored by perry.werneck@gmail.com
1 parent 3cf77331
Exists in master and in 1 other branch develop

Evitando redundancias no dialogo de configuracao de hostname

Showing 1 changed file with 4 additions and 14 deletions   Show diff stats
hostselect.c
... ... @@ -28,22 +28,11 @@
28 28 */
29 29  
30 30 #include "hostselect.h"
  31 + #include <lib3270/log.h>
31 32 #include <pw3270/v3270.h>
32 33  
33 34 /*--[ Widget definition ]----------------------------------------------------------------------------*/
34 35  
35   - static const struct _host_type
36   - {
37   - const gchar * description;
38   - LIB3270_OPTION option;
39   - } host_type[] =
40   - {
41   - { N_( "IBM S/390" ), LIB3270_OPTION_S390 },
42   - { N_( "IBM AS/400" ), LIB3270_OPTION_AS400 },
43   - { N_( "Other (TSO)" ), LIB3270_OPTION_TSO },
44   - { N_( "Other (VM/CMS)" ), 0 }
45   - };
46   -
47 36 static const struct _colortable
48 37 {
49 38 unsigned short colors;
... ... @@ -191,11 +180,12 @@ static void V3270HostSelectWidget_init(V3270HostSelectWidget *widget)
191 180 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(widget->combo[0]), renderer, TRUE);
192 181 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(widget->combo[0]), renderer, "text", 0, NULL);
193 182  
194   - for(f=0;f<G_N_ELEMENTS(host_type);f++)
  183 + const LIB3270_OPTION_ENTRY *entry = lib3270_get_option_list();
  184 + for(f=0;entry[f].name != NULL;f++)
195 185 {
196 186 GtkTreeIter iter;
197 187 gtk_list_store_append((GtkListStore *) model,&iter);
198   - gtk_list_store_set((GtkListStore *) model, &iter, 0, gettext(host_type[f].description), 1, host_type[f].option, -1);
  188 + gtk_list_store_set((GtkListStore *) model, &iter, 0, gettext(entry[f].description), 1, entry[f].option, -1);
199 189 }
200 190  
201 191 g_signal_connect(G_OBJECT(widget->combo[0]),"changed",G_CALLBACK(systype_changed),widget);
... ...