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
=== modified file 'configure.ac'
--- configure.ac 2011-03-10 14:14:10 +0000
+++ configure.ac 2011-03-17 13:31:26 +0000
@@ -71,6 +71,10 @@
71AC_SUBST(LIBNOTIFY_CFLAGS)71AC_SUBST(LIBNOTIFY_CFLAGS)
72AC_SUBST(LIBNOTIFY_LIBS)72AC_SUBST(LIBNOTIFY_LIBS)
7373
74PKG_CHECK_MODULES([LIBGEE], [gee-1.0])
75AC_SUBST(LIBGEE_CFLAGS)
76AC_SUBST(LIBGEE_LIBS)
77
74###########################78###########################
75# Check to see if we're local79# Check to see if we're local
76###########################80###########################
7781
=== modified file 'src/settings/Makefile.am'
--- src/settings/Makefile.am 2011-03-09 12:09:23 +0000
+++ src/settings/Makefile.am 2011-03-17 13:31:26 +0000
@@ -42,6 +42,7 @@
42# -w is needed to disable gcc warnings because of valac42# -w is needed to disable gcc warnings because of valac
43indicator_network_settings_CFLAGS = \43indicator_network_settings_CFLAGS = \
44 $(GTK_CFLAGS) \44 $(GTK_CFLAGS) \
45 $(LIBGEE_CFLAGS) \
45 $(CONNMAN_CFLAGS) \46 $(CONNMAN_CFLAGS) \
46 -w \47 -w \
47 -DLOCALEDIR=\""$(localedir)"\" \48 -DLOCALEDIR=\""$(localedir)"\" \
@@ -49,4 +50,5 @@
4950
50indicator_network_settings_LDADD = \51indicator_network_settings_LDADD = \
51 $(GTK_LIBS) \52 $(GTK_LIBS) \
53 $(LIBGEE_LIBS) \
52 $(CONNMAN_LIBS)54 $(CONNMAN_LIBS)
5355
=== modified file 'src/settings/frontend/widgets/dialogs/edit-connection.vala'
--- src/settings/frontend/widgets/dialogs/edit-connection.vala 2011-02-24 21:22:57 +0000
+++ src/settings/frontend/widgets/dialogs/edit-connection.vala 2011-03-17 13:31:26 +0000
@@ -18,6 +18,15 @@
18 * with this program. If not, see <http://www.gnu.org/licenses/>.18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */19 */
2020
21private enum NotebookPage {
22 PAGE_MAIN = 0,
23 PAGE_WIRELESS = 1,
24 PAGE_CELLULAR = 2,
25 PAGE_IPV4 = 3,
26 PAGE_IPV6 = 4,
27 PAGE_DNS = 5,
28}
29
21public class EditConnectionDialog : GLib.Object {30public class EditConnectionDialog : GLib.Object {
2231
23 public signal void response(int type);32 public signal void response(int type);
@@ -49,6 +58,10 @@
49 private Gtk.Entry entry_nameservers;58 private Gtk.Entry entry_nameservers;
50 private Gtk.Entry entry_domains;59 private Gtk.Entry entry_domains;
5160
61 private Gtk.Notebook notebook_sections;
62 // private NotebookPage pages[];
63 private Gee.ArrayList<NotebookPage> pages;
64
52 // button_cancel here is an _ugly_ workaround to get signals from65 // button_cancel here is an _ugly_ workaround to get signals from
53 // objects working, reason for this is complete unknown66 // objects working, reason for this is complete unknown
54 private string[] hint_labels = { "button_cancel" };67 private string[] hint_labels = { "button_cancel" };
@@ -56,6 +69,8 @@
56 public EditConnectionDialog(Connman.Service connection, string datadir) {69 public EditConnectionDialog(Connman.Service connection, string datadir) {
57 this.connection = connection;70 this.connection = connection;
5871
72 this.select_pages();
73
59 /// Creation74 /// Creation
60 this.builder = Utils.Gui.new_builder(datadir+"ui/edit_connection_dialog.ui");75 this.builder = Utils.Gui.new_builder(datadir+"ui/edit_connection_dialog.ui");
61 this.get_widgets();76 this.get_widgets();
@@ -63,6 +78,68 @@
6378
64 this.connect_signals();79 this.connect_signals();
65 this.update_widget_values();80 this.update_widget_values();
81
82 this.update_tabs();
83 }
84
85 private void select_pages() {
86 var pages = new Gee.ArrayList<NotebookPage>();
87
88 switch (this.connection.get_service_type()) {
89 case Connman.ServiceType.WIFI:
90 pages.add(NotebookPage.PAGE_MAIN);
91 pages.add(NotebookPage.PAGE_WIRELESS);
92 pages.add(NotebookPage.PAGE_IPV4);
93 pages.add(NotebookPage.PAGE_IPV6);
94 pages.add(NotebookPage.PAGE_DNS);
95 break;
96 case Connman.ServiceType.ETHERNET:
97 pages.add(NotebookPage.PAGE_MAIN);
98 pages.add(NotebookPage.PAGE_IPV4);
99 pages.add(NotebookPage.PAGE_IPV6);
100 pages.add(NotebookPage.PAGE_DNS);
101 break;
102 case Connman.ServiceType.CELLULAR:
103 pages.add(NotebookPage.PAGE_MAIN);
104 pages.add(NotebookPage.PAGE_CELLULAR);
105 pages.add(NotebookPage.PAGE_IPV4);
106 pages.add(NotebookPage.PAGE_IPV6);
107 pages.add(NotebookPage.PAGE_DNS);
108 break;
109 case Connman.ServiceType.BLUETOOTH:
110 pages.add(NotebookPage.PAGE_MAIN);
111 pages.add(NotebookPage.PAGE_IPV4);
112 pages.add(NotebookPage.PAGE_IPV6);
113 pages.add(NotebookPage.PAGE_DNS);
114 break;
115 }
116
117 this.pages = pages;
118 }
119
120 private void update_tabs() {
121 /*
122 * As page numbers change as pages are removed it's important to
123 * remove the pages from the end.
124 */
125
126 if (!(NotebookPage.PAGE_DNS in this.pages))
127 this.notebook_sections.remove_page(NotebookPage.PAGE_DNS);
128
129 if (!(NotebookPage.PAGE_IPV6 in this.pages))
130 this.notebook_sections.remove_page(NotebookPage.PAGE_IPV6);
131
132 if (!(NotebookPage.PAGE_IPV4 in this.pages))
133 this.notebook_sections.remove_page(NotebookPage.PAGE_IPV4);
134
135 if (!(NotebookPage.PAGE_CELLULAR in this.pages))
136 this.notebook_sections.remove_page(NotebookPage.PAGE_CELLULAR);
137
138 if (!(NotebookPage.PAGE_WIRELESS in this.pages))
139 this.notebook_sections.remove_page(NotebookPage.PAGE_WIRELESS);
140
141 if (!(NotebookPage.PAGE_MAIN in this.pages))
142 this.notebook_sections.remove_page(NotebookPage.PAGE_MAIN);
66 }143 }
67144
68 private void create_extra_widgets() {145 private void create_extra_widgets() {
@@ -129,6 +206,8 @@
129 /* dns */206 /* dns */
130 this.entry_nameservers = b.get_object("entry_nameservers") as Gtk.Entry;207 this.entry_nameservers = b.get_object("entry_nameservers") as Gtk.Entry;
131 this.entry_domains = b.get_object("entry_domains") as Gtk.Entry;208 this.entry_domains = b.get_object("entry_domains") as Gtk.Entry;
209
210 this.notebook_sections = b.get_object("notebook_sections") as Gtk.Notebook;
132 }211 }
133212
134 private void connect_signals() {213 private void connect_signals() {
135214
=== modified file 'src/settings/ui/edit_connection_dialog.ui'
--- src/settings/ui/edit_connection_dialog.ui 2011-02-16 17:31:48 +0000
+++ src/settings/ui/edit_connection_dialog.ui 2011-03-17 13:31:26 +0000
@@ -13,10 +13,10 @@
13 <property name="border_width">12</property>13 <property name="border_width">12</property>
14 <property name="spacing">6</property>14 <property name="spacing">6</property>
15 <child>15 <child>
16 <object class="GtkNotebook" id="notebook1">16 <object class="GtkNotebook" id="notebook_sections">
17 <property name="visible">True</property>17 <property name="visible">True</property>
18 <property name="can_focus">True</property>18 <property name="can_focus">True</property>
19 <child>19 <child> <!-- main -->
20 <object class="GtkAlignment" id="alignment1">20 <object class="GtkAlignment" id="alignment1">
21 <property name="visible">True</property>21 <property name="visible">True</property>
22 <property name="top_padding">12</property>22 <property name="top_padding">12</property>
@@ -80,8 +80,8 @@
80 <packing>80 <packing>
81 <property name="tab_fill">False</property>81 <property name="tab_fill">False</property>
82 </packing>82 </packing>
83 </child>83 </child> <!-- main -->
84 <child>84 <child> <!-- wireless -->
85 <object class="GtkAlignment" id="alignment2">85 <object class="GtkAlignment" id="alignment2">
86 <property name="visible">True</property>86 <property name="visible">True</property>
87 <property name="top_padding">12</property>87 <property name="top_padding">12</property>
@@ -187,8 +187,61 @@
187 <property name="position">1</property>187 <property name="position">1</property>
188 <property name="tab_fill">False</property>188 <property name="tab_fill">False</property>
189 </packing>189 </packing>
190 </child> <!--wireless end-->
191 <child> <!--cellular-->
192 <object class="GtkAlignment" id="alignment6">
193 <property name="visible">True</property>
194 <property name="top_padding">12</property>
195 <property name="bottom_padding">12</property>
196 <property name="left_padding">24</property>
197 <property name="right_padding">12</property>
198 <child>
199 <object class="GtkTable" id="table_main5">
200 <property name="visible">True</property>
201 <property name="n_columns">2</property>
202 <property name="column_spacing">6</property>
203 <property name="row_spacing">6</property>
204 <child>
205 <object class="GtkLabel" id="label12">
206 <property name="visible">True</property>
207 <property name="xalign">1</property>
208 <property name="label" translatable="yes">APN:</property>
209 </object>
210 <packing>
211 <property name="x_options">GTK_FILL</property>
212 <property name="y_options">GTK_FILL</property>
213 </packing>
214 </child>
215 <child>
216 <object class="GtkEntry" id="entry_apn">
217 <property name="visible">True</property>
218 <property name="can_focus">True</property>
219 <property name="invisible_char">●</property>
220 </object>
221 <packing>
222 <property name="left_attach">1</property>
223 <property name="right_attach">2</property>
224 <property name="y_options">GTK_FILL</property>
225 </packing>
226 </child>
227 </object>
228 </child>
229 </object>
230 <packing>
231 <property name="position">2</property>
232 </packing>
190 </child>233 </child>
191 <child>234 <child type="tab">
235 <object class="GtkLabel" id="label8">
236 <property name="visible">True</property>
237 <property name="label" translatable="yes">Cellular</property>
238 </object>
239 <packing>
240 <property name="position">2</property>
241 <property name="tab_fill">False</property>
242 </packing>
243 </child> <!-- cellular -->
244 <child> <!-- ipv4 -->
192 <object class="GtkAlignment" id="alignment4">245 <object class="GtkAlignment" id="alignment4">
193 <property name="visible">True</property>246 <property name="visible">True</property>
194 <property name="top_padding">12</property>247 <property name="top_padding">12</property>
@@ -308,7 +361,7 @@
308 </child>361 </child>
309 </object>362 </object>
310 <packing>363 <packing>
311 <property name="position">2</property>364 <property name="position">3</property>
312 </packing>365 </packing>
313 </child>366 </child>
314 <child type="tab">367 <child type="tab">
@@ -317,92 +370,11 @@
317 <property name="label" translatable="yes">IPv4</property>370 <property name="label" translatable="yes">IPv4</property>
318 </object>371 </object>
319 <packing>372 <packing>
320 <property name="position">5</property>373 <property name="position">3</property>
321 <property name="tab_fill">False</property>374 <property name="tab_fill">False</property>
322 </packing>375 </packing>
323 </child>376 </child> <!--ipv4 -->
324 <child>377 <child> <!-- ipv6 -->
325 <object class="GtkAlignment" id="alignment3">
326 <property name="visible">True</property>
327 <property name="top_padding">12</property>
328 <property name="bottom_padding">12</property>
329 <property name="left_padding">24</property>
330 <property name="right_padding">12</property>
331 <child>
332 <object class="GtkTable" id="table_dns">
333 <property name="visible">True</property>
334 <property name="n_rows">2</property>
335 <property name="n_columns">2</property>
336 <property name="column_spacing">6</property>
337 <property name="row_spacing">6</property>
338 <child>
339 <object class="GtkLabel" id="label6">
340 <property name="visible">True</property>
341 <property name="xalign">1</property>
342 <property name="label" translatable="yes">Namerservers:</property>
343 </object>
344 <packing>
345 <property name="x_options">GTK_FILL</property>
346 <property name="y_options">GTK_FILL</property>
347 </packing>
348 </child>
349 <child>
350 <object class="GtkLabel" id="label18">
351 <property name="visible">True</property>
352 <property name="xalign">1</property>
353 <property name="label" translatable="yes">Domain names:</property>
354 </object>
355 <packing>
356 <property name="top_attach">1</property>
357 <property name="bottom_attach">2</property>
358 <property name="x_options">GTK_FILL</property>
359 <property name="y_options">GTK_FILL</property>
360 </packing>
361 </child>
362 <child>
363 <object class="GtkEntry" id="entry_nameservers">
364 <property name="visible">True</property>
365 <property name="can_focus">True</property>
366 <property name="invisible_char">●</property>
367 </object>
368 <packing>
369 <property name="left_attach">1</property>
370 <property name="right_attach">2</property>
371 <property name="y_options">GTK_FILL</property>
372 </packing>
373 </child>
374 <child>
375 <object class="GtkEntry" id="entry_domains">
376 <property name="visible">True</property>
377 <property name="can_focus">True</property>
378 <property name="invisible_char">●</property>
379 </object>
380 <packing>
381 <property name="left_attach">1</property>
382 <property name="right_attach">2</property>
383 <property name="top_attach">1</property>
384 <property name="bottom_attach">2</property>
385 <property name="y_options">GTK_FILL</property>
386 </packing>
387 </child>
388 </object>
389 </child>
390 </object>
391 <packing>
392 <property name="position">3</property>
393 </packing>
394 </child>
395 <child type="tab">
396 <object class="GtkLabel" id="label3">
397 <property name="visible">True</property>
398 <property name="label" translatable="yes">DNS</property>
399 </object>
400 <packing>
401 <property name="position">3</property>
402 <property name="tab_fill">False</property>
403 </packing>
404 </child>
405 <child>
406 <object class="GtkAlignment" id="alignment5">378 <object class="GtkAlignment" id="alignment5">
407 <property name="visible">True</property>379 <property name="visible">True</property>
408 <property name="top_padding">12</property>380 <property name="top_padding">12</property>
@@ -534,40 +506,68 @@
534 <property name="position">4</property>506 <property name="position">4</property>
535 <property name="tab_fill">False</property>507 <property name="tab_fill">False</property>
536 </packing>508 </packing>
537 </child>509 </child> <!-- ipv6 -->
538 <child>510 <child> <!--dns -->
539 <object class="GtkAlignment" id="alignment6">511 <object class="GtkAlignment" id="alignment3">
540 <property name="visible">True</property>512 <property name="visible">True</property>
541 <property name="top_padding">12</property>513 <property name="top_padding">12</property>
542 <property name="bottom_padding">12</property>514 <property name="bottom_padding">12</property>
543 <property name="left_padding">24</property>515 <property name="left_padding">24</property>
544 <property name="right_padding">12</property>516 <property name="right_padding">12</property>
545 <child>517 <child>
546 <object class="GtkTable" id="table_main5">518 <object class="GtkTable" id="table_dns">
547 <property name="visible">True</property>519 <property name="visible">True</property>
520 <property name="n_rows">2</property>
548 <property name="n_columns">2</property>521 <property name="n_columns">2</property>
549 <property name="column_spacing">6</property>522 <property name="column_spacing">6</property>
550 <property name="row_spacing">6</property>523 <property name="row_spacing">6</property>
551 <child>524 <child>
552 <object class="GtkLabel" id="label12">525 <object class="GtkLabel" id="label6">
553 <property name="visible">True</property>526 <property name="visible">True</property>
554 <property name="xalign">1</property>527 <property name="xalign">1</property>
555 <property name="label" translatable="yes">APN:</property>528 <property name="label" translatable="yes">Namerservers:</property>
556 </object>529 </object>
557 <packing>530 <packing>
558 <property name="x_options">GTK_FILL</property>531 <property name="x_options">GTK_FILL</property>
559 <property name="y_options">GTK_FILL</property>532 <property name="y_options">GTK_FILL</property>
560 </packing>533 </packing>
561 </child>534 </child>
562 <child>535 <child>
563 <object class="GtkEntry" id="entry_apn">536 <object class="GtkLabel" id="label18">
564 <property name="visible">True</property>537 <property name="visible">True</property>
565 <property name="can_focus">True</property>538 <property name="xalign">1</property>
566 <property name="invisible_char">●</property>539 <property name="label" translatable="yes">Domain names:</property>
567 </object>540 </object>
568 <packing>541 <packing>
569 <property name="left_attach">1</property>542 <property name="top_attach">1</property>
570 <property name="right_attach">2</property>543 <property name="bottom_attach">2</property>
544 <property name="x_options">GTK_FILL</property>
545 <property name="y_options">GTK_FILL</property>
546 </packing>
547 </child>
548 <child>
549 <object class="GtkEntry" id="entry_nameservers">
550 <property name="visible">True</property>
551 <property name="can_focus">True</property>
552 <property name="invisible_char">●</property>
553 </object>
554 <packing>
555 <property name="left_attach">1</property>
556 <property name="right_attach">2</property>
557 <property name="y_options">GTK_FILL</property>
558 </packing>
559 </child>
560 <child>
561 <object class="GtkEntry" id="entry_domains">
562 <property name="visible">True</property>
563 <property name="can_focus">True</property>
564 <property name="invisible_char">●</property>
565 </object>
566 <packing>
567 <property name="left_attach">1</property>
568 <property name="right_attach">2</property>
569 <property name="top_attach">1</property>
570 <property name="bottom_attach">2</property>
571 <property name="y_options">GTK_FILL</property>571 <property name="y_options">GTK_FILL</property>
572 </packing>572 </packing>
573 </child>573 </child>
@@ -579,15 +579,15 @@
579 </packing>579 </packing>
580 </child>580 </child>
581 <child type="tab">581 <child type="tab">
582 <object class="GtkLabel" id="label8">582 <object class="GtkLabel" id="label3">
583 <property name="visible">True</property>583 <property name="visible">True</property>
584 <property name="label" translatable="yes">Cellular</property>584 <property name="label" translatable="yes">DNS</property>
585 </object>585 </object>
586 <packing>586 <packing>
587 <property name="position">5</property>587 <property name="position">5</property>
588 <property name="tab_fill">False</property>588 <property name="tab_fill">False</property>
589 </packing>589 </packing>
590 </child>590 </child> <!--dns-->
591 </object>591 </object>
592 <packing>592 <packing>
593 <property name="position">0</property>593 <property name="position">0</property>

Subscribers

People subscribed via source and target branches