Merge lp:~naaando/switchboard-plug-networking/switchboard-plug-networking into lp:~elementary-pantheon/switchboard-plug-networking/trunk

Proposed by Danielle Foré
Status: Superseded
Proposed branch: lp:~naaando/switchboard-plug-networking/switchboard-plug-networking
Merge into: lp:~elementary-pantheon/switchboard-plug-networking/trunk
Diff against target: 91 lines (+22/-10)
1 file modified
src/Widgets/HotspotInterface.vala (+22/-10)
To merge this branch: bzr merge lp:~naaando/switchboard-plug-networking/switchboard-plug-networking
Reviewer Review Type Date Requested Status
Danielle Foré Needs Fixing
Review via email: mp+312852@code.launchpad.net

This proposal has been superseded by a proposal from 2016-12-10.

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

Hey Fernando, thanks for you branch! It looks like there are a couple of things that need fixing:

* The label needs to have wrap = true so that it won't change the size of the window when the hotspot pane is opened

* The H2 class here is a bit excessive since we already have an H2 in this layout. It should probably just be a regular label

* The box you've added here isn't necessary since we're only packing a single widget (the label).

* Maybe you should consider replacing the current hotspot_revealer with a Gtk.Stack. This would probably be a more elegant way to switch between showing the warning label and the hotspot information

review: Needs Fixing
Revision history for this message
Fernando da Silva Sousa (naaando) wrote :

I've made the changes, now how I change them in my commit ? Or should I make a new commit? I'm new to bzr-launchpad thing(and Vala too).

Any convention about Gtk transitions and duration on elementary?

Revision history for this message
Danielle Foré (danrabbit) wrote :

You'll want to make a new commit like so:

bzr commit -m "A description of changes made in the commit"

and then push it to this branch

bzr push

Please don't change the transition duration from Gtk defaults.

340. By Fernando da Silva Sousa

Add hotspot warning about wifi being disconnected
 https://bugs.launchpad.net/switchboard-plug-networking/+bug/1619088

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/HotspotInterface.vala'
2--- src/Widgets/HotspotInterface.vala 2016-07-29 19:49:28 +0000
3+++ src/Widgets/HotspotInterface.vala 2016-12-10 20:08:43 +0000
4@@ -21,8 +21,10 @@
5 public class HotspotInterface : Network.AbstractHotspotInterface {
6
7 private NM.RemoteSettings nm_settings;
8- private Gtk.Revealer hotspot_revealer;
9+ private Gtk.Stack hotspot_stack;
10 private Gtk.Button hotspot_settings_btn;
11+ private Gtk.Box hinfo_box;
12+ private Gtk.Label warning_label;
13 private Gtk.Label ssid_label;
14 private Gtk.Label key_label;
15 private bool switch_updating = false;
16@@ -34,12 +36,16 @@
17
18 this.icon_name = "network-wireless-hotspot";
19
20- hotspot_revealer = new Gtk.Revealer ();
21- hotspot_revealer.transition_type = Gtk.RevealerTransitionType.SLIDE_DOWN;
22+ hotspot_stack = new Gtk.Stack();
23+ hotspot_stack.set_transition_type(Gtk.StackTransitionType.UNDER_UP);
24+
25+ warning_label = new Gtk.Label (_("Turning on the Hotspot Mode will disconnect from any connected wireless networks."));
26+ warning_label.halign = Gtk.Align.CENTER;
27+ warning_label.set_line_wrap(true);
28
29 hotspot_settings_btn = new SettingsButton.from_device (device, _("Hotspot Settings…"));
30
31- var hinfo_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 6);
32+ hinfo_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 6);
33
34 ssid_label = new Gtk.Label ("");
35 ssid_label.halign = Gtk.Align.START;
36@@ -49,7 +55,9 @@
37
38 hinfo_box.add (ssid_label);
39 hinfo_box.add (key_label);
40- hotspot_revealer.add (hinfo_box);
41+
42+ hotspot_stack.add_named (warning_label, "warning_label");
43+ hotspot_stack.add_named (hinfo_box, "hinfo_box");
44
45 bottom_revealer = new Gtk.Revealer ();
46
47@@ -62,7 +70,7 @@
48
49 update ();
50
51- this.add (hotspot_revealer);
52+ this.add (hotspot_stack);
53 this.add (bottom_revealer);
54 this.show_all ();
55 }
56@@ -104,7 +112,7 @@
57 } else {
58 switch_updating = true;
59 control_switch.active = false;
60- }
61+ }
62 });
63
64 hotspot_dialog.run ();
65@@ -117,11 +125,15 @@
66 bool hotspot_mode = Utils.Hotspot.get_device_is_hotspot (wifi_device, nm_settings);
67
68 var mode = Utils.CustomMode.HOTSPOT_DISABLED;
69+
70 if (hotspot_mode) {
71 mode = Utils.CustomMode.HOTSPOT_ENABLED;
72 }
73
74- hotspot_revealer.set_reveal_child (hotspot_mode);
75+ if(hotspot_mode)
76+ hotspot_stack.set_visible_child (hinfo_box);
77+ else
78+ hotspot_stack.set_visible_child (warning_label);
79
80 if (hotspot_mode) {
81 var connection = nm_settings.get_connection_by_path (wifi_device.get_active_connection ().get_connection ());
82@@ -147,8 +159,8 @@
83 Utils.Hotspot.update_secrets (connection, update);
84 return;
85 }
86-
87- key_label.label = _("Password %s: %s").printf (security, secret);
88+
89+ key_label.label = _("Password %s: %s").printf (security, secret);
90 }
91 }
92

Subscribers

People subscribed via source and target branches