Commit Graph

975 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
9d75d777c7 status/network: Only show custom wired names
Thanks to NetworkManager's connection name disambiguation, it's
pretty common for single wired connections to be named "Wired". This
is fine and what we want almost all times, but in the specific case
of quick settings, we already have a "Wired" string set as title of
the quick settings toggle, so having that as subtitle is reduntant.

Hide the subtitle label (by returning null) when the subtitle of
a wired network matches the title.

Fixes ab10b95d2d
Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6369

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2627>
2023-02-06 08:22:48 -03:00
Georges Basile Stavracas Neto
2d4521be3b status/network: Title mobile connections as "Mobile"
As per the latest mockups, modem network connections are labeled
"Mobile". Override _getDefaultName in NMModemToggle and always
return "Mobile" as title.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>
2023-02-04 20:34:11 -03:00
Georges Basile Stavracas Neto
e0408faf71 status/network: Title bluetooth connections as "Tether"
As per the latest mockups, Bluetooth network connections are simply
labeled "Tether". Override _getDefaultName in NMBluetoothToggle
and always return "Tether" as title.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>
2023-02-04 20:31:58 -03:00
Georges Basile Stavracas Neto
01a89bc29a status/network: Improve network toggle subtitles
If there is a single connection for a given NMToggle subclass,
use the connection name; otherwise, transform that into '%d
connected'. This is better than the current "Device (counter)"
template, e.g. "VPN (2)", which would give us a quick toggle
with:

   VPN
   VPN (2)

Change that to e.g.:

  VPN
  2 connected

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>
2023-02-04 18:10:22 -03:00
Georges Basile Stavracas Neto
707ce2955b status/network: Set default name for toggle title
Following the previous commits where we left the quick toggle title
open for the new title scheme, set the titles for all network pills
to what currently is the "default" name.

That means, we pull the device name from Network Manager for devices,
through the disambiguate function, and hardcode 'VPN' for VPN
connections.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>
2023-02-04 18:09:44 -03:00
Georges Basile Stavracas Neto
ab10b95d2d status/network: Bind subtitle
Instead of map the currently active items - for whatever they are -
into the quick toggle title, bind it to the subtitle.

This leaves room for setting static titles for device-backed
networks, such as Wi-Fi, Wired, Bluetooth, etc.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>
2023-02-04 17:46:54 -03:00
Georges Basile Stavracas Neto
ec397cf604 status/powerProfiles: Set profile name as subtitle
Just like with network names, set the name of the power profile as
the subtitle of the quick settings pill. This allows more of the
power profile name to be visible, and reduces chances of ellipsing
the name.

Rename the 'title' variable to 'name', to be more semantic and
better represent what it is now.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5770
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>
2023-02-04 14:50:36 -03:00
Georges Basile Stavracas Neto
2d2172da32 quickSettings: Rename 'label' property to 'title'
We'll soon add a subtitle, so rename the label property to something
that is a bit more semantic.Add a warning when trying to set the old
'label' property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>
2023-02-04 14:50:36 -03:00
Florian Müllner
3de828cc60 Revert "status/volume: Clear device menus when unsetting stream"
Device additions/removals are tracked by GvcMixerControl, which
doesn't change when unsetting the stream. So clearing the menu
manually was a workaround, not a fix.

It's also worth noting that I failed to reproduce the original
issue again, so it's possible that we were working around a
pipewire bug that has since been fixed.

This reverts commit 1b62b7ea0a.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2616>
2023-01-27 12:53:33 +00:00
Heiko Hösch
35e2ac7a2a status/network: Work around xgettext ignoring translated strings
xgettext quits parsing, when the "<"-operator follows the "++"-operator
directly.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5820
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2613>
2023-01-24 18:20:35 +00:00
sunflowerskater
1c1b3e5e6e quickSettings: Add separator before the "Power Settings" entry
There is no separator before the "Power Settings" entry in the "Power Profiles" menu,
unlike all other quick settings menus.

