Display notification after copying image

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2017-09-12 10:40:52 +02:00
parent a020da7049
commit 93775267fc

View file

@ -611,9 +611,23 @@ cb_page_widget_image_selected(ZathuraPage* page, GdkPixbuf* pixbuf, void* data)
if (selection != NULL) { if (selection != NULL) {
gtk_clipboard_set_image(gtk_clipboard_get(*selection), pixbuf); gtk_clipboard_set_image(gtk_clipboard_get(*selection), pixbuf);
}
g_free(selection); bool notification = true;
girara_setting_get(zathura->ui.session, "selection-notification", &notification);
if (notification == true) {
char* target = NULL;
girara_setting_get(zathura->ui.session, "selection-clipboard", &target);
char* escaped_text = g_markup_printf_escaped(
_("Copied selected image to selection %s"), target);
g_free(target);
girara_notify(zathura->ui.session, GIRARA_INFO, "%s", escaped_text);
}
g_free(selection);
}
} }
void void