aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-06-25 19:31:22 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-06-25 19:31:22 +0800
commit36ad80414746a470d3f64849266817c58fef2344 (patch)
treef7360d1212f4dbc10e0606b4e78852ebbb3463a2 /src
parentb6b7539092921b12790435b10e6bfb68ec9339f5 (diff)
downloadgsoc2013-epiphany-36ad80414746a470d3f64849266817c58fef2344.tar
gsoc2013-epiphany-36ad80414746a470d3f64849266817c58fef2344.tar.gz
gsoc2013-epiphany-36ad80414746a470d3f64849266817c58fef2344.tar.bz2
gsoc2013-epiphany-36ad80414746a470d3f64849266817c58fef2344.tar.lz
gsoc2013-epiphany-36ad80414746a470d3f64849266817c58fef2344.tar.xz
gsoc2013-epiphany-36ad80414746a470d3f64849266817c58fef2344.tar.zst
gsoc2013-epiphany-36ad80414746a470d3f64849266817c58fef2344.zip
Simplify print code. Now there is only one case to deal with, the mozilla
2004-06-25 Marco Pesenti Gritti <marco@gnome.org> * embed/ephy-embed.c: (ephy_embed_print), (ephy_embed_set_print_preview_mode): * embed/ephy-embed.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/PrintingPromptService.cpp: * embed/mozilla/mozilla-embed.cpp: * embed/print-dialog.c: (ephy_print_dialog_response_cb), (ephy_print_dialog_new): * embed/print-dialog.h: * src/ephy-window.c: (ephy_window_delete_event_cb), (ephy_window_finalize), (update_embed_dialogs), (ephy_window_find): * src/ppview-toolbar.c: (toolbar_cmd_ppv_close): * src/window-commands.c: (window_cmd_file_print_preview), (window_cmd_file_print): Simplify print code. Now there is only one case to deal with, the mozilla prompt dialog. This should help with xprint.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-window.c64
-rwxr-xr-xsrc/ppview-toolbar.c2
-rw-r--r--src/window-commands.c16
3 files changed, 9 insertions, 73 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 098624988..0482af01a 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -334,7 +334,6 @@ struct EphyWindowPrivate
GtkNotebook *notebook;
EphyTab *active_tab;
EphyDialog *find_dialog;
- EphyDialog *print_dialog;
gboolean closing;
gboolean has_size;
guint num_tabs;
@@ -688,7 +687,7 @@ ephy_window_delete_event_cb (GtkWidget *widget, GdkEvent *event, EphyWindow *win
EphyEmbed *embed;
embed = ephy_window_get_active_embed (window);
- ephy_embed_print_preview_close (embed);
+ ephy_embed_set_print_preview_mode (embed, FALSE);
ephy_window_set_print_preview (window, FALSE);
}
@@ -2084,11 +2083,6 @@ ephy_window_finalize (GObject *object)
g_object_unref (G_OBJECT (window->priv->find_dialog));
}
- if (window->priv->print_dialog)
- {
- g_object_unref (G_OBJECT (window->priv->print_dialog));
- }
-
g_object_unref (window->priv->fav_menu);
g_object_unref (window->priv->enc_menu);
g_object_unref (window->priv->tabs_menu);
@@ -2467,7 +2461,6 @@ update_embed_dialogs (EphyWindow *window,
{
EphyEmbed *embed;
EphyDialog *find_dialog = window->priv->find_dialog;
- EphyDialog *print_dialog = window->priv->print_dialog;
embed = ephy_tab_get_embed (tab);
@@ -2477,13 +2470,6 @@ update_embed_dialogs (EphyWindow *window,
(EPHY_EMBED_DIALOG(find_dialog),
embed);
}
-
- if (print_dialog)
- {
- ephy_embed_dialog_set_embed
- (EPHY_EMBED_DIALOG(print_dialog),
- embed);
- }
}
static void
@@ -2538,54 +2524,6 @@ ephy_window_find (EphyWindow *window)
}
/**
- * ephy_window_print:
- * @window: an #EphyWindow
- *
- * Displays @window's Print dialog.
- **/
-void
-ephy_window_print (EphyWindow *window)
-{
- if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_PRINTING))
- {
- return;
- }
-
- if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_PRINT_SETUP) ||
- eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_COMMAND_LINE))
- {
- EphyEmbed *embed;
- EmbedPrintInfo *info;
-
- info = ephy_print_get_print_info ();
-
- embed = ephy_window_get_active_embed (window);
- g_return_if_fail (EPHY_IS_EMBED (embed));
-
- ephy_embed_print (embed, info);
-
- ephy_print_info_free (info);
-
- return;
- }
-
- if (window->priv->print_dialog == NULL)
- {
- EphyDialog *dialog;
- EphyEmbed *embed;
-
- embed = ephy_window_get_active_embed (window);
- dialog = ephy_print_dialog_new (GTK_WIDGET (window), embed, FALSE);
-
- window->priv->print_dialog = dialog;
- g_object_add_weak_pointer(G_OBJECT (dialog),
- (gpointer *) &window->priv->print_dialog);
- }
-
- ephy_dialog_show (window->priv->print_dialog);
-}
-
-/**
* ephy_window_set_zoom:
* @window: an #EphyWindow
* @zoom: the desired zoom level
diff --git a/src/ppview-toolbar.c b/src/ppview-toolbar.c
index 70603ea67..9c3b70c64 100755
--- a/src/ppview-toolbar.c
+++ b/src/ppview-toolbar.c
@@ -392,6 +392,6 @@ toolbar_cmd_ppv_close (GtkUIManager *merge,
ephy_window_set_print_preview (window, FALSE);
- ephy_embed_print_preview_close (embed);
+ ephy_embed_set_print_preview_mode (embed, FALSE);
}
diff --git a/src/window-commands.c b/src/window-commands.c
index 4a6528cda..4139b6932 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -88,18 +88,11 @@ window_cmd_file_print_preview (GtkAction *action,
EphyWindow *window)
{
EphyEmbed *embed;
- EmbedPrintInfo *info;
embed = ephy_window_get_active_embed (window);
g_return_if_fail (EPHY_IS_EMBED (embed));
- info = ephy_print_get_print_info ();
- info->preview = TRUE;
-
- ephy_embed_print (embed, info);
-
- ephy_print_info_free (info);
-
+ ephy_embed_set_print_preview_mode (embed, TRUE);
ephy_window_set_print_preview (window, TRUE);
}
@@ -107,7 +100,12 @@ void
window_cmd_file_print (GtkAction *action,
EphyWindow *window)
{
- ephy_window_print (window);
+ EphyEmbed *embed;
+
+ embed = ephy_window_get_active_embed (window);
+ g_return_if_fail (EPHY_IS_EMBED (embed));
+
+ ephy_embed_print (embed);
}
void