settings/src/iLiadUserScreen.c File Reference

setup application - E-reader config screen More...

#include <gtk/gtk.h>
#include <libergtk/ergtk.h>
#include "setupLog.h"
#include "background.h"
#include "gtkInfoItem.h"
#include "gtkSettingItem.h"
#include "gtkSettingItemTextEntry.h"
#include "iLiadUserScreen.h"
#include "iLiadUserData.h"
#include "languages.h"

Go to the source code of this file.

Functions

static GtkWidget * create_name_item (void)
static void create_account_settings (gtkAccountSettings_t *acc)
static void on_account_email_changed (GtkEditable *widget, gpointer data)
static void on_account_password_changed (GtkEditable *widget, gpointer data)
GtkWidget * iLiad_user_create (void)
void iLiad_user_set_text (void)
void iLiad_user_set_name (const char *name)
void iLiad_user_set_email (const char *email)
void iLiad_user_set_password (const char *password)

Variables

static GtkWidget * g_top_level_box = NULL
static GtkWidget * g_name_item = NULL
static GtkWidget * g_name_item_entry = NULL
static gtkAccountSettings_tg_account_settings = NULL
static GtkWidget * g_info_item = NULL


Detailed Description

setup application - E-reader config screen

Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.

<File description>="">

Definition in file iLiadUserScreen.c.


Function Documentation

static void create_account_settings ( gtkAccountSettings_t acc  )  [static]

Definition at line 123 of file iLiadUserScreen.c.

00124 {
00125     GtkWidget* settingitem;
00126     GtkWidget* background;
00127     GtkWidget* alignment;
00128     GtkWidget* vbox;
00129     GtkWidget* hbox;
00130     GtkWidget* label;
00131     GtkWidget* entry;
00132 
00133     ST_LOGPRINTF("entry");
00134 
00135     // settingitem
00136     settingitem = gtk_settingitem_new("");
00137     gtk_widget_set_size_request(settingitem, -1, -1);
00138     acc->settingitem = settingitem;
00139 
00140     // background
00141     background = gtk_event_box_new();
00142     gtk_widget_set_name(background, "user_account_settings_background");
00143     gtk_widget_set_size_request(background, TITLE_MIN_WIDTH, USERSCREEN_ACC_HEIGHT);
00144     gtk_settingitem_add_details(GTK_SETTINGITEM(settingitem), background);
00145 
00146     // alignment
00147     alignment = gtk_alignment_new(0, 0, 0, 0);
00148     gtk_alignment_set_padding(GTK_ALIGNMENT(alignment),
00149                               USERSCREEN_ITEM_PADDING_TOP,
00150                               USERSCREEN_ITEM_PADDING_BOTTOM,
00151                               USERSCREEN_ITEM_PADDING_LEFT,
00152                               USERSCREEN_ITEM_PADDING_RIGHT);
00153     gtk_container_add(GTK_CONTAINER(background), alignment);
00154 
00155     vbox = gtk_vbox_new(FALSE, ACCOUNT_SETTINGS_SPACING);
00156     gtk_container_add(GTK_CONTAINER(alignment), vbox);
00157 
00158     label = gtk_label_new("");
00159     gtk_widget_set_name(label, "settingitem_te_label");
00160     gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.6);
00161     gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, USERSCREEN_ITEM_SPACING);
00162     acc->label_email = label;
00163 
00164     hbox = gtk_hbox_new(FALSE, SETTINGITEMTEXT_HBOX_SPACING);
00165     gtk_widget_set_size_request(hbox, -1, -1);
00166     gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
00167 
00168     entry = ergtk_entry_new();
00169     gtk_widget_set_size_request(entry, SETTINGITEMTEXT_ENTRY_WIDTH, SETTINGITEMTEXT_ENTRY_HEIGHT);
00170     gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
00171     acc->entry_email = entry;
00172                  
00173     label = gtk_label_new("");
00174     gtk_widget_set_name(label, "settingitem_te_label");
00175     gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.6);
00176     gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, USERSCREEN_ITEM_SPACING);
00177     acc->label_password = label;
00178 
00179     hbox = gtk_hbox_new(FALSE, SETTINGITEMTEXT_HBOX_SPACING);
00180     gtk_widget_set_size_request(hbox, -1, -1);
00181     gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
00182             
00183     entry = ergtk_entry_new();
00184     gtk_widget_set_size_request(entry, SETTINGITEMTEXT_ENTRY_WIDTH, SETTINGITEMTEXT_ENTRY_HEIGHT);
00185     gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
00186     gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
00187     acc->entry_password = entry;
00188     
00189     g_signal_connect(GTK_OBJECT(acc->entry_email),    "changed-stable", G_CALLBACK(on_account_email_changed),    NULL);
00190     g_signal_connect(GTK_OBJECT(acc->entry_password), "changed-stable", G_CALLBACK(on_account_password_changed), NULL);
00191 
00192     gtk_widget_show_all(background);
00193     gtk_widget_show(settingitem);
00194 }

Here is the call graph for this function:

static GtkWidget * create_name_item ( void   )  [static]

Definition at line 89 of file iLiadUserScreen.c.

