aboutsummaryrefslogtreecommitdiffstats
path: root/src/ppview-toolbar.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@.gnome.org>2003-08-14 03:17:03 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-08-14 03:17:03 +0800
commita85acf972a5cfa1b6cff927de2c74130d29928e2 (patch)
treeda8d3955f63114ef8215fab217a40114f6b38b33 /src/ppview-toolbar.c
parent2b694ee3289f08527ad278b811cdd76d8408cdb7 (diff)
downloadgsoc2013-epiphany-a85acf972a5cfa1b6cff927de2c74130d29928e2.tar
gsoc2013-epiphany-a85acf972a5cfa1b6cff927de2c74130d29928e2.tar.gz
gsoc2013-epiphany-a85acf972a5cfa1b6cff927de2c74130d29928e2.tar.bz2
gsoc2013-epiphany-a85acf972a5cfa1b6cff927de2c74130d29928e2.tar.lz
gsoc2013-epiphany-a85acf972a5cfa1b6cff927de2c74130d29928e2.tar.xz
gsoc2013-epiphany-a85acf972a5cfa1b6cff927de2c74130d29928e2.tar.zst
gsoc2013-epiphany-a85acf972a5cfa1b6cff927de2c74130d29928e2.zip
Do not show popups on print preview.
2003-08-13 Marco Pesenti Gritti <marco@.gnome.org> * src/ephy-window.c: (show_embed_popup): Do not show popups on print preview. * src/ppview-toolbar.c: (ppview_toolbar_set_window), (ppview_toolbar_init), (toolbar_cmd_ppv_goto_first), (toolbar_cmd_ppv_goto_last), (clamp_page_limits), (toolbar_cmd_ppv_go_back), (toolbar_cmd_ppv_go_forward): Use only known to work api to navigate.
Diffstat (limited to 'src/ppview-toolbar.c')
-rwxr-xr-xsrc/ppview-toolbar.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/ppview-toolbar.c b/src/ppview-toolbar.c
index 922b54a15..d08dbdece 100755
--- a/src/ppview-toolbar.c
+++ b/src/ppview-toolbar.c
@@ -256,6 +256,7 @@ ppview_toolbar_init (PPViewToolbar *t)
t->priv->window = NULL;
t->priv->ui_merge = NULL;
+ t->priv->current_page = 1;
for (i = 0; i < n_entries; i++)
{
@@ -336,6 +337,21 @@ toolbar_cmd_ppv_goto_last (EggMenuMerge *merge,
toolbar_update_sensitivity (t);
}
+static int
+clamp_page_limits (PPViewToolbar *t, int page)
+{
+ EphyWindow *window = t->priv->window;
+ EphyEmbed *embed;
+ int pages;
+
+ embed = ephy_window_get_active_embed (window);
+ g_return_val_if_fail (embed != NULL, -1);
+
+ ephy_embed_print_preview_num_pages (embed, &pages);
+
+ return CLAMP (page, 1, pages);
+}
+
static void
toolbar_cmd_ppv_go_back (EggMenuMerge *merge,
PPViewToolbar *t)
@@ -346,11 +362,11 @@ toolbar_cmd_ppv_go_back (EggMenuMerge *merge,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_embed_print_preview_navigate (embed,
- PRINTPREVIEW_PREV_PAGE,
- 0);
+ t->priv->current_page = clamp_page_limits (t, t->priv->current_page - 1);
- t->priv->current_page --;
+ ephy_embed_print_preview_navigate (embed,
+ PRINTPREVIEW_GOTO_PAGENUM,
+ t->priv->current_page);
toolbar_update_sensitivity (t);
}
@@ -365,11 +381,11 @@ toolbar_cmd_ppv_go_forward (EggMenuMerge *merge,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_embed_print_preview_navigate (embed,
- PRINTPREVIEW_NEXT_PAGE,
- 0);
+ t->priv->current_page = clamp_page_limits (t, t->priv->current_page + 1);
- t->priv->current_page ++;
+ ephy_embed_print_preview_navigate (embed,
+ PRINTPREVIEW_GOTO_PAGENUM,
+ t->priv->current_page);
toolbar_update_sensitivity (t);
}