settings/src/iLiadPincodeScreen.c File Reference

settings - Pincode Screen More...

#include <string.h>
#include <gtk/gtk.h>
#include <liberdm/display.h>
#include <libergtk/ergtk.h>
#include <liberregxml/erregapi.h>
#include "setupLog.h"
#include "displayStatus.h"
#include "system.h"
#include "gtkInfoItem.h"
#include "gtkSettingItem.h"
#include "gtkPincodeEntry.h"
#include "iLiadPincodeScreen.h"
#include "iLiadPincodeData.h"
#include "iLiadUserData.h"
#include "languages.h"
#include "settings.h"

Go to the source code of this file.

Functions

static GtkWidget * create_pincode_onoff_item (void)
static GtkWidget * create_select_pincode_item (void)
static GtkWidget * create_pincode_select_main_area ()
static GtkWidget * create_pincode_labels_entries ()
static GtkWidget * create_pincode_additional_info ()
static void show_help_text (gboolean is_pincode_on)
static void iLiad_pincode_set_message (const gchar *text)
static void on_pincode_onoff_selection_update (erGtkSelectionGroup *selection, gpointer button, gpointer data)
static gboolean iLiad_pincode_get_on (void)
static void on_confirm_button_toggled_event (GtkToggleButton *button, gpointer ptr)
static gboolean delayed_on_confirm_button_toggled (gpointer user_data)
static void iLiad_pincode_screen_toolbar_update (void)
GtkWidget * iLiad_pincode_create (void)
void iLiad_pincode_set_text (void)
void iLiad_pincode_display_data (void)

Variables

static GtkWidget * g_pincode_onoff_item = NULL
static GtkWidget * g_pincode_onoff_infolabel = NULL
static GtkWidget * g_pincode_onoff_selection = NULL
static GtkWidget * g_pincode_button_on = NULL
static GtkWidget * g_pincode_button_off = NULL
static guint g_pincode_off = -1
static guint g_pincode_on = -1
static GtkWidget * g_pincode_select_item = NULL
static GtkWidget * g_pincode_select_infolabel = NULL
static GtkWidget * g_old_pincode_label = NULL
static GtkWidget * g_new_pincode_label = NULL
static GtkWidget * g_verify_pincode_label = NULL
static GtkWidget * g_old_pincode_entry = NULL
static GtkWidget * g_new_pincode_entry = NULL
static GtkWidget * g_verify_pincode_entry = NULL
static GtkWidget * g_pincode_confirm_button = NULL
static GtkWidget * g_pincode_message_label = NULL
static GtkWidget * g_pincode_additional_info = NULL


Detailed Description

settings - Pincode Screen

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

in Pincode Screen of settings, user can switch on or off PINCODE also can set new PINCODE

Definition in file iLiadPincodeScreen.c.


Function Documentation

static GtkWidget * create_pincode_additional_info (  )  [static]

Definition at line 384 of file iLiadPincodeScreen.c.

00385 {
00386     ST_LOGPRINTF("entry");
00387 
00388     // g_background_item_info
00389     g_pincode_additional_info = gtk_infoitem_new(FALSE);
00390 
00391     // display
00392     gtk_widget_show(g_pincode_additional_info);
00393 
00394     return g_pincode_additional_info;
00395 }

Here is the call graph for this function:

static GtkWidget * create_pincode_labels_entries (  )  [static]

Definition at line 317 of file iLiadPincodeScreen.c.

