Commit graph

746 commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
6295831fff
window: Add panel's sidebar widget to sidebar
When opening a panel, add its sidebar widget to the sidebar.
2018-11-16 19:24:49 -02:00
Georges Basile Stavracas Neto
de15083e7a
panel-list: Rename internal function
It was referring to listbox, where in the future
it is going to refer to any kind of widget.
2018-11-16 15:19:09 -02:00
Georges Basile Stavracas Neto
b02bc2a935
panel-list: Replace set_view() by go_previous()
Instead of directly selecting the view that the panel
list will have, let it decide which is the previous
view instead.

This does not change anything functionality wise, but
in the future where we have sidebar widget (and thus
the main window does not control which view the sidebar
is display) this will be important.
2018-11-16 15:19:09 -02: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
3e9425aee3
panel: Remove size negotiation machinery overrides
These overrides were added eight years ago, as a port from
GTK3's size_request() deprecation, in commit f5f5aac5c0.

These overrides are not necessary these days, since they
just reproduce the default behavior now.

Remove these overrides then.
2018-11-16 15:18:59 -02:00
Georges Basile Stavracas Neto
62743ab47e
window: Factor out function to find panel iter
It will be used by the next commits to look for the panel
name. That is because the panel name is what will be used
as the first headerbar title of panels with a sidebar widget.
2018-11-16 15:18:59 -02:00
Georges Basile Stavracas Neto
7e2865131b
panel: Remove unused macro 2018-11-16 15:18:59 -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
Georges Basile Stavracas Neto
c4c901f95d
panel-list: Dynamically show Details/Devices row
This is just a nicety for the test mode; when there are no
panels added under those categories, do not show the rows.
2018-11-11 23:46:07 -02:00
Georges Basile Stavracas Neto
14583e9630
build: Reorganize shell libraries and dependencies
This commit does a few different bit interwined things to the
build steps:

 * Make libtestshell and gnome-control-center share more of the
   variables and resouces;
 * Use 'dependencies' instead of 'link_with' for libshell;
 * Add some visual marks as comments;
2018-11-11 23:44:38 -02:00
Georges Basile Stavracas Neto
9a2c5dc41b
panel-loader: Document public functions
Add documentation comments to the public functions, which
has the additional benefit of adding visual marks for
public functions and making it easier to navigate through
this file.
2018-11-11 23:42:00 -02:00
Georges Basile Stavracas Neto
19bd9b8a89
build: Add more files to libshelltest
These will be used by the test panels.
2018-11-11 23:42:00 -02:00
Georges Basile Stavracas Neto
62d3fb95ff
panel-loader: Allow overriding panel vtable
In order to introduce test panels, which are a nice to have
feature before actually moving to working on the custom
widget on sidebar feature, add a way to override the panels
vtable and load whatever panels we might want.
2018-11-11 23:42:00 -02:00
Georges Basile Stavracas Neto
867a35dc89
panel-loader: Simplify listing panels
Instead of enumerating them, putting that in a GList, then
iterating the GList printing the panel names, simply print
them while enumerating.
2018-11-11 23:42:00 -02:00
Georges Basile Stavracas Neto
31a5d55896
panel-loader: Reorder functions
Put the externally visible functions at the bottom, and
the static functions at the top.
2018-11-11 23:42:00 -02:00
Georges Basile Stavracas Neto
d1fe090bf4
panel-loader: Rename all_panels to default_panels 2018-11-11 23:41:59 -02:00
Georges Basile Stavracas Neto
6a50a21f40
panel-loader: Define vtable struct in the header
We will allow test panels to be added, so the vtable must
be overridable. The first step into making it overridable
is exposing the actual vtable struct.
2018-11-11 23:41:59 -02:00
Georges Basile Stavracas Neto
9d88b84788
panel-loader: Assert get_type() function
Be more strict about the get_type() availability - we cannot
run without it.
2018-11-11 23:41:59 -02:00
Georges Basile Stavracas Neto
a6c983d499
panel-loader: Use #pragma once
Saves use a few lines of code.
2018-11-11 23:41:59 -02:00
Georges Basile Stavracas Neto
81fa6f18b0
build: Alphabetically sort source files
Trivial cleanup.
2018-11-11 23:41:57 -02:00
Robert Ancell
4e6b341edc build: Update bug URL to gitlab.gnome.org 2018-11-12 09:56:16 +13:00
Carlos Garnacho
d51336c2c2 wacom: Port calibrator UI to GTK+
Same dog, different collar. The UI has been ported 1:1 to GTK+, using
GtkBuilder, CSS and event controllers fairly reduced the amount of code
needed for this.

It also allows us to stop initializing clutter-gtk across the several
executables.
2018-11-07 23:02:10 +00: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
Robert Ancell
58d5c9411d shell: Remove AppMenu
https://wiki.gnome.org/Initiatives/GnomeGoals/AppMenuRetirement
2018-10-17 22:14:27 +00:00
Robert Ancell
f3e642da56 shell: Drop unused no-show-all properties 2018-10-11 22:21:34 +00:00
Corentin Noël
a6acc98371 common: fix some wrong autofree uses
g_autofree an array only g_free the first element, GStrv is the string array type.
2018-10-11 14:50:38 +13:00
Georges Basile Stavracas Neto
94f00aecf9 object-cache: Fix function documentation name 2018-09-25 21:02:11 -03:00
Georges Basile Stavracas Neto
2987b7bf5e object-cache: Add more debug messages
Enough to ask users to run Settings with "G_MESSAGES_DEBUG=all"
and get some meaningful output.
2018-09-25 21:01:14 -03:00
Georges Basile Stavracas Neto
3668140dd3 object-cache: Assert task_data before using it
It is not useful to assert that task_data != NULL after
using it to build the D-Bus key.

