Commit graph

328 commits

Author SHA1 Message Date
Monster
47c7f2d216 power: Remove periods in subtitles 2024-02-05 10:52:19 +00:00
Felipe Borges
70888ea71d power: Use CcHostname to obtain the systemd-hostnamed chassis-type 2024-01-30 13:34:10 +00:00
Automeris naranja
f7b41b23f5 power-profile-row: Port to AdwActionRow and add mnemonics
This helps to clean the	code a bit. Also, it makes
the rows to look consistent with other rows with
radio buttons, such as the ones from the
Multitasking and Keyboard panels
2024-01-23 11:05:04 +00:00
Hari Rana
a936ac6bc9 power-panel: Port to AdwSwitchRow 2024-01-18 13:28:54 +00:00
Automeris naranja
760f605bbb power: Add missing mnemonics in the automatic suspend dialog 2024-01-08 09:42:04 +00:00
Hari Rana
a00a0fe3fd automatic-suspend-dialog: Use AdwPreferencesPage
The GtkScrolledWindow-AdwClamp-GtkBox combo would cause the dialog to horizontally move when the user resizes it to its minimum width. Furthermore, the AdwClamp used in the window wasn't using its `child` property. The dialog looks identical.
2024-01-02 15:20:47 +00:00
Automeris naranja
0190c3a89d power-profile-row: Remove periods from power profiles descriptions
"Text generally shouldn’t end with a period. This applies
to headings, descriptions, and includes text that is written
as a complete sentence".

https://developer.gnome.org/hig/guidelines/writing-style.html
2023-11-13 09:49:47 +00:00
Automeris naranja
0fb5767cb6 power-profile-row: Use "subtitle" style class for power profile descriptions
Doing this, the power profiles rows will look consistent
with other rows, such as the "Dynamic workspaces" and
"Fixed number of workspaces" from the Multitasking panel.

This also cleans the code a bit.
2023-11-13 09:49:47 +00:00
Maximiliano Sandoval R
ae33a67be0 power-panel: Modernize suspend dialog
We make the dialog adaptive. Unfortunately for it to be trully modern a
AdwComboRow should be used instead of a GtkComboBox.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2001>
2023-11-07 08:53:08 +00:00
Maximiliano Sandoval R
dca4e0201b power-panel: Use Header Capitalization
Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2001>
2023-11-07 08:53:08 +00:00
Automeris naranja
46239939ed power: Add missing mnemonics
Add mnemonics to the following rows
- Dim Screen
- Automatic Screen Brightness
- Automatic Power Saver

Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2541
2023-11-05 17:39:31 -03:00
Allan Day
a75cdb2c46 power: Adjust section titles
Use the section titles from the latest mockups. Also remove the unused
title from the .ui file.
2023-10-23 14:04:22 +00:00
Felipe Borges
bb835aac9e power: Make battery level percentage string translatable
This allows for local translation teams to change the presentation
format of the battery level percentage string accounting for local
guidelines and standards for displaying percentage values.

See https://en.wikipedia.org/wiki/Percent_sign#Correct_style for
more information.

Fixes #2637
2023-09-19 09:32:03 +00:00
Felipe Borges
5ec953b89c power: Use ISO-31-0 as default standard for showing batter charge percentage
This is the battery charge percentage. Showing number without a space
between the percent sign is the English style.

The ISO-31-0 standard prescribes a space between the number and the
percent sign.

See #2637
2023-09-19 09:32:03 +00:00
Alice Mikhaylenko
4680f362f3 Port to AdwNavigationSplitView 2023-08-25 08:00:43 +00:00
Alice Mikhaylenko
1032ab01f0 power: Port the suspend dialog to AdwWindow and AdwToolbarView 2023-08-25 08:00:43 +00:00
Alice Mikhaylenko
0921015b8b power: Port to AdwToolbarView 2023-08-25 08:00:43 +00:00
Felipe Borges
fc9251c880 Revert "cc-power-panel: add battery health section"
This reverts commit 4a0d924afd.

There are some rough edges to be polished before this is ready for
prime time.

UPower battery health capacity reporting can often be inconsistent
across vendors, and we don't want to expose unreliable information
on the UI without proper sanitization.
2023-08-07 12:18:33 +02:00
Eric Daigle
4a0d924afd cc-power-panel: add battery health section
As described in #2554, it would be useful to be able to see battery health information
such as charge capacity in Settings. This commit implements the proposed design for
battery health information, adding this functionality to the power panel.

Closes #2554
2023-08-04 09:40:07 +00:00
Mohammed Sadiq
1e4ef1fdb0 power: Fix a memory leak 2023-07-03 01:56:24 +00:00
Eric Daigle
598e71fdd2 cc-power-panel: hide automatic suspend row in vm
As described in #2521, the automatic suspend row is currently shown
when Settings is running in a VM, in which case it has no effect.

This commit checks whether Settings is running in a VM and disables
showing the automatic suspend row in this case, as is done for the
Suspend/Hibernate rows. This prevents the user from being shown a
useless row in the power panel.

Closes #2521
2023-06-13 04:17:35 +00:00
Robert Ancell
868dd6cf7e power: Use self for object variable name 2023-06-06 07:54:38 +00:00
Pablo Correa Gómez
7f7b65545c all: meson: do not specify resources from gresource files as dependencies
Meson extracts them by itself and add them as dependencies for the target.
It means one less location to keep track of files, and a lot less boilerplate
around the meson files
2023-05-24 08:34:14 +00:00
Bastien Nocera
5755f0eec7 power: Label the main "battery" as UPS if that's what it is
Change the label from "Battery" to "UPS" if the upower DisplayDevice is
a UPS. This avoids confusions like:
https://www.reddit.com/r/gnome/comments/11aws0q/battery_indicator_for_desktop_computer_seems/
https://askubuntu.com/questions/1344733/why-does-ubuntu-show-battery-and-charge-info-when-it-is-a-desktop-with-no-batter

"
Why does GNOME display a battery percentage ("Fully Charged") when I'm
running a desktop computer without any battery?
"
followed by:
"
Ha! I figured it out[...]. I have my desktop plugged into a UPS
"
2023-03-14 19:19:51 +00:00
Marco Melorio
088edd6c35 power: Remove deprecated gtk_widget_show/hide usage 2023-01-02 22:10:39 +00:00
sunflowerskater
7366eee9ee power: Show a description for Battery Percentage switch
Battery Percentage switch don't offer a description explaining where the percentage will be shown.

This commit adds a description to better explain what this option does.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1641
2022-12-15 16:24:05 -03:00
Jake Dane
89443fe550 desktop: Remove obsolete Bugzilla entries
The `X-GNOME-Bugzilla-*` entries were for use by bug-buddy, a GNOME 2
technology that's been gone for over a decade. These entries are
obsolete and can be removed from all desktop files.

The `X-GNOME-Settings-Panel` entry is also obsolete as far as I can
tell and only these panels had it in their desktop file: notifications,
sharing, sound and user-accounts. These entries can also be removed.

After removing the `X-GNOME-Bugzilla-*` entries, the desktop files have
no more variables in them. The meson `configure_file` step is therefor
pointless—there are no variables to configure. As such the
`*.desktop.in.in` files are renamed to `*.desktop.in` to reflect this
and `meson.build` files are modified to remove `configure_file` step.
2022-10-20 13:20:09 +00:00
Bastien Nocera
da7b4db162 power: Don't assert if we can't find the widget for a profile
In some cases, it was possible for a profile to be set (directly, or
through a hold) even though it wasn't supported. Don't assert in those
cases.