00318 {
00319     GtkWidget *vbox;
00320     GtkWidget *hbox1;
00321     GtkWidget *hbox2;
00322     GtkWidget *hbox3;
00323     GtkWidget *label1;
00324     GtkWidget *label2;
00325     GtkWidget *label3;
00326     GtkWidget *entry1;
00327     GtkWidget *entry2;
00328     GtkWidget *entry3;
00329 
00330     vbox = gtk_vbox_new(FALSE, PINCODE_SELECT_ITEM_INTER_SPACING2);
00331     // hbox1
00332     hbox1 = gtk_hbox_new(FALSE, PINCODE_SCREEN_SPACING_H);
00333     gtk_box_pack_start(GTK_BOX(vbox), hbox1, FALSE, FALSE, 0);
00334     // label1
00335     label1 = gtk_label_new("");
00336     gtk_box_pack_start(GTK_BOX(hbox1), label1, FALSE, FALSE, 0);
00337     gtk_widget_set_name(GTK_WIDGET(label1), "pincode_screen_info_text");
00338     gtk_widget_set_size_request(label1, PINCODE_LABELS_WIDTH, PINCODE_LABELS_HEIGHT);
00339     gtk_label_set_justify(GTK_LABEL(label1), GTK_JUSTIFY_LEFT);
00340     gtk_misc_set_alignment(GTK_MISC(label1), 0.0, 0.0);
00341     // entry1
00342     entry1 = gtk_pincode_entry_new();
00343     gtk_box_pack_start(GTK_BOX(hbox1), entry1, FALSE, FALSE, 0);
00344     // hbox2
00345     hbox2 = gtk_hbox_new(FALSE, PINCODE_SCREEN_SPACING_H);
00346     gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, 0);
00347     // label2
00348     label2 = gtk_label_new("");
00349     gtk_box_pack_start(GTK_BOX(hbox2), label2, FALSE, FALSE, 0);
00350     gtk_widget_set_name(GTK_WIDGET(label2), "pincode_screen_info_text");
00351     gtk_widget_set_size_request(label2, PINCODE_LABELS_WIDTH, PINCODE_LABELS_HEIGHT);
00352     gtk_label_set_justify(GTK_LABEL(label2), GTK_JUSTIFY_LEFT);
00353     gtk_misc_set_alignment(GTK_MISC(label2), 0.0, 0.0);
00354     // entry2
00355     entry2 = gtk_pincode_entry_new();
00356     gtk_box_pack_start(GTK_BOX(hbox2), entry2, FALSE, FALSE, 0);
00357     // hbox3
00358     hbox3 = gtk_hbox_new(FALSE, PINCODE_SCREEN_SPACING_H);
00359     gtk_box_pack_start(GTK_BOX(vbox), hbox3, FALSE, FALSE, 0);
00360     // label3
00361     label3 = gtk_label_new("");
00362     gtk_box_pack_start(GTK_BOX(hbox3), label3, FALSE, FALSE, 0);
00363     gtk_widget_set_name(GTK_WIDGET(label3), "pincode_screen_info_text");
00364     gtk_widget_set_size_request(label3, PINCODE_LABELS_WIDTH, PINCODE_LABELS_HEIGHT);
00365     gtk_label_set_justify(GTK_LABEL(label3), GTK_JUSTIFY_LEFT);
00366     gtk_misc_set_alignment(GTK_MISC(label3), 0.0, 0.0);
00367     // entry3
00368     entry3 = gtk_pincode_entry_new();
00369     gtk_box_pack_start(GTK_BOX(hbox3), entry3, FALSE, FALSE, 0);
00370 
00371     g_old_pincode_label = label1;
00372     g_new_pincode_label = label2;
00373     g_verify_pincode_label = label3;
00374     g_old_pincode_entry = entry1;
00375     g_new_pincode_entry = entry2;
00376     g_verify_pincode_entry = entry3;
00377     return vbox;
00378 }

Here is the call graph for this function:

static GtkWidget * create_pincode_onoff_item ( void   )  [static]

Definition at line 132 of file iLiadPincodeScreen.c.

00133 {
00134     GtkWidget*       item;
00135     GtkWidget*       selection;
00136     GtkWidget*       alignment;
00137     GtkWidget*       vbox;
00138     GtkWidget*       label;
00139     GtkWidget*       hbox;
00140     GtkToggleButton* button_tbl[3];
00141 
00142     // g_pincode_onoff_item
00143     item = gtk_settingitem_new("");
00144     gtk_widget_set_size_request(item, (-1), (-1));
00145 
00146     // selection --> see below
00147 
00148     // alignment
00149     alignment = gtk_alignment_new(0, 0, 0, 0);
00150     gtk_alignment_set_padding(GTK_ALIGNMENT(alignment),
00151                               PINCODE_SCREEN_ITEM_PADDING_TOP,
00152                               PINCODE_SCREEN_ITEM_PADDING_BOTTOM,
00153                               PINCODE_SCREEN_ITEM_PADDING_LEFT,
00154                               PINCODE_SCREEN_ITEM_PADDING_RIGHT);
00155 
00156     // vbox
00157     vbox = gtk_vbox_new(FALSE, PINCODE_SCREEN_SPACING_V * 2);
00158     gtk_container_add(GTK_CONTAINER(alignment), vbox);
00159     
00160     // g_pincode_onoff_infolabel
00161     label = gtk_label_new("");
00162     gtk_widget_set_name(label, "pincode_screen_info_text");
00163     gtk_widget_set_size_request(label, PINCODE_ONOFF_ITEM_LABEL_WIDTH, (-1));
00164     gtk_label_set_single_line_mode(GTK_LABEL(label), FALSE);
00165     gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
00166     gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
00167     gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
00168 
00169     // hbox
00170     hbox = gtk_hbox_new(FALSE, SMALL_BUTTON_SPACING);
00171     gtk_container_add(GTK_CONTAINER(vbox), hbox);
00172     //     g_pincode_button_on
00173     g_pincode_button_on = ergtk_toggle_button_new_with_label("");
00174     gtk_widget_set_size_request(GTK_WIDGET(g_pincode_button_on), SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
00175     gtk_box_pack_start(GTK_BOX(hbox), g_pincode_button_on, FALSE, FALSE, 0);
00176     //     g_pincode_button_off
00177     g_pincode_button_off = ergtk_toggle_button_new_with_label("");
00178     gtk_widget_set_size_request(GTK_WIDGET(g_pincode_button_off), SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
00179     gtk_box_pack_start(GTK_BOX(hbox), g_pincode_button_off, FALSE, FALSE, 0);
00180     // add details to selection
00181     button_tbl[0] = GTK_TOGGLE_BUTTON(g_pincode_button_on );
00182     button_tbl[1] = GTK_TOGGLE_BUTTON(g_pincode_button_off);
00183     button_tbl[2] = NULL;
00184     g_pincode_on  = 0;  // selection-group counts from 0
00185     g_pincode_off = 1;
00186     // selection
00187     selection = ergtk_selection_group_new(button_tbl);
00188     gtk_widget_set_name(selection, "pincode_onoff_background");
00189     ergtk_selection_group_set_details(ERGTK_SELECTION_GROUP(selection), 1, 1);
00190     gtk_widget_set_size_request(GTK_WIDGET(selection), PINCODE_ONOFF_BK_WIDTH, PINCODE_ONOFF_BK_HEIGHT);
00191     g_signal_connect(G_OBJECT(selection), "selection-update", G_CALLBACK(on_pincode_onoff_selection_update), NULL);
00192     gtk_container_add(GTK_CONTAINER(selection), alignment);
00193     gtk_settingitem_add_details(GTK_SETTINGITEM(item), selection);
00194 
00195     gtk_widget_show_all(selection);
00196 
00197     g_pincode_onoff_item = item;
00198     g_pincode_onoff_infolabel = label;
00199     g_pincode_onoff_selection = selection;
00200     return item;
00201 }

Here is the call graph for this function:

static GtkWidget * create_pincode_select_main_area (  )  [static]

Definition at line 260 of file iLiadPincodeScreen.c.

00261 {
00262     GtkWidget *vbox;
00263     GtkWidget *label;
00264     GtkWidget *labels_entries;
00265     GtkWidget *hbox;
00266     GtkWidget *button;
00267     GtkWidget *message;
00268 
00269     // vbox
00270     vbox = gtk_vbox_new(FALSE, PINCODE_SELECT_ITEM_INTER_SPACING1);
00271     // label
00272     label = gtk_label_new("");
00273     gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
00274     gtk_widget_set_name(label, "pincode_screen_info_text");
00275     gtk_widget_set_size_request(label, PINCODE_SELECT_ITEM_LABEL_WIDTH, (-1));
00276     gtk_label_set_single_line_mode(GTK_LABEL(label), FALSE);
00277     gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
00278     gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
00279     // labels_entries
00280     labels_entries = create_pincode_labels_entries();
00281     gtk_box_pack_start(GTK_BOX(vbox), labels_entries, FALSE, FALSE, 0);
00282     // hbox
00283     hbox = gtk_hbox_new(FALSE, PINCODE_SCREEN_SPACING_H);
00284     gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
00285     // button
00286     button = ergtk_toggle_button_new_with_label("");
00287     gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), FALSE, FALSE, 0);
00288     gtk_widget_set_size_request(button, PINCODE_BUTTON_WIDTH, PINCODE_BUTTON_HEIGHT);
00289     g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(on_confirm_button_toggled_event), NULL);
00290     // message
00291     message = gtk_label_new("");
00292     gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(message), FALSE, FALSE, 0);
00293     gtk_widget_set_name(message, "pincode_screen_info_text");
00294     gtk_widget_set_size_request(message, PINCODE_SELECT_MESSAGE_WIDTH, (-1));
00295     gtk_label_set_single_line_mode(GTK_LABEL(label), FALSE);
00296     gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
00297     gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
00298 
00299     g_pincode_select_infolabel = label;
00300     g_pincode_confirm_button = button;
00301     g_pincode_message_label = message;
00302     return vbox;
00303 }

