diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-02-01 04:03:38 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-02-01 04:03:38 +0800 |
commit | 0541bcb1e3d64c8ebbd9d514641917def2515f97 (patch) | |
tree | 65c59efdb54212cceea1d0bbdf7cf87da776fe59 /src/ephy-activation.c | |
parent | f6afe77cb705b9ba2f356ed3d44bdc0201887e4f (diff) | |
download | gsoc2013-epiphany-0541bcb1e3d64c8ebbd9d514641917def2515f97.tar gsoc2013-epiphany-0541bcb1e3d64c8ebbd9d514641917def2515f97.tar.gz gsoc2013-epiphany-0541bcb1e3d64c8ebbd9d514641917def2515f97.tar.bz2 gsoc2013-epiphany-0541bcb1e3d64c8ebbd9d514641917def2515f97.tar.lz gsoc2013-epiphany-0541bcb1e3d64c8ebbd9d514641917def2515f97.tar.xz gsoc2013-epiphany-0541bcb1e3d64c8ebbd9d514641917def2515f97.tar.zst gsoc2013-epiphany-0541bcb1e3d64c8ebbd9d514641917def2515f97.zip |
Change the DBUS interface to sending all the uris at one as string array.
2006-01-31 Christian Persch <chpe@cvs.gnome.org>
* data/epiphany-service.xml:
* src/ephy-activation.c: (ephy_activation_load_uris):
* src/ephy-activation.h:
* src/ephy-main.c: (unref_proxy_reply_cb), (open_urls):
Change the DBUS interface to sending all the uris at one
as string array.
Diffstat (limited to 'src/ephy-activation.c')
-rw-r--r-- | src/ephy-activation.c | 65 |
1 files changed, 44 insertions, 21 deletions
diff --git a/src/ephy-activation.c b/src/ephy-activation.c index b7cb4a54a..8ad478748 100644 --- a/src/ephy-activation.c +++ b/src/ephy-activation.c @@ -32,25 +32,33 @@ #include <string.h> gboolean -ephy_activation_load_url (EphyDbus *ephy_dbus, - char *url, - char *options, - guint startup_id, - GError **error) +ephy_activation_load_uris (EphyDbus *ephy_dbus, + char **uris, + char *options, + guint startup_id, + GError **error) { + EphyShell *shell; + EphySession *session; EphyNewTabFlags flags = 0; EphyWindow *window; - EphySession *session; + EphyTab *tab; + static char *empty_urls[] = { "", NULL }; guint32 user_time = (guint32) startup_id; + guint i; - g_return_val_if_fail (url != NULL && options != NULL, TRUE); + g_return_val_if_fail (uris != NULL && options != NULL, TRUE); - session = EPHY_SESSION (ephy_shell_get_session (ephy_shell)); - g_return_val_if_fail (session != NULL, TRUE); + shell = ephy_shell_get_default (); + + g_object_ref (shell); + + session = EPHY_SESSION (ephy_shell_get_session (shell)); + g_assert (session != NULL); if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_ARBITRARY_URL)) { - url = ""; + uris = empty_urls; } window = ephy_session_get_active_window (session); @@ -65,15 +73,6 @@ ephy_activation_load_url (EphyDbus *ephy_dbus, } #endif - if (url[0] == '\0') - { - flags |= EPHY_NEW_TAB_HOME_PAGE; - } - else - { - flags |= EPHY_NEW_TAB_OPEN_PAGE; - } - if (strstr (options, "new-window") != NULL) { window = NULL; @@ -85,8 +84,32 @@ ephy_activation_load_url (EphyDbus *ephy_dbus, EPHY_NEW_TAB_JUMP; } - ephy_shell_new_tab_full (ephy_shell, window, NULL, url, flags, - EPHY_EMBED_CHROME_ALL, FALSE, user_time); + for (i = 0; uris[i] != NULL; ++i) + { + const char *url = uris[i]; + EphyNewTabFlags page_flags; + + if (url[0] == '\0') + { + page_flags = EPHY_NEW_TAB_HOME_PAGE; + } + else + { + page_flags = EPHY_NEW_TAB_OPEN_PAGE; + } + + tab = ephy_shell_new_tab_full (shell,window, + NULL, url, + flags | page_flags, + EPHY_EMBED_CHROME_ALL, + FALSE, user_time); + + window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tab))); + } + + g_object_unref (shell); + + /* FIXME: do we have to g_strfreev (uris) ? */ return TRUE; } |