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 | |
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.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | embed/mozilla/EphyAboutModule.cpp | 57 |
2 files changed, 59 insertions, 5 deletions
@@ -1,5 +1,12 @@ 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. + +2006-01-30 Christian Persch <chpe@cvs.gnome.org> + * embed/mozilla/GlobalHistory.cpp: Truncate URI and title strings. Bug #329160. 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) { |