Here is the call graph for this function:

static GtkWidget * create_select_pincode_item ( void   )  [static]

Definition at line 212 of file iLiadPincodeScreen.c.

00213 {
00214     GtkWidget *item;
00215     GtkWidget *vbox;
00216     GtkWidget *background;
00217     GtkWidget *alignment;
00218     GtkWidget *widget;
00219     GtkWidget *info;
00220 
00221     // g_pincode_select_item
00222     item = gtk_settingitem_new("");
00223     gtk_widget_set_size_request(GTK_WIDGET(item), (-1), (-1));
00224     // vbox
00225     vbox = gtk_vbox_new(FALSE, PINCODE_SCREEN_SPACING_V);
00226     gtk_settingitem_add_details(GTK_SETTINGITEM(item), vbox);
00227     // background
00228     background = gtk_event_box_new();
00229     gtk_box_pack_start(GTK_BOX(vbox), background, FALSE, FALSE, 0);
00230     gtk_widget_set_name (GTK_WIDGET (background), "pincode_select_background");
00231     gtk_widget_set_size_request(background, PINCODE_SELECT_BK_WIDTH, PINCODE_SELECT_BK_HEIGHT);
00232     // alignment
00233     alignment = gtk_alignment_new(0, 0, 0, 0);
00234     gtk_container_add(GTK_CONTAINER(background), alignment);
00235     gtk_alignment_set_padding(GTK_ALIGNMENT(alignment),
00236                               PINCODE_SCREEN_ITEM_PADDING_TOP,
00237                               PINCODE_SCREEN_ITEM_PADDING_BOTTOM,
00238                               PINCODE_SCREEN_ITEM_PADDING_LEFT, PINCODE_SCREEN_ITEM_PADDING_RIGHT);
00239     widget = create_pincode_select_main_area();
00240     gtk_container_add(GTK_CONTAINER(alignment), widget);
00241     // additional info
00242     info = create_pincode_additional_info();
00243     gtk_box_pack_start(GTK_BOX(vbox), info, FALSE, FALSE, 0);
00244     //
00245     gtk_widget_show_all(vbox);
00246 
00247     g_pincode_select_item = item;
00248 
00249     return item;
00250 }

Here is the call graph for this function:

static gboolean delayed_on_confirm_button_toggled ( gpointer  user_data  )  [static]

Definition at line 596 of file iLiadPincodeScreen.c.

