GNOME Bugzilla – Bug 791292
[review] lr/ugly-descriptions: try harder to sanitize garbage product info from udev hwdb
Last modified: 2018-02-24 00:58:58 UTC
Created attachment 365083 [details] 1024x768 resolution In a low resolution case, the network card's information displays too wide, especially more than one network card. Looking at the attachment, it's not very friendly. In a normal resolution case, it's not a little friendly too. network-manager-applet: master OS: Fedora 27 MATE
Created attachment 365084 [details] 1440x900 resolution This is 1440x900 resolution screen shot.(normal resolution)
Created attachment 365085 [details] [review] change Ethernet name displays from description to interface [PATCH]:0001-applet-change-Ethernet-name-displays-from-description-to-interface.patch
Created attachment 365086 [details] Modified effect-1024x768.png Modified effect:Modified effect-1024x768.png
this fix doesn't seem right. First, nm_device_get_description() is supposed to give a pretty display name for the device. If it's too long, it should be fixed at https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/libnm/nm-device.c?id=cdbe1ad7151266c3ddf594050c8b706ffd9ed19b#n1440 Second, if libnm gives a crazy long name, then applet should do something sensible, like truncating the text. Probably truncating the string itself is not nice. It seems better if the GTK widget itself would restrict itself in size and truncate the string thereby (automatically).
Created attachment 365189 [details] [review] 0001-applet-change-Ethernet-name-displays-from-description-to-interface.patch Yes,probably truncating the string is not a better method, because it could lose some usfull informations. Maybe using tooltip to display description is a good idea, when mouse moved on it? I've already done it, see the attachments.
Created attachment 365190 [details] screenshot-1 See the attachment taking effect
Created attachment 365191 [details] screenshot-2 See the attachment taking effect
Could you take a little time to see it? Thanks:) @Thomas Haller
This modification is OK?
Especially for some kind of devices (modems, wifi adapters) I think the description is generally more clear for the user than the interface name. Can we keep displaying the description and force a maximum width of the menu item? In case it's truncated, a tooltip could be used to display the full text. Maybe, the tooltip could also include the interface name, which is useful when there are multiple devices having the same description.
How can we force a maximum width of the menu item?
*** Bug 738458 has been marked as a duplicate of this bug. ***
Hi, how about your opinion? @@Thomas Haller
(In reply to zhangxianwei8 from comment #13) > Hi, how about your opinion? @@Thomas Haller My opinion is still comment 4 :) nm_device_get_description() is maybe a bad name, but it really is supposed to be the pretty name of the device. If it doesn't fulfil that, it needs to be fixed. The GUI should show the pretty name. Seems Lubomir is working to improve nm_device_get_description() (the "First" part).
Created attachment 368829 [details] Fixed screenshot Ready for review: https://cgit.freedesktop.org/NetworkManager/NetworkManager/log/?h=lr/ugly-descriptions
> libnm/utils: ignore stuff in parentheses for vendor/product fixups + if (*p == ')') + in_paren = TRUE; This should be FALSE? > libnm/utils: drop part after a dash in product name + /* Chop off everything after a '-'. */ + for (p = desc_full; *p; p++) { + if ((p[0] == ' ' && p[1] == '-') && p[2] == ' ') { Extra parentheses ^ ^ The rest LGTM.
Thanks. Merged with fixes for the above.
Well done. But I think there should add the info include the interface name, which is useful when there are multiple devices having the same description.
(In reply to zhangxianwei8 from comment #18) > Well done. But I think there should add the info include the interface name, > which is useful when there are multiple devices having the same description. I tend to agree. I still would like to see that overly long texts are truncated in the applet GUI -- although, now the texts should not be too long anymore.
Why not use tooltip to display more information?