Commit graph

876 commits

Author SHA1 Message Date
Matthijs Velsink
98604e92ae shell, cc-panel: Remove unused struct member
The `subpage` struct member was previously used to communicate subpage
changes via a notify signal.

That's not done anymore, so we can remove it.
2024-05-27 08:00:46 +00:00
Matthijs Velsink
a10ca6d29a shell, cc-panel: Use GTYPE_TO_POINTER/GPOINTER_TO_GTYPE
A `GType` is not an integer, but either `size_t` or `uintptr_t`. So
casting it to int might lose bits of info, resulting in an invalid
`GType`.

Fixes #3062
2024-05-27 08:00:46 +00:00
Matthijs Velsink
6339f2e6d8 shell, cc-panel: Reuse set_subpage() for navigation.push
The `set_subpage()` function already has good error checking for valid
tags, so reuse that for the `navigation.push` action callback.

Note that this likely won't fix #3062, as there the tag must exist in
the hashtable, as `g_object_new()` won't crash if you pass `NULL` to it.
2024-05-27 08:00:46 +00:00
Automeris naranja
100474be23 cc-window: Stop setting default window size
Adw(Application)Window now has a default size[1], so
setting a default window size in Settings isn't
necessary anymore.

[1] 7a705c7959
2024-05-21 08:01:23 +00:00
Felipe Borges
ba74864b61 cc-panel: Require explicit "subpage" widget child type for subpages
Require the use of <child type="subpage"> for when an AdwNavigationPage
is expected to be added to CcPanel.navigation.

This way we can avoid programming errors when a child widget is wrongly
packed in the navigation view.

See also https://gitlab.gnome.org/GNOME/gnome-control-center/-/wikis/shell/CcPanel#child-packing

Co-authored-by: Matthijs Velsink <mvelsink@gnome.org>
2024-05-17 09:18:00 +00:00
Felipe Borges
baf3b3bb2b shell, cc-panel: Drop CcPanel.subpage property
CcPanel now handles subpage activation internally, so we no longer
need to make the subpage a public property.
2024-05-17 09:18:00 +00:00
Felipe Borges
725d2490af shell, cc-panel: Add CcPanel.add_static_subpage () method
So that we have an API for adding subpages that are build-conditional.
For example, CcPrivacy.bolt_page and CcPrivacy.location_page.

Normal static subpages should be statically defined in the respective
CcPanel .ui file.
2024-05-17 09:18:00 +00:00
Felipe Borges
d366789bfe shell, cc-panel: Add CcPanel.pop_visible_subpage () method 2024-05-17 09:18:00 +00:00
Felipe Borges
ae00f58136 shell, cc-panel: Add CcPanel.get_visible_subpage () method
So that hub panels can dynamically query what's been shown, since they
lost control over the navigation directly.

This is useful in Privacy, for example, where we check for the current
visible subpage to decide which documentation page to show.
2024-05-17 09:18:00 +00:00
Felipe Borges
12b93138e0 shell, cc-panel: Handle subpage navigation in CcPanel
When CcPanel.subpage is set it also now will check for the existence of
the subpage and handle its presenting itself.

This way hub panels will no longer need to do any static subpage
handling. (e.g. connecting to the "subpage" property).
2024-05-17 09:18:00 +00:00
Felipe Borges
efc6b2d50d shell, cc-panel: Add CcPanel.push_subpage method
So that CcPanel implementations have a method to add their subpages to
the builtin CcPanel.navigation.

Hub panels like System and Privacy have their main landing page composed
in an AdwNavigationPage. Therefore we overwrite the CcPanel.child setter
to add these pages to CcPanel.navigation instead of overwriting
CcPanel.child like we do for all the other panels.
2024-05-17 09:18:00 +00:00
Felipe Borges
522b04643e shell, cc-panel: Add mechanism to overwrite CcPanel.child setter
So that in the future we can pack children based on their types.
2024-05-17 09:18:00 +00:00
Felipe Borges
b01549f853 Shell, cc-panel: Bundle an AdwNavigationView in every CcPanel
So that in the future panels with subpages don't need to have their own
navigation views.

