mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
[Config] Add 'in your face' error message about deprecated theme setting.
Issue: #1468
This commit is contained in:
parent
4face975a9
commit
0e70d8a5c9
2 changed files with 20 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
|||
#include "theme.h"
|
||||
#include "xrmoptions.h"
|
||||
#include "css-colors.h"
|
||||
#include "rofi.h"
|
||||
|
||||
typedef struct YYLTYPE {
|
||||
int first_line;
|
||||
|
@ -447,6 +448,9 @@ t_config_property
|
|||
yyerror ( &(@$), @$.filename, error );
|
||||
#else
|
||||
g_warning("%s:%d:%d: %s\n", @$.filename, @$.first_line, @$.first_column, error);
|
||||
GString *str = g_string_new("");
|
||||
g_string_append_printf(str,"%s:%d:%d: %s\n", @$.filename, @$.first_line, @$.first_column, error);
|
||||
rofi_add_error_message(str);
|
||||
#endif
|
||||
g_free(error);
|
||||
}
|
||||
|
|
|
@ -644,6 +644,22 @@ static gboolean __config_parser_set_property(XrmOption *option,
|
|||
}
|
||||
|
||||
gboolean config_parse_set_property(const Property *p, char **error) {
|
||||
if (g_ascii_strcasecmp(p->name, "theme") == 0) {
|
||||
if (p->type == P_STRING) {
|
||||
*error = g_strdup_printf("The option:\n<b>\nconfiguration\n{\n\ttheme: "
|
||||
"\"%s\";\n}</b>\nis deprecated. Please replace "
|
||||
"with: <b>@theme \"%s\"</b> "
|
||||
"after the configuration block.",
|
||||
p->value.s, p->value.s);
|
||||
} else {
|
||||
*error = g_strdup_printf("The option:\n<b>\nconfiguration\n{\n\ttheme: "
|
||||
"\"%s\";\n}</b>\nis deprecated. Please replace "
|
||||
"with: <b>@theme \"%s\"</b> "
|
||||
"after the configuration block.",
|
||||
"myTheme", "myTheme");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
for (unsigned int i = 0; i < sizeof(xrmOptions) / sizeof(XrmOption); ++i) {
|
||||
XrmOption *op = &(xrmOptions[i]);
|
||||
if (g_strcmp0(op->name, p->name) == 0) {
|
||||
|
|
Loading…
Reference in a new issue