restrict-applications-dialog: Use close-request

Instead of delete-event. Pretty straightforward, 1:1 port to this
new signal.
This commit is contained in:
Georges Basile Stavracas Neto 2022-07-08 17:22:04 -03:00
parent 977b82f681
commit 8a8fe7b346
3 changed files with 6 additions and 9 deletions

View File

@ -4,7 +4,6 @@
<requires lib="gtk+" version="3.12"/>
<template class="MctRestrictApplicationsDialog" parent="AdwPreferencesWindow">
<property name="title" translatable="yes">Restrict Applications</property>
<property name="skip-taskbar-hint">True</property>
<property name="default-width">500</property>
<property name="default-height">500</property>
<property name="search-enabled">False</property>

View File

@ -125,9 +125,8 @@ static void on_restrict_applications_action_activated (GSimpleAction *action,
GVariant *param,
gpointer user_data);
static gboolean on_restrict_applications_dialog_delete_event_cb (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
static gboolean on_restrict_applications_dialog_close_request_cb (GtkWidget *widget,
gpointer user_data);
static void on_set_age_action_activated (GSimpleAction *action,
GVariant *param,
@ -601,9 +600,8 @@ on_restrict_applications_action_activated (GSimpleAction *action,
}
static gboolean
on_restrict_applications_dialog_delete_event_cb (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
on_restrict_applications_dialog_close_request_cb (GtkWidget *widget,
gpointer user_data)
{
MctUserControls *self = MCT_USER_CONTROLS (user_data);
@ -1003,7 +1001,7 @@ mct_user_controls_class_init (MctUserControlsClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_restrict_installation_switch_active_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, on_restrict_web_browsers_switch_active_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, on_restrict_applications_dialog_delete_event_cb);
gtk_widget_class_bind_template_callback (widget_class, on_restrict_applications_dialog_close_request_cb);
}
static void

View File

@ -133,6 +133,6 @@
<property name="visible">False</property>
<property name="modal">True</property>
<property name="destroy-with-parent">False</property>
<signal name="delete-event" handler="on_restrict_applications_dialog_delete_event_cb" />
<signal name="close-request" handler="on_restrict_applications_dialog_close_request_cb" />
</object>
</interface>