Commit graph

6216 commits

Author SHA1 Message Date
Robert Ancell
35790b5430 power: Replace g_object_new with gtk widget methods
This improves compile time type checking.
2020-10-19 04:07:53 +00:00
Robert Ancell
83d3724ff6 online-accounts: Replace g_object_new with gtk widget methods
This improves compile time type checking.
2020-10-19 04:07:53 +00:00
Robert Ancell
e09e53a8c2 keyboard: Replace g_object_new with gtk widget methods
This improves compile time type checking.
2020-10-19 04:07:53 +00:00
Robert Ancell
9418093900 background: Replace g_object_new with gtk widget methods
This improves compile time type checking.
2020-10-19 04:07:53 +00:00
Ian Douglas Scott
8b7eac0a7b keyboard: replace CcAltCharsKeyDialog with a generic XkbModifierDialog
Previously, there were multiple redundant lists of possible values for
this setting. This uses one struct to define not only all the possible
values, but also anything specific to the alternate characters key, so
this can be used for other modifiers.

This also changes the style of the dialog to use a GtkListBox.
2020-10-19 04:00:32 +00:00
Ian Douglas Scott
f40d4865fa power: Use CcBatteryRow for devices section as well
This had another slightly different version of the same code.
2020-10-14 22:56:16 +00:00
Ian Douglas Scott
dc9a3c993a power: Remove unused status code in add_device
It seems this was added in ee36b0df91, but the `status` variable has
been unused since a9683772d9 (committed in 2012).

Seems safe to remove if it's been unused since 2012.
2020-10-14 22:56:16 +00:00
Ian Douglas Scott
af8c3247b4 power: Remove get_battery_level()
This was added in 6c447dc14a to deal with
both older and newer UPower versions.

It should be safe now to assume a UPower version with this property.
2020-10-14 22:56:16 +00:00
Ian Douglas Scott
f297f544f1 power: Refactor battery row code into a CcBatteryRow type
`set_primary()` and `add_primary()` had a lot of redundant code. This
unifies them, and moves them to a custom widget called `CcBatteryRow`.
This also decreases the somewhat excessive size of `cc-power-panel.c`,
and makes it easier to see the layout of widgets, now that it's
specified in xml.

Before this, `warning-battery-offset` was set to `0.03` for a "primary"
battery, and `0.05` otherwise. I expect this is a bug, so I've changed
both to `0.03`.

No other style or behavior change is intended.
2020-10-14 22:56:16 +00:00
Benjamin Berg
64686cfee3 user-accounts: Consistently return translated strings for fprint helper
Always return translated strings from the fprint translation helper
header. This makes things more consistent overall.
2020-10-13 09:31:00 +00:00
Benjamin Berg
e80b4b5f58 user-accounts: Fix free of const string due to incorrect translations
A duplicatend and translated string could be passed to gettext another
time. If that string can be translated, then a static string would be
returned rather than the const one, causing an invalid free.

Fixes: #1149
2020-10-13 09:31:00 +00:00
Benjamin Berg
66c81d8128 display: Fix possible recursion when configuration type changes
The UI rebuilding code may change the configuration type, which in turn
can trigger a UI rebuild. This should not be done if we are already
updating the UI (but must be done otherwise, as that means the user has
chosen to change the configuration).

Fixes: #1141
2020-10-12 03:22:15 +00:00
Robert Ancell
dad5cc58b6 applications: Hide buttons that launch gnome-software if it is not available
Fixes #417
2020-09-25 03:39:57 +00:00
Dmitry Sharshakov
b31520ae8b Disable the button for hidded Wi-Fi when Wi-Fi is turned off 2020-09-25 03:35:56 +00:00
Ian Douglas Scott
57a0f909d4 keyboard: fix gtk_widget_get_can_default assertion error
Occured when showing the "Replace" button.
2020-09-25 03:24:59 +00:00
Ian Douglas Scott
099426714c keyboard: Fix behavior of "Replace" when adding custom shortcut
In the shortcut editor, the "Replace" button is shown instead of "Set"
or "Add" when there is a collision. But this executes the same code as
"Set", so when adding a shortcut, it doesn't actually work.
2020-09-25 03:17:29 +00:00
Takao Fujiwara
5c0f6e1cde region: Search default input sources
The default input sources are not included in layout_rows_by_id or
engine_rows_by_id but in default_input_source_row of GtkListBoxRow.

