Commit Graph

918 Commits

Author SHA1 Message Date
Florian Müllner
af132dd884 status/network: Catch errors when fetching client
Otherwise any unrelated errors in that function are hidden,
because exceptions in async functions are turned into promise
rejections (and JS cannot know that we won't handle it at a later
point).

It wouldn't happen to me of course 😉

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2406>
2022-08-07 22:41:09 +02:00
Florian Müllner
d9d70c162d status/network: Some minor style fixes
I wasn't genuiously going to touch those lines, but I ran into
a limitation of the run-eslint script:

It currently bases changed lines on a diff between HEAD and main
instead of the commit-by-commit log.

The two can vary quite a bit when shuffling code around, and those
are the lines the tool kept complaining about.

I'll look into improving the script, but for now it's quicker to
just shut it up by fixing up the complaints.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2406>
2022-08-07 22:41:09 +02:00
Florian Müllner
ce19849c09 status/power: Merge with system indicator
Now that the old system menu has been ported over, we can move
the power toggle to its intended place. The main difference to
the stand-alone toggle is that the button now uses its natural
size rather than the fixed size of regular quick items.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
2022-08-03 12:41:05 +00:00
Florian Müllner
ea00da7fd7 status/system: Port to quick settings
This port is a bit messier than the previous ones, because the
existing menu section translates less directly to the new UI,
which uses a row of individual toggles for settings, lock and
shutdown.

In order to not complicate the grid layout further by supporting
rows with a different number of columns than the overall grid and
children at their natural size, create a custom, non-reactive
SystemItem item that spans an entire row, and contains the individual
toggles.

This works quite well, even with the shutdown item that uses a menu
for the various actions.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
2022-08-03 12:41:05 +00:00
Florian Müllner
62c62eced0 status/volume: Port to quick settings
Thanks to the preparations and QuickSlider, this is again
straight-forward.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
2022-08-03 12:41:05 +00:00
Florian Müllner
7bbd59838a status/brightness: Port to quick settings
Using QuickSlider, this is another easy port.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
2022-08-03 12:41:05 +00:00
Florian Müllner
1f178e83d3 status/powerProfiles: Port to quick settings
With menu support in place, this is now a straight-forward port:
Just add the existing profiles section to a QuickToggleMenu instead
of a submenu item.

The toggle itself now switches between 'balanced' and the last used
non-default profile.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
2022-08-03 12:41:05 +00:00
Florian Müllner
a3a886f185 status/darkMode: Add dark mode toggle
The aggregate menu with its submenus isn't well-suited for simple
on-off actions, so we didn't expose the global color-scheme support
that was introduced last cycle.

Quick settings on the other hand are a natural fit for actions like
this, so add a corresponding toggle.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>
2022-08-02 16:05:28 +00:00
Florian Müllner
4d931c2c41 status/autoRotate: Port to quick settings
On devices where auto-rotation is supported, (un)locking the
orientation is a common enough action to not bury it in a menu.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>
2022-08-02 16:05:28 +00:00
Florian Müllner
80d1f68c77 status/power: Port to quick settings
The power indicator should not be a regular quick toggle, but
instead be part of a "system area" row at the top of the menu.

But as in the end it is still a simple button, we can do the
port to quick settings now, and move it later when the system
row is implemented.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>
2022-08-02 16:05:28 +00:00
Florian Müllner
2ebdb6e318 status/bluetooth: Port to quick settings
For now, this is another simple toggle. The icon, state and
visibility reflect what the old menu did, and the top bar
icon is still only shown when devices are currently connected.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>
2022-08-02 16:05:28 +00:00
Florian Müllner
49eaa29f22 status/rfkill: Port to quick settings
Another simple toggle. Unlike the old menu, it is always shown
if airplane mode is supported, not just while airplane mode is
active.