Closes: #1504
2022-09-16 11:07:09 +00:00
Felipe Borges
3a31e34514 power: Fix "Power Button Behavior" setting now applying
The AdwComboRow widget has a selected-item property, while we were
connecting to selected-index (which doesn't exist.

It is likely that selected-index existed in the past in libhandy
or libadwaita and this is a regression during the port to GTK4.

Fixes #2025
2022-08-23 15:26:46 +00:00
Felipe Borges
37f5cbe6af power: Fix blank-screen settings not applying
The AdwComboRow widget has a selected-item property, while we were
connecting to selected-index (which doesn't exist.

It is likely that selected-index existed in the past in libhandy
or libadwaita and this is a regression during the port to GTK4.

Fixes #2025
2022-08-23 15:26:46 +00:00
Lukáš Tyrychtr
de8d28c3eb Improve accessibility of the power panel 2022-05-10 22:14:35 +00:00
Pablo Correa Gómez
ddfacc6b81 power: Only update ALS state if it has changed
Ambient light sensors can be quite sensitive and the LightLevel
property might be changing very often. That has two undesired
consequences:
* The `als_enabled_state_changed` callback gets constantly called
  due to a change in a property which it does not care about, as
  only `HasAmbientLight` is relevant. Therefore, limit the code
  execution to when something needs to be changed.
* During debugging, the terminal gets spammed with "ALS enabled: on/off"
  messages.
2022-05-10 04:32:12 +00:00
Bastien Nocera
0947ae2557 power: Fix scenario tester running upowerd under jhbuild
A logic error meant that the systemd upowerd would always be used.
2022-02-17 14:55:13 +00:00
Sam Hewitt
65b109763b Cleanup private use symbolics
- remove references to deprecated app symbolics
- reduce file size of private-use icons
- update dated icons
2022-02-04 18:12:41 +00:00
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00:00
Bastien Nocera
fa01d3f10a power: Add scenario for a 2nd non-charging laptop battery 2022-01-27 02:52:20 +00:00
Bastien Nocera
6c6d9f4f38 power: Fix launching upower from scenario tester
Not everyone would have upower built under jhbuild, so use the system
one if we can't find it.
2022-01-27 02:52:20 +00:00
Georges Basile Stavracas Neto
07e3f5c3f3 power: Add go-next-symbolic icon to automatic suspend row
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +00:00
Georges Basile Stavracas Neto
0ab20af9ba panels: Switch to CcPanel content
Start porting panels to the new panel format. This commit
temporarily makes panels have two titlebar, which will be
fixed soon.
2022-01-20 02:23:42 +00:00
Bastien Nocera
595f04ea12 power: Remove ad-hoc UI debugging ifdef's
Remove the static UI debugging tools in the power panel code, and use
the scenario tester instead.
2022-01-18 16:06:15 +01:00
Bastien Nocera
bcf2d54772 power: Add helper to launch the Power Settings in scenarios
This helper tool launches the Power Settings panel in a fake
environment, making it easy to test the UI in different scenarios. The
tool allows:
- cycling through power-profiles-daemon degraded performance reasons
- adding and removing a laptop battery, keyboard, mouse or UPS

UPS support needs umockdev 0.17.4 to work correctly
2022-01-18 16:06:15 +01:00
Bastien Nocera
bd4c27e7ab power: Remove support for power-profiles-daemon < 0.9.0 2022-01-14 13:46:50 +00:00
Jan Beich
37b29c32cb meson: drop unused argument for i18n.merge_file()
Ignored in Meson < 0.60.0, deprecated since 0.60.1 and fatal since 0.61.0.

panels/applications/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/background/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/camera/meson.build:10:5: ERROR: Function does not take positional arguments.
[...]
2022-01-07 17:22:43 +00:00
Christopher Davis
981a8cea7b panels: Use .boxed-list instead of .content
The `.content` style class is deprecated in favor
of the `.boxed-list` style class, which is named
after the design pattern it's used for.
2021-12-16 12:52:44 -08:00
Georges Basile Stavracas Neto
a0d49cb3a8 power: Port to GTK4
Extra care was needed for the combo boxes, and the way we currently
use GtkStringList is kind of hacky, but overall things seem to be
working fine.
2021-12-14 22:34:21 -03:00
Frédéric Péters
667af4f521 power: Use translated strings for power button action behaviors
Fixes: #1476
2021-09-29 17:58:46 +00:00
Bastien Nocera
2b7cccf13b power: Update power profile labels
Use "Balanced" instead of "Balanced Power", and make sure to add a
context for all the profiles for translators.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4530#note_1243075
2021-08-09 13:31:12 +00:00
Bastien Nocera
e4c496158e power: Change "Balanced" power profile label
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4530#note_1241985
2021-08-05 15:28:02 +02:00
Allan Day
8fb8a340bf power: Align power profile info boxes with profiles text
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1421
2021-08-05 15:28:02 +02:00
Bastien Nocera
19fb4e4a0c power: Remove icons from power profiles
They were originally included was to educate users about what the icons
mean, for when they appeared in the top bar. However, since we no
longer plan on showing the status icon in the top bar, it's not so
important that people learn the meaning of the icons.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1421
2021-08-05 15:28:02 +02:00