Commit f4ff19d9 authored by Moritz Lipp's avatar Moritz Lipp

pages-per-row must not be 0

parent 37af6180
...@@ -220,13 +220,24 @@ cb_refresh_view(GtkWidget* GIRARA_UNUSED(view), gpointer data) ...@@ -220,13 +220,24 @@ cb_refresh_view(GtkWidget* GIRARA_UNUSED(view), gpointer data)
} }
void void
cb_page_layout_value_changed(girara_session_t* session, const char* UNUSED(name), girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data)) cb_page_layout_value_changed(girara_session_t* session, const char* name, girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
{ {
g_return_if_fail(value != NULL); g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL); g_return_if_fail(session != NULL);
g_return_if_fail(session->global.data != NULL); g_return_if_fail(session->global.data != NULL);
zathura_t* zathura = session->global.data; zathura_t* zathura = session->global.data;
/* pages-per-row must not be 0 */
if (g_strcmp0(name, "pages-per-row") == 0) {
unsigned int pages_per_row = *((unsigned int*) value);
if (pages_per_row == 0) {
pages_per_row = 1;
girara_setting_set(session, name, &pages_per_row);
girara_notify(session, GIRARA_WARNING, _("'%s' must not be 0. Set to 1.."), name);
return;
}
}
if (zathura->document == NULL) { if (zathura->document == NULL) {
/* no document has been openend yet */ /* no document has been openend yet */
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment