mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 23:46:00 +01:00
Open password dialog after handling current input (fixes #468)
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
63e477fd41
commit
f41fc252bd
1 changed files with 12 additions and 2 deletions
|
@ -596,6 +596,16 @@ get_formatted_filename(zathura_t* zathura, const char* file_path, bool statusbar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
document_open_password_dialog(gpointer data)
|
||||||
|
{
|
||||||
|
zathura_password_dialog_info_t* password_dialog_info = data;
|
||||||
|
|
||||||
|
girara_dialog(password_dialog_info->zathura->ui.session, _("Enter password:"), true, NULL,
|
||||||
|
(girara_callback_inputbar_activate_t) cb_password_dialog, password_dialog_info);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
document_open(zathura_t* zathura, const char* path, const char* password,
|
document_open(zathura_t* zathura, const char* path, const char* password,
|
||||||
int page_number)
|
int page_number)
|
||||||
|
@ -610,14 +620,14 @@ document_open(zathura_t* zathura, const char* path, const char* password,
|
||||||
|
|
||||||
if (document == NULL) {
|
if (document == NULL) {
|
||||||
if (error == ZATHURA_ERROR_INVALID_PASSWORD) {
|
if (error == ZATHURA_ERROR_INVALID_PASSWORD) {
|
||||||
|
girara_debug("Invalid or no password.");
|
||||||
zathura_password_dialog_info_t* password_dialog_info = malloc(sizeof(zathura_password_dialog_info_t));
|
zathura_password_dialog_info_t* password_dialog_info = malloc(sizeof(zathura_password_dialog_info_t));
|
||||||
if (password_dialog_info != NULL) {
|
if (password_dialog_info != NULL) {
|
||||||
password_dialog_info->zathura = zathura;
|
password_dialog_info->zathura = zathura;
|
||||||
|
|
||||||
if (path != NULL) {
|
if (path != NULL) {
|
||||||
password_dialog_info->path = g_strdup(path);
|
password_dialog_info->path = g_strdup(path);
|
||||||
girara_dialog(zathura->ui.session, "Enter password:", true, NULL,
|
gdk_threads_add_idle(document_open_password_dialog, password_dialog_info);
|
||||||
(girara_callback_inputbar_activate_t) cb_password_dialog, password_dialog_info);
|
|
||||||
goto error_out;
|
goto error_out;
|
||||||
} else {
|
} else {
|
||||||
free(password_dialog_info);
|
free(password_dialog_info);
|
||||||
|
|
Loading…
Reference in a new issue