00090 {
00091     GtkWidget *widget;
00092 
00093     // g_name_item
00094     g_name_item = gtk_settingitem_new("");
00095     gtk_widget_set_size_request(GTK_WIDGET(g_name_item), (-1), USERNAME_ITEM_REQ_HEIGHT);
00096 
00097     // g_name_item_entry
00098     widget = gtk_settingitem_textentry_new();
00099     gtk_settingitem_add_details(GTK_SETTINGITEM(g_name_item), widget);
00100     g_name_item_entry = widget;
00101 
00102     // signal callback
00103     gtk_settingitem_textentry_callback_on_changed(GTK_SETTINGITEM_TEXTENTRY(widget), on_user_name_changed);
00104 
00105     // display
00106     gtk_widget_show(g_name_item_entry);
00107     gtk_widget_show(g_name_item);
00108 
00109     return g_name_item;
00110 }

Here is the call graph for this function:

GtkWidget* iLiad_user_create ( void   ) 

Definition at line 66 of file iLiadUserScreen.c.

00067 {
00068     g_top_level_box = gtk_vbox_new(FALSE, USERSCREEN_ITEM_SPACING);
00069 
00070     g_name_item = create_name_item();
00071     gtk_box_pack_start(GTK_BOX(g_top_level_box), GTK_WIDGET(g_name_item), FALSE, FALSE, 0);
00072 
00073     g_account_settings = g_new0(gtkAccountSettings_t, 1);
00074     create_account_settings(g_account_settings);
00075     gtk_box_pack_start(GTK_BOX(g_top_level_box), GTK_WIDGET(g_account_settings->settingitem), FALSE, FALSE, 0);
00076 
00077     g_info_item = gtk_infoitem_new(FALSE);
00078     gtk_box_pack_start(GTK_BOX(g_top_level_box), g_info_item, FALSE, FALSE, 0);
00079 
00080     gtk_widget_show(g_top_level_box);
00081 
00082     return g_top_level_box;
00083 }

Here is the call graph for this function:

void iLiad_user_set_email ( const char *  email  ) 

Definition at line 246 of file iLiadUserScreen.c.

00247 {
00248     g_return_if_fail(email != NULL);
00249     
00250     gtk_entry_set_text(GTK_ENTRY(g_account_settings->entry_email), email);
00251 }

void iLiad_user_set_name ( const char *  name  ) 

Definition at line 239 of file iLiadUserScreen.c.

00240 {
00241     g_return_if_fail(name != NULL);
00242 
00243     gtk_settingitem_textentry_settext(GTK_SETTINGITEM_TEXTENTRY(g_name_item_entry), name);
00244 }

Here is the call graph for this function:

void iLiad_user_set_password ( const char *  password  ) 

Definition at line 253 of file iLiadUserScreen.c.

00254 {
00255     g_return_if_fail(password != NULL);
00256 
00257     gtk_entry_set_text(GTK_ENTRY(g_account_settings->entry_password), password);
00258 }

void iLiad_user_set_text ( void   ) 

Definition at line 196 of file iLiadUserScreen.c.

00197 {
00198     ST_LOGPRINTF("entry");
00199 
00200     // name
00201     if (g_name_item)
00202     {
00203         gtk_settingitem_set_header_text(GTK_SETTINGITEM(g_name_item), _("Name"));
00204         gtk_settingitem_textentry_setlabel(GTK_SETTINGITEM_TEXTENTRY(g_name_item_entry), _("Please enter your name"));
00205     }
00206 
00207     // Email address and password
00208     if (g_account_settings)
00209     {
00210         gtk_settingitem_set_header_text(GTK_SETTINGITEM(g_account_settings->settingitem), _("MyiRex account settings"));
00211         gtk_label_set_text(GTK_LABEL(g_account_settings->label_email),  _("Please enter the email address used to create your 'MyiRex' account"));
00212         gtk_label_set_text(GTK_LABEL(g_account_settings->label_password),  _("Please enter your 'MyiRex' password"));
00213     }
00214     
00215     if (g_info_item)
00216     {
00217        // Information text
00218         gtk_infoitem_set_text(GTK_INFOITEM(g_info_item),
00219                               _("\nTo connect to iRex Delivery Service (iDS) you need to create an account."
00220                                 "\nVisit https://myirex.irexnet.com/ and follow the instructions."));
00221     }
00222 }

Here is the call graph for this function:

static void on_account_email_changed ( GtkEditable *  widget,
gpointer  data 
) [static]

Definition at line 226 of file iLiadUserScreen.c.

00227 {
00228     GtkWidget* item = g_account_settings->entry_email;
00229     on_user_email_changed(item, gtk_entry_get_text(GTK_ENTRY(item)));
00230 }

Here is the call graph for this function:

static void on_account_password_changed ( GtkEditable *  widget,
gpointer  data 
) [static]

Definition at line 232 of file iLiadUserScreen.c.

00233 {
00234     GtkWidget* item = g_account_settings->entry_password;
00235     on_user_password_changed(item, gtk_entry_get_text(GTK_ENTRY(item)));
00236 }

Here is the call graph for this function:


Variable Documentation

Definition at line 49 of file iLiadUserScreen.c.

GtkWidget* g_info_item = NULL [static]

Definition at line 51 of file iLiadUserScreen.c.

GtkWidget* g_name_item = NULL [static]

Definition at line 46 of file iLiadUserScreen.c.

GtkWidget* g_name_item_entry = NULL [static]

Definition at line 47 of file iLiadUserScreen.c.

GtkWidget* g_top_level_box = NULL [static]

Definition at line 44 of file iLiadUserScreen.c.


Generated on Sun Dec 14 17:17:25 2008 by  doxygen 1.5.6