|
Tomáš Mráz |
bb93ea |
--- openssh-4.2p1/contrib/gnome-ssh-askpass2.c.progress 2005-11-28 11:11:24.000000000 +0100
|
|
Tomáš Mráz |
bb93ea |
+++ openssh-4.2p1/contrib/gnome-ssh-askpass2.c 2005-12-20 15:22:42.000000000 +0100
|
|
Tomáš Mráz |
09d7e6 |
@@ -53,6 +53,7 @@
|
|
Tomáš Mráz |
09d7e6 |
#include <string.h>
|
|
Tomáš Mráz |
09d7e6 |
#include <unistd.h>
|
|
Tomáš Mráz |
09d7e6 |
#include <X11/Xlib.h>
|
|
Tomáš Mráz |
09d7e6 |
+#include <glib.h>
|
|
Tomáš Mráz |
09d7e6 |
#include <gtk/gtk.h>
|
|
Tomáš Mráz |
09d7e6 |
#include <gdk/gdkx.h>
|
|
Tomáš Mráz |
09d7e6 |
|
|
Tomáš Mráz |
09d7e6 |
@@ -83,13 +84,24 @@
|
|
Tomáš Mráz |
09d7e6 |
gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
|
|
Tomáš Mráz |
09d7e6 |
}
|
|
Tomáš Mráz |
09d7e6 |
|
|
Tomáš Mráz |
09d7e6 |
+static void
|
|
Tomáš Mráz |
09d7e6 |
+move_progress(GtkWidget *entry, gpointer progress)
|
|
Tomáš Mráz |
09d7e6 |
+{
|
|
Tomáš Mráz |
09d7e6 |
+ gdouble step;
|
|
Tomáš Mráz |
09d7e6 |
+ g_return_if_fail(GTK_IS_PROGRESS_BAR(progress));
|
|
Tomáš Mráz |
09d7e6 |
+
|
|
Tomáš Mráz |
09d7e6 |
+ step = g_random_double_range(0.03, 0.1);
|
|
Tomáš Mráz |
09d7e6 |
+ gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(progress), step);
|
|
Tomáš Mráz |
09d7e6 |
+ gtk_progress_bar_pulse(GTK_PROGRESS_BAR(progress));
|
|
Tomáš Mráz |
09d7e6 |
+}
|
|
Tomáš Mráz |
09d7e6 |
+
|
|
Tomáš Mráz |
09d7e6 |
static int
|
|
Tomáš Mráz |
09d7e6 |
passphrase_dialog(char *message)
|
|
Tomáš Mráz |
09d7e6 |
{
|
|
Tomáš Mráz |
09d7e6 |
const char *failed;
|
|
Tomáš Mráz |
09d7e6 |
char *passphrase, *local;
|
|
Tomáš Mráz |
09d7e6 |
int result, grab_tries, grab_server, grab_pointer;
|
|
Tomáš Mráz |
09d7e6 |
- GtkWidget *dialog, *entry;
|
|
Tomáš Mráz |
09d7e6 |
+ GtkWidget *dialog, *entry, *progress, *hbox;
|
|
Tomáš Mráz |
09d7e6 |
GdkGrabStatus status;
|
|
Tomáš Mráz |
09d7e6 |
|
|
Tomáš Mráz |
09d7e6 |
grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL);
|
|
Tomáš Mráz |
bb93ea |
@@ -102,13 +114,31 @@
|
|
Tomáš Mráz |
09d7e6 |
"%s",
|
|
Tomáš Mráz |
09d7e6 |
message);
|
|
Tomáš Mráz |
09d7e6 |
|
|
Tomáš Mráz |
09d7e6 |
+ hbox = gtk_hbox_new(FALSE, 0);
|
|
Tomáš Mráz |
09d7e6 |
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE,
|
|
Tomáš Mráz |
bb93ea |
+ FALSE, 0);
|
|
Tomáš Mráz |
09d7e6 |
+ gtk_widget_show(hbox);
|
|
Tomáš Mráz |
09d7e6 |
+
|
|
Tomáš Mráz |
09d7e6 |
entry = gtk_entry_new();
|
|
Tomáš Mráz |
09d7e6 |
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), entry, FALSE,
|
|
Tomáš Mráz |
bb93ea |
+ gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE,
|
|
Tomáš Mráz |
bb93ea |
FALSE, 0);
|
|
Tomáš Mráz |
09d7e6 |
+ gtk_entry_set_width_chars(GTK_ENTRY(entry), 2);
|
|
Tomáš Mráz |
09d7e6 |
gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
|
|
Tomáš Mráz |
09d7e6 |
gtk_widget_grab_focus(entry);
|
|
Tomáš Mráz |
09d7e6 |
gtk_widget_show(entry);
|
|
Tomáš Mráz |
09d7e6 |
|
|
Tomáš Mráz |
bb93ea |
+ hbox = gtk_hbox_new(FALSE, 0);
|
|
Tomáš Mráz |
bb93ea |
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE,
|
|
Tomáš Mráz |
bb93ea |
+ FALSE, 8);
|
|
Tomáš Mráz |
bb93ea |
+ gtk_widget_show(hbox);
|
|
Tomáš Mráz |
bb93ea |
+
|
|
Tomáš Mráz |
09d7e6 |
+ progress = gtk_progress_bar_new();
|
|
Tomáš Mráz |
bb93ea |
+
|
|
Tomáš Mráz |
bb93ea |
+ gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress), "Passphrase length hidden intentionally");
|
|
Tomáš Mráz |
09d7e6 |
+ gtk_box_pack_start(GTK_BOX(hbox), progress, TRUE,
|
|
Tomáš Mráz |
bb93ea |
+ TRUE, 5);
|
|
Tomáš Mráz |
09d7e6 |
+ gtk_widget_show(progress);
|
|
Tomáš Mráz |
09d7e6 |
+
|
|
Tomáš Mráz |
09d7e6 |
gtk_window_set_title(GTK_WINDOW(dialog), "OpenSSH");
|
|
Tomáš Mráz |
09d7e6 |
gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
|
|
Tomáš Mráz |
09d7e6 |
gtk_label_set_line_wrap(GTK_LABEL((GTK_MESSAGE_DIALOG(dialog))->label),
|
|
Tomáš Mráz |
bb93ea |
@@ -118,6 +148,8 @@
|
|
Tomáš Mráz |
09d7e6 |
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
|
|
Tomáš Mráz |
09d7e6 |
g_signal_connect(G_OBJECT(entry), "activate",
|
|
Tomáš Mráz |
09d7e6 |
G_CALLBACK(ok_dialog), dialog);
|
|
Tomáš Mráz |
09d7e6 |
+ g_signal_connect(G_OBJECT(entry), "changed",
|
|
Tomáš Mráz |
09d7e6 |
+ G_CALLBACK(move_progress), progress);
|
|
Tomáš Mráz |
09d7e6 |
|
|
Tomáš Mráz |
09d7e6 |
gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE);
|
|
Tomáš Mráz |
09d7e6 |
|