Commit af5e94df authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte

GladeWindow: disable survey if there is no TLS support

Closses issue #371 "Glade user survey not working (TLS error)"
parent 81f96c2f
......@@ -49,6 +49,7 @@ Requirements
Optional dependencies:
* glib-networking plugins for TLS support (Needed for survey)
* libwebkit2gtk-4.0 - For Webkit plugin
* python-gi - For Python plugin
* libgjs - For JavaScript plugin
......@@ -59,7 +60,7 @@ Download sources from git and build using meson/ninja
sudo apt install gcc meson libgtk-3-dev libxml2-dev libgirepository1.0-dev xsltproc
# Optional dependencies
sudo apt install libgjs-dev libwebkit2gtk-4.0-dev python-gi-dev
sudo apt install libgjs-dev libwebkit2gtk-4.0-dev python-gi-dev glib-networking
# Clone the source repository or download tarball
git clone https://gitlab.gnome.org/GNOME/glade.git
......
......@@ -113,6 +113,7 @@ add_project_arguments(common_flags, language: 'c')
# Check required libraries
glib_dep = dependency('glib-2.0', version: '>= 2.64.0')
gio_dep = dependency('gio-2.0', version: '>= 2.64.0')
gmodule_dep = dependency('gmodule-2.0')
gmodule_export_dep = dependency('gmodule-export-2.0')
gtk_dep = dependency('gtk+-3.0', version: '>= 3.24.0')
......@@ -214,6 +215,17 @@ meson.add_install_script(
glade_datadir,
)
tls_backend_support_src = '''
#include <stdio.h>
#include <gio/gio.h>
int main(int argc, char **argv)
{
printf ("%s\n", g_tls_backend_supports_tls (g_tls_backend_get_default ()) ? "true" : "false");
return 0;
}
'''
tls_backend_support = cc.run(tls_backend_support_src, dependencies: gio_dep).stdout()
output = '\nConfiguration:\n\n'
output += '\tCompiler: ' + cc.get_id() + '\n'
output += '\tSource code location: ' + source_root + '\n'
......@@ -225,5 +237,6 @@ output += '\tGladeui Catalog: ' + enable_gladeui.to_string() + '\n'
output += '\tWebKit2GTK+ Catalog: ' + have_webkit2gtk.to_string() + '\n'
output += '\tIntrospection Data: ' + enable_introspection.to_string() + '\n\n'
output += '\tBuild Reference Manual: ' + enable_gtk_doc.to_string() + '\n'
output += '\tBuild Manual Pages: ' + enable_man.to_string()
output += '\tBuild Manual Pages: ' + enable_man.to_string() + '\n'
output += '\tTLS backend support: ' + tls_backend_support
message(output)
......@@ -2501,6 +2501,13 @@ glade_window_registration_notify_user (GladeWindow *window)
g_return_if_fail (GLADE_IS_WINDOW (window));
priv = window->priv;
if (!g_tls_backend_supports_tls (g_tls_backend_get_default ()))
{
g_message ("No TLS support in GIO, Registration & User Survey disabled. (missing glib-networking package)");
actions_set_enabled (window, "registration", FALSE);
return;
}
g_object_get (priv->registration,
"completed", &completed,
"skip-reminder", &skip_reminder,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment