diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-11-11 14:21:02 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-11-11 14:21:02 +0100 |
commit | 808ce78d212c6b434d24066f1f2d44d3e76224ae (patch) | |
tree | d810e5fb8e698189ebe9af7f76c53aec0fba7e19 /src/ka-main-window.c | |
parent | New upstream version 3.20.0 (diff) | |
download | krb5-auth-dialog-808ce78d212c6b434d24066f1f2d44d3e76224ae.tar.gz krb5-auth-dialog-808ce78d212c6b434d24066f1f2d44d3e76224ae.tar.bz2 krb5-auth-dialog-808ce78d212c6b434d24066f1f2d44d3e76224ae.zip |
New upstream version 3.26.0
Diffstat (limited to 'src/ka-main-window.c')
-rw-r--r-- | src/ka-main-window.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/ka-main-window.c b/src/ka-main-window.c index 21b1dbc..1509b20 100644 --- a/src/ka-main-window.c +++ b/src/ka-main-window.c @@ -30,6 +30,7 @@ #include "ka-preferences.h" static GtkListStore *tickets; +static GtkButton *ticket_btn; static GtkApplicationWindow *main_window; static void @@ -44,6 +45,26 @@ ccache_changed_cb (KaApplet* applet, } +static void +enable_ticket_button_cb (gpointer* applet G_GNUC_UNUSED, + gchar *princ G_GNUC_UNUSED, + guint when G_GNUC_UNUSED, + gpointer user_data) +{ + gboolean enable = GPOINTER_TO_UINT(user_data); + KA_DEBUG ("Sensitive: %u", enable); + gtk_widget_set_sensitive(GTK_WIDGET(ticket_btn), enable); +} + + +static void +ticket_btn_clicked(GtkButton* btn G_GNUC_UNUSED, gpointer user_data) +{ + KaApplet *applet = KA_APPLET(user_data); + ka_grab_credentials (applet); +} + + GtkApplicationWindow * ka_main_window_create (KaApplet *applet) { @@ -117,6 +138,17 @@ ka_main_window_create (KaApplet *applet) G_CALLBACK(ccache_changed_cb), NULL); + ticket_btn = + GTK_BUTTON (gtk_builder_get_object (builder, "get_ticket_btn")); + g_signal_connect(ticket_btn, "clicked", G_CALLBACK(ticket_btn_clicked), applet); + + g_signal_connect (applet, "krb-tgt-acquired", + G_CALLBACK (enable_ticket_button_cb), + GUINT_TO_POINTER(FALSE)); + + g_signal_connect (applet, "krb-tgt-expired", + G_CALLBACK (enable_ticket_button_cb), + GUINT_TO_POINTER(TRUE)); g_object_unref (builder); return main_window; } |