aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-09-19 20:14:45 +0800
committerChristian Persch <chpe@src.gnome.org>2003-09-19 20:14:45 +0800
commit54d2149bf268430f3b5f11e58c4492b1ab4c6ff5 (patch)
tree1a9e84386f79bffde79a7df3d5b45b6b52e4b599
parentd3873ae5a566d733c31cdde300a6e5997dc4b7ce (diff)
downloadgsoc2013-epiphany-54d2149bf268430f3b5f11e58c4492b1ab4c6ff5.tar
gsoc2013-epiphany-54d2149bf268430f3b5f11e58c4492b1ab4c6ff5.tar.gz
gsoc2013-epiphany-54d2149bf268430f3b5f11e58c4492b1ab4c6ff5.tar.bz2
gsoc2013-epiphany-54d2149bf268430f3b5f11e58c4492b1ab4c6ff5.tar.lz
gsoc2013-epiphany-54d2149bf268430f3b5f11e58c4492b1ab4c6ff5.tar.xz
gsoc2013-epiphany-54d2149bf268430f3b5f11e58c4492b1ab4c6ff5.tar.zst
gsoc2013-epiphany-54d2149bf268430f3b5f11e58c4492b1ab4c6ff5.zip
Add an --import-bookmarks command line option, and really implement the
2003-09-19 Christian Persch <chpe@cvs.gnome.org> * idl/EphyAutomation.idl: * src/ephy-automation.c: (impl_ephy_automation_add_bookmark), (impl_ephy_automation_import_bookmarks), (ephy_automation_class_init): * src/ephy-main.c: (ephy_main_start): Add an --import-bookmarks command line option, and really implement the --add-bookmark one.
-rw-r--r--ChangeLog11
-rw-r--r--idl/EphyAutomation.idl2
-rw-r--r--src/ephy-automation.c18
-rw-r--r--src/ephy-main.c10
4 files changed, 41 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index e1248a212..6246b1f35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2003-09-19 Christian Persch <chpe@cvs.gnome.org>
+ * idl/EphyAutomation.idl:
+ * src/ephy-automation.c: (impl_ephy_automation_add_bookmark),
+ (impl_ephy_automation_import_bookmarks),
+ (ephy_automation_class_init):
+ * src/ephy-main.c: (ephy_main_start):
+
+ Add an --import-bookmarks command line option, and really implement
+ the --add-bookmark one.
+
+2003-09-19 Christian Persch <chpe@cvs.gnome.org>
+
* embed/mozilla/MozRegisterComponents.cpp
A embed/mozilla/GtkNSSDialogs.cpp
A embed/mozilla/GtkNSSDialogs.h
diff --git a/idl/EphyAutomation.idl b/idl/EphyAutomation.idl
index 64e5ef8a9..adc334602 100644
--- a/idl/EphyAutomation.idl
+++ b/idl/EphyAutomation.idl
@@ -12,6 +12,8 @@ module GNOME {
void addBookmark (in string url);
+ void importBookmarks (in string filename);
+
/**
* Closes all opened windows.
* if disableServer is true,
diff --git a/src/ephy-automation.c b/src/ephy-automation.c
index 529b1854e..5980f9c09 100644
--- a/src/ephy-automation.c
+++ b/src/ephy-automation.c
@@ -24,6 +24,8 @@
#include "ephy-embed.h"
#include "ephy-window.h"
#include "session.h"
+#include "ephy-bookmarks.h"
+#include "ephy-bookmarks-import.h"
#include <string.h>
#include <bonobo/bonobo-generic-factory.h>
@@ -35,6 +37,10 @@ impl_ephy_automation_add_bookmark (PortableServer_Servant _servant,
const CORBA_char * url,
CORBA_Environment * ev);
static void
+impl_ephy_automation_import_bookmarks (PortableServer_Servant _servant,
+ const CORBA_char * filename,
+ CORBA_Environment * ev);
+static void
impl_ephy_automation_quit (PortableServer_Servant _servant,
const CORBA_boolean disableServer,
CORBA_Environment * ev);
@@ -149,6 +155,17 @@ impl_ephy_automation_add_bookmark (PortableServer_Servant _servant,
const CORBA_char * url,
CORBA_Environment * ev)
{
+ ephy_bookmarks_add (ephy_shell_get_bookmarks (ephy_shell),
+ url /* title */, url);
+}
+
+static void
+impl_ephy_automation_import_bookmarks (PortableServer_Servant _servant,
+ const CORBA_char * filename,
+ CORBA_Environment * ev)
+{
+ ephy_bookmarks_import (ephy_shell_get_bookmarks (ephy_shell),
+ filename);
}
static void
@@ -194,6 +211,7 @@ ephy_automation_class_init (EphyAutomationClass *klass)
/* connect implementation callbacks */
epv->loadurl = impl_ephy_automation_loadurl;
epv->addBookmark = impl_ephy_automation_add_bookmark;
+ epv->importBookmarks = impl_ephy_automation_import_bookmarks;
epv->quit = impl_ephy_automation_quit;
epv->loadSession = impl_ephy_automation_load_session;
epv->openBookmarksEditor = impl_ephy_automation_open_bookmarks_editor;
diff --git a/src/ephy-main.c b/src/ephy-main.c
index 22c33b695..986588ed8 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -52,6 +52,7 @@ static gboolean open_in_new_window = FALSE; /* force open in a new window?
static gboolean open_fullscreen = FALSE; /* open ephy in full screen ? */
static gchar *session_filename = NULL; /* the session filename */
static gchar *bookmark_url = NULL; /* the temp bookmark to add */
+static gchar *bookmarks_file = NULL; /* the bookmarks file to import */
static gboolean close_option = FALSE; /* --close */
static gboolean quit_option = FALSE; /* --quit */
static gboolean ephy_server_mode = FALSE;
@@ -93,6 +94,9 @@ static struct poptOption popt_options[] =
{ "add-bookmark", 't', POPT_ARG_STRING, &bookmark_url,
0, N_("Add a bookmark (don't open any window)"),
N_("URL")},
+ { "import-bookmarks", '\0', POPT_ARG_STRING, &bookmarks_file,
+ 0, N_("Import bookmarks from the given file"),
+ N_("FILE") },
{ "close", 'c', POPT_ARG_NONE, &close_option, 0,
N_("Close all Epiphany windows"),
NULL },
@@ -227,6 +231,12 @@ ephy_main_start (gpointer data)
GNOME_EphyAutomation_loadSession
(gaserver, session_filename, &corba_env);
}
+ /* if we're given a bookmarks file to import... */
+ else if (bookmarks_file != NULL)
+ {
+ GNOME_EphyAutomation_importBookmarks
+ (gaserver, bookmarks_file, &corba_env);
+ }
/* if found and we're given a bookmark to add... */
else if (bookmark_url != NULL)
{