diff options
author | Xan Lopez <xlopez@igalia.com> | 2011-07-14 06:47:33 +0800 |
---|---|---|
committer | Xan Lopez <xlopez@igalia.com> | 2011-08-29 03:23:26 +0800 |
commit | ebac66a05be1e71bd978f070fb842fd8b457e7e8 (patch) | |
tree | 549cd1797c49a39cf20be47b5567441f208a5fa5 /src/ephy-main.c | |
parent | bebb9f4299f4a86439ed04b335b6852234af0622 (diff) | |
download | gsoc2013-epiphany-ebac66a05be1e71bd978f070fb842fd8b457e7e8.tar gsoc2013-epiphany-ebac66a05be1e71bd978f070fb842fd8b457e7e8.tar.gz gsoc2013-epiphany-ebac66a05be1e71bd978f070fb842fd8b457e7e8.tar.bz2 gsoc2013-epiphany-ebac66a05be1e71bd978f070fb842fd8b457e7e8.tar.lz gsoc2013-epiphany-ebac66a05be1e71bd978f070fb842fd8b457e7e8.tar.xz gsoc2013-epiphany-ebac66a05be1e71bd978f070fb842fd8b457e7e8.tar.zst gsoc2013-epiphany-ebac66a05be1e71bd978f070fb842fd8b457e7e8.zip |
Add basic support for Web Applications
Allow to save any page as a "Web Application". A new .desktop file
will be created, and added to the Shell as a new application. It will
launch epiphany in application mode, with its own private profile
(inheriting some data from the main profile, like the relevant domain
cookies) and in a new process.
Diffstat (limited to 'src/ephy-main.c')
-rw-r--r-- | src/ephy-main.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/ephy-main.c b/src/ephy-main.c index b85fa7562..a87b4b496 100644 --- a/src/ephy-main.c +++ b/src/ephy-main.c @@ -261,9 +261,6 @@ main (int argc, */ LIBXML_TEST_VERSION; - /* sets name to help matching with the .desktop file */ - g_set_prgname ("epiphany"); - /* If we're given -remote arguments, translate them */ if (argc >= 2 && strcmp (argv[1], "-remote") == 0) { const char *opening, *closing; @@ -400,12 +397,6 @@ main (int argc, if (user_time == 0) user_time = slowly_and_stupidly_obtain_timestamp (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())); - /* sets the name to appear in the window list applet when grouping windows */ - g_set_application_name (_("Web Browser")); - - /* Set default window icon */ - gtk_window_set_default_icon_name (EPHY_STOCK_EPHY); - startup_error_quark = g_quark_from_static_string ("epiphany-startup-error"); /* Start our services */ @@ -426,11 +417,31 @@ main (int argc, /* Now create the shell */ if (private_instance) mode = EPHY_EMBED_SHELL_MODE_PRIVATE; - else if (application_mode) + else if (application_mode) { + char *app_name; + mode = EPHY_EMBED_SHELL_MODE_APPLICATION; - else + + app_name = g_strrstr (profile_directory, EPHY_WEB_APP_PREFIX); + if (app_name) { + /* Skip the 'app-' part */ + app_name += strlen (EPHY_WEB_APP_PREFIX); + + g_set_prgname (app_name); + g_set_application_name (app_name); + + /* We need to re-set this because we have already parsed the + * options, which inits GTK+ and sets this as a side effect. */ + gdk_set_program_class (app_name); + } + } else { mode = EPHY_EMBED_SHELL_MODE_BROWSER; + g_set_prgname ("epiphany"); + g_set_application_name (_("Web Browser")); + gtk_window_set_default_icon_name (EPHY_STOCK_EPHY); + } + _ephy_shell_create_instance (mode); startup_flags = get_startup_flags (); |