[gnome-initial-setup] account: Remove avatar chooser



commit 1ba1876ab716ec736b7d00d48da6d39328af4e5e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Nov 14 19:34:04 2012 -0500

    account: Remove avatar chooser
    
    This is not in Allan's latest designs.

 TODO                                               |    1 -
 configure.ac                                       |   11 -
 gnome-initial-setup/pages/account/Makefile.am      |    1 -
 .../pages/account/gis-account-page.c               |   87 -----
 .../pages/account/gis-account-page.ui              |   21 -
 .../pages/account/um-photo-dialog.c                |  391 --------------------
 .../pages/account/um-photo-dialog.h                |   42 --
 7 files changed, 0 insertions(+), 554 deletions(-)
---
diff --git a/TODO b/TODO
index eecf669..e2389d7 100644
--- a/TODO
+++ b/TODO
@@ -10,7 +10,6 @@
 **  just use the local account page by default, with a button for "use enterprise login instead" (design is required here)
 **  various alignment issues - text entry boxes need be longer
 **  password entry - inline error icon isn't good here; we need a better approach to password hints
-**  aday - i wouldn't include avatar selection
 * Location
 **  location data isn't good
 **  map is too small
diff --git a/configure.ac b/configure.ac
index e9387dc..674069b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,17 +36,6 @@ PKG_CHECK_MODULES(INITIAL_SETUP,
                   gio-unix-2.0 >= $GLIB_REQUIRED_VERSION
                   gdm)
 
-PKG_CHECK_MODULES(CHEESE,
-                  cheese
-                  cheese-gtk >= 3.3.5,
-                  have_cheese=yes, have_cheese=no)
-AM_CONDITIONAL(HAVE_CHEESE, [test x$have_cheese = xyes])
-if test x$have_cheese = xyes; then
-  INITIAL_SETUP_CFLAGS="$INITIAL_SETUP_CFLAGS $CHEESE_CFLAGS"
-  INITIAL_SETUP_LIBS="$INITIAL_SETUP_LIBS $CHEESE_LIBS"
-  AC_DEFINE(HAVE_CHEESE, 1, [Build with Cheese support?])
-fi
-
 PKG_CHECK_MODULES(CLUTTER,
                   clutter-gtk-1.0
                   clutter-1.0 >= $CLUTTER_REQUIRED_VERSION,
diff --git a/gnome-initial-setup/pages/account/Makefile.am b/gnome-initial-setup/pages/account/Makefile.am
index 0d7ff86..6902734 100644
--- a/gnome-initial-setup/pages/account/Makefile.am
+++ b/gnome-initial-setup/pages/account/Makefile.am
@@ -25,7 +25,6 @@ libgisaccount_la_SOURCES =				\
 	$(pw_utils_sources)				\
 	$(BUILT_SOURCES)				\
 	gis-account-page.c gis-account-page.h		\
-	um-photo-dialog.c um-photo-dialog.h		\
 	um-realm-manager.c um-realm-manager.h		\
 	um-utils.c um-utils.h				\
 	$(NULL)
diff --git a/gnome-initial-setup/pages/account/gis-account-page.c b/gnome-initial-setup/pages/account/gis-account-page.c
index 839ada2..9a4ed91 100644
--- a/gnome-initial-setup/pages/account/gis-account-page.c
+++ b/gnome-initial-setup/pages/account/gis-account-page.c
@@ -35,7 +35,6 @@
 
 #include "um-realm-manager.h"
 #include "um-utils.h"
-#include "um-photo-dialog.h"
 #include "pw-utils.h"
 
 #ifdef HAVE_CHEESE
@@ -67,10 +66,6 @@ struct _GisAccountPagePrivate
 
   gboolean user_data_unsaved;
 
-  GtkWidget *photo_dialog;
-  GdkPixbuf *avatar_pixbuf;
-  gchar *avatar_filename;
-
   gboolean has_enterprise;
   guint realmd_watch;
   UmRealmManager *realm_manager;
@@ -371,44 +366,6 @@ confirm_entry_focus_out (GtkWidget      *entry,
 }
 
 static void
-set_user_avatar (GisAccountPage *page)
-{
-  GisAccountPagePrivate *priv = page->priv;
-  GFile *file = NULL;
-  GFileIOStream *io_stream = NULL;
-  GOutputStream *stream = NULL;
-  GError *error = NULL;
-
-  if (priv->avatar_filename != NULL) {
-    act_user_set_icon_file (priv->act_user, priv->avatar_filename);
-    return;
-  }
-
-  if (priv->avatar_pixbuf == NULL) {
-    return;
-  }
-
-  file = g_file_new_tmp ("usericonXXXXXX", &io_stream, &error);
-  if (error != NULL)
-    goto out;
-
-  stream = g_io_stream_get_output_stream (G_IO_STREAM (io_stream));
-  if (!gdk_pixbuf_save_to_stream (priv->avatar_pixbuf, stream, "png", NULL, &error, NULL))
-    goto out;
-
-  act_user_set_icon_file (priv->act_user, g_file_get_path (file));
-
- out:
-  if (error != NULL) {
-    g_warning ("failed to save image: %s", error->message);
-    g_error_free (error);
-  }
-  g_clear_object (&stream);
-  g_clear_object (&io_stream);
-  g_clear_object (&file);
-}
-
-static void
 create_user (GisAccountPage *page)
 {
   GisAccountPagePrivate *priv = page->priv;
@@ -426,8 +383,6 @@ create_user (GisAccountPage *page)
     g_warning ("Failed to create user: %s", error->message);
     g_error_free (error);
   }
-
-  set_user_avatar (page);
 }
 
 static void save_account_data (GisAccountPage *page);
