Commit graph

30 commits

Author SHA1 Message Date
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
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
Marco Melorio
46021b152d shell: Remove sidebar subpages support from panels
They are now unused and they should not be used anymore in new panels.
2023-09-22 11:45:02 +00:00
Alice Mikhaylenko
4e75534b2e Port sidebar widget to AdwNavigationView 2023-08-25 08:00:43 +00:00
Alice Mikhaylenko
4680f362f3 Port to AdwNavigationSplitView 2023-08-25 08:00:43 +00:00
Benjamin Berg
cfc5fdb7c6 shell: Deactivate old panel before creating new one
We need to cancel internal operations before starting to create a new
panel, otherwise panels might be creating the same object for the cache
in parallel and this is not supported by the object cache.

The alternative to this would be to handle this inside the object
store to allow parallel creation of the same key.

Fixes: #1685
2022-06-20 03:18:30 +00:00
Georges Basile Stavracas Neto
4073c881d1 panel: Remove cc_panel_get_title_widget
This is now unused.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
d2d3669d34 panel: Add titlebar to panels
Make CcPanel override GtkBuildable, and special-case two types
of children: "content" for the main content, and "titlebar" for
the titlebar. Those two child types exist merely for convenience,
since it's still possible to override the entire panel with
adw_bin_set_child().

For now, no panel is using any of these conveniences.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
7476bef815 panel: Add 'folded' property
This property keeps track of whether the panel is folded
into the main leaflet. Will be used when moving headerbars
into the panel themselves.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
0818bf469c panel: Port to GTK4
Inherit AdwBin.
2021-12-14 22:34:21 -03:00
Robert Ancell
93b14a4339 panel: Move shared GCancellable code into panel class
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
2020-02-03 09:36:24 +13:00
Georges Basile Stavracas Neto
6541c128df
trivial: Update code style 2018-11-16 15:19:08 -02:00
Georges Basile Stavracas Neto
75167f45fd
panel: Add get_sidebar_widget() vfunc
This vfunc is the entry point for panels that have
a sidebar widget. It must never return NULL.

At this point, nothing uses it and this vfunc does
not impact execution of the program.
2018-11-16 15:19:08 -02:00
Georges Basile Stavracas Neto
93209fafab
panel: Remove useless get_type() function
It is already declared by G_DECLARE_DERIVABLE_TYPE().
2018-11-16 15:18:59 -02:00
Robert Ancell
c0f41daff0 shell: Remove the lock button from the shell
Only the date time panel used it, all other panels add their own shell using
cc_shell_embed_widget_in_header which was added after the date time panel was
written. Update the date time panel to use this method.
2018-10-18 00:25:40 +00:00
Georges Basile Stavracas Neto
10cf920fef panel-loader: Add support for static init functions
Static init functions are functions that initialize resources
or monitor daemons without needing any contextual information,
such as a CcPanel instance or access to a CcShell implementation.

These functions are meant to be used for monitoring a panel's
visibility, when it makes sense. Usually, panels that represent
hardware that potentially is not available or is not supported
should hide itself.

Following this commit, the Wi-Fi panel panel will be adapted as
the first user of this new API. Other panels that require this
functionality will be adapted later.
2018-05-29 16:09:51 -03:00
Georges Basile Stavracas Neto
a78cbe3963 model: Add visibility field
This field can be used to communicate the visibility of the
panel from a static context (i.e. without any instances of
a CcPanel nor any access to CcShell).
2018-05-29 16:09:51 -03:00
Georges Basile Stavracas Neto
b261bcaf99 panel: Update code style
This is just an almost-trivial commit that ports
CcPanel to use the latest code practices around.
2018-05-29 16:07:04 -03:00
Carlos Garnacho
b24ccb9415 shell: Add cc_panel_get_title_widget() vmethod
So the panel implementations will be able to set a custom widget
in the shell headerbar. It defaults to NULL, so by default panels
set the plain label with the panel title.
2016-11-04 23:26:23 +01:00
Georges Basile Stavracas Neto
61d7abe795 shell: add a autocleanup function to CcPanel
CcPanel uses the old boilerplate code from GLib,
which does not set an autocleanup function.

The lack of a cleanup function implies that panels
cannot use G_DECLARE_{FINAL,DERIVABLE}_TYPE, making
the code stick to the old boilerplate.

This patch adds a cleanup function to CcPanel. It doesn't
move CcPanel to G_DECLARE_DERIVABLE_TYPE() because it'd
break the CcPanel's subclasses.

https://bugzilla.gnome.org/show_bug.cgi?id=769063
2016-07-26 11:24:26 -03:00
Christophe Fergeau
c84722248e shell: Revert "Let panels have their own commandline flags"
This reverts commit 31a8a99440.

This was meant for bgo#695885 which has stalled for a while, so this
feature has no in-tree user. This commit removes it for now, this can be
readded when users for it materialize.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:49:34 +02:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Emanuele Aina
31a8a99440 shell: Let panels have their own commandline flags
Add a class method to CcPanel to get a GOptionGroup which will be added
to the main commandline parser. This gives panels the chance to have
commandline "--flags" in addition to the already available parameters.

This changes changes the way parameters are passed to panels: the first
entry in the GVariant array is always the a{sv} dictionary of
commandline flags, followed by the remaining free-form arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=696054
2013-04-03 18:09:11 +02:00
Giovanni Campagna
0139f68416 shell: replace GMenu loading code with an hardcoded list of panels
Now that we don't allow or load external panels, using libgnome-menu is just
overengineering. We can get the same results with less code by keeping a static
list of function pointers.
This reduces the number of places one needs to patch to add a new panel.
Also, this way we avoid registering all types at startup, and if we want
we can switch to load panel desktop files in a separate thread.

https://bugzilla.gnome.org/show_bug.cgi?id=690165
2012-12-18 16:46:27 +01:00
Bastien Nocera
3686cf7eb8 shell: Make all control-center plugins static
This makes loading faster, with less I/O, avoids unnecessary
code duplication (around 1k lines shaved), and ensures that
all the panels link and work appropriately.

By the same token, it will stop external panels from being
created, and loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=690036
2012-12-11 17:07:39 +01:00
Ray Strode
b0e7a5efa8 panels: add register macro
Bastien says he doesn't like the blank class_finalize
functions in every panel and he would like a wrapper
macro to hide them.

This commit does that.
2012-08-21 14:32:33 -04:00
Florian Müllner
6827068ade cc-panel: Add get_help_uri() vfunc
We want to allow panels to point to a specific help page, so add
a vfunc for that.

https://bugzilla.gnome.org/show_bug.cgi?id=675471
2012-05-18 18:48:37 +02:00
Bastien Nocera
27c45abda3 shell: Merge libgnome-control-center into main binary
This fixes problems with the CcEditableEntry type not being
registered and causing the printers and user-accounts panels not to
work. As we do not need to work on Windows, we do not need to split
out the library.
2011-11-07 18:03:14 +00:00
Renamed from libgnome-control-center/cc-panel.h (Browse further)