aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-02-02 07:42:48 +0800
committerChristian Persch <chpe@src.gnome.org>2005-02-02 07:42:48 +0800
commit3cc751a30e83efeed8fc9707d2069c545aa005c6 (patch)
tree3d1e4cee4a69ace5bc6a1d0d9ae28dfbebc7f698 /src/ephy-shell.c
parentab9e3429d7c547aad67106a04847e16cda1279b4 (diff)
downloadgsoc2013-epiphany-3cc751a30e83efeed8fc9707d2069c545aa005c6.tar
gsoc2013-epiphany-3cc751a30e83efeed8fc9707d2069c545aa005c6.tar.gz
gsoc2013-epiphany-3cc751a30e83efeed8fc9707d2069c545aa005c6.tar.bz2
gsoc2013-epiphany-3cc751a30e83efeed8fc9707d2069c545aa005c6.tar.lz
gsoc2013-epiphany-3cc751a30e83efeed8fc9707d2069c545aa005c6.tar.xz
gsoc2013-epiphany-3cc751a30e83efeed8fc9707d2069c545aa005c6.tar.zst
gsoc2013-epiphany-3cc751a30e83efeed8fc9707d2069c545aa005c6.zip
Define variants with startup ID.
2005-02-02 Christian Persch <chpe@cvs.gnome.org> * idl/EphyAutomation.idl: Define variants with startup ID. * lib/ephy-gui.c: (ephy_gui_window_update_user_time): * lib/ephy-gui.h: * src/bookmarks/ephy-bookmarks.c: (redirect_cb): * src/ephy-automation.c: (impl_ephy_automation_loadUrlWithStartupId), (impl_ephy_automation_loadurl), (impl_ephy_automation_addBookmark), (impl_ephy_automation_importBookmarks), (impl_ephy_automation_loadSessionWithStartupId), (impl_ephy_automation_loadSession), (impl_ephy_automation_openBookmarksEditorWithStartupId), (impl_ephy_automation_openBookmarksEditor), (ephy_automation_class_init): * src/ephy-main.c: (get_startup_id), (main): * src/ephy-session.c: (offer_to_resume), (ephy_session_autoresume), (ephy_session_load): * src/ephy-session.h: * src/ephy-shell.c: (open_urls), (ephy_shell_startup), (ephy_shell_new_tab_full), (ephy_shell_new_tab): * src/ephy-shell.h: Implement startup ID forwarding to the already-running ephy instance. Part of bug #150085.
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r--src/ephy-shell.c67
1 files changed, 50 insertions, 17 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 191f552bc..dc9647df5 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -46,6 +46,7 @@
#include "ephy-automation.h"
#include "print-dialog.h"
#include "ephy-prefs.h"
+#include "ephy-gui.h"
#ifdef ENABLE_DBUS
#include "ephy-dbus.h"
@@ -308,8 +309,11 @@ path_from_command_line_arg (const char *arg)
static void
open_urls (GNOME_EphyAutomation automation,
- const char **args, CORBA_Environment *ev,
- gboolean new_tab, gboolean existing_window,
+ guint32 user_time,
+ const char **args,
+ CORBA_Environment *ev,
+ gboolean new_tab,
+ gboolean existing_window,
gboolean fullscreen)
{
int i;
@@ -317,9 +321,9 @@ open_urls (GNOME_EphyAutomation automation,
if (args == NULL)
{
/* Homepage or resume */
- GNOME_EphyAutomation_loadurl
+ GNOME_EphyAutomation_loadUrlWithStartupId
(automation, "", fullscreen,
- existing_window, new_tab, ev);
+ existing_window, new_tab, user_time, ev);
}
else
{
@@ -329,9 +333,9 @@ open_urls (GNOME_EphyAutomation automation,
path = path_from_command_line_arg (args[i]);
- GNOME_EphyAutomation_loadurl
+ GNOME_EphyAutomation_loadUrlWithStartupId
(automation, path, fullscreen,
- existing_window, new_tab, ev);
+ existing_window, new_tab, user_time, ev);
g_free (path);
}
@@ -410,6 +414,7 @@ gnome_session_init (EphyShell *shell)
gboolean
ephy_shell_startup (EphyShell *shell,
EphyShellStartupFlags flags,
+ guint32 user_time,
const char **args,
const char *string_arg,
GError **error)
@@ -465,13 +470,13 @@ ephy_shell_startup (EphyShell *shell,
}
else if (flags & EPHY_SHELL_STARTUP_BOOKMARKS_EDITOR)
{
- GNOME_EphyAutomation_openBookmarksEditor
- (automation, &ev);
+ GNOME_EphyAutomation_openBookmarksEditorWithStartupId
+ (automation, user_time, &ev);
}
else if (flags & EPHY_SHELL_STARTUP_SESSION)
{
- GNOME_EphyAutomation_loadSession
- (automation, string_arg, &ev);
+ GNOME_EphyAutomation_loadSessionWithStartupId
+ (automation, string_arg, user_time, &ev);
}
else if (flags & EPHY_SHELL_STARTUP_IMPORT_BOOKMARKS)
{
@@ -485,7 +490,7 @@ ephy_shell_startup (EphyShell *shell,
}
else
{
- open_urls (automation, args, &ev,
+ open_urls (automation, user_time, args, &ev,
flags & EPHY_SHELL_STARTUP_TABS,
flags & EPHY_SHELL_STARTUP_EXISTING_WINDOW,
flags & EPHY_SHELL_STARTUP_FULLSCREEN);
@@ -639,11 +644,12 @@ load_homepage (EphyEmbed *embed)
}
/**
- * ephy_shell_new_tab:
+ * ephy_shell_new_tab_full:
* @shell: a #EphyShell
* @parent_window: the target #EphyWindow or %NULL
* @previous_tab: the referrer tab or %NULL
* @url: an url to load or %NULL
+ * @user_time: a timestamp, or 0
*
* Create a new tab and the parent window when necessary.
* Use this function to open urls in new window/tabs.
@@ -651,11 +657,12 @@ load_homepage (EphyEmbed *embed)
* ReturnValue: the created #EphyTab
**/
EphyTab *
-ephy_shell_new_tab (EphyShell *shell,
- EphyWindow *parent_window,
- EphyTab *previous_tab,
- const char *url,
- EphyNewTabFlags flags)
+ephy_shell_new_tab_full (EphyShell *shell,
+ EphyWindow *parent_window,
+ EphyTab *previous_tab,
+ const char *url,
+ EphyNewTabFlags flags,
+ guint32 user_time)
{
EphyWindow *window;
EphyTab *tab;
@@ -705,6 +712,9 @@ ephy_shell_new_tab (EphyShell *shell,
embed = ephy_tab_get_embed (tab);
ephy_window_add_tab (window, tab, position, jump_to);
+
+ ephy_gui_window_update_user_time (GTK_WIDGET (window), user_time);
+
gtk_widget_show (GTK_WIDGET (window));
if (flags & EPHY_NEW_TAB_HOME_PAGE ||
@@ -729,6 +739,29 @@ ephy_shell_new_tab (EphyShell *shell,
}
/**
+ * ephy_shell_new_tab:
+ * @shell: a #EphyShell
+ * @parent_window: the target #EphyWindow or %NULL
+ * @previous_tab: the referrer tab or %NULL
+ * @url: an url to load or %NULL
+ *
+ * Create a new tab and the parent window when necessary.
+ * Use this function to open urls in new window/tabs.
+ *
+ * ReturnValue: the created #EphyTab
+ **/
+EphyTab *
+ephy_shell_new_tab (EphyShell *shell,
+ EphyWindow *parent_window,
+ EphyTab *previous_tab,
+ const char *url,
+ EphyNewTabFlags flags)
+{
+ return ephy_shell_new_tab_full (shell, parent_window,
+ previous_tab, url, flags, 0);
+}
+
+/**
* ephy_shell_get_session:
* @shell: the #EphyShell
*