[gnome-software] auth-dialog: Disable UI elements while authenticating
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] auth-dialog: Disable UI elements while authenticating
- Date: Sun, 3 Jul 2016 23:43:15 +0000 (UTC)
commit 93361a9a0e28edcb999d7c655e95a2252191d8a1
Author: Robert Ancell <robert ancell canonical com>
Date: Mon Jul 4 11:37:36 2016 +1200
auth-dialog: Disable UI elements while authenticating
src/gs-auth-dialog.c | 8 ++++++++
src/gs-auth-dialog.ui | 2 +-
2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-auth-dialog.c b/src/gs-auth-dialog.c
index 82a8974..050665d 100644
--- a/src/gs-auth-dialog.c
+++ b/src/gs-auth-dialog.c
@@ -36,6 +36,7 @@ struct _GsAuthDialog
GsPluginLoader *plugin_loader;
GsApp *app;
GsAuth *auth;
+ GtkWidget *box_dialog;
GtkWidget *box_error;
GtkWidget *button_cancel;
GtkWidget *button_continue;
@@ -111,6 +112,9 @@ gs_auth_dialog_authenticate_cb (GObject *source,
GsAuthDialog *dialog = GS_AUTH_DIALOG (user_data);
g_autoptr(GError) error = NULL;
+ gtk_widget_set_sensitive (dialog->box_dialog, TRUE);
+ gtk_widget_set_sensitive (dialog->button_continue, TRUE);
+
gtk_widget_set_visible (dialog->box_error, FALSE);
/* we failed */
@@ -158,6 +162,9 @@ gs_auth_dialog_continue_button_cb (GtkWidget *widget, GsAuthDialog *dialog)
{
GsPluginLoaderAction action = GS_AUTH_ACTION_LOGIN;
+ gtk_widget_set_sensitive (dialog->box_dialog, FALSE);
+ gtk_widget_set_sensitive (dialog->button_continue, FALSE);
+
/* alternate actions */
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->radiobutton_lost_pwd)))
action = GS_AUTH_ACTION_LOST_PASSWORD;
@@ -284,6 +291,7 @@ gs_auth_dialog_class_init (GsAuthDialogClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-auth-dialog.ui");
+ gtk_widget_class_bind_template_child (widget_class, GsAuthDialog, box_dialog);
gtk_widget_class_bind_template_child (widget_class, GsAuthDialog, box_error);
gtk_widget_class_bind_template_child (widget_class, GsAuthDialog, button_cancel);
gtk_widget_class_bind_template_child (widget_class, GsAuthDialog, button_continue);
diff --git a/src/gs-auth-dialog.ui b/src/gs-auth-dialog.ui
index d4b1bd0..7cee9f5 100644
--- a/src/gs-auth-dialog.ui
+++ b/src/gs-auth-dialog.ui
@@ -10,7 +10,7 @@
<property name="type_hint">dialog</property>
<property name="deletable">False</property>
<child internal-child="vbox">
- <object class="GtkBox">
+ <object class="GtkBox" id="box_dialog">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]