We still only show the top bar icon while airplane mode is on.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>
2022-08-02 16:05:28 +00:00
Florian Müllner
1459173bc9 status/nightLight: Port to quick settings
Night-light is now a simple, always visible toggle that directly
controls the underlying setting. No change to the top bar icon,
which is still only shown while night-light is active (read: at night).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>
2022-08-02 16:05:28 +00:00
Florian Müllner
0f1f5bb174 status/remoteAccess: Move to quick settings
And there goes the last icon-only indicator. From now on, some
actual work will be involved 😱️

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>
2022-08-02 16:05:28 +00:00
Florian Müllner
b8cb5c6acd status/thunderbolt: Move to quick settings
... and another icon-only indicator that can be just moved.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>
2022-08-02 16:05:28 +00:00
Florian Müllner
c9a9e1ef52 status/location: Move to quick settings
Another icon-only indicator, so another plain move.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>
2022-08-02 16:05:28 +00:00
Florian Müllner
637ee7386e js: Use async D-Bus wrappers
After porting the more complex cases - in particular those that
affect a module's API - we are left with straight-forward D-Bus
method calls that can be moved to promise-based wrappers in one
go.

For consistency, this also switches from Remote to Async where
the call result is ignored.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2344>
2022-08-01 18:51:14 +00:00
Florian Müllner
db3916434e status/location: Make AppAuthorizer async
Instead of passing a callback through a series of methods and
callbacks, change authorize() to return its result asynchronously.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2344>
2022-08-01 18:51:14 +00:00
Florian Müllner
7ab7df739a status/remote-access: Split out screen sharing indicator
The latest mockups move the screen sharing indicator into a
separate control, similar to the existing indicator for built-in
screen recordings.

As this removes the submenu and only keeps the top bar icon (for
external screen recordings), this will smooth the transition to
quick settings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2391>
2022-08-01 12:33:36 +00:00
Florian Müllner
4f155d3757 status/powerProfiles: Remember last selected non-default profile
When we move to quick settings, this will allow us to toggle
between two profiles even where more profiles are available.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2391>
2022-08-01 12:33:36 +00:00
Florian Müllner
dc4ed1d7d2 status/location: Remove submenu
Location services aren't expected to change frequently: They are
either disabled globally, or permissions are granted on a per-app
basis.

This is less of a concern while the setting is exposed in a small
submenu, but as we moving to quick settings, it does not deserve
the prominence of a quick toggle. Just the top bar icon and Settings'
privacy panel should be enough.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2391>
2022-08-01 12:33:36 +00:00
Florian Müllner
3bc9f00a15 status/volume: Merge VolumeMenu into indicator
Other than connecting stream when necessary, the volume menu
only forwards slider events to the indicator, and method calls
from the indicator to the appropriate slider.

Just cut our the middle-man and let the indicator handle the
slider items directly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2391>
2022-08-01 12:33:36 +00:00
Florian Müllner
ed2ae06f35 status/brightness: Improve proxy error handling
On error, we currently print a warning and bail out early. That
means we don't hide the slider, despite it being non-functional
without the proxy.

Fix this by making sure _sync() is called in any case. While at
it, use an appropriate log level for the warning message.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2391>
2022-08-01 12:33:36 +00:00
Florian Müllner
87e4eda46d status/brightness: Hide when proxy has no owner
Properties are null while a proxy has no owner. Javascript helpfully
coerces that into `Number(null)` (a.k.a. 0), so we end up with a
broken slider.

Explicitly check that the value is an integer before doing the
comparison to catch that case.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2391>
2022-08-01 12:33:36 +00:00
Florian Müllner
fcd08fae94 status/bluetooth: Split out BtClient object
The new class abstracts away the nitty-gritty of bluetooth- and
airplane-mode handling, and exposes just what the UI needs.

This will become more important with quick settings, where there's
a stronger separation between top bar icon and quick toggle.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2391>
2022-08-01 12:33:36 +00:00
Florian Müllner
463757569a status/bluetooth: Use promise to initialize proxy
There's no good reason for waiting for the proxy to be initialized
to connect signals. In fact, connecting the signal beforehand
ensures that the handler is in place when the proxy fetches the
properties, so we don't have to call the handler explicitly.

That in turn allows us to rely on the signal parameters to only process
changed properties.

To achieve that, construct the proxy manually, and then initialize
it asynchronously in a Promise.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2391>
2022-08-01 12:33:35 +00:00
Florian Müllner
80e4ae7d7f status/nightLight: Use promise to initialize proxy
There's no good reason for waiting for the proxy to be initialized
to connect signals. In fact, connecting the signal beforehand
ensures that the handler is in place when the proxy fetches the
properties, so we don't have to call the handler explicitly.

That in turn will allow us in a follow-up to rely on the signal
parameters to only process changed properties.

To achieve that, construct the proxy manually, and then initialize
it asynchronously in a Promise.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2391>
2022-08-01 12:33:35 +00:00
Florian Müllner
6aa3a2f4e2 status/powerProfiles: Use CHECK ornament
The design team prefers them over dots in this context now.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2389>
2022-07-27 13:39:02 +00:00
Florian Müllner
d555be0a64 status/powerProfiles: Add image to menu items
We want the icons when we move to quick settings:

https://gitlab.gnome.org/Teams/Design/os-mockups/-/raw/master/system-status/quick-settings/quick-toggles-mvp.png

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2389>
2022-07-27 13:39:02 +00:00
Florian Müllner
d03a94dab1 status/powerProfiles: Split updating profiles from sync
Calling the split out code where necessary seems cleaner than
calling it conditionally as part of the general sync().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2389>
2022-07-27 13:39:02 +00:00
Florian Müllner
e062e96ae6 rfkill: Consider HasAirplaneMode
`ShouldShowAirplaneMode` only considers whether airplane mode
should be shown for the form factor, not whether there are
any actual kill switches available.

That's tracked in a separate property, `HasAirplaneMode`.

Take that into account for our `:show-airplane-mode` property,
so that it reflects when airplane mode should and *can* be shown.

Right now we only show airplane mode when it is enabled (and
therefore available), but this will change in the future.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2385>
2022-07-19 13:27:39 +00:00
Florian Müllner
98cbc31e86 rfkill: Turn manager into a GObject
That will allow us to use it in property bindings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2385>
2022-07-19 13:27:39 +00:00
Florian Müllner
bb043bb761 rfkill: Use promise to initialize proxy
There's no good reason for waiting for the proxy to be initialized
to connect signals. In fact, connecting the signal beforehand
ensures that the handler is in place when the proxy fetches the
properties, so we don't have to call the handler explicitly.

That in turn will allow us in a follow-up to rely on the signal
parameters to only process changed properties.

To achieve that by constructing the proxy manually, and then
initialize it asynchronously in a Promise.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2385>
2022-07-19 13:27:39 +00:00
Florian Müllner
762b4c2066 status/volume: Add device submenus
In case where there are multiple in- or output devices, pulseaudio
or pipewire can pick the "wrong" one by default.

Allow users to change devices without opening sound settings by
adding a submenu to the sliders when there is more than one device.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>
2022-07-19 14:56:46 +02:00
Florian Müllner
cf404f76c0 status/volume: Use (dis)connectObject
It makes sense to use this for all MixerControl handlers, not just
some of them.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>
2022-07-19 14:56:46 +02:00
Florian Müllner
af5bc30dff status/volume: Reindent before making code changes
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>
2022-07-19 14:56:46 +02:00
Florian Müllner
a768efad06 status/volume: Small cleanup
There is no point in splitting out a function that has one caller
and sets a single property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>
2022-07-19 14:56:46 +02:00
Florian Müllner
d80a7224cd status/volume: Document public function
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>
2022-07-19 14:56:46 +02:00
Evan Welsh
a88e59c1a8 Adopt EventEmitter class instead of injecting Signal methods
Introduce a new class, EventEmitter, which implements signal
handling for pure JavaScript classes. EventEmitter still
utilizes GJS' addSignalMethods internally.

EventEmitter allows static typechecking to understand the
structure of event-emitting JS classes and makes creating
child classes simpler.

The name 'EventEmitter' mirrors a common name for this pattern
in Node and in JS libraries.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2043>
2022-07-04 18:30:49 -04:00
Sam Hewitt
68653d5e61 nm-dialog: Fix icon spacing issue
- fixes #4928

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2309>
2022-06-20 07:43:31 +00:00
Christian Glombek
b5ace213a1 status/network: Show WireGuard connections in VPN list
With this change, WireGuard connections, and an on/off toggle button
or a status description for each are shown in the VPN section of the
Gnome Shell network status UI.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1995>
2022-05-23 18:11:16 +02:00
Florian Müllner
9400759f25 status/volume: Hide sliders initially
We update the visibility on state or stream changes, but those
changes may never happen if pipewire-pulse/pulseaudio isn't
available (for example when running as root).

Hiding the sliders is preferable in that case to showing non-working
controls.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2295>
2022-05-11 02:40:33 +02:00
Jonas Dreßler
682629e603 status/network: Also show disabled icon when wwan is not connected
Commit ca4f6e0123 was supposed to show the
"cellular-disabled" icon when wwan is disabled. For wwan, just like for
bluetooth wwan networks, we probably want this to include the "not
connected" state, because disconnecting from cellular service de-facto
means disabling it.

So switch the check to show the "cellular-disabled" icon to also use the
icon whether there's no active connection, not only when the wwan device
is turned off.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2283>
2022-04-29 20:02:16 +00:00
Jonas Ådahl
f979ebcb1a remoteAccess: Hide indicator after a timeout
In order to make very short screen capture sessions more visible, let
the indicator remain visible, but a bit greyed out, for some seconds.
This makes it more obvious something was just capturing the screen.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2132>
2022-03-04 22:05:46 +00:00
Florian Müllner
26235bbe54 js: Use (dis)connectObject()
Start using the new methods to simplify signal cleanup. For now,
focus on replacing existing cleanups; in most cases this means
signals connected in the constructor and disconnected on destroy,
but also other cases with a similarly defined lifetime (say: from
show to hide).

This doesn't change signal connections that only exist for a short
time (say: once), handlers that are connected on-demand (say: the
first time a particular method is called), or connections that
aren't tracked (read: disconnected) at all.

We will eventually replace the latter with connectObject() as
well - especially from actor subclasses - but the changeset is
already big enough as-is :-)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1953>
2022-03-04 14:14:37 +00:00
Jonas Dreßler
eeabdd150c status/bluetooth: Clear list of connected signals on adapter changes
With the porting of gnome-bluetooth to the new GListModel API the
behavior regarding removing adapters changed: It now no longer
guarantees to emit "device-removed" signals for the paired devices when
the adapter gets removed.

This means we need to do that ourselves now, so clear the list of
connected signals when the default adapter changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2214>
2022-02-26 15:53:19 +00:00
Jonas Dreßler
94d9264d96 Revert "status/bluetooth: Bail out and hide UI when there's no adapter"
Turns out this broke showing the bluetooth menu entry for adapters which
rely on the had-devices-setup property being set while turned off. These
adapters are completely removed from the system by the firmware after
powering them off, so in that case there is no default adapter anymore,
although we still want to show the menu.

This reverts commit aaf47167b5.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2214>
2022-02-26 15:53:19 +00:00
Florian Müllner
2b45a01517 cleanup: Use new indentation style for object literals
We have made good progress on object literals as well, although there
are still a lot that use the old style, given how ubiquitous object
literals are.

But the needed reindentation isn't overly intrusive, as changes are
limited to the object literals themselves (i.e. they don't affect
surrounding code).

