swallow errors on CSS loading

preliminary workaround for Ticket #972
On Debian/Jessie, we observed the following error
"gtk-lumiera.css:38:19Theming engine 'adwaita' not found"
even though the package gnome-themes-standard *is* installed

This allows at least to bring the UI up, even if loading
our custom theme and stylesheet fails.
This commit is contained in:
Fischlurch 2015-11-03 05:26:52 +01:00
parent 3248741db1
commit 51a58aacae

View file

@ -64,8 +64,16 @@ namespace gui {
{
auto screen = Gdk::Screen::get_default();
auto css_provider = CssProvider::create();
css_provider->load_from_path (lib::resolveModulePath (stylesheetName, resourceSerachPath_));
try
{
css_provider->load_from_path (lib::resolveModulePath (stylesheetName, resourceSerachPath_));
/////////////////////////////////TICKET #953 should detect and notify CSS parsing errors. CssProvider offers a signal for this purpose
/////////////////////////////////TICKET #953 ...seems to be supported properly starting with gtkmm 3.18 (Debian/Jessie has 3.14)
}
catch(Glib::Error const& failure)
{
WARN(gui, "Failure while loading stylesheet '%s': %s", cStr(stylesheetName), cStr(failure.what()));
}
StyleContext::add_provider_for_screen (screen, css_provider,
GTK_STYLE_PROVIDER_PRIORITY_USER);