diff options
author | Alexander Mikhaylenko <exalm7659@gmail.com> | 2020-09-25 15:31:11 +0500 |
---|---|---|
committer | Alexander Mikhaylenko <alexm@gnome.org> | 2020-09-25 17:20:22 +0500 |
commit | e6b7c0cc8410068ea9542f7ad6ea1f4ac608a9d3 (patch) | |
tree | d83036b834aa306fc96d439a71539a0698a854ec /lib | |
parent | 6c849b7e801a98cb59131404671469e7d9a67e69 (diff) | |
download | epiphany-e6b7c0cc8410068ea9542f7ad6ea1f4ac608a9d3.tar.gz |
Hide web app preferences for system apps
Since system web apps have desktop file in /usr, they cannot be edited and
the preferences do nothing.
Introduce EPHY_WEB_APPLICATION_SYSTEM option, set it for any applications
created via ephy_web_application_ensure_for_app_info(). Hide preferences
for those apps.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ephy-prefs.h | 1 | ||||
-rw-r--r-- | lib/ephy-web-app-utils.c | 11 | ||||
-rw-r--r-- | lib/ephy-web-app-utils.h | 1 |
3 files changed, 10 insertions, 3 deletions
diff --git a/lib/ephy-prefs.h b/lib/ephy-prefs.h index d42344190..6158df1e0 100644 --- a/lib/ephy-prefs.h +++ b/lib/ephy-prefs.h @@ -198,6 +198,7 @@ static const char * const ephy_prefs_web_schema[] = { #define EPHY_PREFS_WEB_APP_ADDITIONAL_URLS "additional-urls" #define EPHY_PREFS_WEB_APP_MOBILE_CAPABLE "mobile-capable" #define EPHY_PREFS_WEB_APP_RUN_IN_BACKGROUND "run-in-background" +#define EPHY_PREFS_WEB_APP_SYSTEM "system" static struct { const char *schema; diff --git a/lib/ephy-web-app-utils.c b/lib/ephy-web-app-utils.c index aff0bc29f..086d794b7 100644 --- a/lib/ephy-web-app-utils.c +++ b/lib/ephy-web-app-utils.c @@ -467,7 +467,7 @@ ephy_web_application_ensure_for_app_info (GAppInfo *app_info) if (error) g_warning ("Couldn't copy desktop file: %s", error->message); - ephy_web_application_initialize_settings (profile_dir, EPHY_WEB_APPLICATION_NONE); + ephy_web_application_initialize_settings (profile_dir, EPHY_WEB_APPLICATION_SYSTEM); } return g_steal_pointer (&profile_dir); @@ -793,12 +793,17 @@ ephy_web_application_initialize_settings (const char *profile_dir g_object_unref (settings); g_object_unref (web_app_settings); - if (options & EPHY_WEB_APPLICATION_MOBILE_CAPABLE) { + if (options) { path = g_build_path ("/", "/org/gnome/epiphany/web-apps/", name, "webapp/", NULL); web_app_settings = g_settings_new_with_path (EPHY_PREFS_WEB_APP_SCHEMA, path); g_free (path); - g_settings_set_boolean (web_app_settings, EPHY_PREFS_WEB_APP_MOBILE_CAPABLE, TRUE); + if (options & EPHY_WEB_APPLICATION_MOBILE_CAPABLE) + g_settings_set_boolean (web_app_settings, EPHY_PREFS_WEB_APP_MOBILE_CAPABLE, TRUE); + + if (options & EPHY_WEB_APPLICATION_SYSTEM) + g_settings_set_boolean (web_app_settings, EPHY_PREFS_WEB_APP_SYSTEM, TRUE); + g_object_unref (web_app_settings); } diff --git a/lib/ephy-web-app-utils.h b/lib/ephy-web-app-utils.h index b51fdaf41..0044abf94 100644 --- a/lib/ephy-web-app-utils.h +++ b/lib/ephy-web-app-utils.h @@ -38,6 +38,7 @@ typedef struct { typedef enum { EPHY_WEB_APPLICATION_NONE, EPHY_WEB_APPLICATION_MOBILE_CAPABLE, + EPHY_WEB_APPLICATION_SYSTEM, } EphyWebApplicationOptions; #define EPHY_WEB_APP_ICON_NAME "app-icon.png" |