printer_set_ppd_async and printer_set_ppd_file_async copy the printer name, but
this isn't freed in any cases that use these callback (the string isn't even
used at all).
When swicthing configurations, we should ensure that the selected scale
is valid. This is complicated by the fact that it depends on other
factors whether we need a single global scale or not.
Try to retain the scale that monitors have if possible. If that does not
work, try to use the old scale of the primary monitor everywhere. This
should result in a good behaviour in most situations.
Co-authored-by: Stéphane Travostino <steph@combo.cc>
Fixes: #1038
01874f7 added this `gtk_widget_show (label)` call, which seems to be
erroneous. The previous `g_object_new()` call had `"visible", FALSE,`.
It should only be shown when searching panels. This fixes that,
restoring the older behavior.
Use g_steal_pointer() on task in get_bus_cb() in pp-printer.c
to not invalidate a pointer passed to a DBus call.
Cleanup the task in callback of the DBus call.
The previous code was leaking a string (job title), used an integer pointer
instead of an integer for an id and requited a lot of memory management for a
string array. There was a lot of boilerplate code required for property
management which was not being used much. This is why type safe methods are a
much better idea than GObject properties. :)
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
It simplifies the code, and allows us to have some consistency
between projects (either inside and outside GNOME, mind you).
I took the liberty to rename and reword some of the options so
that they actually describe which ones are optional, and also
which ones are hard dependencies detected at build time.
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