Add that separator for consistency.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2559#note_1641102

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2602>
2023-01-13 21:29:38 -03:00
sunflowerskater
37c0906755 quickSettings: Add a "Power Settings" entry to the Power Profiles submenu
This change adds the shortcut so it can be accessible by devices without a battery and to keep consistency with other submenus like the Wi-Fi submenu and the upcoming Bluetooth submenu (Teams/Design/os-mockups#178).

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6111

Part of <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2559>

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2559>
2023-01-13 18:16:29 +00:00
sunflowerskater
ed364e4e41 keyboard: Add "Keyboard Settings" menu entry
The keyboard popover doesn't have a shortcut to open the Keyboard panel from the Settings app.

This commit adds this menu entry to improve usability.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2600>
2023-01-13 16:05:25 +00:00
Jonas Ådahl
8d68bdaaa1 js: Queue 'later' via MetaLaters
This replaces the meta_later_add() API which used now removed global
singletons under the hood.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2557>
2022-12-16 22:12:59 +01:00
Carlos Garnacho
2e8e1fe8fc status/keyboard: Ignore purpose hint changes while keymap switcher is shown
If we are getting purpose hint changes while the language switcher is popped
up, this likely means the purpose hint was actually triggered by the key
focus change induced by the language switcher popping up.

In this case, we on one hand would like to preserve the state that applied
before thise focus change, and on the other we very much want to avoid the
keymap change that would forget about the keys being pressed.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6066
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2534>
2022-12-05 14:50:33 +00:00
Florian Müllner
1b62b7ea0a status/volume: Clear device menus when unsetting stream
Otherwise we end up accumulating devices when pipewire crashes or
is restarted.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6142

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2558>
2022-11-28 00:00:21 +00:00
Florian Müllner
d0740d605e status/remoteAccess: Don't override existing style classes
The indicator needs special styling for the color, but we still
want it to pick shared 'system-status-icon' styling like the
icon size.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6008

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2547>
2022-11-18 18:50:43 +01:00
Florian Müllner
14f061ffab status/network: Fix handling portal result
Commit 637ee7386e accidentally dropped all parameters from the
method invocation when changing a .bind() handler to an arrow
function.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2545>
2022-11-17 22:05:52 +01:00
Florian Müllner
b2ff25b31d status/network: Fix name of initially hidden devices
We assign (disambiguated) device names every time a device is added
or removed, and store the name on the corresponding menu item.

However menu items are only created when the device should be shown,
not necessarily when it is added (unplugged ethernet cable, ongoing
initialization, ...).

Fix this by tracking device names separately from device items, and
set the name on newly created items.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6040

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2529>
2022-11-17 11:09:27 +00:00
Cassidy James Blaede
092a069214 darkMode: Update string to "Dark Style"
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2499>
2022-11-04 14:31:29 +00:00
Florian Müllner
cbbc066d6f powerProfiles: Avoid warnings on missing power-profiles-daemon
GDBusProxy transparently handles the remote object appearing and
vanishing. It is therefore not an error if the service is not
running at the time the proxy is initialized, so we proceed and
try to read the list of profiles which is null in that case,
resulting in (harmless but annoying) warnings.

Avoid this by only reading the initial list of profiles if the
service has a name owner.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5992

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2518>
2022-10-20 13:55:06 +02:00
Carlos Garnacho
9c262ad7bf status: Ignore prior single-element lists updating input sources MRU
Consider the existing input sources MRU only valid if it contained
more than one element to pick from. Fixes the following situation
with initial-setup sessions:

- Initial setup Session starts, with several input sources already
  configured ("us" between them)
- InputSourceManager initializes, only the default "us" keymap is
  available
- MRU list is constructed, "us" is picked
- InputSourceManager catches up with session configuration, the
  other extra sources are added
- MRU list is reconstructed, "us" is already the most recent
- Session ends up with "us" picked, regardless of its position in
  the list, and no MRU existing prior to startup

If we consider the intermediate single-element MRU list invalid,
it is still possible to pick the best default source between all
the configured ones (the one that was put first in the list,
basically), after initialization is complete.

But also, it is unnecessary to have if there is a single source to
pick from. After the sources list has two elements or more, the
MRU list will become effective and preserved during changes to
the available sources.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5873
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2495>
2022-10-18 18:38:27 +00:00
Florian Müllner
0ce2bc343b status/volume: Include origin in device names
The description alone may not be descriptive enough, so include
the origin (if available) to disambiguate the name.

This is consistent with the Sound Settings panel.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5829

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2502>
2022-10-03 18:37:07 +02:00
Bastien Nocera
e7cf6d348c bluetooth: Remove unused 'had-bluetooth-devices-setup' setting
Now that we always show the Bluetooth switch when there's a Bluetooth
adapter hiding somewhere, remove all the settings it used as storage.

If the user wants to really really disable any Bluetooth adapters in
their system, the gnome-bluetooth documentation explains how to do that
irrespective of GNOME:
https://gitlab.gnome.org/GNOME/gnome-bluetooth/#multiple-bluetooth-adapters

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2488>
2022-09-17 18:24:15 +00:00
Bastien Nocera
57aa91e2b3 bluetooth: Show the Bluetooth switch in more cases
In older versions of GNOME, when a menu was used for Bluetooth devices,
we tried to avoid showing the Bluetooth menu to folks who didn't use
Bluetooth.

This kept causing problems as the menu would disappear if no
devices were setup and the platform "airplane mode" removed the
Bluetooth device from the USB bus, making it impossible to detect
whether a Bluetooth device existed, compared to a user unplugging a
removable Bluetooth device.

Closes: #5749
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2488>
2022-09-17 18:24:15 +00:00
Carlos Garnacho
13c9fd2a66 status: Use fixed sorting of input sources on empty MRU
When updating the MRU sources if there was no prior MRU, we want
to go with the unmodified list of sources in visibility order.

However iterating over object properties happens in an undetermined
order, so the initial MRU list ends up picking a value at random.

In order to prefer the sources list in the same order than they
appear in the menu if there was no prior MRU, order the keys
when accessing it and building the initial list of sources.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5873
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2487>
2022-09-17 18:18:43 +00:00
Florian Müllner
c9efc137ac status/system: Add context to a11y label
"Lock Screen" can refer to the lock screen component or the action
of locking the screen. Add context to clarify that the button
refers to the latter.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5852

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2485>
2022-09-14 22:07:06 +00:00
Florian Müllner
ebaf9aa4c5 status/system: Mark 'Power Off' menu header for translation
This was missed when the menu was added as part of quick settings.

Luckily we can re-use the msg-id/context from the shutdown dialog,
so the change is not subject to the string freeze.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5862

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2484>
2022-09-14 22:01:20 +00:00
sabriunal
4a1bfb45d5 quick-settings: Add ellipses to 'Log Out' string
According to GNOME HIG, if an item opens a new window or dialog,
it should be indicated with ellipses.

This change adds ellipses to the "Log Out" menu item
in the quick access menu.

Fixes #5821

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2467>
2022-09-05 17:35:58 +00:00
Florian Müllner
6a23e8ee0f status/bluetooth: Indicate progress on toggle
Turning bluetooth on or off can be very slow ­– 10-15 seconds on
my system – and we currently don't provide any feedback that
something is indeed happening until the state changes at last.

Address this by using the `acquiring` icon when the adapter is
in a transitioning state.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5773

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2444>
2022-09-03 15:05:57 +00:00
Florian Müllner
d54dc08a32 status/bluetooth: Expose adapter-state
GnomeBluetooth now exposes a more precise state than the binary
"adapter fully powerered on/off" property. Expose that on the
BtClient object to make it available to the toggle and indicator.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5773

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2444>
2022-09-03 15:05:57 +00:00
Florian Müllner
2ed0a61b6d status/system: Set accessible name for screenshot item
Otherwise it shows up as plain "push button".

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2455>
2022-08-31 02:20:56 +00:00
Florian Müllner
6c56de82ea status/network: Stop using radio-mode for VPN items
If a device has multiple connections set up, then at most one of
those can be active at a time, which is why they are presented
as radio items.

In contrast, VPN connections are not mutually exclusive, each can
be turned on or off independently. Setting :radio-mode on them
currently means that VPN connections can be activated, but never
disabled.

So instead of abusing the :radio-mode property to give VPN items
the UI we want, use regular items that reflect the desired behavior
and explicitly set up the UI the way we want.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2426>
2022-08-30 15:43:11 +00:00
Florian Müllner
1e9749a782 status/system: Add screenshot item
We got a shiny new screenshot UI last cycle, but only relatively
obscure ways of launching it: Keyboard shortcut or overview search.

The new quick settings provides us with a natural place to expose
the functionality more prominently, and at the same time reduce
the emptiness of the top row, in particular on systems without a
battery and when locked.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2439>
2022-08-22 14:15:17 +00:00
Florian Müllner
6050229aa1 status/system: "Move" spacer in desktop case
When we aren't showing the power toggle (read: on systems without
a battery), all items in the top are located on one side. Address
this by "moving" the spacer between "Settings" and "Screen Lock"
in that case to balance items a bit better.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2439>
2022-08-22 14:15:17 +00:00
Florian Müllner
e2cd66169b status/system: Use icon-name property
The quick settings code was first developed in an extension, which
meant it made sense to maintain compatibility with GNOME 42 and not
use the new :icon-name convenience property.

