The Wi-Fi panel displays an old fashioned status page when NM isn't running. Also, it shows a generic error message instead of explaining why the error occurred.
This commit updates this status page to an AdwStatusPage, Also, it makes clear that the error happens because of NM not running.
Currently, this dialog doesn't have a minimum width and height.
It's possible to shrink it to an unexpected small size.
This commit adds a minimum width and height for this dialog.
This dialog appears with a really small size, making elements almost invisible.
Also, it can be shrunken to an even smaller size.
This commit sets a minimum width and height for this dialog.
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1826
The current layout intersection algorithm compares pointers to strings.
It assumes that `gnome_xkb_info_get_layouts_for_country()` and
`gnome_xkb_info_get_layouts_for_language()` will return two GList
containing pointers to the same strings. Looking at libgnome-desktop[1]
it seems like this is the case: given the same layout, the same pointer
to the layout id will be stored in both lists. However, this is an
implementation detail and we should not rely on that.
Rewrite the intersection algorithm in order to compare the strings. While
at it, use a more efficient algorithm: add all the items of the first list
to a set, then iterate over the second list and check if the item is in
the set. If this happens, remove the item from the set and add it to the
intersection list.
Probably the layout lists are not big enough to notice the difference, but
the complexity goes from O(N*M) to O(N+M).
[1] 3c8834af09/libgnome-desktop/gnome-xkb-info.c (L281)
country_layouts are being appended to the layouts_with_locale which results in less relevant
layout groupings. for example, we if choose Hindi language which is an Indian language,
all Indian language layouts are shown within it - including Tamil, Bangla etc.
furthermore, language_layouts are also getting appended for countries where they may not
belong, for example, English (Ireland) is shown when we search India.
The layouts_with_locale table is filled as union however it yields better
search results if we change that to intersection.
Relates #2114
When NetworkManager doesn't give us any secrets for a connection, the
connection editor still needs to be opened. This change ensures that
initialization of the editor completes even when there's an error when
fetching secrets.
Fixes#2329