00597 {
00598     GtkWidget *button = g_pincode_confirm_button;
00599 
00600     gboolean check_old = FALSE;
00601     gboolean check_new = FALSE;
00602     gboolean check_verify = FALSE;
00603 
00604     const gchar *old_pincode = NULL;
00605     const gchar *new_pincode = NULL;
00606     const gchar *verify_pincode = NULL;
00607 
00608     gchar *pincode = NULL;
00609 
00610     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE);
00611 
00612     pincode = iLiad_pincode_data_get_pincode();
00613     if ((NULL == pincode) || (0 == strlen(pincode)))
00614     {
00615         check_old = TRUE;
00616     }
00617     else
00618     {
00619         check_old = gtk_pincode_entry_check_text(GTK_PINCODE_ENTRY(g_old_pincode_entry));
00620     }
00621     check_new    = gtk_pincode_entry_check_text(GTK_PINCODE_ENTRY(g_new_pincode_entry));
00622     check_verify = gtk_pincode_entry_check_text(GTK_PINCODE_ENTRY(g_verify_pincode_entry));
00623     if (FALSE == check_old || FALSE == check_new || FALSE == check_verify)
00624     {
00625         gtk_entry_set_text(GTK_ENTRY(g_old_pincode_entry), "");
00626         gtk_entry_set_text(GTK_ENTRY(g_new_pincode_entry), "");
00627         gtk_entry_set_text(GTK_ENTRY(g_verify_pincode_entry), "");
00628         iLiad_pincode_set_message(_("Illegal characters or illegal length, pincode unchanged"));
00629         return FALSE;
00630     }
00631 
00632     new_pincode    = gtk_entry_get_text(GTK_ENTRY(g_new_pincode_entry));
00633     verify_pincode = gtk_entry_get_text(GTK_ENTRY(g_verify_pincode_entry));
00634     if (strcmp(new_pincode, verify_pincode))
00635     {
00636         gtk_entry_set_text(GTK_ENTRY(g_old_pincode_entry), "");
00637         gtk_entry_set_text(GTK_ENTRY(g_new_pincode_entry), "");
00638         gtk_entry_set_text(GTK_ENTRY(g_verify_pincode_entry), "");
00639 
00640         iLiad_pincode_set_message(_("Pincode verification failed, pincode unchanged"));
00641         return FALSE;
00642     }
00643     if (NULL == pincode || 0 == strlen(pincode))
00644     {
00645         iLiad_pincode_data_set_pincode(new_pincode);
00646         iLiad_pincode_display_data();
00647 
00648         // for pincode, store into sysset immediately
00649         iLiad_pincode_data_store();
00650 
00651         iLiad_pincode_set_message(_("Pincode updated successfully"));
00652         // update toolbar lock screen icon
00653         iLiad_pincode_screen_toolbar_update();
00654 
00655         gtk_entry_set_text(GTK_ENTRY(g_old_pincode_entry), "");
00656         gtk_entry_set_text(GTK_ENTRY(g_new_pincode_entry), "");
00657         gtk_entry_set_text(GTK_ENTRY(g_verify_pincode_entry), "");
00658 
00659         return FALSE;
00660     }
00661     old_pincode = gtk_entry_get_text(GTK_ENTRY(g_old_pincode_entry));
00662     if (strcmp(old_pincode, pincode))
00663     {
00664         gtk_entry_set_text(GTK_ENTRY(g_old_pincode_entry), "");
00665         gtk_entry_set_text(GTK_ENTRY(g_new_pincode_entry), "");
00666         gtk_entry_set_text(GTK_ENTRY(g_verify_pincode_entry), "");
00667 
00668         iLiad_pincode_set_message(_("Current pincode incorrect, pincode unchanged"));
00669     }
00670     else
00671     {
00672         iLiad_pincode_data_set_pincode(new_pincode);
00673         iLiad_pincode_display_data();
00674 
00675         // for pincode, store into sysset immediately
00676         iLiad_pincode_data_store();
00677 
00678         iLiad_pincode_set_message(_("Pincode updated successfully"));
00679         // update toolbar lock screen icon
00680         iLiad_pincode_screen_toolbar_update();
00681 
00682         gtk_entry_set_text(GTK_ENTRY(g_old_pincode_entry), "");
00683         gtk_entry_set_text(GTK_ENTRY(g_new_pincode_entry), "");
00684         gtk_entry_set_text(GTK_ENTRY(g_verify_pincode_entry), "");
00685     }
00686     return FALSE;               // don't call me anymore
00687 }

