display warning notification on depricated settings

This commit is contained in:
Sascha Kruse 2012-07-25 06:58:23 +02:00
parent f05e80edf6
commit b06a94c8fc
2 changed files with 11 additions and 11 deletions

20
dunst.c
View File

@ -104,6 +104,9 @@ static enum follow_mode f_mode = FOLLOW_NONE;
int next_notification_id = 1;
int depricated_mod = False;
int depricated_dunstrc_shortcuts;
/* notification lists */
list *notification_queue = NULL; /* all new notifications get into here */
list *displayed_notifications = NULL; /* currently displayed notifications */
@ -1280,8 +1283,7 @@ void parse_cmdline(int argc, char *argv[])
format = optarg;
break;
case 'M':
fprintf(stderr,
"-mod is depricated. Use \"-key mod+key\" instead\n");
depricated_mod = True;
mod = string_to_mask(optarg);
close_ks.mask = mod;
close_all_ks.mask = mod;
@ -1401,8 +1403,7 @@ dunst_ini_handle(void *user_data, const char *section,
else if (strcmp(name, "geometry") == 0)
geom = dunst_ini_get_string(value);
else if (strcmp(name, "modifier") == 0) {
fprintf(stderr,
"WARNING: Keyboard Shortcuts in [global] are depricated. See example dunstrc for new [shortcuts] section\n");
depricated_dunstrc_shortcuts = True;
KeySym mod =
string_to_mask(dunst_ini_get_string(value));
@ -1410,16 +1411,10 @@ dunst_ini_handle(void *user_data, const char *section,
close_all_ks.mask = mod;
history_ks.mask = mod;
} else if (strcmp(name, "key") == 0) {
fprintf(stderr,
"WARNING: Keyboard Shortcuts in [global] are depricated. See example dunstrc for new [shortcuts] section\n");
close_ks.str = dunst_ini_get_string(value);
} else if (strcmp(name, "all_key") == 0) {
fprintf(stderr,
"WARNING: Keyboard Shortcuts in [global] are depricated. See example dunstrc for new [shortcuts] section\n");
close_all_ks.str = dunst_ini_get_string(value);
} else if (strcmp(name, "history_key") == 0) {
fprintf(stderr,
"WARNING: Keyboard Shortcuts in [global] are depricated. See example dunstrc for new [shortcuts] section\n");
history_ks.str = dunst_ini_get_string(value);
} else if (strcmp(name, "alignment") == 0) {
@ -1589,6 +1584,11 @@ int main(int argc, char *argv[])
color_strings[ColBG][CRIT] = critbgcolor;
setup();
if (depricated_mod)
warn("-mod is depricated. Use \"-key mod+key\" instead\n", CRIT);
if (depricated_dunstrc_shortcuts)
warn("You are using depricated settings. Please update your dunstrc. SEE [shortcuts]",CRIT);
run();
return 0;
}

View File

@ -256,7 +256,7 @@ void notificationClosed(notification * n, int reason)
DBusMessageIter args;
int id;
if (n == NULL) {
if (n == NULL || n->dbus_client == NULL) {
return;
}