src: Give the Provider to the CallWindow on construction

This allows us to get rid of the signals on the MainWindow and
simplifies things dramatically.
This commit is contained in:
Bob Ham
2018-10-08 10:40:02 +00:00
parent 1843d72ad1
commit 9aa34cceff
4 changed files with 110 additions and 65 deletions

View File

@@ -60,14 +60,6 @@ enum {
static GParamSpec *props[PROP_LAST_PROP];
enum {
SIGNAL_CALL_ADDED,
SIGNAL_CALL_REMOVED,
SIGNAL_LAST_SIGNAL,
};
static guint signals [SIGNAL_LAST_SIGNAL];
static void
about_action (GSimpleAction *action,
GVariant *parameter,
@@ -175,8 +167,6 @@ info_response_cb (GtkInfoBar *infobar,
static void
add_call (CallsMainWindow *self, CallsCall *call)
{
g_signal_emit (self, signals[SIGNAL_CALL_ADDED], 0, call);
g_signal_connect_swapped (call, "message",
G_CALLBACK (show_message), self);
}
@@ -188,8 +178,6 @@ 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);
show_message(self, reason, GTK_MESSAGE_INFO);
}
@@ -345,28 +333,6 @@ 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);