Opened 11 years ago

Closed 10 years ago

#9666 closed enhancement (fixed)

NetworkStatus: indicate if network is protected

Reported by: dsjonny Owned by: mmadia
Priority: normal Milestone: R1
Component: Applications/NetworkStatus Version: R1/Development
Keywords: Cc: przemub@…
Blocked By: Blocking:
Platform: All

Description

It would be fine if the user can see the protection status in the NetworkStatus's WiFi list for example with a "lock" icon. Now in the popup menu we can see only the signal, but in the command line we can find the protection's status/type of the network:

~/Desktop> ifconfig /dev/net/iprowifi4965/0 scan
name                             address              signal  auth
TPLINKHOME                       d8:5d:4c:86:24:b4        25  WPA2
DR-WiFi                          cc:5d:4e:47:99:bd        24  WPA2
SZKSZAK_T10Z                     c8:60:00:67:32:d4        11  WPA2

Using 45487 nightly.

Attachments (3)

wifilist.png (10.5 KB ) - added by dsjonny 11 years ago.
patch.png (11.3 KB ) - added by przemub 10 years ago.
networkstatus.patch (4.2 KB ) - added by przemub 10 years ago.

Download all attachments as: .zip

Change History (10)

by dsjonny, 11 years ago

Attachment: wifilist.png added

comment:1 by przemub, 11 years ago

Cc: przemub@… added

comment:2 by przemub, 10 years ago

patch: 01

by przemub, 10 years ago

Attachment: patch.png added

comment:3 by axeld, 10 years ago

Thanks! The patch is not bad, but there are a few issues:

  • You leak the BString. Generally, you should put things on the stack when you can.
  • 'bName' is not a good name. 'label' would have been better.
  • The way you build the string is not really localize friendly. You should do it like this:
    BString label=B_TRANSLATE("%name% (%authenticationMode%)");
    label.Replace("%name%", name);
    label.Replace("%authenticationMode%", AuthenticationName(authenticationMode));
    

where the AuthenticationName() method would looke like:

switch (authenticationMode) {
    case B_NETWORK_AUTHENTICATION_NONE:
        return B_TRANSLATE_CONTEXT("open", "Open network");
    ...

}}}

Version 0, edited 10 years ago by axeld (next)

by przemub, 10 years ago

Attachment: networkstatus.patch added

comment:4 by przemub, 10 years ago

Thank you for review. I've rewritten those parts.

comment:5 by axeld, 10 years ago

Wow, that was fast. Thanks! Just one minor issue for the next time: there are always two blank lines between functions.

I don't have the time to commit it right now, but if no one beats me to it, I'll try to do it this weekend.

comment:6 by mmadia, 10 years ago

Owner: changed from axeld to mmadia
Status: newin-progress

I'll apply the patch and do the whitespace changes.

To note, {{{ git am --signoff -i networkstatus.patch }} failed to detect the patch format. So, I did a

    git apply networkstatus.patch
    git commit --author='Przemysław Buczkowski <przemub@przemub.pl>' --signoff

and re-used the original commit message.

comment:7 by mmadia, 10 years ago

Resolution: fixed
Status: in-progressclosed

Applied in hrev46341. Thanks for the patch (and the quick review of it)!

Note: See TracTickets for help on using tickets.