GtkStringObject and GtkStringList are perfect for adding strings to
things like an AdwComboRow. However, things like delay times are harder
to set up, as the underlying GSettings take integer values directly, and
so require mapping from strings to integers if GtkStringList would be
used.
Using an AdwEnumList is an option, but is not flexible as no new values
can be added, which is required if wanting to represent values that were
set to dconf (by the user or using older Settings version) which are not
in the enum.
To solve this, we add CcNumberObject, with a similar api to
GtkStringObject. It contains an integer value, and an (optional)
representing string and (optional) custom order. These objects are
stored in a CcNumberList which wraps a GListStore and implements
GListModel. It has convenient methods for adding values directly. The
CcNumberList is always sorted, either ascending or descending, but also
takes into account any special ordering of CcNumberObjects.
Properties of CcNumberList are set up so that "values" can be added in
.ui files with a simple array notation, and one "special-value"
CcNumberObject (with string and/or custom order) can be added in .ui
files as well.
Using CcNumberObjects/CcNumberList in an AdwComboRow is very easy, it
just requires a function that takes a CcNumberObject and returns a
string. Two example functions are provided, which assume the
CcNumberObject contains a time duration value in either seconds or
minutes.
In rows that have a "Copy" button that is set as activatable
widget, Orca doesn't the buttons a11y label/tooltip; instead,
it reads "[row title] push button".
To fix this, don't set these buttons as activatable widgets.
Also:
- Remove the AdwPreferencesPage description, since
it's redundant with the explanatory text provided in
button from the "File Sharing" row.
Reference:
cfb7cae4a9
In the File/Media Sharing dialogs, add a explanatory
text to the "File Sharing" and "Media Sharing" rows
explaining how these sharing features work.
Also, remove the AdwPreferencesPage description in
the "Media Sharing" dialog, since it's redundant
with the explanatory text provided in button from
the "Media Sharing" row.
Reference:
cfb7cae4a9
Set the AdwViewStack as the content widget of a single
AdwToolbarView instead of using an AdwToolbarView in
each AdwViewStackPage, as this is redundant.
Actions can be set in .ui files, but not callback actions. That's done
in the .c file anyways, but it was also put in the .ui file.
That used to be ignored, but since gtk!7121 that will generate a
warning.
So, remove that line.
Closes#3050
CcListRow is very similar to CcInfoRow:
- The "show-arrow" property is the equivalent of the "is-link"
property from CcInfoRow[1]
- The "secondary-label" is the equivalent of the "info" property
from CcInfoRow
- Setting the "activatable" property of CcListRow to "false" makes
the row to not be activatable just like CcInfoRow
Unlike CcListRow, CcInfoRow has the `expanded` property. However,
none of the CcInfoRows from the Apps panel are currently using it.
Also, CcInfoRow is specific to the Apps panel, while CcListRow is
used in many different panels
All of these things makes CcInfoRow redundant, so remove it and replace
all CcInfoRows with CcListRows.
[1] used together with the "has-expander" property
When the user clicks in an existing Bluetooth connection and in the
Connection Editor chooses to "Remove Connection", we should delete the
row from the Bluetooth list.
Currently the row doesn't get deleted because the code that is shared
among all network device types assumes every list to be a GtkBox, while
the Bluetooth device list is a GtkListBox.
Let's check what's the connection being removed and remove the device
from the Bluetooth listbox correctly.
The VPN list is sorted, but this sorting does not get updated when
changing any VPN name.
Make sure sorting gets retriggered by calling `gtk_list_box_row_changed()`
when updating the row contents.
GNOME Shell sorts VPNs in the quick settings, but GNOME Settings does
not. This can be particularly annoying with many saved VPNs.
Fix this by adding a sort function to the VPN GtkListBox.
Closes#510
The GtkListBox from the "Date & Time" dialog is
currently what gives the dialog width, but this
is an unusual approach that other dialogs from
Settings don't use.
To fix this, use the content-width property from
AdwDialog. The dialog width is now almost the same
as before this change.
The Month row is a CcListRow which displays the selected month
using the secondary-label property from CcListRow. However, the
month appears dimmed (because secondary-label uses the .dim-label
style class) and the Month row is supposed to mimick AdwComboRow,
which doesn't dim the selected item. To fix this, use an
AdwActionRow instead.
This improves consistency with "Required Permissions"
dialog which is already using property rows
(and System > About is using them too).
Also:
- Set more descriptive names in the rows from this
dialog to avoid confusion with other rows in the Apps
panel
- Remove the placeholder subtitles from the rows, as
their subtitle will be unconditionally set to either
"..." or the size
If the page is closed before the async call finishes, the page is
unreffed and gets disposed, resulting in a crash when the finish handler
is called, as it may try to access pointers of self that got set to NULL
in the disposer.
To prevent this, use the source object directly, which is guaranteed to
be alive during the call and callback. If self gets disposed during the
async call, we'll get a warning that the cancellable was cancelled
instead of a crash.
Fixes#3045
When the proxy switch is flipped from enabled to disabled, we assert
that there are no unmodified settings to be flushed to GSettings. This
is wrong because it's expected that settings will not be flushed if the
user did not yet press Save.
Fixes#2996
Adds `6GHz` to `Supported Frequencies` in Wi-Fi Details page.
Also removes `g_strdup()`, since the string is only passed to
`gtk_label_set_label()` anyways.
Resolves: #2474
The volume slider only has a page up/down increment of 1%, and can't be
moved with the arrow keys, but still consumes arrow key presses with a
beep sound.
Fix this by adding a step increment of 1%, and increasing the page
increment to 10%, as that one should be bigger. Do the same for the
subwoofer slider.
Furthermore, the balance slider has both a page and step increment that
are way too big to use effectively.
So, set the page and step increments also to 10% and 1%, respectively.
Stepping with arrow keys close to 0 requires rounding to avoid an
additional micro step, so let's add that as well.
"Searching networks" is incorrect, because the lack of the
preposition "for" implies that something is being searching
in networks, which isn't the case. This placeholder is
supposed to mean that networks are being searched/discovered.
See also: https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/merge_requests/186#note_2093252
The decision to disable was a reaction to the announcement of the
Mozilla Location Service shutdown. The goal was to give distros an
option to decide based on their own release schedule and support
lifetime.
Given that the issue of low accuracy in location might not turn out to
be a big issue for most of our users, let's turn "Location Services" ON
by default and instead let distros disable the feature if they desire.
Fixes#2959
Previously, the AdwComboRow for setting the delete period was titled
"Atomatically Delete Period." This commit fixes that small grammatic
typo to "Automatic Deletion Period."
Also other changes were made in response to a design review under the
merge request !2512.
Those aren't actionable for our users. Most of the information required
in these templates are for developers or designers familiar with the
development process.
This allows it to be read by screen readers.
Search for the subtitle of the row and add it to the described-by
relation, until we have a proper API for appending to a11y relations,
of course.
Fixes#3034