]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-window.c
shell: It's 2010 already!
[evince.git] / shell / ev-window.c
index e70e7eee84805ce23a020563fa84a7c9b4f265de..e5acd4089c2dbd64f5850e6746220383bc3fed80 100644 (file)
@@ -4646,7 +4646,7 @@ ev_window_cmd_help_about (GtkAction *action, EvWindow *ev_window)
                "name", _("Evince"),
                "version", VERSION,
                "copyright",
-               _("© 1996–2009 The Evince authors"),
+               _("© 1996–2010 The Evince authors"),
                "license", license_trans,
                "website", "http://www.gnome.org/projects/evince",
                "comments", comments,
@@ -6595,6 +6595,9 @@ ev_window_sync_source (EvWindow     *window,
 {
        GDBusConnection *connection;
        GError          *error = NULL;
+       guint32          timestamp;
+       gchar           *uri_input;
+       GFile           *input_gfile;
 
        if (window->priv->dbus_object_id <= 0)
                return;
@@ -6603,16 +6606,41 @@ ev_window_sync_source (EvWindow     *window,
        if (!connection)
                return;
 
+       timestamp = gtk_get_current_event_time ();
+       if (g_path_is_absolute (link->filename)) {
+               input_gfile = g_file_new_for_path (link->filename);
+       } else {
+               GFile *gfile, *parent_gfile;
+
+               gfile = g_file_new_for_uri (window->priv->uri);
+               parent_gfile = g_file_get_parent (gfile);
+
+               /* parent_gfile should never be NULL */
+               if (parent_gfile == NULL) {
+                       g_printerr ("Document URI is '/'\n");
+                       return;
+               }
+
+               input_gfile = g_file_get_child (parent_gfile, link->filename);
+               g_object_unref (parent_gfile);
+               g_object_unref (gfile);
+       }
+
+       uri_input = g_file_get_uri (input_gfile);
+       g_object_unref (input_gfile);
+
        g_dbus_connection_emit_signal (connection,
                                       NULL,
                                       window->priv->dbus_object_path,
                                       EV_WINDOW_DBUS_INTERFACE,
                                       "SyncSource",
-                                      g_variant_new ("(s(ii))",
-                                                     link->filename,
+                                      g_variant_new ("(s(ii)u)",
+                                                     uri_input,
                                                      link->line,
-                                                     link->col),
+                                                     link->col,
+                                                     timestamp),
                                       &error);
+       g_free (uri_input);
        if (error) {
                g_printerr ("Failed to emit DBus signal SyncSource: %s\n",
                            error->message);
@@ -6722,6 +6750,7 @@ static const char introspection_xml[] =
            "<signal name='SyncSource'>"
              "<arg type='s' name='source_file' direction='out'/>"
              "<arg type='(ii)' name='source_point' direction='out'/>"
+             "<arg type='u' name='timestamp' direction='out'/>"
            "</signal>"
             "<signal name='Closed'/>"
            "<signal name='DocumentLoaded'>"
@@ -6887,7 +6916,7 @@ ev_window_init (EvWindow *ev_window)
        gtk_widget_show (ev_window->priv->toolbar);
 
        /* Add the main area */
-       ev_window->priv->hpaned = gtk_hpaned_new ();
+       ev_window->priv->hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
        g_signal_connect (ev_window->priv->hpaned,
                          "notify::position",
                          G_CALLBACK (ev_window_sidebar_position_change_cb),