Add setting to ignore page number stored in file info. (Closes: #145)

Thanks for the patch to Urchlay.
This commit is contained in:
Sebastian Ramacher 2012-03-12 22:31:40 +01:00
parent 59f27880a8
commit 01b5750bcc
2 changed files with 9 additions and 0 deletions

View File

@ -97,6 +97,8 @@ config_load_default(zathura_t* zathura)
girara_setting_add(gsession, "show-hidden", &bool_value, BOOLEAN, false, _("Show hidden files and directories"), NULL, NULL);
bool_value = true;
girara_setting_add(gsession, "show-directories", &bool_value, BOOLEAN, false, _("Show directories"), NULL, NULL);
bool_value = false;
girara_setting_add(gsession, "open-first-page", &bool_value, BOOLEAN, false, _("Always open on first page"), NULL, NULL);
/* define default shortcuts */
girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_c, NULL, sc_abort, 0, 0, NULL);

View File

@ -330,6 +330,13 @@ zathura_document_open(zathura_t* zathura, const char* path, const char* password
document->pages[page_id] = page;
}
/* jump to first page if setting enabled */
bool always_first_page = false;
girara_setting_get(zathura->ui.session, "open-first-page", &always_first_page);
if (always_first_page) {
document->current_page_number = 0;
}
/* apply open adjustment */
char* adjust_open = "best-fit";
document->adjust_mode = ADJUST_BESTFIT;