Commit graph

338 commits

Author SHA1 Message Date
Felipe Borges
49e35600c9 power: Load a different list for suspend-times when on mobile
Using the systemd-hostnamed chassis-type to detect when running on
"tablet", "handset", or "watch" and setting a more reasonable list
of suspend time options for them.
2024-03-21 16:01:11 +00:00
silver
f694945b6e power: Add some more reasonable suspend time options for mobile
Edited by felipeborges.
2024-03-21 16:01:11 +00:00
Automeris naranja
1b357b2fb4 power-profile-info-row: Set natural-wrap-mode to none
This fixes title_label appearing awkwardly truncated when
the the text is long (a lot of whitespace is shown at the
right of the row).

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2240
2024-03-12 22:17:17 +00:00
Automeris naranja
cb8819657b general: Rename "computer" strings to "device"
"Computer" isn't a suitable term for other device
form factors. Also, there are several strings in
Settings that already use "device", and cc-color-panel.ui
uses a mix of "computer" and "device" strings, which is
weird.
2024-03-11 15:19:55 +00:00
Automeris naranja
36917a0896 common: Replace info-symbolic icon with info-outline-symbolic
Latest mockups are now using info-outline-symbolic,
example:
1c55bbb53a
2024-03-11 15:06:26 +00:00
Automeris naranja
95f36e2d71 power: Remove row-activated callback for power profile rows
It isn't necessary anymore now that power profile
rows are AdwActionRows[1].

[1] f7b41b23f5
2024-02-26 15:56:41 +00:00
Automeris naranja
2b2af85ead power: Port "Automatic Suspend" row to CCListRow
This helps to clean the code a bit.
2024-02-20 10:05:15 +00:00
Automeris naranja
5785f4cc7d power: Don't use GtkSizeGroup
This isn't being used in other panels; it also
increases the height of all rows when the
window is narrow, making the UI to look odd.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1674
2024-02-20 08:51:52 +00:00
Jeremy Bícha
80b02fdb97 power: Use imperative verb tense
This verb style commonly known as "imperative" is simpler without
the trailing "s" and better matches the style used elsewhere
2024-02-12 09:17:48 +00:00
Automeris naranja
9209f5f149 power: Ship "info-symbolic" icon as a gresource
The Power panel currently installs "info-symbolic"
in /usr/share/icons, which makes this icon to appear
as a pre-installed system icon. This makes app
developers to use this icon in their apps
under that assumption.

Ship this icon as a gresource to fix this.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2865
2024-02-08 10:20:36 +00:00
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