Here is the call graph for this function:

GtkWidget* iLiad_pincode_create ( void   ) 

Definition at line 102 of file iLiadPincodeScreen.c.

00103 {
00104     GtkWidget *vbox;
00105     GtkWidget *onoff_item;
00106     GtkWidget *select_item;
00107 
00108     vbox = gtk_vbox_new(FALSE, PINCODE_SCREEN_SPACING_V);
00109 
00110     onoff_item = create_pincode_onoff_item();
00111     gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(onoff_item), FALSE, FALSE, 0);
00112     select_item = create_select_pincode_item();
00113     gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(select_item), FALSE, FALSE, 0);
00114 
00115     gtk_widget_show(onoff_item);
00116     gtk_widget_show(select_item);
00117     gtk_widget_show(vbox);
00118 
00119     return vbox;
00120 }

Here is the call graph for this function:

void iLiad_pincode_display_data ( void   ) 

Definition at line 503 of file iLiadPincodeScreen.c.

00504 {
00505     const gboolean enable  = iLiad_pincode_data_is_pincode_on();
00506 
00507     if (enable)
00508     {
00509         ST_LOGPRINTF("PIN code on");
00510         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g_pincode_button_on), TRUE);
00511     }
00512     else
00513     {
00514         ST_LOGPRINTF("PIN code off");
00515         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g_pincode_button_off), TRUE);
00516     }
00517 }

Here is the call graph for this function:

static gboolean iLiad_pincode_get_on ( void   )  [static]

Definition at line 519 of file iLiadPincodeScreen.c.

00520 {
00521     GtkWidget* selection = g_pincode_onoff_selection;
00522     gint       selection_id;
00523     gboolean   returnValue = FALSE;
00524 
00525     ergtk_selection_group_get_selected_buttons(ERGTK_SELECTION_GROUP(selection), &selection_id, 1);
00526 
00527     if (g_pincode_on == selection_id)
00528     {
00529         ST_LOGPRINTF("PIN code on");
00530         returnValue = TRUE;
00531     }
00532     else if (g_pincode_off == selection_id)
00533     {
00534         ST_LOGPRINTF("PIN code off");
00535         returnValue = FALSE;
00536     }
00537     else
00538     {
00539         ST_ERRORPRINTF("invalid pincode on/off %d", selection_id);
00540         //terminate application if this point is reached
00541         g_assert_not_reached();
00542     }
00543     return returnValue;
00544 }

Here is the call graph for this function:

static void iLiad_pincode_screen_toolbar_update ( void   )  [static]

Definition at line 689 of file iLiadPincodeScreen.c.

00690 {
00691     gboolean enable = FALSE;
00692     gchar *pincode = NULL;
00693     
00694     // update toolbar lock screen icon
00695     enable =  iLiad_pincode_data_is_pincode_on();
00696     pincode = iLiad_pincode_data_get_pincode();
00697 
00698     if (FALSE == enable || NULL == pincode || 0 == strlen(pincode))
00699     {
00700         show_lock_screen_icon(FALSE);
00701     }
00702     else
00703     {
00704         show_lock_screen_icon(TRUE);
00705     }
00706 }

Here is the call graph for this function:

static void iLiad_pincode_set_message ( const gchar *  text  )  [static]

Definition at line 546 of file iLiadPincodeScreen.c.

00547 {
00548     GtkWidget *label;
00549 
00550     label = g_pincode_message_label;
00551     if (label && text)
00552     {
00553         gtk_label_set_text(GTK_LABEL(label), text);
00554         gtk_widget_show(label);
00555         display_update_request_screen_refresh(SETTING_ITEM_CHANGE, WAVEFORM_TYPING);
00556     }
00557 }

Here is the call graph for this function:

