Merge lp:~kvalo/indicator-network/bug-736673 into lp:~indicator-applet-developers/indicator-network/indicator-network

Proposed by Kalle Valo
Status: Merged
Merged at revision: 172
Proposed branch: lp:~kvalo/indicator-network/bug-736673
Merge into: lp:~indicator-applet-developers/indicator-network/indicator-network
Diff against target: 459 lines (+203/-118)
4 files modified
configure.ac (+4/-0)
src/settings/Makefile.am (+2/-0)
src/settings/frontend/widgets/dialogs/edit-connection.vala (+79/-0)
src/settings/ui/edit_connection_dialog.ui (+118/-118)
To merge this branch: bzr merge lp:~kvalo/indicator-network/bug-736673
Reviewer Review Type Date Requested Status
Conor Curran (community) Approve
Andrew Pending
Review via email: mp+53810@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Conor Curran (cjcurran) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2011-03-10 14:14:10 +0000
3+++ configure.ac 2011-03-17 13:31:26 +0000
4@@ -71,6 +71,10 @@
5 AC_SUBST(LIBNOTIFY_CFLAGS)
6 AC_SUBST(LIBNOTIFY_LIBS)
7
8+PKG_CHECK_MODULES([LIBGEE], [gee-1.0])
9+AC_SUBST(LIBGEE_CFLAGS)
10+AC_SUBST(LIBGEE_LIBS)
11+
12 ###########################
13 # Check to see if we're local
14 ###########################
15
16=== modified file 'src/settings/Makefile.am'
17--- src/settings/Makefile.am 2011-03-09 12:09:23 +0000
18+++ src/settings/Makefile.am 2011-03-17 13:31:26 +0000
19@@ -42,6 +42,7 @@
20 # -w is needed to disable gcc warnings because of valac
21 indicator_network_settings_CFLAGS = \
22 $(GTK_CFLAGS) \
23+ $(LIBGEE_CFLAGS) \
24 $(CONNMAN_CFLAGS) \
25 -w \
26 -DLOCALEDIR=\""$(localedir)"\" \
27@@ -49,4 +50,5 @@
28
29 indicator_network_settings_LDADD = \
30 $(GTK_LIBS) \
31+ $(LIBGEE_LIBS) \
32 $(CONNMAN_LIBS)
33
34=== modified file 'src/settings/frontend/widgets/dialogs/edit-connection.vala'
35--- src/settings/frontend/widgets/dialogs/edit-connection.vala 2011-02-24 21:22:57 +0000
36+++ src/settings/frontend/widgets/dialogs/edit-connection.vala 2011-03-17 13:31:26 +0000
37@@ -18,6 +18,15 @@
38 * with this program. If not, see <http://www.gnu.org/licenses/>.
39 */
40
41+private enum NotebookPage {
42+ PAGE_MAIN = 0,
43+ PAGE_WIRELESS = 1,
44+ PAGE_CELLULAR = 2,
45+ PAGE_IPV4 = 3,
46+ PAGE_IPV6 = 4,
47+ PAGE_DNS = 5,
48+}
49+
50 public class EditConnectionDialog : GLib.Object {
51
52 public signal void response(int type);
53@@ -49,6 +58,10 @@
54 private Gtk.Entry entry_nameservers;
55 private Gtk.Entry entry_domains;
56
57+ private Gtk.Notebook notebook_sections;
58+ // private NotebookPage pages[];
59+ private Gee.ArrayList<NotebookPage> pages;
60+
61 // button_cancel here is an _ugly_ workaround to get signals from
62 // objects working, reason for this is complete unknown
63 private string[] hint_labels = { "button_cancel" };
64@@ -56,6 +69,8 @@
65 public EditConnectionDialog(Connman.Service connection, string datadir) {
66 this.connection = connection;
67
68+ this.select_pages();
69+
70 /// Creation
71 this.builder = Utils.Gui.new_builder(datadir+"ui/edit_connection_dialog.ui");
72 this.get_widgets();
73@@ -63,6 +78,68 @@
74
75 this.connect_signals();
76 this.update_widget_values();
77+
78+ this.update_tabs();
79+ }
80+
81+ private void select_pages() {
82+ var pages = new Gee.ArrayList<NotebookPage>();
83+
84+ switch (this.connection.get_service_type()) {
85+ case Connman.ServiceType.WIFI:
86+ pages.add(NotebookPage.PAGE_MAIN);
87+ pages.add(NotebookPage.PAGE_WIRELESS);
88+ pages.add(NotebookPage.PAGE_IPV4);
89+ pages.add(NotebookPage.PAGE_IPV6);
90+ pages.add(NotebookPage.PAGE_DNS);
91+ break;
92+ case Connman.ServiceType.ETHERNET:
93+ pages.add(NotebookPage.PAGE_MAIN);
94+ pages.add(NotebookPage.PAGE_IPV4);
95+ pages.add(NotebookPage.PAGE_IPV6);
96+ pages.add(NotebookPage.PAGE_DNS);
97+ break;
98+ case Connman.ServiceType.CELLULAR:
99+ pages.add(NotebookPage.PAGE_MAIN);
100+ pages.add(NotebookPage.PAGE_CELLULAR);
101+ pages.add(NotebookPage.PAGE_IPV4);
102+ pages.add(NotebookPage.PAGE_IPV6);
103+ pages.add(NotebookPage.PAGE_DNS);
104+ break;
105+ case Connman.ServiceType.BLUETOOTH:
106+ pages.add(NotebookPage.PAGE_MAIN);
107+ pages.add(NotebookPage.PAGE_IPV4);
108+ pages.add(NotebookPage.PAGE_IPV6);
109+ pages.add(NotebookPage.PAGE_DNS);
110+ break;
111+ }
112+
113+ this.pages = pages;
114+ }
115+
116+ private void update_tabs() {
117+ /*
118+ * As page numbers change as pages are removed it's important to
119+ * remove the pages from the end.
120+ */
121+
122+ if (!(NotebookPage.PAGE_DNS in this.pages))
123+ this.notebook_sections.remove_page(NotebookPage.PAGE_DNS);
124+
125+ if (!(NotebookPage.PAGE_IPV6 in this.pages))
126+ this.notebook_sections.remove_page(NotebookPage.PAGE_IPV6);
127+
128+ if (!(NotebookPage.PAGE_IPV4 in this.pages))
129+ this.notebook_sections.remove_page(NotebookPage.PAGE_IPV4);
130+
131+ if (!(NotebookPage.PAGE_CELLULAR in this.pages))
132+ this.notebook_sections.remove_page(NotebookPage.PAGE_CELLULAR);
133+
134+ if (!(NotebookPage.PAGE_WIRELESS in this.pages))
135+ this.notebook_sections.remove_page(NotebookPage.PAGE_WIRELESS);
136+
137+ if (!(NotebookPage.PAGE_MAIN in this.pages))
138+ this.notebook_sections.remove_page(NotebookPage.PAGE_MAIN);
139 }
140
141 private void create_extra_widgets() {
142@@ -129,6 +206,8 @@
143 /* dns */
144 this.entry_nameservers = b.get_object("entry_nameservers") as Gtk.Entry;
145 this.entry_domains = b.get_object("entry_domains") as Gtk.Entry;
146+
147+ this.notebook_sections = b.get_object("notebook_sections") as Gtk.Notebook;
148 }
149
150 private void connect_signals() {
151
152=== modified file 'src/settings/ui/edit_connection_dialog.ui'
153--- src/settings/ui/edit_connection_dialog.ui 2011-02-16 17:31:48 +0000
154+++ src/settings/ui/edit_connection_dialog.ui 2011-03-17 13:31:26 +0000
155@@ -13,10 +13,10 @@
156 <property name="border_width">12</property>
157 <property name="spacing">6</property>
158 <child>
159- <object class="GtkNotebook" id="notebook1">
160+ <object class="GtkNotebook" id="notebook_sections">
161 <property name="visible">True</property>
162 <property name="can_focus">True</property>
163- <child>
164+ <child> <!-- main -->
165 <object class="GtkAlignment" id="alignment1">
166 <property name="visible">True</property>
167 <property name="top_padding">12</property>
168@@ -80,8 +80,8 @@
169 <packing>
170 <property name="tab_fill">False</property>
171 </packing>
172- </child>
173- <child>
174+ </child> <!-- main -->
175+ <child> <!-- wireless -->
176 <object class="GtkAlignment" id="alignment2">
177 <property name="visible">True</property>
178 <property name="top_padding">12</property>
179@@ -187,8 +187,61 @@
180 <property name="position">1</property>
181 <property name="tab_fill">False</property>
182 </packing>
183+ </child> <!--wireless end-->
184+ <child> <!--cellular-->
185+ <object class="GtkAlignment" id="alignment6">
186+ <property name="visible">True</property>
187+ <property name="top_padding">12</property>
188+ <property name="bottom_padding">12</property>
189+ <property name="left_padding">24</property>
190+ <property name="right_padding">12</property>
191+ <child>
192+ <object class="GtkTable" id="table_main5">
193+ <property name="visible">True</property>
194+ <property name="n_columns">2</property>
195+ <property name="column_spacing">6</property>
196+ <property name="row_spacing">6</property>
197+ <child>
198+ <object class="GtkLabel" id="label12">
199+ <property name="visible">True</property>
200+ <property name="xalign">1</property>
201+ <property name="label" translatable="yes">APN:</property>
202+ </object>
203+ <packing>
204+ <property name="x_options">GTK_FILL</property>
205+ <property name="y_options">GTK_FILL</property>
206+ </packing>
207+ </child>
208+ <child>
209+ <object class="GtkEntry" id="entry_apn">
210+ <property name="visible">True</property>
211+ <property name="can_focus">True</property>
212+ <property name="invisible_char">●</property>
213+ </object>
214+ <packing>
215+ <property name="left_attach">1</property>
216+ <property name="right_attach">2</property>
217+ <property name="y_options">GTK_FILL</property>
218+ </packing>
219+ </child>
220+ </object>
221+ </child>
222+ </object>
223+ <packing>
224+ <property name="position">2</property>
225+ </packing>
226 </child>
227- <child>
228+ <child type="tab">
229+ <object class="GtkLabel" id="label8">
230+ <property name="visible">True</property>
231+ <property name="label" translatable="yes">Cellular</property>
232+ </object>
233+ <packing>
234+ <property name="position">2</property>
235+ <property name="tab_fill">False</property>
236+ </packing>
237+ </child> <!-- cellular -->
238+ <child> <!-- ipv4 -->
239 <object class="GtkAlignment" id="alignment4">
240 <property name="visible">True</property>
241 <property name="top_padding">12</property>
242@@ -308,7 +361,7 @@
243 </child>
244 </object>
245 <packing>
246- <property name="position">2</property>
247+ <property name="position">3</property>
248 </packing>
249 </child>
250 <child type="tab">
251@@ -317,92 +370,11 @@
252 <property name="label" translatable="yes">IPv4</property>
253 </object>
254 <packing>
255- <property name="position">5</property>
256- <property name="tab_fill">False</property>
257- </packing>
258- </child>
259- <child>
260- <object class="GtkAlignment" id="alignment3">
261- <property name="visible">True</property>
262- <property name="top_padding">12</property>
263- <property name="bottom_padding">12</property>
264- <property name="left_padding">24</property>
265- <property name="right_padding">12</property>
266- <child>
267- <object class="GtkTable" id="table_dns">
268- <property name="visible">True</property>
269- <property name="n_rows">2</property>
270- <property name="n_columns">2</property>
271- <property name="column_spacing">6</property>
272- <property name="row_spacing">6</property>
273- <child>
274- <object class="GtkLabel" id="label6">
275- <property name="visible">True</property>
276- <property name="xalign">1</property>
277- <property name="label" translatable="yes">Namerservers:</property>
278- </object>
279- <packing>
280- <property name="x_options">GTK_FILL</property>
281- <property name="y_options">GTK_FILL</property>
282- </packing>
283- </child>
284- <child>
285- <object class="GtkLabel" id="label18">
286- <property name="visible">True</property>
287- <property name="xalign">1</property>
288- <property name="label" translatable="yes">Domain names:</property>
289- </object>
290- <packing>
291- <property name="top_attach">1</property>
292- <property name="bottom_attach">2</property>
293- <property name="x_options">GTK_FILL</property>
294- <property name="y_options">GTK_FILL</property>
295- </packing>
296- </child>
297- <child>
298- <object class="GtkEntry" id="entry_nameservers">
299- <property name="visible">True</property>
300- <property name="can_focus">True</property>
301- <property name="invisible_char">●</property>
302- </object>
303- <packing>
304- <property name="left_attach">1</property>
305- <property name="right_attach">2</property>
306- <property name="y_options">GTK_FILL</property>
307- </packing>
308- </child>
309- <child>
310- <object class="GtkEntry" id="entry_domains">
311- <property name="visible">True</property>
312- <property name="can_focus">True</property>
313- <property name="invisible_char">●</property>
314- </object>
315- <packing>
316- <property name="left_attach">1</property>
317- <property name="right_attach">2</property>
318- <property name="top_attach">1</property>
319- <property name="bottom_attach">2</property>
320- <property name="y_options">GTK_FILL</property>
321- </packing>
322- </child>
323- </object>
324- </child>
325- </object>
326- <packing>
327- <property name="position">3</property>
328- </packing>
329- </child>
330- <child type="tab">
331- <object class="GtkLabel" id="label3">
332- <property name="visible">True</property>
333- <property name="label" translatable="yes">DNS</property>
334- </object>
335- <packing>
336- <property name="position">3</property>
337- <property name="tab_fill">False</property>
338- </packing>
339- </child>
340- <child>
341+ <property name="position">3</property>
342+ <property name="tab_fill">False</property>
343+ </packing>
344+ </child> <!--ipv4 -->
345+ <child> <!-- ipv6 -->
346 <object class="GtkAlignment" id="alignment5">
347 <property name="visible">True</property>
348 <property name="top_padding">12</property>
349@@ -534,40 +506,68 @@
350 <property name="position">4</property>
351 <property name="tab_fill">False</property>
352 </packing>
353- </child>
354- <child>
355- <object class="GtkAlignment" id="alignment6">
356+ </child> <!-- ipv6 -->
357+ <child> <!--dns -->
358+ <object class="GtkAlignment" id="alignment3">
359 <property name="visible">True</property>
360 <property name="top_padding">12</property>
361 <property name="bottom_padding">12</property>
362 <property name="left_padding">24</property>
363 <property name="right_padding">12</property>
364 <child>
365- <object class="GtkTable" id="table_main5">
366+ <object class="GtkTable" id="table_dns">
367 <property name="visible">True</property>
368+ <property name="n_rows">2</property>
369 <property name="n_columns">2</property>
370 <property name="column_spacing">6</property>
371 <property name="row_spacing">6</property>
372 <child>
373- <object class="GtkLabel" id="label12">
374- <property name="visible">True</property>
375- <property name="xalign">1</property>
376- <property name="label" translatable="yes">APN:</property>
377- </object>
378- <packing>
379- <property name="x_options">GTK_FILL</property>
380- <property name="y_options">GTK_FILL</property>
381- </packing>
382- </child>
383- <child>
384- <object class="GtkEntry" id="entry_apn">
385- <property name="visible">True</property>
386- <property name="can_focus">True</property>
387- <property name="invisible_char">●</property>
388- </object>
389- <packing>
390- <property name="left_attach">1</property>
391- <property name="right_attach">2</property>
392+ <object class="GtkLabel" id="label6">
393+ <property name="visible">True</property>
394+ <property name="xalign">1</property>
395+ <property name="label" translatable="yes">Namerservers:</property>
396+ </object>
397+ <packing>
398+ <property name="x_options">GTK_FILL</property>
399+ <property name="y_options">GTK_FILL</property>
400+ </packing>
401+ </child>
402+ <child>
403+ <object class="GtkLabel" id="label18">
404+ <property name="visible">True</property>
405+ <property name="xalign">1</property>
406+ <property name="label" translatable="yes">Domain names:</property>
407+ </object>
408+ <packing>
409+ <property name="top_attach">1</property>
410+ <property name="bottom_attach">2</property>
411+ <property name="x_options">GTK_FILL</property>
412+ <property name="y_options">GTK_FILL</property>
413+ </packing>
414+ </child>
415+ <child>
416+ <object class="GtkEntry" id="entry_nameservers">
417+ <property name="visible">True</property>
418+ <property name="can_focus">True</property>
419+ <property name="invisible_char">●</property>
420+ </object>
421+ <packing>
422+ <property name="left_attach">1</property>
423+ <property name="right_attach">2</property>
424+ <property name="y_options">GTK_FILL</property>
425+ </packing>
426+ </child>
427+ <child>
428+ <object class="GtkEntry" id="entry_domains">
429+ <property name="visible">True</property>
430+ <property name="can_focus">True</property>
431+ <property name="invisible_char">●</property>
432+ </object>
433+ <packing>
434+ <property name="left_attach">1</property>
435+ <property name="right_attach">2</property>
436+ <property name="top_attach">1</property>
437+ <property name="bottom_attach">2</property>
438 <property name="y_options">GTK_FILL</property>
439 </packing>
440 </child>
441@@ -579,15 +579,15 @@
442 </packing>
443 </child>
444 <child type="tab">
445- <object class="GtkLabel" id="label8">
446+ <object class="GtkLabel" id="label3">
447 <property name="visible">True</property>
448- <property name="label" translatable="yes">Cellular</property>
449+ <property name="label" translatable="yes">DNS</property>
450 </object>
451 <packing>
452 <property name="position">5</property>
453 <property name="tab_fill">False</property>
454 </packing>
455- </child>
456+ </child> <!--dns-->
457 </object>
458 <packing>
459 <property name="position">0</property>

Subscribers

People subscribed via source and target branches