+2005-04-12 Nikolay V. Shmyrev <nshmyrev@yandex.ru>
+
+ * backend/ev-page-cache.c: (ev_page_cache_next_page):
+
+ Fix for #300233. Next page correctly handles document end.
+
+ * shell/ev-sidebar-thumbnails.c: (ev_sidebar_thumbnails_dispose),
+ (ev_sidebar_thumbnails_class_init),
+ (ev_sidebar_thumbnails_set_document),
+ (ev_sidebar_thumbnails_clear_job),
+ (ev_sidebar_thumbnails_clear_model):
+
+ Cleanup thumbnail jobs on document changes.
+
+ * shell/ev-view.c: (add_scroll_binding_keypad),
+ (add_scroll_binding_shifted), (ev_view_class_init):
+
+ Shift + Space scrolls up. Fix for #173184
+
+ * shell/ev-window.c: (ev_window_open_page),
+ (ev_window_cmd_view_reload):
+
+ Fix reload (Bug #300094)
+
2005-04-09 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
{
g_return_val_if_fail (EV_IS_PAGE_CACHE (page_cache), FALSE);
- if (page_cache->current_page >= page_cache->n_pages)
+ if (page_cache->current_page >= page_cache->n_pages - 1)
return FALSE;
ev_page_cache_set_current_page (page_cache, page_cache->current_page + 1);
#define EV_SIDEBAR_THUMBNAILS_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_SIDEBAR_THUMBNAILS, EvSidebarThumbnailsPrivate));
+static void
+ev_sidebar_thumbnails_clear_model (EvSidebarThumbnails *sidebar);
+
+static void
+ev_sidebar_thumbnails_dispose (GObject *object)
+{
+ EvSidebarThumbnails *sidebar_thumbnails = EV_SIDEBAR_THUMBNAILS (object);
+
+ ev_sidebar_thumbnails_clear_model (sidebar_thumbnails);
+
+ G_OBJECT_CLASS (ev_sidebar_thumbnails_parent_class)->dispose (object);
+}
+
static void
ev_sidebar_thumbnails_class_init (EvSidebarThumbnailsClass *ev_sidebar_thumbnails_class)
{
g_object_class = G_OBJECT_CLASS (ev_sidebar_thumbnails_class);
gtk_object_class = GTK_OBJECT_CLASS (ev_sidebar_thumbnails_class);
+ g_object_class->dispose = ev_sidebar_thumbnails_dispose;
+
g_type_class_add_private (g_object_class, sizeof (EvSidebarThumbnailsPrivate));
}
loading_icon = ev_document_misc_get_thumbnail_frame (width, height, NULL);
- gtk_list_store_clear (priv->list_store);
+ ev_sidebar_thumbnails_clear_model (sidebar_thumbnails);
for (i = 0; i < n_pages; i++) {
EvJob *job;
gchar *page_label;
}
+static gboolean
+ev_sidebar_thumbnails_clear_job (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer data)
+{
+ EvJob *job;
+
+ gtk_tree_model_get (model, iter, COLUMN_JOB, &job, -1);
+
+ if (job != NULL) {
+ ev_job_queue_remove_job (job);
+ g_signal_handlers_disconnect_by_func (job, thumbnail_job_completed_callback, data);
+ g_object_unref (job);
+ }
+
+ return FALSE;
+}
+
+static void
+ev_sidebar_thumbnails_clear_model (EvSidebarThumbnails *sidebar_thumbnails)
+{
+ EvSidebarThumbnailsPrivate *priv = sidebar_thumbnails->priv;
+
+ gtk_tree_model_foreach (GTK_TREE_MODEL (priv->list_store), ev_sidebar_thumbnails_clear_job, sidebar_thumbnails);
+ gtk_list_store_clear (priv->list_store);
+}
+
+
}
static void
-add_scroll_binding (GtkBindingSet *binding_set,
- guint keyval,
- GtkScrollType scroll,
- gboolean horizontal)
+add_scroll_binding_keypad (GtkBindingSet *binding_set,
+ guint keyval,
+ GtkScrollType scroll,
+ gboolean horizontal)
{
guint keypad_keyval = keyval - GDK_Left + GDK_KP_Left;
G_TYPE_BOOLEAN, horizontal);
}
+static void
+add_scroll_binding_shifted (GtkBindingSet *binding_set,
+ guint keyval,
+ GtkScrollType scroll_normal,
+ GtkScrollType scroll_shifted,
+ gboolean horizontal)
+{
+ gtk_binding_entry_add_signal (binding_set, keyval, 0,
+ "scroll_view", 2,
+ GTK_TYPE_SCROLL_TYPE, scroll_normal,
+ G_TYPE_BOOLEAN, horizontal);
+ gtk_binding_entry_add_signal (binding_set, keyval, GDK_SHIFT_MASK,
+ "scroll_view", 2,
+ GTK_TYPE_SCROLL_TYPE, scroll_shifted,
+ G_TYPE_BOOLEAN, horizontal);
+}
+
static void
ev_view_jump (EvView *view,
GtkScrollType scroll)
binding_set = gtk_binding_set_by_class (class);
- add_scroll_binding (binding_set, GDK_Left, GTK_SCROLL_STEP_BACKWARD, TRUE);
- add_scroll_binding (binding_set, GDK_Right, GTK_SCROLL_STEP_FORWARD, TRUE);
- add_scroll_binding (binding_set, GDK_Up, GTK_SCROLL_STEP_BACKWARD, FALSE);
- add_scroll_binding (binding_set, GDK_Down, GTK_SCROLL_STEP_FORWARD, FALSE);
+ add_scroll_binding_keypad (binding_set, GDK_Left, GTK_SCROLL_STEP_BACKWARD, TRUE);
+ add_scroll_binding_keypad (binding_set, GDK_Right, GTK_SCROLL_STEP_FORWARD, TRUE);
+ add_scroll_binding_keypad (binding_set, GDK_Up, GTK_SCROLL_STEP_BACKWARD, FALSE);
+ add_scroll_binding_keypad (binding_set, GDK_Down, GTK_SCROLL_STEP_FORWARD, FALSE);
- add_scroll_binding (binding_set, GDK_Page_Up, GTK_SCROLL_PAGE_BACKWARD, FALSE);
- add_scroll_binding (binding_set, GDK_Page_Down, GTK_SCROLL_PAGE_FORWARD, FALSE);
+ add_scroll_binding_keypad (binding_set, GDK_Page_Up, GTK_SCROLL_PAGE_BACKWARD, FALSE);
+ add_scroll_binding_keypad (binding_set, GDK_Page_Down, GTK_SCROLL_PAGE_FORWARD, FALSE);
- add_scroll_binding (binding_set, GDK_space, EV_SCROLL_PAGE_FORWARD, FALSE);
- add_scroll_binding (binding_set, GDK_BackSpace, EV_SCROLL_PAGE_BACKWARD, FALSE);
+ add_scroll_binding_shifted (binding_set, GDK_space, EV_SCROLL_PAGE_FORWARD, EV_SCROLL_PAGE_BACKWARD, FALSE);
+ add_scroll_binding_shifted (binding_set, GDK_BackSpace, EV_SCROLL_PAGE_BACKWARD, EV_SCROLL_PAGE_FORWARD, FALSE);
}
static void
void
ev_window_open_page (EvWindow *ev_window, int page)
{
- if (ev_window->priv->page_cache)
- ev_page_cache_set_current_page (ev_window->priv->page_cache, page);
+ if (ev_window->priv->page_cache) {
+ page = CLAMP (page, 0, ev_page_cache_get_n_pages (ev_window->priv->page_cache));
+ ev_page_cache_set_current_page (ev_window->priv->page_cache, page);
+ }
}
void
g_return_if_fail (EV_IS_WINDOW (ev_window));
-#if 0
- /* FIXME: uncomment when this is written.*/
- page = ev_page_cache_get_page (ev_window->priv->page_cache);
-#else
- page = 1;
-#endif
+ page = ev_page_cache_get_current_page (ev_window->priv->page_cache);
uri = g_strdup (ev_window->priv->uri);
ev_window_open (ev_window, uri);