https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1131
2020-09-25 03:09:06 +00:00
Jonathan Kang
918838f567 network: complete SAE support
Added WirelessSecuritySAE class to fully implement SAE support.
2020-09-25 02:06:52 +00:00
Bastien Nocera
12e2475e72 power: Remove WiMax handling
It's been deprecated and unsupported by NetworkManager since version 1.2
(current is 1.26).
2020-09-25 02:04:00 +00:00
Brandon Nielsen
9364deba3e Code cleanup as per HACKING. 2020-09-25 01:59:57 +00:00
Brandon Nielsen
68dca0e748 Consumers clean up the PPD list, not the dialog itself. 2020-09-25 01:59:57 +00:00
Brandon Nielsen
bee87f1b0a Spaces over tabs. 2020-09-25 01:59:57 +00:00
Brandon Nielsen
26e8f11566 component: PpPPDSelectionDialog
G_IS_OBJECT checks fail when calling g_signal_connect_object because
PpPPDSelectionDialog is a struct, not a type descending from G_OBJECT.

This makes the changes required for PpPPDSelectionDialog to be a
GObject, and defines PpPPDSelectionDialog as a GObject. It also updates
consumers of PpPPDSelectionDialog to destroy created PpPPDSelectionDialogs as GObjects.

https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1126
2020-09-25 01:59:57 +00:00
Arne
9225cd9364 sound: fix subwoofer slider 2020-09-25 01:53:44 +00:00
Robert Ancell
68042c95c1 printers: Use a shared PpCups object 2020-09-22 21:23:05 +00:00
Robert Ancell
f8204635ce printers: Fix location where GTask is unreffed 2020-09-22 21:23:05 +00:00
Robert Ancell
b25db4f601 printers: Don't pass PpJob references around
An internal GTask will hold a reference to it for the duration of the async calls.
2020-09-22 21:23:05 +00:00
Robert Ancell
f42d7cca9a printers: Don't pass PpNewPrinter references around
An internal GTask will hold a reference to it for the duration of the async calls.
2020-09-22 21:23:05 +00:00
Robert Ancell
9d0815bb90 printers: Don't pass PpCups references around
An internal GTask will hold a reference to it for the duration of the async calls.
2020-09-22 21:23:05 +00:00
Robert Ancell
519c390b04 printers: Don't pass PpHost references around
An internal GTask will hold a reference to it for the duration of the async calls.

Correctly unref these objects in finalize.
2020-09-22 21:23:05 +00:00
Robert Ancell
7ebf0f22aa printers: Don't pass PpSamba references around
An internal GTask will hold a reference to it for the duration of the async calls.
2020-09-22 21:23:05 +00:00
Robert Ancell
703d833e2f printers: Don't pass PpPrinter references around
An internal GTask will hold a reference to it for the duration of the async call.
2020-09-22 21:23:05 +00:00
Robert Ancell
e6a05e535e printers: Fix PpPrinter reference leaks
They were not unreferenced in the callback.
2020-09-22 21:23:05 +00:00
Robert Ancell
7c1f84b4d3 printers: Don't pass PpMaintenanceCommand references around
An internal GTask will hold a reference to it for the duration of the async call.
2020-09-22 21:23:05 +00:00
Robert Ancell
5f4599d649 printers: Don't pass GFile references around
An internal GTask will hold a reference to it for the duration of the async call.
2020-09-22 21:23:04 +00:00
Robert Ancell
f3bf0080d7 printers: Don't pass GDBusConnection references around
An internal GTask will hold a reference to it for the duration of the async call.
2020-09-22 21:23:04 +00:00
Robert Ancell
b2c5056031 printers: Use g_autoptr 2020-09-22 21:23:04 +00:00
Robert Ancell
ec23d22ada printers: Use g_clear_object 2020-09-22 21:23:04 +00:00
Gunnar Hjalmarsson
5aee280a29 common: Display locale @modifiers properly
Fixes GNOME/gnome-desktop#50
2020-09-21 13:13:10 +00:00
Bastien Nocera
eb79846c53 network: Fix missing prototype error
gnome-control-center/panels/network/net-device-wifi.c:1179:1: warning: no previous prototype for ‘nm_client_on_permission_change’ [-Wmissing-prototypes]
 1179 | nm_client_on_permission_change (NetDeviceWifi *self) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-09-16 10:11:48 -03:00
