The previous code would have leaked all the UpDevice objects because no
free function was set on the returned GPtrArray.
Since we already depend on upower-glib 0.99.8 which is the release in
which get_devices() was deprecated and get_devices2() was introduced, we
can simply switch to get_devices2() which does set a free function on
the returned GPtrArray, stopping the leak.
* Add another vertical size group handling only battery
rows.
* Add more vertical margins to the battery rows -- set
to 16px and 14px, respectivelly, the top and bottom
margins.
* Increase spacing between battery level and labels to
10px.
* Increase spacing between titles and subtitles to 4px.
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/553
This factorizes the row creation a bit and normalizes the margins and
spacing, reducing the required width. This also makes labels like row
titles and descriptions ellipsizable so the rows can reach narrower
widths.
The pending-charge state means AC power is on but the battery is not
being charged. This can happen because its charge is above a certain
threshold, to avoid short charging cycles and prolong the battery's
life, or because the PSU is not powerful enough to charge the batteries.
Instead of lying to the user about something being estimated, we should
simply tell the truth and set the label to "Not Charging".
Closes: #249.
The code to lookup or insert items into the combobox had a few issues.
It would assume that the items are sorted, causing existing items to not
be found and be inserted instead. It also would simply forget to insert
an item if it was larger than all existing items.
This code is now changed to iterate over all items, finding the best
insertion point in the process (next item has a larger value, or the
values are not increasing anymore). The item will only be inserted if it
has not been found.
Fixes#261
The Wi-Fi and mobile broadband row's visibility depends on related
device status. But calling gtk_widget_show_all on the whole list box
makes them visible even related device is not avialbe. Fix that by
setting no-show-all of these two widgets as TRUE.
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/189
Objects created using the object storage API are not disposed when the panel
that created them is disposed. In order to prevent segfaults we need to manually
disconnect signal handler connected to these objects or we can do it
automatically using g_signal_connect_object.
Fixes: https://launchpad.net/bugs/1797205
The code must not access the passed panel if the operation to create the
keyboard proxy has been cancelled. This fixes a possible crash when
switching away from the power panel.
The battery power level level bars are using the default offsets for low, high and full battery level, 0.25, 0.75 and 1.0.
Based on the suggestion from #68, this commit changes the high and full offset to 0.1 and 0.8, and the low battery level offset to 0.03 for primary batteries and UPSs, and 0.05 for other batteries and devices.
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/68
Some of the current string related to saving power by
turning something off are ambiguous, and can mean both
"yes, turn off" or "yes, keep it on" at the same time.
This commit slightly rewords those sentences in order
to disambiguate them.
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/53
[skip ci]
When a setting is set to a value that's not in the list of options, add
that custom value to the drop-down for the duration of the run, so as to
avoid the last item being selected and causing confusion.
https://bugzilla.gnome.org/show_bug.cgi?id=793448
Fix a use-after-free while creating the dbus proxy for
org.gnome.SettingsDaemon.Power.Keyboard. This fix is identical to the
previous fix for the screen proxy.
https://bugzilla.gnome.org/show_bug.cgi?id=794089
Another use-after-free on cancellation crash.
#0 g_type_check_instance_cast (type_instance=type_instance@entry=0x1eac3c0, iface_type=32150864) at /glib/gobject/gtype.c:4057
#1 0x0000000000494077 in got_screen_proxy_cb (source_object=<optimized out>, res=0x1eceab0, user_data=user_data@entry=0x1eac3c0)
at panels/power/cc-power-panel.c:1083
https://bugzilla.gnome.org/show_bug.cgi?id=789464
Show the "desktop" style dialogue ("Automatic suspend, when idle") even
when we have devices with batteries in use. We need "power supply"
batteries to consider the device as a laptop, or UPS-powered machine.
https://bugzilla.gnome.org/show_bug.cgi?id=793509
Ensure that the vertical spacing inside each panel is similar.
This makes the transition between each panel smoother and makes
the control center feel more cohesive.
Settings panels are given 32px above and below their content
and 32px vertical space between major sections. 12px space is
placed below headings.
Bluetooth, displays and printers are not addressed.
https://bugzilla.gnome.org/show_bug.cgi?id=786384
This toggle is always set to off when the panel is opened. We should
check whether it's on or not when opening the panel. Currently we are
only subscribed to changes, so we don't check the wifi state until it's
toggled on or off after the panel has been opened the first time.
https://bugzilla.gnome.org/show_bug.cgi?id=771564
They should probably have been unsigned integers, but they're not, so
warn if they are. The rest of the code handles negative values as if
they were 0.
https://bugzilla.gnome.org/show_bug.cgi?id=771542
We now ask logind whether the system can suspend or hibernate, and
change the visibility of the items in the panel based on that.
Based on a patch by Mario Sanchez Prada <mario@endlessm.com>.
https://bugzilla.gnome.org/show_bug.cgi?id=764508
When running on something other than a VM or a tablet, which have
hard-coded actions when the power button is pressed, offer to configure
the power button to either suspend (default), hibernate, or do nothing.
https://bugzilla.gnome.org/show_bug.cgi?id=757880
On panel construction, we trigger asynchronous creation of a GDBusProxy
for the IIO sensors daemon and one for the Screen g-s-d interface.
Since there's no guarantee we'll have the screen proxy ready by the time
the IIO proxy is constructed, guard for (priv->screen_proxy != NULL), or
we'll hit a critical.
https://bugzilla.gnome.org/show_bug.cgi?id=754735