diff options
author | Bastien Nocera <hadess@hadess.net> | 2010-10-28 13:14:43 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2010-10-28 13:14:43 +0100 |
commit | 61cdc580c9594799395a3d5a366cfbd9cce76116 (patch) | |
tree | 68f3e11ccc50bcb4d22d80f227100033c8514698 /wizard/main.c | |
parent | 8e08765e45471f93ea0c9b396c76f450585dfa62 (diff) | |
download | gnome-bluetooth-61cdc580c9594799395a3d5a366cfbd9cce76116.tar.gz |
wizard: Make it compile with latest GApplication
This also fixes the window just getting task bar attention, instead
of popping up in front of the user.
Diffstat (limited to 'wizard/main.c')
-rw-r--r-- | wizard/main.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/wizard/main.c b/wizard/main.c index 350fa2fb..054ad543 100644 --- a/wizard/main.c +++ b/wizard/main.c @@ -985,11 +985,10 @@ create_wizard (void) } static void -activated_cb (GtkApplication *app, - GVariant *variant, - gpointer user_data) +activate_cb (GApplication *app, + gpointer user_data) { - gtk_window_present (GTK_WINDOW (user_data)); + gtk_window_present_with_time (GTK_WINDOW (user_data), GDK_CURRENT_TIME); } static GOptionEntry options[] = { @@ -1016,8 +1015,15 @@ int main (int argc, char **argv) return 1; } - app = gtk_application_new ("org.gnome.Bluetooth.wizard", &argc, &argv); - if (g_application_is_remote (G_APPLICATION (app))) { + app = gtk_application_new ("org.gnome.Bluetooth.wizard", G_APPLICATION_FLAGS_NONE); + if (g_application_register (G_APPLICATION (app), NULL, &error) == FALSE) { + g_warning ("Could not register application: %s", error->message); + g_error_free (error); + return 1; + } + + if (g_application_get_is_remote (G_APPLICATION (app))) { + g_application_activate (G_APPLICATION (app)); gdk_notify_startup_complete (); return 0; } @@ -1046,10 +1052,10 @@ int main (int argc, char **argv) gtk_application_add_window (app, GTK_WINDOW (window_assistant)); - g_signal_connect (app, "activated", - G_CALLBACK (activated_cb), window_assistant); + g_signal_connect (app, "activate", + G_CALLBACK (activate_cb), window_assistant); - gtk_application_run (app); + g_application_run (G_APPLICATION (app), argc, argv); bluetooth_plugin_manager_cleanup (); |