Rename GtkApplicationEndStyle
Call it EndSession to make it clearer what this is about.
This commit is contained in:
@ -7013,7 +7013,7 @@ GtkApplicationInhibitFlags
|
|||||||
gtk_application_inhibit
|
gtk_application_inhibit
|
||||||
gtk_application_uninhibit
|
gtk_application_uninhibit
|
||||||
gtk_application_is_inhibited
|
gtk_application_is_inhibited
|
||||||
GtkApplicationEndStyle
|
GtkApplicationEndSessionStyle
|
||||||
gtk_application_end_session
|
gtk_application_end_session
|
||||||
|
|
||||||
<SUBSECTION>
|
<SUBSECTION>
|
||||||
|
@ -668,6 +668,15 @@ gtk_application_class_init (GtkApplicationClass *class)
|
|||||||
G_STRUCT_OFFSET (GtkApplicationClass, quit),
|
G_STRUCT_OFFSET (GtkApplicationClass, quit),
|
||||||
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
|
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GtkApplication::register-session:
|
||||||
|
*
|
||||||
|
* Set this property to %TRUE to register with the session manager
|
||||||
|
* and receive the #GtkApplication::quit signal when the session
|
||||||
|
* is about to end.
|
||||||
|
*
|
||||||
|
* Since: 3.4
|
||||||
|
*/
|
||||||
g_object_class_install_property (object_class, PROP_REGISTER_SESSION,
|
g_object_class_install_property (object_class, PROP_REGISTER_SESSION,
|
||||||
g_param_spec_boolean ("register-session",
|
g_param_spec_boolean ("register-session",
|
||||||
P_("Register session"),
|
P_("Register session"),
|
||||||
@ -1161,8 +1170,8 @@ gtk_application_startup_session_dbus (GtkApplication *app)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* GtkApplicationInhibitFlags:
|
* GtkApplicationInhibitFlags:
|
||||||
* @GTK_APPLICATION_INHIBIT_LOGOUT: Inhibit logging out (including shutdown
|
* @GTK_APPLICATION_INHIBIT_LOGOUT: Inhibit ending the user session
|
||||||
* of the computer)
|
* by logging out or by shutting down the computer
|
||||||
* @GTK_APPLICATION_INHIBIT_SWITCH: Inhibit user switching
|
* @GTK_APPLICATION_INHIBIT_SWITCH: Inhibit user switching
|
||||||
* @GTK_APPLICATION_INHIBIT_SUSPEND: Inhibit suspending the
|
* @GTK_APPLICATION_INHIBIT_SUSPEND: Inhibit suspending the
|
||||||
* session or computer
|
* session or computer
|
||||||
@ -1190,8 +1199,10 @@ gtk_application_startup_session_dbus (GtkApplication *app)
|
|||||||
* that should not be interrupted, such as creating a CD or DVD. The
|
* that should not be interrupted, such as creating a CD or DVD. The
|
||||||
* types of actions that may be blocked are specified by the @flags
|
* types of actions that may be blocked are specified by the @flags
|
||||||
* parameter. When the application completes the operation it should
|
* parameter. When the application completes the operation it should
|
||||||
* call g_application_uninhibit() to remove the inhibitor.
|
* call g_application_uninhibit() to remove the inhibitor. Note that
|
||||||
* Inhibitors are also cleared when the application exits.
|
* an application can have multiple inhibitors, and all of the must
|
||||||
|
* be individually removed. Inhibitors are also cleared when the
|
||||||
|
* application exits.
|
||||||
*
|
*
|
||||||
* Applications should not expect that they will always be able to block
|
* Applications should not expect that they will always be able to block
|
||||||
* the action. In most cases, users will be given the option to force
|
* the action. In most cases, users will be given the option to force
|
||||||
@ -1199,7 +1210,7 @@ gtk_application_startup_session_dbus (GtkApplication *app)
|
|||||||
*
|
*
|
||||||
* Reasons should be short and to the point.
|
* Reasons should be short and to the point.
|
||||||
*
|
*
|
||||||
* If a window is passed, the session manager may point the user to
|
* If @window is given, the session manager may point the user to
|
||||||
* this window to find out more about why the action is inhibited.
|
* this window to find out more about why the action is inhibited.
|
||||||
*
|
*
|
||||||
* Returns: A non-zero cookie that is used to uniquely identify this
|
* Returns: A non-zero cookie that is used to uniquely identify this
|
||||||
@ -1242,7 +1253,7 @@ gtk_application_inhibit (GtkApplication *application,
|
|||||||
&error);
|
&error);
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
g_warning ("Calling Inhibit failed: %s\n", error->message);
|
g_warning ("Calling Inhibit failed: %s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1312,7 +1323,7 @@ gtk_application_is_inhibited (GtkApplication *application,
|
|||||||
&error);
|
&error);
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
g_warning ("Calling IsInhibited failed: %s\n", error->message);
|
g_warning ("Calling IsInhibited failed: %s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1324,10 +1335,10 @@ gtk_application_is_inhibited (GtkApplication *application,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GtkApplicationEndStyle:
|
* GtkApplicationEndSessionStyle:
|
||||||
* @GTK_APPLICATION_LOGOUT: End the session by logging out.
|
* @GTK_APPLICATION_LOGOUT: End the session by logging out
|
||||||
* @GTK_APPLICATION_REBOOT: Restart the computer.
|
* @GTK_APPLICATION_REBOOT: Restart the computer
|
||||||
* @GTK_APPLICATION_SHUTDOWN: Shut the computer down.
|
* @GTK_APPLICATION_SHUTDOWN: Shut the computer down
|
||||||
*
|
*
|
||||||
* Different ways to end a user session, for use with
|
* Different ways to end a user session, for use with
|
||||||
* gtk_application_end_session().
|
* gtk_application_end_session().
|
||||||
@ -1352,9 +1363,9 @@ gtk_application_is_inhibited (GtkApplication *application,
|
|||||||
* Since: 3.4
|
* Since: 3.4
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gtk_application_end_session (GtkApplication *application,
|
gtk_application_end_session (GtkApplication *application,
|
||||||
GtkApplicationEndStyle style,
|
GtkApplicationEndSessionStyle style,
|
||||||
gboolean request_confirmation)
|
gboolean request_confirmation)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GTK_IS_APPLICATION (application), FALSE);
|
g_return_val_if_fail (GTK_IS_APPLICATION (application), FALSE);
|
||||||
g_return_val_if_fail (!g_application_get_is_remote (G_APPLICATION (application)), FALSE);
|
g_return_val_if_fail (!g_application_get_is_remote (G_APPLICATION (application)), FALSE);
|
||||||
|
@ -114,11 +114,11 @@ typedef enum {
|
|||||||
GTK_APPLICATION_LOGOUT,
|
GTK_APPLICATION_LOGOUT,
|
||||||
GTK_APPLICATION_REBOOT,
|
GTK_APPLICATION_REBOOT,
|
||||||
GTK_APPLICATION_SHUTDOWN
|
GTK_APPLICATION_SHUTDOWN
|
||||||
} GtkApplicationEndStyle;
|
} GtkApplicationEndSessionStyle;
|
||||||
|
|
||||||
gboolean gtk_application_end_session (GtkApplication *application,
|
gboolean gtk_application_end_session (GtkApplication *application,
|
||||||
GtkApplicationEndStyle style,
|
GtkApplicationEndSessionStyle style,
|
||||||
gboolean request_confirmation);
|
gboolean request_confirmation);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user