And given that object literals account for quite a bit of the remaining
differences between regular and legacy rules, doing the transition now
is still worthwhile.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2200>
2022-02-23 12:23:52 +00:00
Florian Müllner
ac9fbe92e5 cleanup: Use new indentation style for arrays
We've made some progress on transitioning to the modern indentation
style, and for arrays the legacy style is now rare enough to make
a bulk transition feasible.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2200>
2022-02-23 12:23:52 +00:00
Jonas Dreßler
3d3ed850fe status/network: Show disabled icon when bluetooth cellular is disabled
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2186

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2198>
2022-02-23 00:15:06 +00:00
Jonas Dreßler
2898b4d29c status/network: Show vpn-disabled icon when vpn is disabled
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2186

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2198>
2022-02-23 00:15:05 +00:00
Jonas Dreßler
ca4f6e0123 status/network: Show cellular-disabled icon when cellular is disabled
We also have this icon, so let's use it.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2198>
2022-02-23 00:15:05 +00:00
Jonas Dreßler
8a7f935969 status/bluetooth: Show bluetooth-disabled icon when disabled
We have an icon for this, so let's actually use it.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2198>
2022-02-23 00:15:05 +00:00
Jonas Dreßler
24143eae0d status/network: Show wireless-disabled icon when wifi is disabled
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2186

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2198>
2022-02-23 00:15:05 +00:00
Xiaoguang Wang
8655814329 network: Get dbus path from NMDevice
In the NetworkManager new version the NMDevice.get_path returns pci
path, we need to use NM prototype to get device dbus path.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2194>
2022-02-21 02:41:40 +00:00
Jonas Dreßler
aaf47167b5 status/bluetooth: Bail out and hide UI when there's no adapter
While _sync() does already handle the case where there's no adapter just
fine (hiding the item and the indicator), let's make the handling a bit
more obvious and add an explicit check for !this._adapter where we bail
out and hide the UI.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2188>
2022-02-18 19:10:18 +00:00
Jonas Dreßler
109e2968e2 status/bluetooth: Use BlueZ state to determine whether bluetooth is on
There's two ways bluetooth can be powered off/on for us: One way is to
go via airplane mode (which uses rfkill), and the second way is to tell
BlueZ to turn off the device. Now rfkill always has the final say on
whether bluetooth is off, BlueZ OTOH has the final say on whether
bluetooth is on.

This means when we want to know whether bluetooth is turned on, we only
have to ask BlueZ, so simply read this._client.default_adapter_powered
for that.

For turning bluetooth on or off we use rfkill, but when turning it on,
make sure it's turned on in Bluez, too.

FTR, this is exactly the same way the Bluetooth panel in Settings
handles this.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2188>
2022-02-18 19:10:18 +00:00
Jonas Dreßler
34dcf2f7b1 status/bluetooth: Use JS Set for tracking signal connections
We can make things a bit fancier here and use a JS Set instead of an
object for tracking which devices we're having a signal handler
connected to.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2188>
2022-02-18 19:10:18 +00:00
Ivan Molodetskikh
2949244d72 status/remote-access: Don't show recording icon for screenshot UI casts
If there's only a single recording and it is the screenshot UI
recording, don't show the icon, because it's already displayed by the
new panel.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2163>
2022-02-12 14:36:54 +00:00
Ivan Molodetskikh
144acb1d02 status/remote-access: Remove menu for stopping screencasts
It is now handled by a dedicated panel.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2163>
2022-02-12 14:36:54 +00:00
Ivan Molodetskikh
6ec8480052 panel: Add a screen recording indicator
The indicator shows the recording duration and lets the user stop it on
click. It is more discoverable than the stop entry in the aggregate
menu.

