#include "ev-window.h"
#include "ev-window-title.h"
+#include "ev-navigation-action.h"
#include "ev-page-action.h"
#include "ev-sidebar.h"
#include "ev-sidebar-links.h"
#include "ev-file-helpers.h"
#include "ev-utils.h"
#include "ev-debug.h"
+#include "ev-history.h"
#ifdef WITH_GNOME_PRINT
#include "ev-print-job.h"
#include <gtk/gtkprintunixdialog.h>
#endif
+#ifdef ENABLE_PDF
#include <poppler.h>
+#endif
#include <glib/gstdio.h>
#include <glib/gi18n.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <gconf/gconf-client.h>
+#include "totem-scrsaver.h"
+
#include <string.h>
typedef enum {
GtkWidget *fullscreen_toolbar;
GtkWidget *fullscreen_popup;
guint fullscreen_timeout_id;
-
+
+ /* Screensaver */
+ TotemScrsaver *screensaver;
+
/* Popup link */
GtkWidget *view_popup;
EvLink *link;
gboolean unlink_temp_file;
EvDocument *document;
-
+ EvHistory *history;
EvPageCache *page_cache;
EvWindowPageMode page_mode;
EvWindowTitle *title;
#define PAGE_SELECTOR_ACTION "PageSelector"
#define ZOOM_CONTROL_ACTION "ViewZoom"
+#define NAVIGATION_ACTION "Navigation"
#define GCONF_OVERRIDE_RESTRICTIONS "/apps/evince/override_restrictions"
#define GCONF_LOCKDOWN_SAVE "/desktop/gnome/lockdown/disable_save_to_disk"
/* Toolbar-specific actions: */
ev_window_set_action_sensitive (ev_window, PAGE_SELECTOR_ACTION, has_pages);
ev_window_set_action_sensitive (ev_window, ZOOM_CONTROL_ACTION, has_pages);
+ ev_window_set_action_sensitive (ev_window, NAVIGATION_ACTION, has_pages);
ev_window_update_actions (ev_window);
}
gint page,
EvWindow *ev_window)
{
+ gchar *label;
+
ev_window_update_actions (ev_window);
+
+ if (ev_window->priv->history) {
+ label = ev_page_cache_get_page_label (ev_window->priv->page_cache, page);
+ ev_history_add_page (ev_window->priv->history, page, label);
+ g_free (label);
+ }
if (!ev_window_is_empty (ev_window))
ev_metadata_manager_set_int (ev_window->priv->uri, "page", page);
ev_page_action_set_document (EV_PAGE_ACTION (action), document);
ev_window_setup_action_sensitivity (ev_window);
+ if (ev_window->priv->history)
+ g_object_unref (ev_window->priv->history);
+ ev_window->priv->history = ev_history_new ();
+ action = gtk_action_group_get_action (ev_window->priv->action_group, NAVIGATION_ACTION);
+ ev_navigation_action_set_history (EV_NAVIGATION_ACTION (action), ev_window->priv->history);
+ ev_navigation_action_set_window (EV_NAVIGATION_ACTION (action), ev_window);
+
if (ev_window->priv->properties) {
ev_properties_dialog_set_document (EV_PROPERTIES_DIALOG (ev_window->priv->properties),
ev_window->priv->document);
window);
fullscreen_set_timeout (window);
+ totem_scrsaver_disable (window->priv->screensaver);
+
if (!ev_window_is_empty (window))
ev_metadata_manager_set_boolean (window->priv->uri, "presentation", TRUE);
}
window);
fullscreen_clear_timeout (window);
+ totem_scrsaver_enable (window->priv->screensaver);
+
if (!ev_window_is_empty (window))
ev_metadata_manager_set_boolean (window->priv->uri, "presentation", FALSE);
}
static char *
build_comments_string (void)
{
+#ifdef ENABLE_PDF
PopplerBackend backend;
const char *backend_name;
const char *version;
return g_strdup_printf (_("PostScript and PDF File Viewer.\n"
"Using poppler %s (%s)"),
version, backend_name);
+#else
+ return g_strdup_printf (_("Document Viewer."));
+#endif
}
static void
"name", _("Evince"),
"version", VERSION,
"copyright",
- _("\xc2\xa9 1996-2005 The Evince authors"),
+ _("\xc2\xa9 1996-2007 The Evince authors"),
"license", license_trans,
"website", "http://www.gnome.org/projects/evince",
"comments", comments,
priv->dest = NULL;
}
+ if (priv->history) {
+ g_object_unref (priv->history);
+ priv->history = NULL;
+ }
+
if (priv->fullscreen_timeout_id) {
g_source_remove (priv->fullscreen_timeout_id);
priv->fullscreen_timeout_id = 0;
G_CALLBACK (ev_window_cmd_edit_find_previous) },
{ "EditToolbar", NULL, N_("T_oolbar"), NULL, NULL,
G_CALLBACK (ev_window_cmd_edit_toolbar) },
- { "EditRotateLeft", "object-rotate-left", N_("Rotate _Left"), NULL, NULL,
+ { "EditRotateLeft", EV_STOCK_ROTATE_LEFT, N_("Rotate _Left"), NULL, NULL,
G_CALLBACK (ev_window_cmd_edit_rotate_left) },
- { "EditRotateRight", "object-rotate-right", N_("Rotate _Right"), NULL, NULL,
+ { "EditRotateRight", EV_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), NULL, NULL,
G_CALLBACK (ev_window_cmd_edit_rotate_right) },
/* View menu */
G_CALLBACK (zoom_control_changed_cb), window);
gtk_action_group_add_action (group, action);
g_object_unref (action);
+
+ action = g_object_new (EV_TYPE_NAVIGATION_ACTION,
+ "name", NAVIGATION_ACTION,
+ "label", _("Navigation"),
+ "is_important", TRUE,
+ "short_label", _("Back"),
+ "stock_id", GTK_STOCK_GO_DOWN,
+ "tooltip", _("Move across visited pages"),
+ NULL);
+ gtk_action_group_add_action (group, action);
+ g_object_unref (action);
}
static void
g_signal_connect_swapped (G_OBJECT (ev_window->priv->view), "drag-data-received",
G_CALLBACK (drag_data_received_cb),
ev_window);
-
+
+ /* Screensaver */
+
+ ev_window->priv->screensaver = totem_scrsaver_new ();
+
/* Set it user interface params */
ev_window_setup_recent (ev_window);