From b523d1e162760844b69f14891ea547e2a7aa4f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20For=C3=A9?= Date: Tue, 5 Nov 2019 06:16:30 -0800 Subject: [PATCH] WifiMenuItem: Clean up properties (#222) --- src/Widgets/WifiMenuItem.vala | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/Widgets/WifiMenuItem.vala b/src/Widgets/WifiMenuItem.vala index c5e067ab..2c2b89a4 100644 --- a/src/Widgets/WifiMenuItem.vala +++ b/src/Widgets/WifiMenuItem.vala @@ -16,19 +16,27 @@ */ public class Network.WifiMenuItem : Gtk.ListBoxRow { - private Gee.LinkedList _ap; public signal void user_action (); + + public bool is_secured { get; private set; } + public bool active { get; set; } + public Network.State state { get; set; default = Network.State.DISCONNECTED; } + + private NM.AccessPoint _tmp_ap; + public NM.AccessPoint ap { + get { + return _tmp_ap; + } + } + public GLib.Bytes ssid { get { return _tmp_ap.get_ssid (); } } - public bool is_secured; - - public Network.State state { get; set; default = Network.State.DISCONNECTED; } - public bool active { get; set; } - public uint8 strength { + private Gee.LinkedList _ap; + private uint8 strength { get { uint8 strength = 0; foreach (var ap in _ap) { @@ -39,10 +47,6 @@ public class Network.WifiMenuItem : Gtk.ListBoxRow { } private bool show_icons = true; - - public NM.AccessPoint ap { get { return _tmp_ap; } } - NM.AccessPoint _tmp_ap; - private Gtk.RadioButton radio_button; private Gtk.Image img_strength; private Gtk.Image lock_img; @@ -182,7 +186,7 @@ public class Network.WifiMenuItem : Gtk.ListBoxRow { update (); } - string strength_to_string (uint8 strength) { + private string strength_to_string (uint8 strength) { if (strength < 30) { return "weak"; } else if (strength < 55) {