void iLiad_pincode_set_text ( void   ) 

Definition at line 398 of file iLiadPincodeScreen.c.

00399 {
00400     ST_LOGPRINTF("entry");
00401 
00402     GtkWidget *item;
00403     GtkWidget *selection;
00404     GtkWidget *label;
00405     GtkWidget *button;
00406 
00407     // g_pincode_onoff_item
00408     if (g_pincode_onoff_item)
00409     {
00410         item = g_pincode_onoff_item;
00411         gtk_settingitem_set_header_text(GTK_SETTINGITEM(item), _("PIN Code"));
00412         if (g_pincode_onoff_infolabel)
00413         {
00414             label = g_pincode_onoff_infolabel;
00415             gtk_label_set_text(GTK_LABEL(label),
00416                                _("The PIN code protects your reader against unauthorized use.\n"
00417                                  "The code is requested each time the reader is switched on."   ));
00418         }
00419         if (g_pincode_onoff_selection)
00420         {
00421             selection = g_pincode_onoff_selection;
00422             gtk_button_set_label(GTK_BUTTON(g_pincode_button_on ), _("On" ));
00423             gtk_button_set_label(GTK_BUTTON(g_pincode_button_off), _("Off"));
00424         }
00425     }
00426     // g_pincode_select_item
00427     if (g_pincode_select_item)
00428     {
00429         item = g_pincode_select_item;
00430         gtk_settingitem_set_header_text(GTK_SETTINGITEM(item), _("Select PIN code"));
00431         if (g_pincode_select_infolabel)
00432         {
00433             label = g_pincode_select_infolabel;
00434             gtk_label_set_text(GTK_LABEL(label), _("Please select a PIN code of 4 digits."));
00435         }
00436         if (g_old_pincode_label)
00437         {
00438             label = g_old_pincode_label;
00439             gtk_label_set_text(GTK_LABEL(label), _("Please enter current PIN code"));
00440         }
00441         if (g_new_pincode_label)
00442         {
00443             label = g_new_pincode_label;
00444             gtk_label_set_text(GTK_LABEL(label), _("Please enter new PIN code"));
00445         }
00446         if (g_verify_pincode_label)
00447         {
00448             label = g_verify_pincode_label;
00449             gtk_label_set_text(GTK_LABEL(label), _("Please verify new PIN code"));
00450         }
00451 
00452         if (g_pincode_confirm_button)
00453         {
00454             button = g_pincode_confirm_button;
00455             gtk_button_set_label(GTK_BUTTON(button), _("Confirm"));
00456         }
00457 
00458         if (g_pincode_message_label)
00459         {
00460             label = g_pincode_message_label;
00461             gtk_label_set_text(GTK_LABEL(label), "");
00462         }
00463         if (g_pincode_additional_info)
00464         {
00465             show_help_text(iLiad_pincode_data_is_pincode_on());
00466         }
00467     }
00468 }

Here is the call graph for this function:

static void on_confirm_button_toggled_event ( GtkToggleButton *  button,
gpointer  ptr 
) [static]

Definition at line 584 of file iLiadPincodeScreen.c.

00585 {
00586     // check if it is a "pressed event"
00587     gboolean pressed = gtk_toggle_button_get_active(button);
00588     if (pressed)
00589     {
00590         // show button selected, then start check pincode
00591         display_update_request_screen_refresh(TEXT_ENTRY_CHANGED_LEVEL, WAVEFORM_TYPING);
00592         g_timeout_add(500, delayed_on_confirm_button_toggled, ptr);
00593     }
00594 }

Here is the call graph for this function:

static void on_pincode_onoff_selection_update ( erGtkSelectionGroup selection,
gpointer  button,
gpointer  data 
) [static]

Definition at line 560 of file iLiadPincodeScreen.c.

