]>
Commit | Line | Data |
---|---|---|
852f4e06 SS |
1 | diff -up openssh-5.1p1/contrib/gnome-ssh-askpass2.c.progress openssh-5.1p1/contrib/gnome-ssh-askpass2.c |
2 | --- openssh-5.1p1/contrib/gnome-ssh-askpass2.c.progress 2008-07-23 19:05:26.000000000 +0200 | |
3 | +++ openssh-5.1p1/contrib/gnome-ssh-askpass2.c 2008-07-23 19:05:26.000000000 +0200 | |
4 | @@ -53,6 +53,7 @@ | |
5 | #include <string.h> | |
6 | #include <unistd.h> | |
7 | #include <X11/Xlib.h> | |
8 | +#include <glib.h> | |
9 | #include <gtk/gtk.h> | |
10 | #include <gdk/gdkx.h> | |
11 | ||
12 | @@ -83,13 +84,24 @@ ok_dialog(GtkWidget *entry, gpointer dia | |
13 | gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); | |
14 | } | |
15 | ||
16 | +static void | |
17 | +move_progress(GtkWidget *entry, gpointer progress) | |
18 | +{ | |
19 | + gdouble step; | |
20 | + g_return_if_fail(GTK_IS_PROGRESS_BAR(progress)); | |
21 | + | |
22 | + step = g_random_double_range(0.03, 0.1); | |
23 | + gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(progress), step); | |
24 | + gtk_progress_bar_pulse(GTK_PROGRESS_BAR(progress)); | |
25 | +} | |
26 | + | |
27 | static int | |
28 | passphrase_dialog(char *message) | |
29 | { | |
30 | const char *failed; | |
31 | char *passphrase, *local; | |
32 | int result, grab_tries, grab_server, grab_pointer; | |
33 | - GtkWidget *dialog, *entry; | |
34 | + GtkWidget *dialog, *entry, *progress, *hbox; | |
35 | GdkGrabStatus status; | |
36 | ||
37 | grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL); | |
38 | @@ -102,13 +114,31 @@ passphrase_dialog(char *message) | |
39 | "%s", | |
40 | message); | |
41 | ||
42 | + hbox = gtk_hbox_new(FALSE, 0); | |
43 | + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, | |
44 | + FALSE, 0); | |
45 | + gtk_widget_show(hbox); | |
46 | + | |
47 | entry = gtk_entry_new(); | |
48 | - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), entry, FALSE, | |
49 | + gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, | |
50 | FALSE, 0); | |
51 | + gtk_entry_set_width_chars(GTK_ENTRY(entry), 2); | |
52 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); | |
53 | gtk_widget_grab_focus(entry); | |
54 | gtk_widget_show(entry); | |
55 | ||
56 | + hbox = gtk_hbox_new(FALSE, 0); | |
57 | + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, | |
58 | + FALSE, 8); | |
59 | + gtk_widget_show(hbox); | |
60 | + | |
61 | + progress = gtk_progress_bar_new(); | |
62 | + | |
63 | + gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress), "Passphrase length hidden intentionally"); | |
64 | + gtk_box_pack_start(GTK_BOX(hbox), progress, TRUE, | |
65 | + TRUE, 5); | |
66 | + gtk_widget_show(progress); | |
67 | + | |
68 | gtk_window_set_title(GTK_WINDOW(dialog), "OpenSSH"); | |
69 | gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); | |
70 | gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE); | |
71 | @@ -119,6 +149,8 @@ passphrase_dialog(char *message) | |
72 | gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); | |
73 | g_signal_connect(G_OBJECT(entry), "activate", | |
74 | G_CALLBACK(ok_dialog), dialog); | |
75 | + g_signal_connect(G_OBJECT(entry), "changed", | |
76 | + G_CALLBACK(move_progress), progress); | |
77 | ||
78 | gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE); | |
79 |