1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00

Give a visible (popup) error message when failed to open theme

This commit is contained in:
Dave Davenport 2017-01-19 18:49:55 +01:00
parent 46f1e6f107
commit 13a83e3495

View file

@ -860,7 +860,10 @@ gboolean rofi_theme_parse_file ( const char *file )
char *filename = rofi_expand_path ( file );
yyin = fopen ( filename, "rb" );
if ( yyin == NULL ) {
fprintf ( stderr, "Failed to open file: %s: '%s'\n", filename, strerror ( errno ) );
char *str = g_markup_printf_escaped ( "Failed to open theme: <i>%s</i>\nError: <b>%s</b>",
filename, strerror ( errno ) );
rofi_add_error_message ( g_string_new ( str ) );
g_free(str);
g_free ( filename );
return TRUE;
}