diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-02-02 07:42:48 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-02-02 07:42:48 +0800 |
commit | 3cc751a30e83efeed8fc9707d2069c545aa005c6 (patch) | |
tree | 3d1e4cee4a69ace5bc6a1d0d9ae28dfbebc7f698 /src/ephy-session.c | |
parent | ab9e3429d7c547aad67106a04847e16cda1279b4 (diff) | |
download | gsoc2013-epiphany-3cc751a30e83efeed8fc9707d2069c545aa005c6.tar.gz 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-session.c')
-rw-r--r-- | src/ephy-session.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c index 117081c83..49ca547d9 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -32,6 +32,7 @@ #include "ephy-file-helpers.h" #include "eel-gconf-extensions.h" #include "ephy-prefs.h" +#include "ephy-gui.h" #include "ephy-debug.h" #include <glib/gi18n.h> @@ -357,7 +358,8 @@ ephy_session_class_init (EphySessionClass *class) } static gboolean -offer_to_resume (EphySession *session) +offer_to_resume (EphySession *session, + guint32 user_time) { GtkWidget *dialog; int response; @@ -385,6 +387,9 @@ offer_to_resume (EphySession *session) session->priv->resume_dialog = dialog; + ephy_gui_window_update_user_time (session->priv->resume_dialog, + user_time); + response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); @@ -397,6 +402,7 @@ offer_to_resume (EphySession *session) /** * ephy_session_autoresume: * @session: a #EphySession + * @user_time: a timestamp, or 0 * * Resume a crashed session when necessary (interactive) * @@ -405,28 +411,33 @@ offer_to_resume (EphySession *session) * has been re-presented to the user. **/ gboolean -ephy_session_autoresume (EphySession *session) +ephy_session_autoresume (EphySession *session, + guint32 user_time) { + EphySessionPrivate *priv = session->priv; char *saved_session; gboolean retval = FALSE; LOG ("ephy_session_autoresume"); - if (session->priv->windows != NULL || session->priv->tool_windows != NULL) return FALSE; + if (priv->windows != NULL || priv->tool_windows != NULL) return FALSE; - if (session->priv->resume_dialog) + if (priv->resume_dialog) { - gtk_window_present (GTK_WINDOW (session->priv->resume_dialog)); + ephy_gui_window_update_user_time (session->priv->resume_dialog, + user_time); + gtk_window_present (GTK_WINDOW (priv->resume_dialog)); return TRUE; } saved_session = get_session_filename (SESSION_CRASHED); if (g_file_test (saved_session, G_FILE_TEST_EXISTS) - && offer_to_resume (session)) + && offer_to_resume (session, user_time)) { session->priv->dont_save = TRUE; - retval = ephy_session_load (session, saved_session); + retval = ephy_session_load (session, saved_session, + user_time); session->priv->dont_save = FALSE; ephy_session_save (session, SESSION_CRASHED); } @@ -738,6 +749,7 @@ restore_geometry (GtkWindow *window, * ephy_session_load: * @session: a #EphySession * @filename: the path of the source file + * @user_time: a timestamp, or 0 * * Load a session from disk, restoring the windows and their state * @@ -745,7 +757,8 @@ restore_geometry (GtkWindow *window, **/ gboolean ephy_session_load (EphySession *session, - const char *filename) + const char *filename, + guint32 user_time) { xmlDocPtr doc; xmlNodePtr child; @@ -776,6 +789,9 @@ ephy_session_load (EphySession *session, widget = GTK_WIDGET (ephy_window_new ()); restore_geometry (GTK_WINDOW (widget), child); parse_embed (child->children, EPHY_WINDOW (widget)); + + ephy_gui_window_update_user_time (widget, user_time); + gtk_window_present (GTK_WINDOW (widget)); } else if (xmlStrEqual (child->name, (const xmlChar *) "toolwindow")) @@ -800,6 +816,9 @@ ephy_session_load (EphySession *session, } restore_geometry (GTK_WINDOW (widget), child); + + ephy_gui_window_update_user_time (widget, user_time); + gtk_window_present (GTK_WINDOW (widget)); } |