From 481a284b5bee27b139689cb8bf9ff8eac15b1cd5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Aliste?= Date: Wed, 1 Sep 2010 17:12:03 -0400 Subject: [PATCH] [shell] Add DBUS DocumentLoaded signal to EvWindow See bug #626561. --- shell/ev-window.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/shell/ev-window.c b/shell/ev-window.c index 5b6cb785..19a404e4 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -349,6 +349,7 @@ static void ev_window_media_player_key_pressed (EvWindow *windo static void ev_window_update_max_min_scale (EvWindow *window); #ifdef ENABLE_DBUS static void ev_window_emit_closed (EvWindow *window); +static void ev_window_emit_doc_loaded (EvWindow *window); #endif static guint ev_window_n_copies = 0; @@ -1544,6 +1545,7 @@ ev_window_load_job_cb (EvJob *job, if (!ev_job_is_failed (job)) { ev_document_model_set_document (ev_window->priv->model, document); + ev_window_emit_doc_loaded (ev_window); setup_chrome_from_metadata (ev_window); update_chrome_actions (ev_window); setup_document_from_metadata (ev_window); @@ -6614,6 +6616,35 @@ ev_window_emit_closed (EvWindow *window) g_dbus_connection_flush_sync (connection, NULL, NULL); } +static void +ev_window_emit_doc_loaded (EvWindow *window) +{ + GDBusConnection *connection; + GError *error = NULL; + + if (window->priv->dbus_object_id <= 0) + return; + + connection = ev_application_get_dbus_connection (EV_APP); + if (!connection) + return; + + g_dbus_connection_emit_signal (connection, + NULL, + window->priv->dbus_object_path, + EV_WINDOW_DBUS_INTERFACE, + "DocumentLoaded", + g_variant_new("(s)", window->priv->uri), + &error); + if (error) { + g_printerr ("Failed to emit DBus signal DocumentLoaded: %s\n", + error->message); + g_error_free (error); + + return; + } +} + static void method_call_cb (GDBusConnection *connection, const gchar *sender, @@ -6652,6 +6683,9 @@ static const char introspection_xml[] = "" "" "" + "" + "" + "" "" ""; -- 2.43.5