Commit graph

18 commits

Author SHA1 Message Date
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)