Commit graph

29 commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
eda492aab4 application: Remove empty override
The :dispose handler was just chaining up, so remove it.
2018-01-21 10:36:59 -02:00
Georges Basile Stavracas Neto
ed75703936 application: Modernize codebase
This commit ports CcApplication to use the modern
code practices and utilities, removing the boilerplate
macros. Namely, this commit introduces:

 * G_DECLARE_FINAL_TYPE
 * Remove unnecessary private field
 * Unifies parameter layout
2018-01-21 10:31:07 -02:00
Georges Basile Stavracas Neto
682bec8dd1 application: Use gtk_show_uri_on_window
Instead of the deprecated gtk_show_uri.
2018-01-21 10:24:53 -02:00
Georges Basile Stavracas Neto
3632bc7dad window: Remove unnecessary wrapper functions
These were only used by CcApplication, and at this level
of the program we don't need to use any wrapper functions,
since we're certain that the CcWindow is a GtkWindow subclass.
2018-01-21 10:24:53 -02:00
Georges Basile Stavracas Neto
dc5e2fd555 application: Initialize clutter-gtk either with Cheese or Wacom
Both require clutter-gtk, but only Wacom was being checked. This would
make compiling with Cheese disabled fail.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-17 20:09:38 -02:00
Matthias Clasen
fde96cc691 shell: Add a help overlay
This explains the various keyboard shortcuts that are available
in the control-center.

See https://wiki.gnome.org/Initiatives/GnomeGoals/ShortcutWindows

https://bugzilla.gnome.org/show_bug.cgi?id=759320
2015-12-10 20:51:28 -05:00
Christophe Fergeau
3717e985eb shell: Don't call gtk_clutter_init() when using cheese
cheese_gtk_init() is called as well and will be taking care of that for
us.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:51:07 +02:00
Christophe Fergeau
a70172cfea shell: Move cheese_gtk_init() call earlier
Now that we handle local command line arguments, the 'command_line'
vfunc can no longer get the initial argc/argv passed to the process.
Now, cheese_gtk_init() is called unconditionally from main()
where argc/argv are available.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:51:07 +02:00
Christophe Fergeau
3f586c4a95 shell: Handle --version as a regular argument
It was handled through a callback calling exit(). Now that we have a
handle-local-options callback, we can handle it as a regular argument
from there.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:51:07 +02:00
Christophe Fergeau
b484470e56 shell: Handle --list from the local instance
This is an help-like parameter, so we want its output to show up in the
terminal from which gnome-control-center was just started, not from the
terminal from which the main gnome-control-center instance was started.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:51:06 +02:00
Christophe Fergeau
b3138a4c0f shell: Connect to "handle-local-options" signal
https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:50:48 +02:00
Christophe Fergeau
e8485dea69 shell: Parse command line args into a GVariantDict
Since we are using g_application_add_main_option, we can remove the
global variable used to parse the arguments into, and get the parsed
arguments from the GVariantDict returned by
g_application_command_line_get_options_dict().
This is in preparation for handling some command line options in the
local gnome-control-center instance, and others in the remote instance.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:49:40 +02:00
Christophe Fergeau
750bb5158d shell: Use g_application_add_main_option_entries
Since GApplication provides this API, we can as well use it, this will
be useful in order to correctly split option handling between the local
instance and the main instance.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:49:40 +02:00
Christophe Fergeau
0db5500232 shell: Don't handle --help ourselves
GOption can handle --help for us, so we don't need to reimplement this
ourselves. This causes a small regression as starting a main
gnome-control-center instance and then running gnome-control-center
--help will cause the main instance-control-center to exit. This will be
fixed in the following patches, and this fixes the opposite bug:
if gnome-control-center is not running, gnome-control-center --help
would not exit after displaying the help before this commit.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:49:40 +02:00
Christophe Fergeau
c33ac8bca9 shell: Fix GVariantBuilder leak
When a GVariantBuilder is created with g_variant_builder_new(), it must
be unref'ed with g_variant_builder_unref() when no longer needed. In
this case, we can just use a local stack-allocated GVariantBuilder to
avoid the leak.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:49:40 +02: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
Rui Matos
1df796ac28 printers: Drop remaining deprecated API usage
https://bugzilla.gnome.org/show_bug.cgi?id=740986
2015-01-08 19:04:53 +01:00
Rui Matos
52c27cd672 shell: Drop deprecated API usage
https://bugzilla.gnome.org/show_bug.cgi?id=740986
2015-01-06 16:17:36 +01:00
Cosimo Cecchi
73137e2071 application: activate application when launching a panel
This ensures the control-center window is correctly presented if the
application is already running when the action is activated.