Move the assertion to before it is first used and get
rid of this inconsistency.
2018-09-25 20:46:22 -03:00
Georges Basile Stavracas Neto
7f5b5d6060 object-cache: Declare singleton instance as static
Otherwise, it is visible for other compile units. This
is a theoretical problem though, there's nothing wrong
happening right now.
2018-09-25 20:45:12 -03:00
Andrea Azzarone
d7857c113a object-storage: Check for cancellation before resulting in assert failure
As per doumentation: "It is a programming error to create an identical proxy
while asynchronously creating one. Not cancelling this operation will result in
an assertion failure when calling cc_object_storage_create_dbus_proxy_finish()."
In order to fullfill the second part we need to check for errors (including
cancellation ones) before we generate an assertion failure.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/158
2018-09-25 17:12:18 +02:00
Sam Hewitt
e6efc207e6 project: update desktop.in to reference new icon name 2018-09-12 21:30:52 +00:00
Florian Müllner
d5de9d86c9 model: Convert panel icons to symbolic variants if possible
Panel icons should be consistent between the app and corresponding
search results in GNOME Shell, but currently the former uses the
symbolic variant while the latter uses the colored version.

Address this by converting icons to their symbolic variants when
building the model rather than later when consuming them.

https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/151
2018-07-29 21:45:38 +00:00
Georges Basile Stavracas Neto
a8673b06c7 shell: Rename .ui files to match .c files
To keep it clean and well organized, rename the .ui files
(window.ui and panel-list.ui) to have the 'cc-' prefix and
match their .c counterparts.
2018-07-18 21:34:09 +00:00
Georges Basile Stavracas Neto
72924c6aba project: Remove unused files
The CcShellCategoryView and CcShellItemView were
residuals from the old shell there managed to stay
around unoticed.

Remove them from the project.
2018-07-15 10:59:27 -03:00
Sam Hewitt
b5f14731ba shell: update pixel_size of empty_search_placeholder icon to avoid aliasing 2018-07-10 18:02:18 -04:00
Bastien Nocera
0e2a4aa2d6 wacom: Hide Wacom panel when there are no tablets
Use GsdDeviceManager to monitor libwacom-supported tablets coming and
going. Hide the Wacom panel from the list when there's no supported
tablets plugged in.
2018-06-20 12:53:11 +00:00
Georges Basile Stavracas Neto
c89a919536 window: Remove unused panel box
Whenever a panel is activated, there is a GtkBox that
is added between the window and the panel itself.

Investigating the history of this field, it originally
appeared at ec7f8c9b when the window started using
widgets rather than page numbers. Apparently, it was a
GtkBox to help dealing with the GtkNotebook (which was
later changed to the current GtkStack).

The field was renamed from 'current_panel' to 'current_panel_box'
at ab435aa9. But since the transition to GtkStack, there
is no real need to use the GtkBox anymore.

This patch removes this GtkBox, and as a consequence, the
code is slightly simplified.
2018-06-18 11:33:02 -03:00
Georges Basile Stavracas Neto
6d3ed43e74 window: Remove custom widgets at the correct time
The correct time to remove custom widgets is precisely
after we checked if the panel can be activated, and before
creating the panel. We were not following that, and it was
causing the panels with header widgets to never actually
show their custom widgets.

Fix that by calling remove_all_custom_widgets() at the
correct point in panel creation.
2018-05-29 20:46:03 -03:00
Georges Basile Stavracas Neto
1d8faa2a73 window: Instrument some functions
This will help in debugging.
2018-05-29 20:44:21 -03:00
Georges Basile Stavracas Neto
f4b630030c panel-list: Properly select panels when changing views
When moving from and to different views, the first row
might be activated due to focus going to the listbox. This
wasn't a problem before because we couldn't hit that code
path, but now we can.

Fix that by always selecting the first visible row.
2018-05-29 19:20:44 -03:00
Georges Basile Stavracas Neto
62cfe91689 panel-list: Improve search behavior
There are a couple of small problems with the search
behavior here. First, if we select a panel from search
and leave it, it will continue to stay there forever.
Second, if panels change their visibility status during
runtime, the panel list wouldn't respond accordingly.
2018-05-29 18:03:05 -03:00
Georges Basile Stavracas Neto
a461045f37 window: Don't remove header widgets before changing panels
When changing panels, CcWindow can only remove the previous
panel's header widgets after making sure the new panel was
successfully set.

However, this is not the case, and when the current panel
fails to be set, the previous panel's header widget is
removed.

Fix that by waiting to remove the header widgets until the
panel is successfully set.
2018-05-29 16:09:51 -03:00
Georges Basile Stavracas Neto
4151af5ea2 wifi: Hide when no Wi-Fi adapter is available
It's WIP.
2018-05-29 16:09:51 -03: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
489a7ae5dd window: Delegate model creation to CcApplication
In order be able to modify panel information statically,
we need to have access to the CcShellModel from static
functions. CcApplication, thus, is a better place for the
model to live, since we can access it outside any scope
using g_application_get_default().

It also makes sense from the modeling point of view, since
the model is not tied to the shell anymore.
2018-05-29 16:09:49 -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
Georges Basile Stavracas Neto
6b334a8a00 window: Fix going back to previous panels
This never really worked on the new Setting layout
because it was historically implemented as "Back to
Overview", and we don't have an overview anymore.

This is fixed by morphing the implementation to be
"Back to previous panel", which forces us to actually
store the previous panel.
2018-05-28 22:23:35 -03:00