Mention actions in the libunique migration guide

This commit is contained in:
Matthias Clasen
2010-10-31 22:14:53 -04:00
parent 54a5e37136
commit a3f19ddae8

View File

@ -106,22 +106,28 @@ main (int argc, char *argv[])
<section><title>Commands and Messages</title> <section><title>Commands and Messages</title>
<para> <para>
libunique lets you send messages with commands to a running libunique lets you send messages with commands to a running
instance using unique_app_send_message(). GApplication does not instance using unique_app_send_message(). The commands can be either
have a direct equivalent for this feature at this time, but predefined or custom. Some of the predefined libunique commands have
some of the predefined libunique commands have equivalents in equivalents in GApplication. Instead of sending the %UNIQUE_ACTIVATE
GApplication. Instead of sending the %UNIQUE_ACTIVATE command, command, call g_application_activate(), instead of sending the
call g_application_activate(), instead of sending the
%UNIQUE_OPEN command, call g_application_open(). The %UNIQUE_OPEN command, call g_application_open(). The
%UNIQUE_NEW and %UNIQUE_CLOSE and user-defined commands don't %UNIQUE_NEW and %UNIQUE_CLOSE and user-defined commands don't
have direct replacement at this time. have direct replacement at this time.
</para> </para>
<para> <para>
On the other hand, GApplication supports passing entire As a replacement for custom commands, GApplication implements the
commandlines to the running instance, which reduces the need #GActionGroup interface and lets you add a group of actions with
for user-defined commands. And GDBus makes it very easy to g_application_set_action_group(). The actions can then be invoked,
implement D-Bus interfaces for communication between either by using the D-Bus interface for #GAction directly, or by
application instances, see e.g. g_dbus_connection_register_object(). calling g_action_group_activate_action() from another instance of
the GApplication. The #GApplication documentation contains an
example for using GApplication with actions.
</para>
<para>
For more complex needs, GApplication supports passing entire
commandlines to the running instance.
</para> </para>
</section> </section>
</chapter> </chapter>