- wlmessage_set_title (wlmessage, title);
- wlmessage_set_icon (wlmessage, image_path);
- wlmessage_set_message (wlmessage, content);
- wlmessage_add_button (wlmessage, 0, "Ok");
- wlmessage_show (wlmessage, NULL);
+ if (title)
+ wlmessage_set_title (wlmessage, title);
+ if (image_path)
+ wlmessage_set_icon (wlmessage, image_path);
+ if (content)
+ wlmessage_set_message (wlmessage, content);
+ else
+ wlmessage_set_message (wlmessage, "<Default>");
+ if (type == NOTIF_TYPE_USERPROMPT)
+ wlmessage_set_textfield (wlmessage, "");
+ if (type == NOTIF_TYPE_USERCONFIRM) {
+ wlmessage_add_button (wlmessage, 1, "Yes");
+ wlmessage_add_button (wlmessage, 0, "No");
+ } else {
+ wlmessage_add_button (wlmessage, 0, "Ok");
+ }
+
+ if (wlmessage_show (wlmessage, NULL) < 0) {
+ wlmessage_destroy (wlmessage);
+ return;
+ }