As of now this is useless as implementations of CcPanel will reset the
CcPanel.child object.
2024-05-17 09:18:00 +00:00
Felipe Borges
89c28d3f7f shell, cc-panel: Make CcPanel use gtk widget templates 2024-05-17 09:18:00 +00:00
Felipe Borges
6be167ce95 shell, cc-panel: Make CcPanel a derivable class
Rather than an abstract class, so that we can later provide a base implementation with widget templates.
2024-05-17 09:18:00 +00:00
Automeris naranja
9ed8e47e91 window: Port "Warning: Development Version" to AdwAlertDialog 2024-05-14 15:07:31 -03:00
Mohammed Sadiq
7007aaabe0 application: Specify that -v can be provided multiple times 2024-05-05 12:37:16 +05:30
Mohammed Sadiq
d35ad2b00d log: Increase default verbosity level
GLib shows g_message() and g_info() logs by default.
Let's do the same, so that a single -v shall show debug
logs.
2024-05-05 12:37:12 +05:30
Sam Hewitt
87569018c7 Drop orphaned symbolic assets 2024-04-29 11:07:20 -02:30
Automeris naranja
623909ccfa style: Add and use the .cc-placeholder-row style class
By creating a .cc-placeholder-row style class that
sets a padding, it won't be necessary to set margins
to every GtkLabel that is being used as list box
placeholder widgets.
2024-04-18 13:35:46 +00:00
Felipe Borges
b5768e4bf7 sharing, panel-loader: Hide "Sharing" panel when nothing to show
Since we started moving some settings from the Sharing panel to other
panels, we were left with only tree things in the Sharing panel for
gnome-46: hostname row, file sharing row, and media sharing row.

The hostname row is already in System ->About, so we should check
whether file-sharing or media-sharing are supported and show the panel
accordingly.

Fixes #2979
2024-04-18 10:26:17 +02:00
kramo
8b5df52d93 appdata: Update screenshots 2024-04-02 15:06:54 +00:00
Felipe Borges
bbfbfb76cb shell, window: Handle old panel cmdline arguments in System
The System panel subpages used to be CcPanels. They still have
their own desktop file so that they can be findable in Search.

A future goal is to decouple our Search model from our panel list
model, so that we can better handle panel subpages and other more
grained search results.

Fixes #2930
Fixes #2974
2024-03-27 13:38:46 +00:00
Felipe Borges
3ff371e61c shell, panel-list: Avoid accessing a negative array index
As the list of panels doesn't match the list of items in the model.
2024-03-27 13:38:46 +00:00
Automeris naranja
b7c1b671a0 application: Port AdwAboutWindow to AdwAboutDialog 2024-03-27 12:23:36 +00:00
Hari Rana
d9970d4f27 flatpak: Suffix app ID with .Devel
This commit changes the app ID from `org.gnome.SettingsDevel` to `org.gnome.Settings.Devel`, as recommended by the GNOME Developer Documentation - https://developer.gnome.org/documentation/tutorials/application-id.html#application-id-for-flatpak-development.

Additionally, some changes have been made in the buildsystem, to properly substitute the app ID depending on the profile in use.
2024-03-21 16:14:31 +00:00
Matthijs Velsink
32ccbab789 shell: All search words must match to find row
Now that we match against all words in the query, if any of them matches
with a row it is "found".

However, it is more useful if all of the words must match, as narrowing
down the results is much quicker that way.
2024-03-15 11:34:14 +00:00
Matthijs Velsink
394abe8cb3 shell: Do not match on empty strings
Splitting the search query on spaces results in empty strings if there
are double spaces in the query. These would always match.

Therefore, do not do anything with empty search words.
2024-03-15 11:34:14 +00:00
Matthijs Velsink
60794dfeda shell: Split search entry only once
There is no need to split a search entry for every row we want to match,
we can do it once when the search entry is updated.
2024-03-15 11:34:14 +00:00
Felipe Borges
216368db4b shell: Display search results for multiple query words
Before, queries like "remote desktop" were going through g_strstrip()
and turning alternative matches to "remote" or "desktop" unreachable.

See #2763
2024-03-15 11:34:14 +00:00
Felipe Borges
d62f048058 shell: Add CcShell.subpage string property 2024-03-12 10:03:07 +01:00
Felipe Borges
ec280a8755 shell-model, panel-loader: Add CC_CATEGORY_PRIVACY
This is supposed to classify pages that belong in the Privacy panel.
2024-03-12 09:42:14 +01:00
Automeris naranja
6d8edb80dc apps: Use AdwStatusPage when showing "No Apps Found"
The scrolling bug described in [1] and [2] doesn't
happen anymore. Apparently this was fixed in [3],
which stopped wrapping the status page inside
a GtkListBox.

Use AdwStatusPage again, since it makes the code
simpler.

[1] 1ae2c5295c
[2] https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/989#note_1837249
[3] e2b4896287
2024-03-11 16:12:16 +00:00
Matthijs Velsink
58c1e8fc47 metainfo: Update and add URLs
Initiatives#51 proposes to update and unify links in metainfo for GNOME
apps. We were using the old wiki link for translation and did not use
the welcome.gnome.org page for contributors.

Fix and add these links.

Closes #2938
2024-03-06 11:39:52 +00:00
Sophie Herold
fbb93a4dab metainfo: Fix wrong developer id
Appstream decided to use reversed domains. Please merge before 46 if possible.
2024-03-01 09:09:43 +00:00
Automeris naranja
0aeb0b55a7 general: Add translator comments about the "Search" term
Clarify in which occasions this term should be
phrased as a verb or as a noun.

Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2903
2024-02-29 13:48:20 +00:00
Automeris naranja
7dac08c29e cc-window: Minor cleanups/changes
- Remove a11y labels from buttons that
have tooltips, since Orca also reads tooltips
- Remove the .image-button style class, since
it's automatically added if a GtkMenuButton has
an icon[1]
- In property names that have more than 1 word,
use a hyphen minus symbol to separate the words
instead of an underscore

[1] https://docs.gtk.org/gtk4/class.MenuButton.html
2024-02-29 10:13:37 +00:00
Felipe Borges
d2b40f8dee shell: Load subpages in the CcShellModel
Setting their visibility only as search results.
2024-02-27 16:04:00 +00:00
Felipe Borges
049ac874ff shell, panel-list, window: Propagate subpage info
When the row is a subpage it has a parent_id, which should be activated
instead of panel_id. So we construct a parameters GVariant so that
panels can handle it.
2024-02-27 16:04:00 +00:00
Felipe Borges
8ea7a87168 shell-model, panel-loader: Add CC_CATEGORY_SYSTEM
This is supposed to classify pages that belong in the System panel.
2024-02-27 16:04:00 +00:00
Bastien Nocera
5748c50f44 shell: Fix typo in variable name
ellapsed -> elapsed
2024-02-05 10:59:13 +00:00
velsinki
6fba003ec9 shell: Don't set release notes on About window
Since !2212, the version for the about window is taken from the build
system. Since release notes in the appdata file can be outdated or
incomplete, showing them in the About window is not really needed.

So, don't set any release notes version, which also fixes a critical
warning when the version does not have release notes in the appdata
file.

Fixes #2779
2024-01-31 11:44:26 +01:00
Felipe Borges
0c04d14a36 shell: Show correct version in About dialog for development branches
Our AdwAboutWindow is initialized with values loaded from from the
appdata file. For development versions we often don't add appdata
info, causing AdwAboutWindow to fallback to the latest version
available in the appdata file.

This should not occur in a stable branch, but this occurs in
development branches.

Let's always call adw_about_window_set_version() so that we guarantee
that the right verion number is shown in the UI.

Fixes #2779
2024-01-30 17:20:16 +00:00
Felipe Borges
8def72a266 common: Introduce CcHostname
This object allows for panels to interact with systemd-hostnamed over
DBus using a simple API that abstracts the GVariant and DBus specifics
involved.
2024-01-30 13:34:10 +00:00
Felipe Borges
1c0fef5718 panel-list: Reorder panel list
This also drops the Categories as a criteria for creating the sidebar
list separators. Now the "panel_order" array will include entries named
"separator" to indicate where a separator should go.

See https://hedgedoc.gnome.org/FLcx6argT6uycE3An7uaxw
2024-01-22 09:47:00 +00:00
Sabri Ünal
1d1f95bb4d appdata: Improve appdata for AppStream 1.0
- Add the `<developer><name>` tag
- Mark the `<developer_name>` tag as deprecated
- Add appstreamcli validation
- Fix release version warnings
- Remove one of the custom Purism tag to pass the validation test
2024-01-08 15:48:19 +00:00
Hari Rana
03f7a6c8f0 about: Set copyright holder
The copyright year was retrieved by running `git log --reverse`, and picking the first commit (3c03b47392).
2024-01-08 14:01:51 +00:00
Felipe Borges
d52ec68f8d system: Add "Users" panel
This moves the UserAccounts panel to a page in the System panel.

This simplifies a lot of the existing code in the UserAccounts panel.

I did minimal changes to the sub dialogs so that those can be touched
in following changes, making it easier to review this one alone.

The main panel widget is now CcUsersPage, and is an AdwNavigationView
widget that has a default "current_user_page" page. Each page is a
CcUserPage (careful with the one-character difference between these
two classes).

Each CcUserPage has an associated ActUser object.
2024-01-08 13:59:26 +01:00
Hari Rana
2a75af4d48 primary-menu: Add mnemonics 2024-01-02 08:58:13 +00:00
Felipe Borges
a6538b26e1 appdata: Add "help" address
So that we can show the "Support Questions" row in AdwAboutWindow.
2023-12-01 13:06:43 +01:00