aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-06-24 02:28:31 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-06-24 02:28:31 +0800
commit96aedf7f4f19c494a549310b7c6e55b6fcd7668a (patch)
tree93c41ee9896977c52df9f03a5e3f81f36665d3ad /src/ephy-window.c
parentd12bc3fbd3a34b8bcf8a6d7c23815f5a79dec49d (diff)
downloadgsoc2013-epiphany-96aedf7f4f19c494a549310b7c6e55b6fcd7668a.tar
gsoc2013-epiphany-96aedf7f4f19c494a549310b7c6e55b6fcd7668a.tar.gz
gsoc2013-epiphany-96aedf7f4f19c494a549310b7c6e55b6fcd7668a.tar.bz2
gsoc2013-epiphany-96aedf7f4f19c494a549310b7c6e55b6fcd7668a.tar.lz
gsoc2013-epiphany-96aedf7f4f19c494a549310b7c6e55b6fcd7668a.tar.xz
gsoc2013-epiphany-96aedf7f4f19c494a549310b7c6e55b6fcd7668a.tar.zst
gsoc2013-epiphany-96aedf7f4f19c494a549310b7c6e55b6fcd7668a.zip
Add EphyWindow API to open multiple uris in tabs, use it for dnd on the
2004-06-23 Marco Pesenti Gritti <marco@gnome.org> * src/ephy-notebook.c: (notebook_drag_data_received_cb): * src/ephy-window.c: (ephy_window_set_zoom), (ephy_window_load_in_tabs): * src/ephy-window.h: Add EphyWindow API to open multiple uris in tabs, use it for dnd on the notebook.
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 5010ffc46..0ddf7f59c 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -304,6 +304,7 @@ static guint ephy_popups_n_entries = G_N_ELEMENTS (ephy_popups_entries);
#define CONF_LOCKDOWN_HIDE_MENUBAR "/apps/epiphany/lockdown/hide_menubar"
#define CONF_DESKTOP_BG_PICTURE "/desktop/gnome/background/picture_filename"
+#define INSANE_NUMBER_OF_URLS 20
#define EPHY_WINDOW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_WINDOW, EphyWindowPrivate))
@@ -2620,6 +2621,52 @@ ephy_window_set_zoom (EphyWindow *window,
}
}
+void
+ephy_window_load_in_tabs (EphyWindow *window, EphyTab *tab, GList *uri_list)
+{
+ EphyEmbed *embed = NULL;
+ GList *l;
+ gchar *url = NULL;
+ guint num = 0;
+ GnomeVFSURI *uri;
+
+ if (tab != NULL)
+ {
+ embed = ephy_tab_get_embed (tab);
+ g_return_if_fail (EPHY_IS_EMBED (embed));
+ }
+
+ l = uri_list;
+ while (l != NULL && num < INSANE_NUMBER_OF_URLS)
+ {
+ uri = (GnomeVFSURI*) l->data;
+ url = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+
+ if (num == 0 && embed != NULL)
+ {
+ /**
+ * The first url is special: if the drag was to an
+ * existing tab, load it there
+ */
+ ephy_embed_load_url (embed, url);
+ }
+ else
+ {
+ tab = ephy_shell_new_tab (ephy_shell, window,
+ tab, url,
+ EPHY_NEW_TAB_OPEN_PAGE |
+ EPHY_NEW_TAB_IN_EXISTING_WINDOW |
+ (tab ? EPHY_NEW_TAB_APPEND_AFTER :
+ EPHY_NEW_TAB_APPEND_LAST));
+ }
+
+ g_free (url);
+ url = NULL;
+ l = l->next;
+ ++num;
+ }
+}
+
static void
sync_prefs_with_chrome (EphyWindow *window)
{