There is no good for sticking with that for GNOME 43 as well.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2439>
2022-08-22 14:15:17 +00:00
Florian Müllner
8945e25655 status/location: Use better indicator icon
We've used find-location since the indicator was added, however
the icon theme got a more appropriate location-services-active
icon a while ago.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5755

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2430>
2022-08-19 09:44:57 +00:00
Florian Müllner
4c495380a5 status/nightLight: Hide when unsupported
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5752

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2425>
2022-08-18 15:40:49 +00:00
Clerie Riese
2d6b21357d status/network: Use NM connectivity check URI for Portal Helper
NetworkManager can check if a network interface has "internet access" by
invoking a HTTP request.

The URI used for connectivity checking in NetworkManager can be configured
manually in NetworkManager.conf:

[connectivity]
uri=http://portal-check.exmaple.com/nm-check.txt

Portal Helper provides an argument to pass the URI that should be opened.
If this argument is empty it uses http://nmcheck.gnome.org as a fallback.

Pass the URI configured in NetworkManager to Portal Helper instead of
an empty string.

Fixes #1313

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2228>
2022-08-18 08:00:24 +00:00
Florian Müllner
4fd4b09919 status/bluetooth: Fix remembering set up devices
It is generally not possible to differentiate between systems
without bluetooth support, and systems where a bluetooth adapter
is powered down.

We work around that by tracking whether there are any set up devices,
and keep the bluetooth visible in that case, even when no adapter
is present.

However commit eeabdd150c moved updating the setting into the code
that handles adapter changes, which is exactly the place where we
carefully avoid changing the setting because it would be too
unreliable (devices may have already disappeared, or not yet
appeared).

Fix this by changing _setHadSetupDevices() to _syncHadSetupDevices()
and call that everywhere _sync() used to be called, *except* on
adapter changes.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5714

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2409>
2022-08-10 17:19:07 +00:00
Florian Müllner
0c7446c1fc status/bluetooth: Fix call to undefined method
The method started out as private and was then made public without
updating the internal caller, whoops.

Spotted by Sebastian Keller.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5722

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2409>
2022-08-10 17:19:07 +00:00
Florian Müllner
84c33157a2 status/network: Request scans while wireless menu is open
We want the list to keep updating, so periodically request scans
from NetworkManager. The code follows what Settings does in its
wifi panel, including the used interval.

There's a cute little spinner in the menu header now, to indicate
an ongoing scan.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2408>
2022-08-10 16:37:15 +00:00
Florian Müllner
81eb7db5a0 status/network: Port to quick settings
… and just like that, we've reached the end of the journey.

There's little else to say, except how remarkably unremarkable
the change is (not in terms of UI of course).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2408>
2022-08-10 16:37:15 +00:00
Florian Müllner
dc09f990c4 status/network: Keep sensitive when locked
Unlike the old menu that restricted almost everything on the lock
screen, we went into the completely opposite direction with quick
settings and kept everything that does not launch windows available.

Extend that line to the network items, but still respect the
`network-control` permission.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2408>
2022-08-10 16:37:15 +00:00
Florian Müllner
cd9284e48f status/network: Hide sections if networking is disabled
When moving to quick settings, we will no longer have a single
parent we can hide instead.

This is only really needed for VPN - devices go away when networking
is disabled, connections (as in: configuration) do not - but it's
simpler to just handle this in the base class than adding a
_shouldBeVisible() method the VPN section can override.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2408>
2022-08-10 16:37:15 +00:00
Florian Müllner
8e685246e2 status/network: Special-case wireless hotspots
If any device is in hotspot mode, use the corresponding item as
primary. Disable the (future QuickMenuToggle) menu in that case,
and turn off the hotspot when activated rather than toggling the
global wireless switch.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2408>
2022-08-10 16:37:15 +00:00
Florian Müllner
3a1ebd86d2 status/network: Make wireless insensitive when hardware-disabled
We cannot do anything while switched off, so indicate that to the
user.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2408>
2022-08-10 16:37:15 +00:00
Florian Müllner
791c65a5f9 status/network: Override activate() for wireless
Wireless items represent a single adapter, but wireless connectivity
is controlled globally under NetworkManager.

So instead of delegating activation to items, bind the :checked
property to the global :wireless-enabled property and toggle it
on activate.

As any wireless devices will change their state to UNAVAILABLE
when wireless is disabled, don't remove corresponding items in
that case to keep the section visible.

We don't want to hide the button to turn Wi-Fi back on when toggled
off :-)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2408>
2022-08-10 16:37:15 +00:00
Florian Müllner
1cc07716fa status/network: Expose WirelessDeviceItem:is-hotspot
Whether the device is used as a hotspot is currently only
used internally for the name and icon-name properties.

But hotspots need special treatment in the toggle as well,
so turn the method into a GObject property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2408>
2022-08-10 16:37:15 +00:00
Florian Müllner
88262a1042 status/network: Add activate() in NMSection
As the sections are about to turn into quick toggles, they need
to be able to perform an action on click.

Add an activate() method for that purpose, which either disconnects
all active items, or connects the primary item.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2408>
2022-08-10 16:37:15 +00:00