Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-window.c
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2005-08-15 04:41:30 (GMT)
committer Jonathan Blandford <jrb@src.gnome.org>2005-08-15 04:41:30 (GMT)
commit09458b5fc51b3504582e76a12b7a57cbba332ac0 (patch)
treeabdc6fb099a4fab1cd79f9bd7a32f32aa6142ec1 /shell/ev-window.c
parent6e5cbc7bbdd23310885fd983499008f544b269ee (diff)
* shell/ev-metadata-manager.c: (ev_metadata_manager_init): *
Mon Aug 15 00:40:21 2005 Jonathan Blandford <jrb@redhat.com> * pdf/ev-poppler.cc: * shell/ev-metadata-manager.c: (ev_metadata_manager_init): * shell/ev-view.c: (ev_view_rotate_left), (ev_view_set_rotation), (ev_view_get_rotation): * shell/ev-view.h: * shell/ev-window.c: (setup_view_from_metadata), (save_rotation_to_file), (ev_window_cmd_edit_rotate_left), (ev_window_cmd_edit_rotate_right): Fix rotation. Save it to disk.
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r--shell/ev-window.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index dc67739..a264cbc 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -956,6 +956,7 @@ setup_view_from_metadata (EvWindow *window)
GValue dual_page = { 0, };
GValue presentation = { 0, };
GValue fullscreen = { 0, };
+ GValue rotation = { 0, };
/* Window size */
if (!GTK_WIDGET_VISIBLE (window)) {
@@ -1018,6 +1019,25 @@ setup_view_from_metadata (EvWindow *window)
ev_window_run_fullscreen (window);
}
}
+
+ /* Rotation */
+ if (ev_metadata_manager_get (uri, "rotation", &rotation)) {
+ if (g_value_get_int (&rotation)) {
+ switch (g_value_get_int (&rotation)) {
+ case 90:
+ ev_view_set_rotation (view, 90);
+ break;
+ case 180:
+ ev_view_set_rotation (view, 180);
+ break;
+ case 270:
+ ev_view_set_rotation (view, 270);
+ break;
+ default:
+ break;
+ }
+ }
+ }
}
void
@@ -2036,11 +2056,27 @@ ev_window_cmd_edit_toolbar_cb (GtkDialog *dialog, gint response, gpointer data)
gtk_widget_destroy (GTK_WIDGET (dialog));
}
+/* should these be hooked up to properties?? */
+static void
+save_rotation_to_file (EvWindow *window)
+{
+ int rotation;
+
+ if (window->priv->uri) {
+ rotation = ev_view_get_rotation (EV_VIEW (window->priv->view));
+ ev_metadata_manager_set_int (window->priv->uri, "rotation",
+ rotation);
+ }
+
+
+}
+
static void
ev_window_cmd_edit_rotate_left (GtkAction *action, EvWindow *ev_window)
{
ev_view_rotate_left (EV_VIEW (ev_window->priv->view));
ev_sidebar_thumbnails_refresh (EV_SIDEBAR_THUMBNAILS (ev_window->priv->sidebar_thumbs));
+ save_rotation_to_file (ev_window);
}
static void
@@ -2048,6 +2084,7 @@ ev_window_cmd_edit_rotate_right (GtkAction *action, EvWindow *ev_window)
{
ev_view_rotate_right (EV_VIEW (ev_window->priv->view));
ev_sidebar_thumbnails_refresh (EV_SIDEBAR_THUMBNAILS (ev_window->priv->sidebar_thumbs));
+ save_rotation_to_file (ev_window);
}
static void