00563 {
00564     gboolean enable;
00565 
00566     enable = iLiad_pincode_get_on();
00567 
00568     ST_LOGPRINTF("pincode %s", enable == 0 ? "OFF" : "ON");
00569 
00570     show_help_text(enable);
00571 
00572     iLiad_pincode_data_set_pincode_on(enable);
00573 
00574     // update toolbar lock screen icon
00575     iLiad_pincode_screen_toolbar_update();
00576 
00577     // for pincode, store into sysset immediately
00578     iLiad_pincode_data_store();
00579 
00580     display_update_request_screen_refresh(SETTING_ITEM_CHANGE, WAVEFORM_TYPING);
00581 }

Here is the call graph for this function:

void show_help_text ( gboolean  is_pincode_on  )  [static]

Definition at line 470 of file iLiadPincodeScreen.c.

00471 {
00472     gboolean show_warning_msg = FALSE;
00473 
00474     if (is_pincode_on)
00475     {
00476         regUserProfile_t* user_profile = get_user_profile_ptr();
00477 
00478         if ((NULL == user_profile) ||
00479             (NULL == user_profile->name) || (user_profile->name[0] == '\0') ||
00480             (NULL == user_profile->email) || (user_profile->email[0] == '\0'))
00481         {
00482             show_warning_msg = TRUE;
00483         }
00484     }
00485     
00486     // Show warning message when switched to "ON" by an unregistered user
00487     if (show_warning_msg)
00488     {
00489         gtk_infoitem_set_text( GTK_INFOITEM(g_pincode_additional_info),
00490                                _("Please create a user account at 'MyiRex' and fill in the account settings in your iLiad."));
00491     }
00492     else
00493     {
00494         gtk_infoitem_set_text( GTK_INFOITEM(g_pincode_additional_info),
00495                                _("Warning!\n"
00496                                  "You can only enter the PIN code with the iLiad's stylus. "
00497                                  "Make sure that you always have the stylus available "
00498                                  "after enabling the pin code functionality."));
00499     }
00500 }

Here is the call graph for this function:


Variable Documentation

GtkWidget* g_new_pincode_entry = NULL [static]

Definition at line 66 of file iLiadPincodeScreen.c.

GtkWidget* g_new_pincode_label = NULL [static]

Definition at line 63 of file iLiadPincodeScreen.c.

GtkWidget* g_old_pincode_entry = NULL [static]

Definition at line 65 of file iLiadPincodeScreen.c.

GtkWidget* g_old_pincode_label = NULL [static]

Definition at line 62 of file iLiadPincodeScreen.c.

GtkWidget* g_pincode_additional_info = NULL [static]

Definition at line 70 of file iLiadPincodeScreen.c.

GtkWidget* g_pincode_button_off = NULL [static]

Definition at line 56 of file iLiadPincodeScreen.c.

GtkWidget* g_pincode_button_on = NULL [static]

Definition at line 55 of file iLiadPincodeScreen.c.

GtkWidget* g_pincode_confirm_button = NULL [static]

Definition at line 68 of file iLiadPincodeScreen.c.

GtkWidget* g_pincode_message_label = NULL [static]

Definition at line 69 of file iLiadPincodeScreen.c.

guint g_pincode_off = -1 [static]

Definition at line 57 of file iLiadPincodeScreen.c.

guint g_pincode_on = -1 [static]

Definition at line 58 of file iLiadPincodeScreen.c.

GtkWidget* g_pincode_onoff_infolabel = NULL [static]

Definition at line 53 of file iLiadPincodeScreen.c.

GtkWidget* g_pincode_onoff_item = NULL [static]

Definition at line 52 of file iLiadPincodeScreen.c.

GtkWidget* g_pincode_onoff_selection = NULL [static]

Definition at line 54 of file iLiadPincodeScreen.c.

GtkWidget* g_pincode_select_infolabel = NULL [static]

Definition at line 61 of file iLiadPincodeScreen.c.

GtkWidget* g_pincode_select_item = NULL [static]

Definition at line 60 of file iLiadPincodeScreen.c.

GtkWidget* g_verify_pincode_entry = NULL [static]

Definition at line 67 of file iLiadPincodeScreen.c.

GtkWidget* g_verify_pincode_label = NULL [static]

Definition at line 64 of file iLiadPincodeScreen.c.


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