summaryrefslogtreecommitdiff
path: root/client/gtk.c
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2010-03-24 09:38:08 +0100
committerSamuel Lidén Borell <samuel@slbdata.se>2010-03-24 14:53:04 +0100
commit53dd623500302ace19de7c620b7c08d1ab0ded25 (patch)
tree774c06149210181020c2e8685cfc43b95f404d31 /client/gtk.c
parent87b6cf7d353b69e0622569d9063f85c2bb7b9b24 (diff)
downloadfribid-53dd623500302ace19de7c620b7c08d1ab0ded25.tar.gz
fribid-53dd623500302ace19de7c620b7c08d1ab0ded25.tar.bz2
fribid-53dd623500302ace19de7c620b7c08d1ab0ded25.zip
Make the signing/authentication dialog faster
Before this patch it was shown and then filled with information. This caused it to be resized and repainted. With this patch the dialog isn't shown until the platform_sign function is called.
Diffstat (limited to 'client/gtk.c')
-rw-r--r--client/gtk.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/client/gtk.c b/client/gtk.c
index bb1ae3f..193786c 100644
--- a/client/gtk.c
+++ b/client/gtk.c
@@ -76,7 +76,7 @@ void platform_mainloop() {
gtk_main();
}
-/* Authentication */
+/* Sign/Authenticate dialog controls and state */
static GtkDialog *signDialog;
static GtkLabel *operationLabel;
static GtkTextView *signText;
@@ -89,7 +89,7 @@ static GtkWidget *signLabel;
static GtkWidget *signScroller;
static char *currentSubjectFilter;
-
+static bool dialogShown;
static void showMessage(GtkMessageType type, const char *text) {
GtkWidget *dialog = gtk_message_dialog_new(
@@ -262,7 +262,7 @@ void platform_startSign(const char *url, const char *hostname, const char *ip,
validateDialog(NULL, NULL);
gtk_window_set_modal(GTK_WINDOW(signDialog), TRUE);
- gtk_widget_show(GTK_WIDGET(signDialog));
+ dialogShown = false;
}
void platform_endSign() {
@@ -351,7 +351,12 @@ bool platform_sign(char **signature, int *siglen, KeyfileSubject **person,
// Restrict the password to the length of the preallocated
// password buffer
gtk_entry_set_max_length(passwordEntry, password_maxlen-1);
-
+
+ if (!dialogShown) {
+ gtk_widget_show(GTK_WIDGET(signDialog));
+ dialogShown = true;
+ }
+
while ((response = gtk_dialog_run(signDialog)) == RESPONSE_EXTERNAL) {
// User pressed "External file..."
selectExternalFile();