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.
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.
`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.
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
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
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.
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
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>
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.
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.