https://bugzilla.gnome.org/show_bug.cgi?id=721969
2014-01-13 09:21:47 -08:00
Matthias Clasen
beea258891 Handle repeated commandline parsing properly
The control-center may call g_option_context_parse repeatedly,
so we need to reset the static variables used to hold the parsing
results, otherwise things like the search string may leak from
a previous parsing run.
https://bugzilla.gnome.org/show_bug.cgi?id=700362
2013-05-18 18:07:21 -04:00
Joaquim Rocha
d78bc9772a wacom: Re-write gui_gtk in Clutter to introduce animations
The name of the file was also changed to calibratorgui.c/h to avoid
it being inconsistent, this way it is no longer dependent on the
the technology.

https://bugzilla.gnome.org/show_bug.cgi?id=667797
2013-05-17 16:36:59 +02:00
Bastien Nocera
015cd17f96 shell: Remove obsolete libnotify dependency
The notification code to open the firewall ports was removed
in commit 45ba8e89e8, but libnotify
was still initialised.

https://bugzilla.gnome.org/show_bug.cgi?id=697035
2013-04-12 11:39:36 +02:00
Emanuele Aina
ab0576f1f0 shell: Expose panel launching with DBus-activation
Turn Control Center in a DBus-activable service and export a
'launch-panel' GAction which accepts a tuple containing the id of the
desired panel and its parameters as a GVariant array.

The snippet below show how the custom shortcuts section of the keyboard
panel can be invoked by a external programs through DBus:

GVariantBuilder *flags = g_variant_builder_new (G_VARIANT_TYPE_VARDICT);
GVariantBuilder *params = g_variant_builder_new (G_VARIANT_TYPE ("av"));
g_variant_builder_add (params, "v", g_variant_builder_end (flags));
g_variant_builder_add (params, "v", g_variant_new_string ("shortcuts"));
g_variant_builder_add (params, "v", g_variant_new_string ("custom"));
GVariant *v = g_variant_new ("(s@av)", "keyboard", g_variant_builder_end (params));

GApplication *gnomecc = g_application_new (id, G_APPLICATION_IS_LAUNCHER);
if (!g_application_register (gnomecc, NULL, &error))
  g_error ("Failed to register launcher for %s: %s", id, error->message);
g_action_group_activate_action (G_ACTION_GROUP (gnomecc), "launch-panel", v);

https://bugzilla.gnome.org/show_bug.cgi?id=696054
2013-04-03 18:09:15 +02: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
Emanuele Aina
9977bb200e shell: Use GVariant to convey panel arguments instead of a string array
By using a GVariant of type "av" we can potentially pass more structured
data to panels, which will become relevant with the ability to invoke
them by GAction-based DBus-activation introduced in the following patch.

https://bugzilla.gnome.org/show_bug.cgi?id=696054
2013-04-03 18:02:10 +02:00
Jeremy Bicha
dd73671c24 shell: build fix (clutter-gtk includes)
Building without cheese broke with commit 64467d7

https://bugzilla.gnome.org/show_bug.cgi?id=694118
2013-02-18 15:20:44 -05:00
William Jon McCann
42974a3c8d shell: Rename shell window to CcWindow
This avoids the confusion of the name gnome-control-center.c and
is consistent with all the other classes/files in the project.

https://bugzilla.gnome.org/show_bug.cgi?id=692174
2013-02-18 16:40:44 +01:00
William Jon McCann
408ae4a87c shell: Make the main app window a subclass of GtkApplicationWindow
This allows for better encapsulation of window logic. In order to
do this CcShell was made an interface instead of an abstract base
class.

https://bugzilla.gnome.org/show_bug.cgi?id=692174
2013-02-18 16:40:44 +01:00
William Jon McCann
64467d7f0a shell: Make the application a GtkApplication subclass
This promotes better encapsulation and allows us to move
application logic out of main() and rename the confusingly
named control-center.c to main.c

https://bugzilla.gnome.org/show_bug.cgi?id=692174
2013-02-18 16:40:44 +01:00
Renamed from shell/control-center.c (Browse further)