]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/gpe-conf/gpe-conf-0.1.22/fix-wificonfig.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / gpe-conf / gpe-conf-0.1.22 / fix-wificonfig.patch
1 Index: cfgfile.h
2 ===================================================================
3 RCS file: /cvs/gpe/base/gpe-conf/cfgfile.h,v
4 retrieving revision 1.10
5 diff -u -r1.10 cfgfile.h
6 --- cfgfile.h   24 Nov 2004 15:43:10 -0000      1.10
7 +++ cfgfile.h   29 Nov 2004 16:21:47 -0000
8 @@ -58,15 +58,16 @@
9         t_wifimode mode;
10         gint iswireless;
11         
12 -       gint isstatic;
13 -       gint isinet;
14 -       gint isloop;
15 -       gint isdhcp;
16 -       gint isppp;
17 +       gboolean isstatic;
18 +       gboolean isinet;
19 +       gboolean isloop;
20 +       gboolean isdhcp;
21 +       gboolean isppp;
22         gint firstline;
23         gint lastline;
24         gint status;
25         gboolean ispresent;
26 +       gint uipos;     
27  } NWInterface_t;
28  
29  gint set_file_open(gint openon);
30 Index: network.c
31 ===================================================================
32 RCS file: /cvs/gpe/base/gpe-conf/network.c,v
33 retrieving revision 1.43
34 diff -u -r1.43 network.c
35 --- network.c   24 Nov 2004 15:43:10 -0000      1.43
36 +++ network.c   29 Nov 2004 16:21:48 -0000
37 @@ -65,7 +65,6 @@
38  GtkWidget *create_nwdhcp_widgets (NWInterface_t iface);
39  GtkWidget *create_nwppp_widgets (NWInterface_t iface);
40  
41 -static guint not_added = 0;
42  static gchar *cfgfile;
43  static gboolean have_access = FALSE;
44  static GtkTooltips *tooltips;
45 @@ -300,12 +299,15 @@
46                 if (ctable)
47                 {
48                         label = gtk_label_new (iflist[i].name);
49 -                       gtk_notebook_append_page (GTK_NOTEBOOK (table),
50 -                                                 GTK_WIDGET (ctable), label);
51 +                       iflist[i].uipos = gtk_notebook_append_page (GTK_NOTEBOOK (table),
52 +                                                                   GTK_WIDGET (ctable),
53 +                                                                   label);
54                         gtk_widget_show_all (table);
55 +                       g_object_set_data(G_OBJECT(ctable), "ifnr", (gpointer)i);
56                 }
57                 else
58 -                       not_added++;
59 +                       iflist[i].uipos = -1;
60 +               
61                 gtk_notebook_set_current_page (GTK_NOTEBOOK (table), -1);
62         }
63  }
64 @@ -335,11 +337,13 @@
65  void
66  changed_nwtype (GtkToggleButton * togglebutton, gpointer user_data)
67  {
68 -       GtkWidget *ctable, *label;
69 +       GtkWidget *ctable, *label, *page;
70         gchar wname[100];
71 -       gint row =
72 -               gtk_notebook_get_current_page (GTK_NOTEBOOK (table)) +
73 -               not_added - PAGE_OFFSET;
74 +       gint row;
75 +       
76 +       page = gtk_notebook_get_nth_page(GTK_NOTEBOOK (table), 
77 +                                        gtk_notebook_get_current_page (GTK_NOTEBOOK (table)));
78 +       row = (gint)g_object_get_data(G_OBJECT(page), "ifnr");
79  
80         if (!gtk_toggle_button_get_active (togglebutton))
81                 return;         // just run once
82 @@ -385,10 +389,11 @@
83                                           (GTK_NOTEBOOK (table)));
84                 gtk_notebook_insert_page (GTK_NOTEBOOK (table),
85                                           GTK_WIDGET (ctable), label,
86 -                                         row - not_added + PAGE_OFFSET);
87 +                                         iflist[row].uipos);
88                 gtk_widget_show_all (table);
89                 gtk_notebook_set_page (GTK_NOTEBOOK (table),
90 -                                      row - not_added + PAGE_OFFSET);
91 +                                     iflist[row].uipos);
92 +               g_object_set_data(G_OBJECT(ctable), "ifnr", (gpointer)row);
93         }
94  }
95  
96 @@ -922,12 +927,14 @@
97  void
98  changed_wifi (GtkToggleButton * togglebutton, gpointer user_data)
99  {
100 -       GtkWidget *widget;
101 +       GtkWidget *widget, *page;
102         gchar wname[100];
103 -       gint ifnr = gtk_notebook_get_current_page (GTK_NOTEBOOK (table)) +
104 -               not_added - PAGE_OFFSET;
105 +       gint ifnr;
106 +       
107 +       page = gtk_notebook_get_nth_page(GTK_NOTEBOOK (table), 
108 +                                        gtk_notebook_get_current_page (GTK_NOTEBOOK (table)));
109 +       ifnr = (gint)g_object_get_data(G_OBJECT(page), "ifnr");
110  
111 -       // look who called us...
112         strcpy (wname, "wificonfig");
113         strcat (wname, iflist[ifnr].name);
114         
115 @@ -941,10 +948,12 @@
116  void
117  clicked_wificonfig (GtkButton *button, gpointer user_data)
118  {
119 +       GtkWidget *page;
120         gint ifnr;
121         
122 -       ifnr = gtk_notebook_get_current_page (GTK_NOTEBOOK (table)) +
123 -               not_added - PAGE_OFFSET;
124 +       page = gtk_notebook_get_nth_page(GTK_NOTEBOOK (table), 
125 +                                        gtk_notebook_get_current_page (GTK_NOTEBOOK (table)));
126 +       ifnr = (gint)g_object_get_data(G_OBJECT(page), "ifnr");
127  
128         show_wificonfig(gtk_widget_get_toplevel(GTK_WIDGET(button)), &iflist[ifnr]);
129  }
130 @@ -1662,11 +1671,13 @@
131                         if (!have_access)
132                                 gtk_widget_set_sensitive (ctable, FALSE);
133                         label = gtk_label_new (iflist[row].name);
134 -                       gtk_notebook_append_page (GTK_NOTEBOOK (table),
135 -                                                 GTK_WIDGET (ctable), label);
136 +                       iflist[row].uipos = gtk_notebook_append_page (GTK_NOTEBOOK (table),
137 +                                                                     GTK_WIDGET (ctable), 
138 +                                                                     label);
139 +                       g_object_set_data(G_OBJECT(ctable), "ifnr", (gpointer)row);
140                 }
141                 else
142 -                       not_added++;    // we'll run into trouble if we have a loopback device between other in interfaces
143 +                       iflist[row].uipos = -1;
144         }
145         return tablebox;
146  }