Ian Douglas Scott
ddfd582b72 region: Move preview of format to a widget 2020-09-15 22:19:55 +00:00
Ian Douglas Scott
0dce812e18 region: "move up" and "move down" buttons in input row menu
Implementation borrowed from cc-search-panel-row.c
2020-09-15 21:28:25 +00:00
Ian Douglas Scott
561a6b93dc region: Use popover for input source rows 2020-09-15 21:28:25 +00:00
Hui Wang
9b81e0ee45 sound: update the profile list after getting the signal from gvc
In the ubuntu 20.04, we found a regression on HDMI audio. We plug a
HDMI/DP monitor, the output device is the speaker in the output device
combo box, then we select the HDMI from the combo box, the output
device is switched to HDMI audio successfully, but the configuration
box is empty. This will not happen in the ubuntu 18.04, the profile
will show hdmi-stereo in this situation. So I think this is a
regression.

When problem happens, I could see the errors from log:
Gvc:    DEBUG: Matching profile for 'output:analog-stereo' is '(null)'
Gvc:    DEBUG: Matching profile for 'output:analog-stereo' is '(null)'
Gvc:    DEBUG: Matching profile for 'output:analog-stereo' is '(null)'

Through debugging, I found the cc_profile_combo_box_set_device() is
called too early. In the ubuntu 18.04, this function is called after
pulseaudio changes the active_profile, but in the ubuntu 20.04, it is
called ahead of pulseaudio changes the active_profile.

To fix it, add a signal callback function, after pulseaudio changes
the active_profile, this callback function will be called, then call
cc_profile_combo_box_set_device().

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2020-09-16 09:10:02 +12:00
Mohammed Sadiq
55ea4cabda datetime: Implement the new time-date editor dialog design 2020-09-15 03:07:41 +00:00
Ian Douglas Scott
c3c5d724bd region: move input source ListBox code into it's own class 2020-09-14 22:07:36 +00:00
Felipe Borges
04211dd548 power: Hide "Suspend & Power Button" section when empty
Fixes #1075
2020-09-14 21:39:34 +00:00
Ian Douglas Scott
dc02c803c2 keyboard: Move row code to CcKeyboardShortcutRow
This adds a widget called `CcKeyboardShortcutRow`, sub-classing
`GtkListBoxRow`, to handle a shortcut row. This makes the implementation
a bit tidier, rather than handling it all in `CcKeyboardPanel`, and
allows the widgets that compose the row to be laid out in xml.

This is a prerequisite for moving the shortcuts to a new dialog.
2020-09-14 17:19:33 +00:00
Ian Douglas Scott
67cb508802 keyboard: Refactoring of CcKeyboardItem handling of multiple combos
This commit includes all the changes that seem to be necessary for
CcKeyboardItem to be used for dealing with multiple keybindings, without
(yet) changing the user interface to expose this.

The `primary_combo` and `binding` fields of `CcKeyboardItem` are
removed, in favor of the existing `key_combos`. No combination is
"primary", since all of them can now be seen and changed equally.

We treat `CcKeyboardItem.key_combos` as a set, that a combo can be added
to or removed from. Though it continues to be represented as a `GList`,
instead of a `GHashTable`, to preserve ordering.

A lot of the keyboard panel code relied on the assumption that only one
combo can be set for each setting, so this required a variety of
miscellaneous changes.
2020-09-14 17:19:33 +00:00
Carlos Garnacho
6782bc07db display: Hook to PanelOrientationManaged for accelerometer checks
This property gives means for Mutter to determine who is in charge of
display rotation for the built-in panel (us or Mutter). The UI must
reflect this change.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1018
2020-09-05 08:03:44 +00:00