diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-11-02 18:33:16 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-11-02 18:33:16 +0800 |
commit | 770f563a42864d688b4e040ecc4c5a5b32c8e9ac (patch) | |
tree | 110039785eb48559ded3a4a4f914c010f77fac2a | |
parent | 2aeb3bbca292b7e3ccd07ed2f7ce3f727cfec19c (diff) | |
download | gsoc2013-epiphany-770f563a42864d688b4e040ecc4c5a5b32c8e9ac.tar gsoc2013-epiphany-770f563a42864d688b4e040ecc4c5a5b32c8e9ac.tar.gz gsoc2013-epiphany-770f563a42864d688b4e040ecc4c5a5b32c8e9ac.tar.bz2 gsoc2013-epiphany-770f563a42864d688b4e040ecc4c5a5b32c8e9ac.tar.lz gsoc2013-epiphany-770f563a42864d688b4e040ecc4c5a5b32c8e9ac.tar.xz gsoc2013-epiphany-770f563a42864d688b4e040ecc4c5a5b32c8e9ac.tar.zst gsoc2013-epiphany-770f563a42864d688b4e040ecc4c5a5b32c8e9ac.zip |
Don't unref print dialogue twice when shown from mozilla.
2003-11-02 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/PrintingPromptService.cpp:
* embed/print-dialog.c: (print_dialog_new),
(print_dialog_new_with_parent), (print_dialog_print),
(print_cancel_button_cb), (print_preview_button_cb):
Don't unref print dialogue twice when shown from mozilla.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | embed/mozilla/PrintingPromptService.cpp | 11 | ||||
-rwxr-xr-x | embed/print-dialog.c | 42 |
3 files changed, 52 insertions, 10 deletions
@@ -1,3 +1,12 @@ +2003-11-02 Christian Persch <chpe@cvs.gnome.org> + + * embed/mozilla/PrintingPromptService.cpp: + * embed/print-dialog.c: (print_dialog_new), + (print_dialog_new_with_parent), (print_dialog_print), + (print_cancel_button_cb), (print_preview_button_cb): + + Don't unref print dialogue twice when shown from mozilla. + 2003-10-31 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/MozillaPrivate.cpp: diff --git a/embed/mozilla/PrintingPromptService.cpp b/embed/mozilla/PrintingPromptService.cpp index 168e361be..2e0ee5848 100644 --- a/embed/mozilla/PrintingPromptService.cpp +++ b/embed/mozilla/PrintingPromptService.cpp @@ -51,6 +51,7 @@ NS_IMETHODIMP GPrintingPromptService::ShowPrintDialog(nsIDOMWindow *parent, nsIW { EphyDialog *dialog; EmbedPrintInfo *info; + nsresult rv = NS_OK; GtkWidget *gtkParent = MozillaFindGtkParent(parent); EphyEmbed *embed = EPHY_EMBED (MozillaFindEmbed (parent)); @@ -64,10 +65,16 @@ NS_IMETHODIMP GPrintingPromptService::ShowPrintDialog(nsIDOMWindow *parent, nsIW MozillaCollatePrintSettings(info, printSettings); print_free_info(info); - return NS_OK; + rv = NS_OK; } else - return NS_ERROR_FAILURE; + { + rv = NS_ERROR_FAILURE; + } + + g_object_unref (dialog); + + return rv; } /* void showProgress (in nsIDOMWindow parent, in nsIWebBrowserPrint webBrowserPrint, in nsIPrintSettings printSettings, in nsIObserver openDialogObserver, in boolean isForPrinting, out nsIWebProgressListener webProgressListener, out nsIPrintProgressParams printProgressParams, out boolean notifyOnOpen); */ diff --git a/embed/print-dialog.c b/embed/print-dialog.c index 26a0981cb..c1558999c 100755 --- a/embed/print-dialog.c +++ b/embed/print-dialog.c @@ -82,7 +82,8 @@ enum TO_PROP, FROM_PROP, COLOR_PROP, - ORIENTATION_PROP + ORIENTATION_PROP, + PREVIEW_PROP }; enum @@ -112,6 +113,7 @@ EphyDialogProperty properties [] = { FROM_PROP, "from_spinbutton", NULL, PT_NORMAL, NULL }, { COLOR_PROP, "print_color_radiobutton", CONF_PRINT_COLOR, PT_NORMAL, NULL }, { ORIENTATION_PROP, "orient_p_radiobutton", CONF_PRINT_ORIENTATION, PT_NORMAL, NULL }, + { PREVIEW_PROP, "preview_button", NULL, PT_NORMAL, NULL }, { -1, NULL, NULL } }; @@ -228,8 +230,18 @@ print_dialog_new (EphyEmbed *embed, "embed", embed, NULL)); - if (!embed) dialog->only_collect_info = TRUE; - dialog->ret_info = ret_info; + if (ret_info != NULL) + { + GtkWidget *button; + + dialog->only_collect_info = TRUE; + dialog->ret_info = ret_info; + + /* disappear preview button */ + button = ephy_dialog_get_control (EPHY_DIALOG (dialog), + PREVIEW_PROP); + gtk_widget_hide (button); + } return EPHY_DIALOG(dialog); } @@ -246,8 +258,18 @@ print_dialog_new_with_parent (GtkWidget *window, "ParentWindow", window, NULL)); - if (!embed) dialog->only_collect_info = TRUE; - dialog->ret_info = ret_info; + if (ret_info != NULL) + { + GtkWidget *button; + + dialog->only_collect_info = TRUE; + dialog->ret_info = ret_info; + + /* disappear preview button */ + button = ephy_dialog_get_control (EPHY_DIALOG (dialog), + PREVIEW_PROP); + gtk_widget_hide (button); + } return EPHY_DIALOG(dialog); } @@ -391,6 +413,8 @@ print_dialog_print (EphyDialog *dialog) if(PRINT_DIALOG(dialog)->only_collect_info && PRINT_DIALOG(dialog)->ret_info) { *(PRINT_DIALOG(dialog)->ret_info) = info; + + return; } else { @@ -437,6 +461,11 @@ void print_cancel_button_cb (GtkWidget *widget, EphyDialog *dialog) { + if (PRINT_DIALOG (dialog)->only_collect_info) + { + return; + } + g_object_unref (G_OBJECT(dialog)); } @@ -451,9 +480,6 @@ void print_preview_button_cb (GtkWidget *widget, EphyDialog *dialog) { - //FIXME: Don't show preview button at all. if(!(PRINT_DIALOG(dialog)->only_collect_info)) print_dialog_preview (dialog); } - - |