Commit ec16deba authored by Stepan Salenikovich's avatar Stepan Salenikovich

account wizard: make sure avatar is created

Many users don't complete the avatar creation process because its
not evident you must verify the area selection after taking the
photo. In this case, we assume they wanted to verify and use the
area they selected even if they didn't click the checkmark.

Change-Id: I6c502ed8406096c8d4af149aadd00a9f6c7a404c
Tuleap: #1441
parent a169c719
......@@ -398,6 +398,13 @@ create_new_ring_account(AccountCreationWizard *win)
g_return_val_if_fail(IS_ACCOUNT_CREATION_WIZARD(win), G_SOURCE_REMOVE);
AccountCreationWizardPrivate *priv = ACCOUNT_CREATION_WIZARD_GET_PRIVATE(win);
/* Tuleap: #1441
* if the user did not validate the avatar area selection, we still take that as the image
* for their avatar; otherwise many users end up with no avatar by default
* TODO: improve avatar creation process to not need this fix
*/
avatar_manipulation_wizard_completed(AVATAR_MANIPULATION(priv->avatar_manipulation));
gchar *display_name = g_strdup(gtk_entry_get_text(GTK_ENTRY(priv->entry_display_name)));
gchar *username = g_strdup(gtk_entry_get_text(GTK_ENTRY(priv->entry_username)));
gchar *password = g_strdup(gtk_entry_get_text(GTK_ENTRY(priv->entry_password)));
......
......@@ -464,3 +464,17 @@ got_snapshot(AvatarManipulation *self)
set_state(self, AVATAR_MANIPULATION_STATE_EDIT);
}
void
avatar_manipulation_wizard_completed(AvatarManipulation *self)
{
auto priv = AVATAR_MANIPULATION_GET_PRIVATE(self);
/* Tuleap: #1441
* if the user did not validate the avatar area selection, we still take that as the image
* for their avatar; otherwise many users end up with no avatar by default
* TODO: improve avatar creation process to not need this fix
*/
if (priv->state == AVATAR_MANIPULATION_STATE_EDIT)
set_avatar(self);
}
......@@ -55,7 +55,10 @@ typedef enum
GType avatar_manipulation_get_type (void) G_GNUC_CONST;
GtkWidget *avatar_manipulation_new (void);
GtkWidget *avatar_manipulation_new_from_wizard(void); /* should be used from the account creation wizard */
/* used from the account creation wizard */
GtkWidget *avatar_manipulation_new_from_wizard(void);
void avatar_manipulation_wizard_completed(AvatarManipulation *);
G_END_DECLS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment