mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-06 03:25:31 +00:00
main-window: Add the 'call-added' and 'call-removed' signals
These will be used in the next commit to notify of added and removed, which will be needed to display the calls in a secondary window.
This commit is contained in:
parent
bc6295f5fe
commit
7e2a1f376a
1 changed files with 34 additions and 0 deletions
|
@ -71,6 +71,14 @@ enum {
|
|||
static GParamSpec *props[PROP_LAST_PROP];
|
||||
|
||||
|
||||
enum {
|
||||
SIGNAL_CALL_ADDED,
|
||||
SIGNAL_CALL_REMOVED,
|
||||
SIGNAL_LAST_SIGNAL,
|
||||
};
|
||||
static guint signals [SIGNAL_LAST_SIGNAL];
|
||||
|
||||
|
||||
CallsMainWindow *
|
||||
calls_main_window_new (GtkApplication *application, CallsProvider *provider)
|
||||
{
|
||||
|
@ -262,6 +270,8 @@ add_call (CallsMainWindow *self, CallsCall *call)
|
|||
CallsCallHolder *holder;
|
||||
CallsCallDisplay *display;
|
||||
|
||||
g_signal_emit (self, signals[SIGNAL_CALL_ADDED], 0, call);
|
||||
|
||||
g_signal_connect_swapped (call, "message",
|
||||
G_CALLBACK (show_message), self);
|
||||
|
||||
|
@ -309,6 +319,8 @@ remove_call (CallsMainWindow *self, CallsCall *call, const gchar *reason)
|
|||
g_return_if_fail (CALLS_IS_MAIN_WINDOW (self));
|
||||
g_return_if_fail (CALLS_IS_CALL (call));
|
||||
|
||||
g_signal_emit (self, signals[SIGNAL_CALL_REMOVED], 0, call, reason);
|
||||
|
||||
found = find_call_holder (self, &n_items, &position, &holder,
|
||||
find_call_holder_by_call, call);
|
||||
g_return_if_fail (found);
|
||||
|
@ -566,6 +578,28 @@ calls_main_window_class_init (CallsMainWindowClass *klass)
|
|||
g_object_class_install_properties (object_class, PROP_LAST_PROP, props);
|
||||
|
||||
|
||||
signals[SIGNAL_CALL_ADDED] =
|
||||
g_signal_new ("call-added",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE,
|
||||
1,
|
||||
CALLS_TYPE_CALL);
|
||||
|
||||
signals[SIGNAL_CALL_REMOVED] =
|
||||
g_signal_new ("call-removed",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE,
|
||||
2,
|
||||
CALLS_TYPE_CALL,
|
||||
G_TYPE_STRING);
|
||||
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/sm/puri/calls/ui/main-window.ui");
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, info);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, info_label);
|
||||
|
|
Loading…
Reference in a new issue