From b086814a1ff6d94b29ae2185aebb22321da7e1a4 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 13 Nov 2003 18:26:28 +0000 Subject: Put back borked mozilla alert. 2003-11-13 Marco Pesenti Gritti * embed/ephy-embed-shell.c: (ephy_embed_shell_get_embed_single): * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-embed-single.h: * src/ephy-shell.h: Put back borked mozilla alert. --- ChangeLog | 9 +++++++ embed/ephy-embed-shell.c | 16 +---------- embed/mozilla/mozilla-embed-single.cpp | 49 +++++++++++++++++++++++----------- embed/mozilla/mozilla-embed-single.h | 2 -- src/ephy-shell.h | 3 +-- 5 files changed, 44 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf0f8e566..6a2802dfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-11-13 Marco Pesenti Gritti + + * embed/ephy-embed-shell.c: (ephy_embed_shell_get_embed_single): + * embed/mozilla/mozilla-embed-single.cpp: + * embed/mozilla/mozilla-embed-single.h: + * src/ephy-shell.h: + + Put back borked mozilla alert. + 2003-11-13 Marco Pesenti Gritti * src/ephy-shell.c: (ephy_shell_finalize): diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index e338a0c35..e15aba244 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -209,21 +209,7 @@ ephy_embed_shell_get_embed_single (EphyEmbedShell *shell) if (!shell->priv->embed_single) { - EphyEmbedSingle *single; - gboolean res; - - single = mozilla_embed_single_new (); - res = mozilla_embed_single_init_services - (MOZILLA_EMBED_SINGLE (single)); - - if (res) - { - shell->priv->embed_single = single; - } - else - { - g_object_unref (single); - } + shell->priv->embed_single = mozilla_embed_single_new (); } return shell->priv->embed_single; diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index cfaf6028f..50c75484c 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -315,20 +315,6 @@ mozilla_register_external_protocols (void) mozilla_register_MailtoProtocolHandler (); } -static void -mozilla_embed_single_init (MozillaEmbedSingle *mes) -{ - mes->priv = MOZILLA_EMBED_SINGLE_GET_PRIVATE (mes); - - mes->priv->theme_window = NULL; - mes->priv->user_prefs = - g_build_filename (ephy_dot_dir (), - MOZILLA_PROFILE_DIR, - MOZILLA_PROFILE_NAME, - MOZILLA_PROFILE_FILE, - NULL); -} - static nsresult getUILang (nsAString& aUILang) { @@ -387,8 +373,8 @@ mozilla_init_chrome (void) return NS_OK; } -gboolean -mozilla_embed_single_init_services (MozillaEmbedSingle *single) +static gboolean +init_services (MozillaEmbedSingle *single) { /* Pre initialization */ mozilla_init_home (); @@ -423,6 +409,37 @@ mozilla_embed_single_init_services (MozillaEmbedSingle *single) return TRUE; } +static void +mozilla_embed_single_init (MozillaEmbedSingle *mes) +{ + mes->priv = MOZILLA_EMBED_SINGLE_GET_PRIVATE (mes); + + mes->priv->theme_window = NULL; + mes->priv->user_prefs = + g_build_filename (ephy_dot_dir (), + MOZILLA_PROFILE_DIR, + MOZILLA_PROFILE_NAME, + MOZILLA_PROFILE_FILE, + NULL); + + if (!init_services (mes)) + { + GtkWidget *dialog; + + dialog = gtk_message_dialog_new + (NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Epiphany can't be used now. " + "Mozilla initialization failed. Check your " + "MOZILLA_FIVE_HOME environmental variable.")); + gtk_dialog_run (GTK_DIALOG (dialog)); + + exit (0); + } +} + static void mozilla_embed_single_finalize (GObject *object) { diff --git a/embed/mozilla/mozilla-embed-single.h b/embed/mozilla/mozilla-embed-single.h index 71cc48416..dfefd0a5a 100644 --- a/embed/mozilla/mozilla-embed-single.h +++ b/embed/mozilla/mozilla-embed-single.h @@ -50,8 +50,6 @@ GType mozilla_embed_single_get_type (void); EphyEmbedSingle *mozilla_embed_single_new (void); -gboolean mozilla_embed_single_init_services (MozillaEmbedSingle *single); - G_END_DECLS #endif diff --git a/src/ephy-shell.h b/src/ephy-shell.h index 32a01a48c..66e12ace5 100644 --- a/src/ephy-shell.h +++ b/src/ephy-shell.h @@ -55,8 +55,7 @@ typedef enum { EPHY_SHELL_ERROR_MISSING_SERVER, EPHY_SHELL_ERROR_OBJECT_REG_FAILED, - EPHY_SHELL_ERROR_FACTORY_REG_FAILED, - EPHY_SHELL_ERROR_MOZILLA_REG_FAILED + EPHY_SHELL_ERROR_FACTORY_REG_FAILED } EphyShellError; typedef enum -- cgit v1.2.3