mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 11:36:01 +01:00
Merge branch 'develop' of pwmt.org:zathura into develop
This commit is contained in:
commit
cba92029fa
2 changed files with 26 additions and 12 deletions
24
callbacks.c
24
callbacks.c
|
@ -221,6 +221,17 @@ cb_file_monitor(GFileMonitor* monitor, GFile* file, GFile* UNUSED(other_file), G
|
|||
sc_reload(session, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
password_dialog(gpointer data)
|
||||
{
|
||||
zathura_password_dialog_info_t* dialog = data;
|
||||
if (dialog != NULL) {
|
||||
girara_dialog(dialog->zathura->ui.session, "Incorrect password. Enter password:", true, NULL,
|
||||
(girara_callback_inputbar_activate_t) cb_password_dialog, dialog);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool
|
||||
cb_password_dialog(GtkEntry* entry, zathura_password_dialog_info_t* dialog)
|
||||
{
|
||||
|
@ -245,18 +256,19 @@ cb_password_dialog(GtkEntry* entry, zathura_password_dialog_info_t* dialog)
|
|||
g_free(input);
|
||||
}
|
||||
|
||||
girara_dialog(dialog->zathura->ui.session, "Enter password:", true, NULL,
|
||||
(girara_callback_inputbar_activate_t) cb_password_dialog, dialog);
|
||||
|
||||
g_idle_add(password_dialog, dialog);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* try to open document again */
|
||||
document_open(dialog->zathura, dialog->path, input);
|
||||
if (document_open(dialog->zathura, dialog->path, input) == false) {
|
||||
g_idle_add(password_dialog, dialog);
|
||||
} else {
|
||||
g_free(dialog->path);
|
||||
free(dialog);
|
||||
}
|
||||
|
||||
g_free(input);
|
||||
g_free(dialog->path);
|
||||
free(dialog);
|
||||
|
||||
return true;
|
||||
|
||||
|
|
14
shortcuts.c
14
shortcuts.c
|
@ -23,13 +23,15 @@ sc_abort(girara_session_t* session, girara_argument_t* UNUSED(argument),
|
|||
g_return_val_if_fail(session->global.data != NULL, false);
|
||||
zathura_t* zathura = session->global.data;
|
||||
|
||||
for (unsigned int page_id = 0; page_id < zathura->document->number_of_pages; ++page_id) {
|
||||
zathura_page_t* page = zathura->document->pages[page_id];
|
||||
if (page == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (zathura->document != NULL) {
|
||||
for (unsigned int page_id = 0; page_id < zathura->document->number_of_pages; ++page_id) {
|
||||
zathura_page_t* page = zathura->document->pages[page_id];
|
||||
if (page == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
g_object_set(page->drawing_area, "draw-links", FALSE, NULL);
|
||||
g_object_set(page->drawing_area, "draw-links", FALSE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
girara_mode_set(session, session->modes.normal);
|
||||
|
|
Loading…
Reference in a new issue