The class extends ButtonBox directly rather than Button because Button
does nothing that it uses, and actually causes issues with its dummy
menu (its vfunc_hide() throws an "open-state-changed: Error: incorrect
pop").

The menu-set signal declaration is required by the panel.

The screencast is stopped upon button press in vfunc_event(), which
matches PanelMenu.Button's input handling.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2163>
2022-02-12 14:36:54 +00:00
Florian Müllner
a1dd1b25d8 js: Use templates for non-translatable strings
This reverts commit 9d941f8202 and replaces all additional
instances of .format() that have been added since.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2160>
2022-02-12 12:29:52 +00:00
Florian Müllner
29dfde5a4a js: Reindent some code
... to make sure it conforms to the non-legacy style
before touching it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2160>
2022-02-12 12:29:52 +00:00
Alexander Mikhaylenko
ad830fad1e network: Update Settings appid
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2175>
2022-02-11 17:33:34 +00:00
Florian Müllner
5442266f28 js: Simplify promisify() calls
If the finish function isn't specified, promisify will now try
to use the async name without '_async'/'_begin' suffix (if any)
and '_finish' appended.

Everything except IBus uses a variation of that pattern, so there's
quite a bit of boilerplate we get to remove…

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2174>
2022-02-11 16:24:01 +00:00
Florian Müllner
78c7d5ba0c status/location: Track enabled state
More fallout from commit e3a1d84992: We are tracking the agent's
:max-accuracy-level property that we don't use, but not :enabled.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2170>
2022-02-10 13:19:57 +00:00
Florian Müllner
5628849a40 status/location: Use correct enabled state
Commit e3a1d84992 split out the agent from the indicator, but kept
using a local 'enabled' property with no connection at all to the
actual state.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2170>
2022-02-10 13:19:57 +00:00
Bastien Nocera
0531fc54e5 status/bluetooth: Fix wedged state
Fix a state where toggling the main Bluetooth switch in the header will
always show the "Bluetooth Off" menu header with "Turn Off" as the only
option.

To reproduce, with Bluetooth enabled and working, run
"hciconfig hci0 down" as root, and check the status menu.

See gnome-bluetooth!102 and gnome-control-center!1148

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4857
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2055>
2022-02-08 23:16:46 +00:00
Bastien Nocera
4a480a78af status/bluetooth: Port to new GListModel API
The GtkTreeView API was removed, and replaced with a GListModel API.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4748
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2055>
2022-02-08 23:16:46 +00:00
Bastien Nocera
b83b22bc58 powerProfiles: Remove support for power-profiles-daemon < 0.9.0
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2101>
2022-02-08 11:21:44 +00:00
Sam Hewitt
372ccc3e29 status/a11y: Update deprecated icon name
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2155>
2022-02-04 13:08:42 +00:00
Alexander Mikhaylenko
f6edfd503b status/a11y: Use the new high-contrast gsettings key
With the new boolean setting, the "High Contrast" toggle can now
simply toggle the setting instead of the current gtk/icon-theme
shenanigans.

This isn't only much simpler, but will also make switching between
high-contrast and a non-default theme reliable at last.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2069>
2022-02-01 14:11:07 +00:00
Ivan Molodetskikh
6d0c2ae697 status/remote-access: Add menu for stopping screencasts
This is specifically for stopping the screenshot UI screencasts for now.
It's possible to stop arbitrary screen recording handles, however due to
an issue with pipewiresrc, this method cannot currently work for cleanly
stopping Shell's own screen recordings. Hence the best we can do is to
handle just the screenshot UI screencasts to let them stop cleanly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2103>
2022-01-29 14:43:49 +00:00
Florian Müllner
b54111ef88 cleanup: Use logical assignments
gjs updated mozjs to a version that support assignment operators
for logical operators, so use those where appropriate.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2115>
2022-01-25 15:21:16 +00:00
Georges Basile Stavracas Neto
87927b8281 ui: Rename gnome-control-center to org.gnome.Settings
The app-id has changes since  [1].

[1] https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1153

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2123>
2022-01-21 10:44:37 -03:00
Emily Gonyer
f752be2bfe docs: Use gender-neutral pronouns
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2031>
2022-01-05 16:34:23 +01:00
Mohammed Sadiq
3495873c90 status/network: Use wwan settings panel for GSM/LTE Modems
GSM/UMTS/LTE modems now have better support with wwan panel in GNOME
Settings.  So, if the modem supports, open wwan panel, otherwise
fallback to opening network panel when "Mobile Broadband Settings"
item is clicked.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/583

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1942>
2021-08-14 10:39:56 +00:00
Florian Müllner
c6b72ccd15 status/location: Change permission table
There is now a location portal that provides a similar role
as our agent. Settings supports that portal in its application
panel, which allows users to revisit their choice later.

Unfortunately it uses a different permission store table, so
any permissions granted (or denied) through our agent won't
show up there.

To change that, switch to the same table as the portal/Settings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1945>
2021-08-12 22:39:45 +00:00
Florian Müllner
19fc6ef5dd powerProfiles: Tweak profile names
After some more discussion, we settled on slightly different
profile names.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1939>
2021-08-09 13:50:13 +00:00
Florian Müllner
f1320bd250 status/powerProfiles: Add power mode selection
Settings' power panel gained support for switchable power profiles
in GNOME 40. It's useful to have that functionality more readily
available, so expose it in the system status menu as well.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1907>
2021-08-02 16:41:06 +02:00
Ian Douglas Scott
e3a1d84992 location: Split Location.Indicator into a seperate GeoclueAgent
Before this, creating a separate instance of `Location.Indicator` failed
because it tries to create export the same DBus path.

This is useful for extensions adding panels on multiple monitors. But
it also seems like a cleaner design to separate the indicator widget
from the logically separate role as a Geoclue agent.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1919>
2021-07-16 17:51:17 -07:00
Ian Douglas Scott
51a8bbddd5 location: Add GObject properties to Location.Indicator
Makes `enabled`, `in-use`, and `max-accuracy-level` GObject properties
that can be used for property binding, etc.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1919>
2021-07-16 16:07:30 -07:00
Florian Müllner
28a42da947 status/network: Do not disable on login screen
We currently disable all network items on both the lock- and login
screen. While it makes sense to be very restrictive on the lock screen,
there are some (fringe) use cases for being more permissive on the
login screen (like remote home directories only accessible via VPN).

There's precedence with the power-off/restart actions to be less
restrictive on the login screen, and since we started respecting
the `network-control` polkit action, it's possible to restore the
old behavior if desired.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1874>
2021-07-16 22:21:12 +00:00
Florian Müllner
d1333cb249 status/network: Consider network-control action
NetworkManager installs a `network-control` polkit action that can
be used to disallow network configuration, except that we happily
ignore it. Add it to the conditions that turn a network section
insensitive.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1874>
2021-07-16 22:21:12 +00:00
Florian Müllner
d53285d71b status/network: Only list wifi networks that can be activated
Setting up a connection for an Enterprise WPA(2) encrypted wireless
network requires Settings. That's not available when windows are
disabled via the session mode, so filter out affected entries.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1874>
2021-07-16 22:21:12 +00:00
Florian Müllner
25793b9d97 status/network: Disable modem connection when windows aren't allowed
The item launches the corresponding Settings panel when activated, which
doesn't work when windows are disabled by the session mode. Rather than
failing silently, turn the item insensitive.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1874>
2021-07-16 22:21:12 +00:00
Florian Müllner
8430aa59da status/power: Always sync after creating proxy
Otherwise the menu remains in an inconsistent state in case of an
error, until something else triggers a call to _sync() (like a
settings change).

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1901>
2021-06-28 20:49:43 +00:00
Florian Müllner
9e9ed42263 status/power: Update to new coding style
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4431

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1901>
2021-06-28 20:49:43 +00:00
Prajna Sariputra
6ee2c4f74c status/power: Always show real percentage in battery label
We currently display the percentage as "100%" if the battery state is
"fully charged", but the actual capacity may be lower than that.

Just show the real percentage, which is consistent with Settings.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1787>
2021-04-27 21:04:34 +02:00
Sebastian Keller
dfc44973de status/network: Disconnect signal handler on destroy in NMConnectionItem
Otherwise this can trigger _sync() calls after the objects it is trying
to update have been destroyed.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1782>
2021-03-31 10:31:12 +00:00
Peng Wu
f563424417 keyboard: Fix display keyboard layout crash with some input methods
Some ibus input method will use the current keyboard layout,
and return "default" as the keyboard layout.
When this happens, display the current keyboard layout instead.

Fixes #3863.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1756>
2021-03-29 09:33:45 +00:00
Daniel van Vugt
c5b18ee66a status/network: Ensure the Cancel button passes undefined to close()
The parameter to `ModalDialog.close(timestamp)` is optional. But when
invoked via the network dialog's Cancel button it was receiving an
implicit parameter value that's definitely not a timestamp:

```
[0x560f18af0c50 StButton.modal-dialog-linked-button:first-child hover ("Cancel")]
```

And as of today (or gjs >= 1.67.3) that's reported as an error:
```
JS ERROR: Error: Argument timestamp: value is out of range for uint32
popModal@resource:///org/gnome/shell/ui/main.js:638:12
popModal@resource:///org/gnome/shell/ui/modalDialog.js:206:14
close@resource:///org/gnome/shell/ui/modalDialog.js:179:14
```
and so you can't Cancel the dialog anymore.

Make sure `ModalDialog.close()` receives an `undefined` timestamp it
knows how to handle.

Fixes: https://bugs.launchpad.net/bugs/1918666
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1757>
2021-03-15 18:19:04 +08:00
Remi Salmon
9cd211a99a status/network: Use the same signal strength values as GNOME Settings
Be consistent and use the same wifi signal strength thresholds that are
used by Settings to ensure that the signal strengths look the same in
Settings and gnome-shell.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/blob/master/panels/netwo>
for the	values used in Control Center.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1432>
2021-03-02 23:07:01 +00:00
Razze
ed628b90d7 accessibility/keyboard: Align the panelMenu button style
This get's rid of the single-indicator introduced in one of the latest
commits. This was causing the accessibility pill in the top panel
 to have different padding from the keyboard layout pill.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1615>
2021-02-04 20:08:29 +00:00
Florian Müllner
add6dfe2e4 status/dwellClick: Remove menu arrow
This was missed in commit db9a008.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1618>
2021-02-01 11:40:03 +00:00
Doan Nam Long Vu
db9a008e8a panel: Remove drop down arrows from standalone indicators
The keyboard/language selector area is the smallest element
on the panel. Additional margin about 6px inside the a11y
and language items to make them comfortable to click targets.

With that, we can remove the remaining arrows.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1583>
2021-01-26 16:53:42 +01:00
Razze
f87f9848c3 status/volume: Allow changing input volume by scrolling
Previously scrolling on the volume or input indicator would always
change the volume. This change lets you change the input volume if
you scroll over the input indicator.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1566>
2021-01-14 01:13:17 +01:00
Florian Müllner
8a47f1c667 cleanup: Remove empty leading/trailing lines in blocks
gjs added a new rule to its eslint ruleset that forbids "block padding",
so make sure we conform to that rule before syncing up the configuration.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1498
2020-11-16 18:04:23 +00:00
Jonas Ådahl
a0e87b53ff remoteAccess: Ignore all but the screen record handles on X11
We still want to show the red dot when recording the screen on X11, so
only drop the "screen-is-shared" handles when using the X11 session.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3279

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1466
2020-10-13 21:45:59 +00:00
Florian Müllner
ba804de15e status/bluetooth: Fix label for >1 connected devices
Eeeks, we want two strings here, not one with embedded double quotes.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3073
2020-08-24 15:37:08 +00:00