Opened 6 years ago

Closed 6 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:
Has a Patch: yes 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 6 years ago.
patch.png (11.3 KB) - added by przemub 6 years ago.
networkstatus.patch (4.2 KB) - added by przemub 6 years ago.

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by dsjonny

Attachment: wifilist.png added

comment:1 Changed 6 years ago by przemub

Cc: przemub@… added

comment:2 Changed 6 years ago by przemub

Has a Patch: set

Changed 6 years ago by przemub

Attachment: patch.png added

comment:3 Changed 6 years ago by axeld

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");
    ...
Last edited 6 years ago by axeld (previous) (diff)

Changed 6 years ago by przemub

Attachment: networkstatus.patch added

comment:4 Changed 6 years ago by przemub

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

comment:5 Changed 6 years ago by axeld

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 Changed 6 years ago by mmadia

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 Changed 6 years ago by mmadia

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.