@@ -737,40 +692,6 @@ save_account_data (GisAccountPage *page)
 }
 
 static void
-avatar_callback (GdkPixbuf   *pixbuf,
-                 const gchar *filename,
-                 gpointer     user_data)
-{
-  GisAccountPage *page = user_data;
-  GisAccountPagePrivate *priv = page->priv;
-  GtkWidget *image;
-  GdkPixbuf *tmp;
-
-  g_clear_object (&priv->avatar_pixbuf);
-  g_free (priv->avatar_filename);
-  priv->avatar_filename = NULL;
-
-  image = WID("local-account-avatar-image");
-
-  if (pixbuf) {
-    priv->avatar_pixbuf = g_object_ref (pixbuf);
-    tmp = gdk_pixbuf_scale_simple (pixbuf, 64, 64, GDK_INTERP_BILINEAR);
-    gtk_image_set_from_pixbuf (GTK_IMAGE (image), tmp);
-    g_object_unref (tmp);
-  }
-  else if (filename) {
-    priv->avatar_filename = g_strdup (filename);
-    tmp = gdk_pixbuf_new_from_file_at_size (filename, 64, 64, NULL);
-    gtk_image_set_from_pixbuf (GTK_IMAGE (image), tmp);
-    g_object_unref (tmp);
-  }
-  else {
-    gtk_image_set_from_icon_name (GTK_IMAGE (image), "avatar-default",
-                                  GTK_ICON_SIZE_DIALOG);
-  }
-}
-
-static void
 enterprise_add_realm (GisAccountPage *page,
                       UmRealmObject  *realm)
 {
@@ -926,7 +847,6 @@ gis_account_page_constructed (GObject *object)
   GtkWidget *username_combo;
   GtkWidget *password_entry;
   GtkWidget *confirm_entry;
-  GtkWidget *local_account_avatar_button;
 
   G_OBJECT_CLASS (gis_account_page_parent_class)->constructed (object);
 
@@ -941,10 +861,6 @@ gis_account_page_constructed (GObject *object)
   username_combo = WID("account-username-combo");
   password_entry = WID("account-password-entry");
   confirm_entry = WID("account-confirm-entry");
-  local_account_avatar_button = WID("local-account-avatar-button");
-  priv->photo_dialog = (GtkWidget *)um_photo_dialog_new (local_account_avatar_button,
-                                                         avatar_callback,
-                                                         page);
 
   g_signal_connect (fullname_entry, "notify::text",
                     G_CALLBACK (fullname_changed), page);
@@ -993,7 +909,6 @@ gis_account_page_dispose (GObject *object)
   g_clear_object (&priv->act_user);
   g_clear_object (&priv->act_client);
   g_clear_object (&priv->realm_manager);
-  g_clear_object (&priv->avatar_pixbuf);
 
   G_OBJECT_CLASS (gis_account_page_parent_class)->dispose (object);
 }
@@ -1004,8 +919,6 @@ gis_account_page_finalize (GObject *object)
   GisAccountPage *page = GIS_ACCOUNT_PAGE (object);
   GisAccountPagePrivate *priv = page->priv;
 
-  g_clear_pointer (&priv->avatar_filename, g_free);
-
   G_OBJECT_CLASS (gis_account_page_parent_class)->finalize (object);
 }
 
diff --git a/gnome-initial-setup/pages/account/gis-account-page.ui b/gnome-initial-setup/pages/account/gis-account-page.ui
index 46f072e..00b6a39 100644
--- a/gnome-initial-setup/pages/account/gis-account-page.ui
+++ b/gnome-initial-setup/pages/account/gis-account-page.ui
@@ -96,27 +96,6 @@
             <property name="row_spacing">6</property>
             <property name="column_spacing">12</property>
             <child>
-              <object class="GtkToggleButton" id="local-account-avatar-button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">False</property>
-                <child>
-                  <object class="GtkImage" id="local-account-avatar-image">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="pixel_size">64</property>
-                    <property name="icon_name">avatar-default</property>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">2</property>
-                <property name="top_attach">0</property>
-                <property name="width">1</property>
-                <property name="height">2</property>
-              </packing>
-            </child>
-            <child>
               <object class="GtkLabel" id="account-fullname-label">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]