Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
3212d524
Commit
3212d524
authored
Feb 08, 2012
by
Moritz Lipp
Browse files
Ask for password if input has been incorrect
parent
a8cdff1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
callbacks.c
View file @
3212d524
...
...
@@ -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
,
"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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment