aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--src/ephy-window.c6
-rwxr-xr-xsrc/ppview-toolbar.c32
3 files changed, 43 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 5132a3d10..012e20b52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
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.
+
+2003-08-13 Marco Pesenti Gritti <marco@.gnome.org>
+
* AUTHORS:
* HACKING:
* src/window-commands.c: (window_cmd_help_about):
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 41944f37b..59ff4e30e 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1064,6 +1064,12 @@ show_embed_popup (EphyWindow *window, EphyTab *tab, EphyEmbedEvent *event)
GtkWidget *widget;
EphyEmbedEventType type;
+ /* Do not show the menu in print preview mode */
+ if (window->priv->chrome_mask & EMBED_CHROME_PPVIEWTOOLBARON)
+ {
+ return;
+ }
+
ephy_embed_event_get_property (event, "framed_page", &value);
framed = g_value_get_int (value);
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);
}