diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-01-31 04:32:44 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-01-31 04:32:44 +0800 |
commit | 03101dff3364d93e18b7145ff4fcd164bff7eb60 (patch) | |
tree | e84db1bece153aecb840d36890217fb007d68414 /embed | |
parent | 745ff820f8656ed82091b06af7c29e5a351b4277 (diff) | |
download | gsoc2013-epiphany-03101dff3364d93e18b7145ff4fcd164bff7eb60.tar gsoc2013-epiphany-03101dff3364d93e18b7145ff4fcd164bff7eb60.tar.gz gsoc2013-epiphany-03101dff3364d93e18b7145ff4fcd164bff7eb60.tar.bz2 gsoc2013-epiphany-03101dff3364d93e18b7145ff4fcd164bff7eb60.tar.lz gsoc2013-epiphany-03101dff3364d93e18b7145ff4fcd164bff7eb60.tar.xz gsoc2013-epiphany-03101dff3364d93e18b7145ff4fcd164bff7eb60.tar.zst gsoc2013-epiphany-03101dff3364d93e18b7145ff4fcd164bff7eb60.zip |
Special error text for localhost URIs. Bug #323261, patch by
2006-01-30 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/EphyAboutModule.cpp:
Special error text for localhost URIs. Bug #323261,
patch by Jean-François Rameau.
Diffstat (limited to 'embed')
-rw-r--r-- | embed/mozilla/EphyAboutModule.cpp | 57 |
1 files changed, 52 insertions, 5 deletions
diff --git a/embed/mozilla/EphyAboutModule.cpp b/embed/mozilla/EphyAboutModule.cpp index 350fa8569..9690c2c03 100644 --- a/embed/mozilla/EphyAboutModule.cpp +++ b/embed/mozilla/EphyAboutModule.cpp @@ -244,15 +244,62 @@ EphyAboutModule::GetErrorMessage(nsIURI *aURI, /* Translators: %s is the hostname, like "www.example.com" */ *aTitle = g_markup_printf_escaped - (_("“%s” Refused the Connection"), - host.get()); + (_("“%s” Refused the Connection"), + host.get()); /* Translators: %s is the hostname, like "www.example.com" */ *aPrimary = g_markup_printf_escaped (_("“%s” refused the connection."), host.get()); - *aSecondary = _("The server may be busy or you may have a " - "network connection problem. Try again later."); - *aLinkIntro = _("There may be an old version of the page you wanted:"); + + /* FIXME what about 127.0.0.* ? */ + if (strcmp (host.get(), "localhost") == 0) + { + const char *not_started_msg = _("some service isn't started, or"); + PRInt32 port; + aURI->GetPort (&port); + + *aSecondary = _("Likely causes of the problem are"); + + /* Try to get the service name attached to that port */ + if (port != -1) + { + struct servent *serv; + + if ((serv = getservbyport (htons (port), NULL)) != NULL) + { + *aTertiary = g_markup_printf_escaped ( + _("<ul>" + "<li>the service ""%s"" isn't started.</li>" + "Try to start it using the Services Configuration Tool in " + "Desktop > System Settings > Server Settings > Services, or</ul>" + "<ul><li>the port number %d is wrong.</li>" + "</ul>"), + serv->s_name, port); + } + else + { + *aTertiary = g_markup_printf_escaped ( + _("<ul>" + "<li>some service isn't started, or</li>" + "<li>the port number %d is wrong.</li>" + "</ul>"), + port); + } + } + else + { + *aTertiary = _("<ul>" + "<li>some service isn't started, or</li>" + "<li>you got the port number wrong.</li>" + "</ul>"); + } + } + else + { + *aSecondary = _("The server may be busy or you may have a " + "network connection problem. Try again later."); + *aLinkIntro = _("There may be an old version of the page you wanted:"); + } } else if (strcmp (aError, "netInterrupt") == 0) { |