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

@@ -97,7 +97,6 @@ activate (GApplication *application)
{
CallsApplication *self = (CallsApplication *)application;
GtkApplication *app = (GtkApplication *)application;
CallsCallWindow *call_window;
GtkWindow *window;
g_assert (GTK_IS_APPLICATION (app));
@@ -112,12 +111,7 @@ activate (GApplication *application)
* window. In that case, GTK+ frees the resources right.
*/
window = GTK_WINDOW (calls_main_window_new (app, self->provider));
call_window = calls_call_window_new (app);
g_signal_connect_swapped (window, "call-added",
G_CALLBACK (calls_call_window_add_call), call_window);
g_signal_connect_swapped (window, "call-removed",
G_CALLBACK (calls_call_window_remove_call), call_window);
calls_call_window_new (app, self->provider);
}
gtk_window_present (window);