user-accounts: Move UmEditableEntry to lib

So it can be reused in the printers panel.

Also see:
https://bugzilla.gnome.org/show_bug.cgi?id=649511
This commit is contained in:
Bastien Nocera 2011-05-13 13:44:55 +01:00
parent a089d7e710
commit ac5bc2da75
7 changed files with 139 additions and 138 deletions

View file

@ -26,6 +26,8 @@ libgnome_control_center_la_SOURCES = \
cc-shell.h \ cc-shell.h \
gconf-property-editor.c \ gconf-property-editor.c \
gconf-property-editor.h \ gconf-property-editor.h \
cc-editable-entry.c \
cc-editable-entry.h \
$(NULL) $(NULL)
libgnome_control_center_la_LDFLAGS = \ libgnome_control_center_la_LDFLAGS = \

View file

@ -20,11 +20,11 @@
*/ */
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include "um-editable-entry.h" #include "cc-editable-entry.h"
#define EMPTY_TEXT "\xe2\x80\x94" #define EMPTY_TEXT "\xe2\x80\x94"
struct _UmEditableEntryPrivate { struct _CcEditableEntryPrivate {
GtkNotebook *notebook; GtkNotebook *notebook;
GtkLabel *label; GtkLabel *label;
GtkButton *button; GtkButton *button;
@ -40,7 +40,7 @@ struct _UmEditableEntryPrivate {
gboolean in_stop_editing; gboolean in_stop_editing;
}; };
#define UM_EDITABLE_ENTRY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UM_TYPE_EDITABLE_ENTRY, UmEditableEntryPrivate)) #define CC_EDITABLE_ENTRY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CC_TYPE_EDITABLE_ENTRY, CcEditableEntryPrivate))
enum { enum {
PROP_0, PROP_0,
@ -65,13 +65,13 @@ enum {
static guint signals [LAST_SIGNAL] = { 0, }; static guint signals [LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (UmEditableEntry, um_editable_entry, GTK_TYPE_ALIGNMENT); G_DEFINE_TYPE (CcEditableEntry, cc_editable_entry, GTK_TYPE_ALIGNMENT);
void void
um_editable_entry_set_text (UmEditableEntry *e, cc_editable_entry_set_text (CcEditableEntry *e,
const gchar *text) const gchar *text)
{ {
UmEditableEntryPrivate *priv; CcEditableEntryPrivate *priv;
gchar *tmp; gchar *tmp;
GtkWidget *label; GtkWidget *label;
@ -94,16 +94,16 @@ um_editable_entry_set_text (UmEditableEntry *e,
} }
const gchar * const gchar *
um_editable_entry_get_text (UmEditableEntry *e) cc_editable_entry_get_text (CcEditableEntry *e)
{ {
return e->priv->text; return e->priv->text;
} }
void void
um_editable_entry_set_editable (UmEditableEntry *e, cc_editable_entry_set_editable (CcEditableEntry *e,
gboolean editable) gboolean editable)
{ {
UmEditableEntryPrivate *priv; CcEditableEntryPrivate *priv;
priv = e->priv; priv = e->priv;
@ -117,16 +117,16 @@ um_editable_entry_set_editable (UmEditableEntry *e,
} }
gboolean gboolean
um_editable_entry_get_editable (UmEditableEntry *e) cc_editable_entry_get_editable (CcEditableEntry *e)
{ {
return e->priv->editable; return e->priv->editable;
} }
static void static void
update_entry_font (GtkWidget *widget, update_entry_font (GtkWidget *widget,
UmEditableEntry *e) CcEditableEntry *e)
{ {
UmEditableEntryPrivate *priv = e->priv; CcEditableEntryPrivate *priv = e->priv;
PangoFontDescription *desc; PangoFontDescription *desc;
GtkStyleContext *style; GtkStyleContext *style;
gint size; gint size;
@ -156,13 +156,13 @@ update_entry_font (GtkWidget *widget,
} }
static void static void
update_fonts (UmEditableEntry *e) update_fonts (CcEditableEntry *e)
{ {
PangoAttrList *attrs; PangoAttrList *attrs;
PangoAttribute *attr; PangoAttribute *attr;
GtkWidget *label; GtkWidget *label;
UmEditableEntryPrivate *priv = e->priv; CcEditableEntryPrivate *priv = e->priv;
attrs = pango_attr_list_new (); attrs = pango_attr_list_new ();
if (priv->scale_set) { if (priv->scale_set) {
@ -185,10 +185,10 @@ update_fonts (UmEditableEntry *e)
} }
void void
um_editable_entry_set_weight (UmEditableEntry *e, cc_editable_entry_set_weight (CcEditableEntry *e,
gint weight) gint weight)
{ {
UmEditableEntryPrivate *priv = e->priv; CcEditableEntryPrivate *priv = e->priv;
if (priv->weight == weight && priv->weight_set) if (priv->weight == weight && priv->weight_set)
return; return;
@ -203,16 +203,16 @@ um_editable_entry_set_weight (UmEditableEntry *e,
} }
gint gint
um_editable_entry_get_weight (UmEditableEntry *e) cc_editable_entry_get_weight (CcEditableEntry *e)
{ {
return e->priv->weight; return e->priv->weight;
} }
void void
um_editable_entry_set_scale (UmEditableEntry *e, cc_editable_entry_set_scale (CcEditableEntry *e,
gdouble scale) gdouble scale)
{ {
UmEditableEntryPrivate *priv = e->priv; CcEditableEntryPrivate *priv = e->priv;
if (priv->scale == scale && priv->scale_set) if (priv->scale == scale && priv->scale_set)
return; return;
@ -227,34 +227,34 @@ um_editable_entry_set_scale (UmEditableEntry *e,
} }
gdouble gdouble
um_editable_entry_get_scale (UmEditableEntry *e) cc_editable_entry_get_scale (CcEditableEntry *e)
{ {
return e->priv->scale; return e->priv->scale;
} }
static void static void
um_editable_entry_set_property (GObject *object, cc_editable_entry_set_property (GObject *object,
guint prop_id, guint prop_id,
const GValue *value, const GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
UmEditableEntry *e = UM_EDITABLE_ENTRY (object); CcEditableEntry *e = CC_EDITABLE_ENTRY (object);
switch (prop_id) { switch (prop_id) {
case PROP_TEXT: case PROP_TEXT:
um_editable_entry_set_text (e, g_value_get_string (value)); cc_editable_entry_set_text (e, g_value_get_string (value));
break; break;
case PROP_EDITABLE: case PROP_EDITABLE:
um_editable_entry_set_editable (e, g_value_get_boolean (value)); cc_editable_entry_set_editable (e, g_value_get_boolean (value));
break; break;
case PROP_WEIGHT: case PROP_WEIGHT:
um_editable_entry_set_weight (e, g_value_get_int (value)); cc_editable_entry_set_weight (e, g_value_get_int (value));
break; break;
case PROP_WEIGHT_SET: case PROP_WEIGHT_SET:
e->priv->weight_set = g_value_get_boolean (value); e->priv->weight_set = g_value_get_boolean (value);
break; break;
case PROP_SCALE: case PROP_SCALE:
um_editable_entry_set_scale (e, g_value_get_double (value)); cc_editable_entry_set_scale (e, g_value_get_double (value));
break; break;
case PROP_SCALE_SET: case PROP_SCALE_SET:
e->priv->scale_set = g_value_get_boolean (value); e->priv->scale_set = g_value_get_boolean (value);
@ -266,32 +266,32 @@ um_editable_entry_set_property (GObject *object,
} }
static void static void
um_editable_entry_get_property (GObject *object, cc_editable_entry_get_property (GObject *object,
guint prop_id, guint prop_id,
GValue *value, GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
UmEditableEntry *e = UM_EDITABLE_ENTRY (object); CcEditableEntry *e = CC_EDITABLE_ENTRY (object);
switch (prop_id) { switch (prop_id) {
case PROP_TEXT: case PROP_TEXT:
g_value_set_string (value, g_value_set_string (value,
um_editable_entry_get_text (e)); cc_editable_entry_get_text (e));
break; break;
case PROP_EDITABLE: case PROP_EDITABLE:
g_value_set_boolean (value, g_value_set_boolean (value,
um_editable_entry_get_editable (e)); cc_editable_entry_get_editable (e));
break; break;
case PROP_WEIGHT: case PROP_WEIGHT:
g_value_set_int (value, g_value_set_int (value,
um_editable_entry_get_weight (e)); cc_editable_entry_get_weight (e));
break; break;
case PROP_WEIGHT_SET: case PROP_WEIGHT_SET:
g_value_set_boolean (value, e->priv->weight_set); g_value_set_boolean (value, e->priv->weight_set);
break; break;
case PROP_SCALE: case PROP_SCALE:
g_value_set_double (value, g_value_set_double (value,
um_editable_entry_get_scale (e)); cc_editable_entry_get_scale (e));
break; break;
case PROP_SCALE_SET: case PROP_SCALE_SET:
g_value_set_boolean (value, e->priv->scale_set); g_value_set_boolean (value, e->priv->scale_set);
@ -303,31 +303,31 @@ um_editable_entry_get_property (GObject *object,
} }
static void static void
um_editable_entry_finalize (GObject *object) cc_editable_entry_finalize (GObject *object)
{ {
UmEditableEntry *e = (UmEditableEntry*)object; CcEditableEntry *e = (CcEditableEntry*)object;
g_free (e->priv->text); g_free (e->priv->text);
G_OBJECT_CLASS (um_editable_entry_parent_class)->finalize (object); G_OBJECT_CLASS (cc_editable_entry_parent_class)->finalize (object);
} }
static void static void
um_editable_entry_class_init (UmEditableEntryClass *class) cc_editable_entry_class_init (CcEditableEntryClass *class)
{ {
GObjectClass *object_class; GObjectClass *object_class;
object_class = G_OBJECT_CLASS (class); object_class = G_OBJECT_CLASS (class);
object_class->set_property = um_editable_entry_set_property; object_class->set_property = cc_editable_entry_set_property;
object_class->get_property = um_editable_entry_get_property; object_class->get_property = cc_editable_entry_get_property;
object_class->finalize = um_editable_entry_finalize; object_class->finalize = cc_editable_entry_finalize;
signals[EDITING_DONE] = signals[EDITING_DONE] =
g_signal_new ("editing-done", g_signal_new ("editing-done",
G_TYPE_FROM_CLASS (class), G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (UmEditableEntryClass, editing_done), G_STRUCT_OFFSET (CcEditableEntryClass, editing_done),
NULL, NULL, NULL, NULL,
g_cclosure_marshal_VOID__VOID, g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
@ -368,17 +368,17 @@ um_editable_entry_class_init (UmEditableEntryClass *class)
FALSE, FALSE,
G_PARAM_READWRITE)); G_PARAM_READWRITE));
g_type_class_add_private (class, sizeof (UmEditableEntryPrivate)); g_type_class_add_private (class, sizeof (CcEditableEntryPrivate));
} }
static void static void
start_editing (UmEditableEntry *e) start_editing (CcEditableEntry *e)
{ {
gtk_notebook_set_current_page (e->priv->notebook, PAGE_ENTRY); gtk_notebook_set_current_page (e->priv->notebook, PAGE_ENTRY);
} }
static void static void
stop_editing (UmEditableEntry *e) stop_editing (CcEditableEntry *e)
{ {
/* Avoid launching another "editing-done" signal /* Avoid launching another "editing-done" signal
* caused by the notebook page change */ * caused by the notebook page change */
@ -387,28 +387,28 @@ stop_editing (UmEditableEntry *e)
e->priv->in_stop_editing = TRUE; e->priv->in_stop_editing = TRUE;
gtk_notebook_set_current_page (e->priv->notebook, PAGE_BUTTON); gtk_notebook_set_current_page (e->priv->notebook, PAGE_BUTTON);
um_editable_entry_set_text (e, gtk_entry_get_text (e->priv->entry)); cc_editable_entry_set_text (e, gtk_entry_get_text (e->priv->entry));
g_signal_emit (e, signals[EDITING_DONE], 0); g_signal_emit (e, signals[EDITING_DONE], 0);
e->priv->in_stop_editing = FALSE; e->priv->in_stop_editing = FALSE;
} }
static void static void
cancel_editing (UmEditableEntry *e) cancel_editing (CcEditableEntry *e)
{ {
gtk_entry_set_text (e->priv->entry, um_editable_entry_get_text (e)); gtk_entry_set_text (e->priv->entry, cc_editable_entry_get_text (e));
gtk_notebook_set_current_page (e->priv->notebook, PAGE_BUTTON); gtk_notebook_set_current_page (e->priv->notebook, PAGE_BUTTON);
} }
static void static void
button_clicked (GtkWidget *widget, button_clicked (GtkWidget *widget,
UmEditableEntry *e) CcEditableEntry *e)
{ {
start_editing (e); start_editing (e);
} }
static void static void
entry_activated (GtkWidget *widget, entry_activated (GtkWidget *widget,
UmEditableEntry *e) CcEditableEntry *e)
{ {
stop_editing (e); stop_editing (e);
} }
@ -416,7 +416,7 @@ entry_activated (GtkWidget *widget,
static gboolean static gboolean
entry_focus_out (GtkWidget *widget, entry_focus_out (GtkWidget *widget,
GdkEventFocus *event, GdkEventFocus *event,
UmEditableEntry *e) CcEditableEntry *e)
{ {
stop_editing (e); stop_editing (e);
return FALSE; return FALSE;
@ -425,7 +425,7 @@ entry_focus_out (GtkWidget *widget,
static gboolean static gboolean
entry_key_press (GtkWidget *widget, entry_key_press (GtkWidget *widget,
GdkEventKey *event, GdkEventKey *event,
UmEditableEntry *e) CcEditableEntry *e)
{ {
if (event->keyval == GDK_KEY_Escape) { if (event->keyval == GDK_KEY_Escape) {
cancel_editing (e); cancel_editing (e);
@ -436,9 +436,9 @@ entry_key_press (GtkWidget *widget,
static void static void
update_button_padding (GtkWidget *widget, update_button_padding (GtkWidget *widget,
GtkAllocation *allocation, GtkAllocation *allocation,
UmEditableEntry *e) CcEditableEntry *e)
{ {
UmEditableEntryPrivate *priv = e->priv; CcEditableEntryPrivate *priv = e->priv;
GtkAllocation alloc; GtkAllocation alloc;
gint offset; gint offset;
gint pad; gint pad;
@ -453,11 +453,11 @@ update_button_padding (GtkWidget *widget,
} }
static void static void
um_editable_entry_init (UmEditableEntry *e) cc_editable_entry_init (CcEditableEntry *e)
{ {
UmEditableEntryPrivate *priv; CcEditableEntryPrivate *priv;
priv = e->priv = UM_EDITABLE_ENTRY_GET_PRIVATE (e); priv = e->priv = CC_EDITABLE_ENTRY_GET_PRIVATE (e);
priv->weight = PANGO_WEIGHT_NORMAL; priv->weight = PANGO_WEIGHT_NORMAL;
priv->weight_set = FALSE; priv->weight_set = FALSE;
@ -502,7 +502,7 @@ um_editable_entry_init (UmEditableEntry *e)
} }
GtkWidget * GtkWidget *
um_editable_entry_new (void) cc_editable_entry_new (void)
{ {
return (GtkWidget *) g_object_new (UM_TYPE_EDITABLE_ENTRY, NULL); return (GtkWidget *) g_object_new (CC_TYPE_EDITABLE_ENTRY, NULL);
} }

View file

@ -0,0 +1,72 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright 2009-2010 Red Hat, Inc,
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Written by: Matthias Clasen <mclasen@redhat.com>
*/
#ifndef _CC_EDITABLE_ENTRY_H_
#define _CC_EDITABLE_ENTRY_H_
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define CC_TYPE_EDITABLE_ENTRY cc_editable_entry_get_type()
#define CC_EDITABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CC_TYPE_EDITABLE_ENTRY, CcEditableEntry))
#define CC_EDITABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CC_TYPE_EDITABLE_ENTRY, CcEditableEntryClass))
#define CC_IS_EDITABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CC_TYPE_EDITABLE_ENTRY))
#define CC_IS_EDITABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CC_TYPE_EDITABLE_ENTRY))
#define CC_EDITABLE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CC_TYPE_EDITABLE_ENTRY, CcEditableEntryClass))
typedef struct _CcEditableEntry CcEditableEntry;
typedef struct _CcEditableEntryClass CcEditableEntryClass;
typedef struct _CcEditableEntryPrivate CcEditableEntryPrivate;
struct _CcEditableEntry
{
GtkAlignment parent;
CcEditableEntryPrivate *priv;
};
struct _CcEditableEntryClass
{
GtkAlignmentClass parent_class;
void (* editing_done) (CcEditableEntry *entry);
};
GType cc_editable_entry_get_type (void) G_GNUC_CONST;
GtkWidget *cc_editable_entry_new (void);
void cc_editable_entry_set_text (CcEditableEntry *entry,
const gchar *text);
const gchar *cc_editable_entry_get_text (CcEditableEntry *entry);
void cc_editable_entry_set_editable (CcEditableEntry *entry,
gboolean editable);
gboolean cc_editable_entry_get_editable (CcEditableEntry *entry);
void cc_editable_entry_set_weight (CcEditableEntry *entry,
gint weight);
gint cc_editable_entry_get_weight (CcEditableEntry *entry);
void cc_editable_entry_set_scale (CcEditableEntry *entry,
gdouble scale);
gdouble cc_editable_entry_get_scale (CcEditableEntry *entry);
G_END_DECLS
#endif /* _CC_EDITABLE_ENTRY_H_ */

View file

@ -14,6 +14,7 @@ AM_CPPFLAGS = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DUM_PIXMAP_DIR=\""$(pkgdatadir)/pixmaps"\" \ -DUM_PIXMAP_DIR=\""$(pkgdatadir)/pixmaps"\" \
-I$(srcdir)/../common/ \ -I$(srcdir)/../common/ \
-I$(top_srcdir)/libgnome-control-center/ \
$(PANEL_CFLAGS) \ $(PANEL_CFLAGS) \
$(USER_ACCOUNTS_PANEL_CFLAGS) \ $(USER_ACCOUNTS_PANEL_CFLAGS) \
$(DISABLE_DEPRECATED) $(DISABLE_DEPRECATED)
@ -59,8 +60,6 @@ libuser_accounts_la_SOURCES = \
$(MARSHALFILES) \ $(MARSHALFILES) \
um-editable-button.h \ um-editable-button.h \
um-editable-button.c \ um-editable-button.c \
um-editable-entry.h \
um-editable-entry.c \
um-editable-combo.h \ um-editable-combo.h \
um-editable-combo.c \ um-editable-combo.c \
um-user-panel.h \ um-user-panel.h \

View file

@ -204,7 +204,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child> <child>
<object class="UmEditableEntry" id="full-name-entry"> <object class="CcEditableEntry" id="full-name-entry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="scale">1.2</property> <property name="scale">1.2</property>
<property name="weight">700</property> <property name="weight">700</property>

View file

@ -1,72 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright 2009-2010 Red Hat, Inc,
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Written by: Matthias Clasen <mclasen@redhat.com>
*/
#ifndef _UM_EDITABLE_ENTRY_H_
#define _UM_EDITABLE_ENTRY_H_
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define UM_TYPE_EDITABLE_ENTRY um_editable_entry_get_type()
#define UM_EDITABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UM_TYPE_EDITABLE_ENTRY, UmEditableEntry))
#define UM_EDITABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UM_TYPE_EDITABLE_ENTRY, UmEditableEntryClass))
#define UM_IS_EDITABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UM_TYPE_EDITABLE_ENTRY))
#define UM_IS_EDITABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UM_TYPE_EDITABLE_ENTRY))
#define UM_EDITABLE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UM_TYPE_EDITABLE_ENTRY, UmEditableEntryClass))
typedef struct _UmEditableEntry UmEditableEntry;
typedef struct _UmEditableEntryClass UmEditableEntryClass;
typedef struct _UmEditableEntryPrivate UmEditableEntryPrivate;
struct _UmEditableEntry
{
GtkAlignment parent;
UmEditableEntryPrivate *priv;
};
struct _UmEditableEntryClass
{
GtkAlignmentClass parent_class;
void (* editing_done) (UmEditableEntry *entry);
};
GType um_editable_entry_get_type (void) G_GNUC_CONST;
GtkWidget *um_editable_entry_new (void);
void um_editable_entry_set_text (UmEditableEntry *entry,
const gchar *text);
const gchar *um_editable_entry_get_text (UmEditableEntry *entry);
void um_editable_entry_set_editable (UmEditableEntry *entry,
gboolean editable);
gboolean um_editable_entry_get_editable (UmEditableEntry *entry);
void um_editable_entry_set_weight (UmEditableEntry *entry,
gint weight);
gint um_editable_entry_get_weight (UmEditableEntry *entry);
void um_editable_entry_set_scale (UmEditableEntry *entry,
gdouble scale);
gdouble um_editable_entry_get_scale (UmEditableEntry *entry);
G_END_DECLS
#endif /* _UM_EDITABLE_ENTRY_H_ */

View file

@ -45,7 +45,7 @@
#include "um-strength-bar.h" #include "um-strength-bar.h"
#include "um-editable-button.h" #include "um-editable-button.h"
#include "um-editable-entry.h" #include "cc-editable-entry.h"
#include "um-editable-combo.h" #include "um-editable-combo.h"
#include "um-account-dialog.h" #include "um-account-dialog.h"
@ -569,7 +569,7 @@ show_user (UmUser *user, UmUserPanelPrivate *d)
um_photo_dialog_set_user (d->photo_dialog, user); um_photo_dialog_set_user (d->photo_dialog, user);
widget = get_widget (d, "full-name-entry"); widget = get_widget (d, "full-name-entry");
um_editable_entry_set_text (UM_EDITABLE_ENTRY (widget), um_user_get_real_name (user)); cc_editable_entry_set_text (CC_EDITABLE_ENTRY (widget), um_user_get_real_name (user));
gtk_widget_set_tooltip_text (widget, um_user_get_user_name (user)); gtk_widget_set_tooltip_text (widget, um_user_get_user_name (user));
widget = get_widget (d, "account-type-combo"); widget = get_widget (d, "account-type-combo");
@ -636,7 +636,7 @@ change_name_done (GtkWidget *entry,
user = get_selected_user (d); user = get_selected_user (d);
text = um_editable_entry_get_text (UM_EDITABLE_ENTRY (entry)); text = cc_editable_entry_get_text (CC_EDITABLE_ENTRY (entry));
if (g_strcmp0 (text, um_user_get_real_name (user)) != 0) { if (g_strcmp0 (text, um_user_get_real_name (user)) != 0) {
um_user_set_real_name (user, text); um_user_set_real_name (user, text);
@ -956,7 +956,7 @@ on_permission_changed (GPermission *permission,
gtk_widget_show (get_widget (d, "user-icon-button")); gtk_widget_show (get_widget (d, "user-icon-button"));
gtk_widget_hide (get_widget (d, "user-icon-nonbutton")); gtk_widget_hide (get_widget (d, "user-icon-nonbutton"));
um_editable_entry_set_editable (UM_EDITABLE_ENTRY (get_widget (d, "full-name-entry")), TRUE); cc_editable_entry_set_editable (CC_EDITABLE_ENTRY (get_widget (d, "full-name-entry")), TRUE);
remove_unlock_tooltip (get_widget (d, "full-name-entry")); remove_unlock_tooltip (get_widget (d, "full-name-entry"));
um_editable_combo_set_editable (UM_EDITABLE_COMBO (get_widget (d, "account-language-combo")), TRUE); um_editable_combo_set_editable (UM_EDITABLE_COMBO (get_widget (d, "account-language-combo")), TRUE);
@ -971,7 +971,7 @@ on_permission_changed (GPermission *permission,
gtk_widget_hide (get_widget (d, "user-icon-button")); gtk_widget_hide (get_widget (d, "user-icon-button"));
gtk_widget_show (get_widget (d, "user-icon-nonbutton")); gtk_widget_show (get_widget (d, "user-icon-nonbutton"));
um_editable_entry_set_editable (UM_EDITABLE_ENTRY (get_widget (d, "full-name-entry")), FALSE); cc_editable_entry_set_editable (CC_EDITABLE_ENTRY (get_widget (d, "full-name-entry")), FALSE);
add_unlock_tooltip (get_widget (d, "full-name-entry")); add_unlock_tooltip (get_widget (d, "full-name-entry"));
um_editable_combo_set_editable (UM_EDITABLE_COMBO (get_widget (d, "account-language-combo")), FALSE); um_editable_combo_set_editable (UM_EDITABLE_COMBO (get_widget (d, "account-language-combo")), FALSE);
@ -1240,7 +1240,7 @@ um_user_panel_init (UmUserPanel *self)
/* register types that the builder might need */ /* register types that the builder might need */
type = um_strength_bar_get_type (); type = um_strength_bar_get_type ();
type = um_editable_button_get_type (); type = um_editable_button_get_type ();
type = um_editable_entry_get_type (); type = cc_editable_entry_get_type ();
type = um_editable_combo_get_type (); type = um_editable_combo_get_type ();
gtk_widget_set_size_request (GTK_WIDGET (self), -1, 350); gtk_widget_set_size_request (GTK_WIDGET (self), -1, 350);