aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-01-09 03:12:33 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-01-09 03:12:33 +0800
commit74f30634c4d7187f9c04b0b4e7dfad1253c5616c (patch)
treebb5e9c11ecc10e6af05addc7b519e69f9386aa86 /embed
parent5df83cc343c496873f84e939a6367b69ad9286bb (diff)
downloadgsoc2013-epiphany-74f30634c4d7187f9c04b0b4e7dfad1253c5616c.tar
gsoc2013-epiphany-74f30634c4d7187f9c04b0b4e7dfad1253c5616c.tar.gz
gsoc2013-epiphany-74f30634c4d7187f9c04b0b4e7dfad1253c5616c.tar.bz2
gsoc2013-epiphany-74f30634c4d7187f9c04b0b4e7dfad1253c5616c.tar.lz
gsoc2013-epiphany-74f30634c4d7187f9c04b0b4e7dfad1253c5616c.tar.xz
gsoc2013-epiphany-74f30634c4d7187f9c04b0b4e7dfad1253c5616c.tar.zst
gsoc2013-epiphany-74f30634c4d7187f9c04b0b4e7dfad1253c5616c.zip
More start here page work, importing bookmarks from mozilla now should
2003-01-08 Marco Pesenti Gritti <marco@it.gnome.org> * TODO: * data/starthere/Makefile.am: * data/starthere/index.xml.in: * data/starthere/section.xsl: * data/starthere/smartbookmarks.xml.in: * embed/ephy-embed-shell.c: (ephy_embed_shell_class_init): * embed/ephy-embed-shell.h: * embed/mozilla/StartHereProtocolHandler.cpp: * po/POTFILES.in: * src/ephy-shell.c: (ephy_shell_command_cb), (ephy_shell_init): More start here page work, importing bookmarks from mozilla now should work.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed-shell.c12
-rw-r--r--embed/ephy-embed-shell.h4
-rw-r--r--embed/mozilla/StartHereProtocolHandler.cpp19
3 files changed, 34 insertions, 1 deletions
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 69d1c98dd..679e6f663 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -29,6 +29,7 @@
enum
{
NEW_WINDOW,
+ COMMAND,
LAST_SIGNAL
};
@@ -113,6 +114,17 @@ ephy_embed_shell_class_init (EphyEmbedShellClass *klass)
2,
G_TYPE_POINTER,
G_TYPE_INT);
+ ephy_embed_shell_signals[COMMAND] =
+ g_signal_new ("command",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EphyEmbedShellClass, command),
+ NULL, NULL,
+ ephy_marshal_VOID__STRING_STRING,
+ G_TYPE_NONE,
+ 2,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
}
static void
diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h
index 105db27f2..e7d789d57 100644
--- a/embed/ephy-embed-shell.h
+++ b/embed/ephy-embed-shell.h
@@ -139,6 +139,10 @@ struct EphyEmbedShellClass
EphyEmbed **new_embed,
EmbedChromeMask chromemask);
+ void (* command) (EphyEmbedShell *shell,
+ char *command,
+ char *param);
+
/* Methods */
void (* get_capabilities) (EphyEmbedShell *shell,
diff --git a/embed/mozilla/StartHereProtocolHandler.cpp b/embed/mozilla/StartHereProtocolHandler.cpp
index 2d2bb3c35..a4548378d 100644
--- a/embed/mozilla/StartHereProtocolHandler.cpp
+++ b/embed/mozilla/StartHereProtocolHandler.cpp
@@ -18,6 +18,9 @@
#include "ephy-file-helpers.h"
#include "ephy-start-here.h"
+#include "ephy-embed-shell.h"
+
+#include <string.h>
#include "nsCOMPtr.h"
#include "nsIFactory.h"
@@ -121,6 +124,19 @@ NS_IMETHODIMP GStartHereProtocolHandler::NewChannel(nsIURI *aURI,
rv = aURI->GetPath(path);
if (NS_FAILED(rv)) return rv;
+ if (g_str_has_prefix (path.get(), "import-bookmarks"))
+ {
+ g_signal_emit_by_name (embed_shell, "command", "import-bookmarks",
+ path.get() + strlen ("import-bookmarks?"));
+ return NS_ERROR_FAILURE;
+ }
+ else if (g_str_has_prefix (path.get(), "configure-network"))
+ {
+ g_signal_emit_by_name (embed_shell, "command", "configure-network",
+ NULL);
+ return NS_ERROR_FAILURE;
+ }
+
nsCOMPtr<nsIStorageStream> sStream;
nsCOMPtr<nsIOutputStream> stream;
@@ -131,7 +147,8 @@ NS_IMETHODIMP GStartHereProtocolHandler::NewChannel(nsIURI *aURI,
if (NS_FAILED(rv)) return rv;
sh = ephy_start_here_new ();
- buf = ephy_start_here_get_page (sh, "index");
+ buf = ephy_start_here_get_page
+ (sh, path.IsEmpty() ? "index" : path.get ());
aBaseURI = ephy_start_here_get_base_uri (sh);
rv = stream->Write (buf, strlen (buf), &bytesWritten);