connectionMgr/src/editScreenWirelessExt.c File Reference

#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include <liberdm/connectionMgrConstants.h>
#include <liberdm/display.h>
#include <liberregxml/erregapi.h>
#include <libergtk/ergtk.h>
#include "connectionMgrLog.h"
#include "displayStatus.h"
#include "erbusy.h"
#include "background.h"
#include "connectionMgr.h"
#include "gtkSettingItem.h"
#include "gtkInfoItem.h"
#include "gtkProfileEntry.h"
#include "widgetUtils.h"
#include "connectScreen.h"
#include "connectScreenData.h"
#include "editScreen.h"
#include "editScreenOverview.h"
#include "editScreenWireless.h"
#include "editScreenWirelessExt.h"
#include "commonData.h"
#include "connectPing.h"
#include "connectBackground.h"
#include "languages.h"

Go to the source code of this file.

Enumerations

enum  wlanExtStatus_t {
  inputEncrKey_e = 0, wrongEncrKey_e, advancedSettings_e, pcshareSettings_e,
  wlanExtConnecting_e, wlanExtConnected_e, wlanExtAborting_e, wlanExtAborted_e,
  undefWlanExtStatus_e
}

Functions

static GtkWidget * create_encrypt (void)
static void edit_wireless_ext_update_status (pingStatus_t status)
static void edit_wireless_ext_set_profile (const regNetworkProfile_t *settings)
static void edit_wireless_ext_set_ssid (const char *ssid)
static void edit_wireless_ext_set_encrtype (wireless_encr_type_t encrtype)
static void edit_wireless_ext_set_encrkey (const char *encrkey)
static const char * edit_wireless_ext_get_ssid (void)
static wireless_encr_type_t edit_wireless_ext_get_encrtype (void)
static const char * edit_wireless_ext_get_encrkey (void)
static void edit_wireless_ext_backup_network_settings (void)
static void on_connect (GtkToggleButton *button, gpointer data)
static void on_advanced (GtkToggleButton *button, gpointer data)
static gboolean delayed_deactive_button (gpointer data)
static void edit_wireless_ext_restore_ping_ctxt (void)
static void on_connected (int profileIndex)
static void on_failed (void)
static void ui_update_status (int profileIndex, pingStatus_t status)
static void ui_display_settings (int profileIndex, gboolean resetStatus)
static void ui_select_profile (int profileIndex)
static void ui_unselect_all_profile (void)
static void edit_wireless_ext_freeze_ui (gboolean freeze)
GtkWidget * edit_wireless_ext_create (void)
static void edit_wireless_ext_show_widgets (wlanExtStatus_t mode)
void edit_wireless_ext_set_text (void)
static void edit_wireless_ext_update_info_text (wlanExtStatus_t status)
void edit_wireless_ext_set_network_settings (const regNetworkProfile_t *settings)
void edit_wireless_ext_get_network_settings (regNetworkProfile_t *settings)
gboolean edit_wireless_ext_check_network_settings (void)
void edit_wireless_ext_restore_network_settings (void)
static gboolean on_delayed_connect (gpointer data)
static gboolean on_delayed_advanced (gpointer data)
gboolean on_edit_wireless_ext_keypress (GdkEventKey *event)

Variables

static GtkWidget * g_wireless_ext = NULL
static bkProfileEntryg_profile_entry = NULL
static GtkWidget * g_ssid_name = NULL
static GtkWidget * g_ssid_value = NULL
static GtkWidget * g_encrtype_name = NULL
static GtkWidget * g_encrtype_value = NULL
static wdtLabelEntryg_encrkey = NULL
static bkWdtLabelButtong_advanced = NULL
static GtkWidget * g_info = NULL
static char * g_old_encrkey = NULL


Enumeration Type Documentation

Enumerator:
inputEncrKey_e 
wrongEncrKey_e 
advancedSettings_e 
pcshareSettings_e 
wlanExtConnecting_e 
wlanExtConnected_e 
wlanExtAborting_e 
wlanExtAborted_e 
undefWlanExtStatus_e 

Definition at line 57 of file editScreenWirelessExt.c.


Function Documentation

static GtkWidget * create_encrypt ( void   )  [static]

Definition at line 195 of file editScreenWirelessExt.c.

00196 {
00197     GtkWidget *background;
00198     GtkWidget *alignment;
00199     GtkWidget *vbox;
00200     GtkWidget *subvbox;
00201     GtkWidget *hbox;
00202     GtkWidget *ssidName;
00203     GtkWidget *ssidValue;
00204     GtkWidget *encrtypeName;
00205     GtkWidget *encrtypeValue;
00206     wdtLabelEntry *encrkey;
00207     GtkWidget *widget;
00208 
00209     CN_LOGPRINTF("entry");
00210 
00211     // background
00212     background = gtk_event_box_new();
00213     gtk_widget_set_name(background, "bk_grey_666_168");
00214     gtk_widget_set_size_request(background, 
00215             BK_666_168_WIDTH, BK_666_168_HEIGHT);
00216 
00217     // alignment
00218     alignment = gtk_alignment_new(0.0, 0.0, 0.0, 0.0);
00219     gtk_alignment_set_padding(GTK_ALIGNMENT(alignment),
00220                               PADDING_TOP * 2, 
00221                               PADDING_BOTTOM * 2, 
00222                               PADDING_LEFT, 
00223                               PADDING_RIGHT);
00224     gtk_container_add(GTK_CONTAINER(background), alignment);
00225 
00226     // vbox
00227     vbox = gtk_vbox_new(FALSE, VBOX_SPACING * 3);
00228     gtk_container_add(GTK_CONTAINER(alignment), vbox);
00229 
00230     // subvbox
00231     subvbox = gtk_vbox_new(FALSE, VBOX_SPACING);
00232     gtk_box_pack_start(GTK_BOX(vbox), subvbox, FALSE, FALSE, 0);
00233 
00234     // hbox
00235     hbox = gtk_hbox_new(FALSE, HBOX_SPACING);
00236     gtk_box_pack_start(GTK_BOX(subvbox), hbox, FALSE, FALSE, 0);
00237 
00238     // ssidName
00239     ssidName = gtk_label_new("");
00240     gtk_widget_set_name(ssidName, "info_label");
00241     gtk_box_pack_start(GTK_BOX(hbox), ssidName, FALSE, FALSE, 0);
00242     
00243     // ssidValue
00244     ssidValue = gtk_label_new("");
00245     gtk_widget_set_name(ssidValue, "info_label");
00246     gtk_box_pack_start(GTK_BOX(hbox), ssidValue, FALSE, FALSE, 0);
00247 
00248     // hbox
00249     hbox = gtk_hbox_new(FALSE, HBOX_SPACING);
00250     gtk_box_pack_start(GTK_BOX(subvbox), hbox, FALSE, FALSE, 0);
00251 
00252     // encrtypeName
00253     encrtypeName = gtk_label_new("");
00254     gtk_widget_set_name(encrtypeName, "info_label");
00255     gtk_box_pack_start(GTK_BOX(hbox), encrtypeName, FALSE, FALSE, 0);
00256     
00257     // encrtypeValue
00258     encrtypeValue = gtk_label_new("");
00259     gtk_widget_set_name(encrtypeValue, "info_label");
00260     gtk_box_pack_start(GTK_BOX(hbox), encrtypeValue, FALSE, FALSE, 0);
00261 
00262     // encrkey
00263     encrkey = wdt_label_entry_new(string_e);
00264     gtk_entry_set_visibility(GTK_ENTRY(encrkey->entry), FALSE); 
00265     gtk_box_pack_start(GTK_BOX(vbox), encrkey->parent, FALSE, FALSE, 0);
00266 
00267     // signal handlers
00268     widget = encrkey->button;
00269     g_signal_connect_after(G_OBJECT(widget), "toggled", 
00270                            G_CALLBACK(on_connect), NULL);
00271 
00272     // show widgets
00273     gtk_widget_show(alignment);
00274     gtk_widget_show(vbox);
00275     gtk_widget_show_all(subvbox);
00276     gtk_widget_show(encrkey->parent);
00277     gtk_widget_grab_focus(encrkey->entry);
00278 
00279     // global variables
00280     g_ssid_name = ssidName;
00281     g_ssid_value = ssidValue;
00282     g_encrtype_name = encrtypeName;
00283     g_encrtype_value = encrtypeValue;
00284     g_encrkey = encrkey;
00285 
00286     // return
00287     return background;
00288 }

Here is the call graph for this function:

static gboolean delayed_deactive_button ( gpointer  data  )  [static]

Definition at line 724 of file editScreenWirelessExt.c.

00725 {
00726     GtkToggleButton *button = GTK_TOGGLE_BUTTON(data);
00727     
00728     if (button)
00729     {
00730         gtk_toggle_button_set_active(button, FALSE);
00731     }
00732 
00733     return FALSE;
00734 }

static void edit_wireless_ext_backup_network_settings ( void   )  [static]

Definition at line 629 of file editScreenWirelessExt.c.

00630 {
00631     const char *encrkey;
00632 
00633     CN_LOGPRINTF("entry");
00634 
00635     g_free(g_old_encrkey);
00636 
00637     encrkey = edit_wireless_ext_get_encrkey();
00638     g_old_encrkey = g_strdup(encrkey);
00639 }

Here is the call graph for this function:

gboolean edit_wireless_ext_check_network_settings ( void   ) 

Definition at line 616 of file editScreenWirelessExt.c.

00617 {
00618     gboolean valid = TRUE;
00619 
00620     CN_LOGPRINTF("entry");
00621     if (!ergtk_entry_check_field(ERGTK_ENTRY(g_encrkey->entry)))
00622     {
00623         valid = FALSE;
00624     }
00625 
00626     return valid;
00627 }

Here is the call graph for this function:

GtkWidget* edit_wireless_ext_create ( void   ) 

Definition at line 124 of file editScreenWirelessExt.c.

00125 {
00126     GtkWidget *item;
00127     GtkWidget *vbox;
00128     bkProfileEntry *profileEntry;
00129     GtkWidget *encrypt;
00130     bkWdtLabelButton *advanced;
00131     GtkWidget *info;
00132     GtkWidget *widget;
00133 
00134     CN_LOGPRINTF("entry");
00135 
00136     // item
00137     item = gtk_settingitem_new("");
00138 
00139     // vbox
00140     vbox =gtk_vbox_new(FALSE, VBOX_SPACING);
00141     gtk_settingitem_add_details(GTK_SETTINGITEM(item), vbox);
00142     
00143     // profileEntry
00144     profileEntry = bk_profile_entry_new();
00145     gtk_box_pack_start(GTK_BOX(vbox), profileEntry->background, 
00146                        FALSE, FALSE, 0);
00147 
00148     // encrypt
00149     encrypt = create_encrypt();
00150     gtk_box_pack_start(GTK_BOX(vbox), encrypt, FALSE, FALSE, 0);
00151     
00152     // advanced
00153     advanced = bk_wdt_label_button_new(1, FALSE, 0, 1);
00154     gtk_box_pack_start(GTK_BOX(vbox), advanced->background, 
00155                        FALSE, FALSE, 0); 
00156 
00157     // info
00158     info = gtk_infoitem_new(FALSE);
00159     gtk_box_pack_start(GTK_BOX(vbox), info, FALSE, FALSE, 0);
00160 
00161     // signal handlers
00162     widget = GTK_WIDGET(advanced->details->buttonList[0]);
00163     g_signal_connect_after(G_OBJECT(widget), "toggled", 
00164                            G_CALLBACK(on_advanced), NULL);
00165  
00166     // show widgets
00167     gtk_widget_show(item);
00168     gtk_widget_show(vbox);
00169     gtk_widget_show(profileEntry->background);
00170     gtk_widget_show(encrypt);
00171     gtk_widget_show(advanced->background);
00172     gtk_widget_show(info);
00173 
00174     // global variables
00175     g_wireless_ext = item;
00176     g_profile_entry = profileEntry;
00177     g_advanced =  advanced;
00178     g_info = info;
00179 
00180     // return
00181     return item;
00182 }

Here is the call graph for this function:

static void edit_wireless_ext_freeze_ui ( gboolean  freeze  )  [static]

Definition at line 938 of file editScreenWirelessExt.c.

00939 {
00940     gboolean sensitive;
00941     GtkWidget *widget;
00942 
00943     CN_LOGPRINTF("entry[%d]", freeze);
00944 
00945     sensitive = !freeze;
00946     
00947     // the encryption key
00948     widget = g_encrkey->entry;
00949     gtk_widget_set_sensitive(widget, sensitive);
00950 
00951     // the 'Connect' button
00952     widget = g_encrkey->button;
00953     gtk_widget_set_sensitive(widget, sensitive);
00954 
00955     // the 'Advanced settings' button
00956     widget = GTK_WIDGET(g_advanced->details->buttonList[0]);
00957     gtk_widget_set_sensitive(widget, sensitive);
00958 }

static const char * edit_wireless_ext_get_encrkey ( void   )  [static]

Definition at line 599 of file editScreenWirelessExt.c.

00600 {
00601     const char *encrkey = NULL;
00602     GtkWidget *widget;
00603 
00604     CN_LOGPRINTF("entry");
00605 
00606     if (g_encrkey)
00607     {
00608         widget = g_encrkey->entry;
00609         encrkey = gtk_entry_get_text(GTK_ENTRY(widget)); 
00610     }
00611 
00612     CN_LOGPRINTF("return encrkey=%s", encrkey);
00613     return encrkey;
00614 }

static wireless_encr_type_t edit_wireless_ext_get_encrtype ( void   )  [static]

Definition at line 568 of file editScreenWirelessExt.c.

00569 {
00570     const char *value = NULL;
00571     wireless_encr_type_t encrtype = encr_undefined_t;
00572        
00573     CN_LOGPRINTF("entry");
00574 
00575     if (g_encrtype_value)
00576     {
00577         value = gtk_label_get_text(GTK_LABEL(g_encrtype_value));
00578         if (value)
00579         {
00580             if (strcmp(value, "NONE") == 0)
00581             {
00582                 encrtype = encr_none_t;
00583             }
00584             else if (strcmp(value, "WEP") == 0)
00585             {
00586                 encrtype = encr_wep_t;
00587             }
00588             else if (strcmp(value, "WPA") == 0)
00589             {
00590                 encrtype = encr_wpa_t;
00591             }
00592         }
00593     }
00594 
00595     CN_LOGPRINTF("return encrtype=%d", encrtype);
00596     return encrtype;
00597 }

void edit_wireless_ext_get_network_settings ( regNetworkProfile_t settings  ) 

Definition at line 516 of file editScreenWirelessExt.c.

00517 {
00518     regWirelessSetting_t *wirelessSettings;
00519     const char *ssid = NULL;
00520     const char *encrkey = NULL;
00521 
00522     CN_LOGPRINTF("entry");
00523 
00524     g_return_if_fail(settings != NULL);
00525     g_return_if_fail(settings->connection == wireless_t);
00526 
00527     wirelessSettings = settings->wirelessSettings;
00528 
00529     ssid = edit_wireless_ext_get_ssid();
00530     encrkey = edit_wireless_ext_get_encrkey();
00531 
00532     if (wirelessSettings)
00533     {
00534         g_free(wirelessSettings->SSID);
00535         g_free(wirelessSettings->encrKey);
00536         g_free(wirelessSettings);
00537         wirelessSettings = NULL;
00538         settings->wirelessSettings = NULL;
00539     }
00540 
00541     if (settings->connection == wireless_t)
00542     {
00543         wirelessSettings = g_new0(regWirelessSetting_t, 1);
00544         g_assert(wirelessSettings != NULL);
00545         wirelessSettings->SSID     = g_strdup(ssid);
00546         wirelessSettings->encrType = edit_wireless_ext_get_encrtype();
00547         wirelessSettings->encrKey  = g_strdup(encrkey);
00548         // it's a broadcast access point
00549         wirelessSettings->broadcast = TRUE;
00550         settings->wirelessSettings = wirelessSettings;
00551     }
00552 }

Here is the call graph for this function:

static const char * edit_wireless_ext_get_ssid ( void   )  [static]

Definition at line 554 of file editScreenWirelessExt.c.

00555 {
00556     const char *ssid = NULL;
00557     
00558     CN_LOGPRINTF("entry");
00559     if (g_ssid_value)
00560     {
00561         ssid = gtk_label_get_text(GTK_LABEL(g_ssid_value));
00562     }
00563 
00564     CN_LOGPRINTF("return ssid=%s", ssid);
00565     return ssid;
00566 }

void edit_wireless_ext_restore_network_settings ( void   ) 

Definition at line 641 of file editScreenWirelessExt.c.

00642 {
00643     CN_LOGPRINTF("entry");
00644 
00645     edit_wireless_ext_set_encrkey(g_old_encrkey);
00646 }

Here is the call graph for this function:

static void edit_wireless_ext_restore_ping_ctxt ( void   )  [static]

Definition at line 739 of file editScreenWirelessExt.c.

00740 {
00741     pingContext_t *ctxt;
00742     cmgrConnectType_t connectType;
00743 
00744     CN_LOGPRINTF("entry");
00745     
00746     ctxt = cmgr_get_ping_ctxt();
00747     if (ctxt)
00748     {
00749         // set mode and connect type
00750         connect_ping_ctxt_set_mode(ctxt, editPing_e);
00751         connectType = connect_data_get_connect_type();
00752         connect_ping_ctxt_set_connect_type(ctxt, connectType);
00753         
00754         // ping done callbacks
00755         connect_ping_ctxt_set_done_callbacks(ctxt, on_connected, on_failed);
00756        
00757         // data access callbacks
00758         connect_ping_ctxt_set_get_initial_profile(ctxt, 
00759                         edit_get_initial_profile);
00760         connect_ping_ctxt_set_access_network_profiles_callbacks(ctxt,
00761                                         edit_get_n_network_profiles,
00762                                         edit_get_network_profile,
00763                                         edit_select_next_regprofile);
00764 
00765         // ui callbacks
00766         connect_ping_ctxt_set_ui_callbacks(ctxt, 
00767                                     ui_update_status, 
00768                                     ui_display_settings,
00769                                     ui_select_profile,
00770                                     ui_unselect_all_profile);
00771     }
00772 }

Here is the call graph for this function:

static void edit_wireless_ext_set_encrkey ( const char *  encrkey  )  [static]

Definition at line 503 of file editScreenWirelessExt.c.

00504 {
00505     GtkWidget *widget;
00506 
00507     CN_LOGPRINTF("entry");
00508 
00509     if (g_encrkey)
00510     {
00511         widget = g_encrkey->entry;
00512         gtk_entry_set_text(GTK_ENTRY(widget), encrkey);
00513     }
00514 }

static void edit_wireless_ext_set_encrtype ( wireless_encr_type_t  encrtype  )  [static]

Definition at line 478 of file editScreenWirelessExt.c.

00479 {
00480     char *text;
00481 
00482     CN_LOGPRINTF("entry");
00483 
00484     if (g_encrtype_value)
00485     {
00486         switch (encrtype)
00487         {
00488             case encr_wep_t:
00489                 text = "WEP";
00490                 break;
00491             case encr_wpa_t:
00492                 text = "WPA";
00493                 break;
00494             case encr_none_t:
00495             default:
00496                 text = "NONE";
00497                 break;
00498         }
00499         gtk_label_set_text(GTK_LABEL(g_encrtype_value), text);
00500     }
00501 }

void edit_wireless_ext_set_network_settings ( const regNetworkProfile_t settings  ) 

Definition at line 430 of file editScreenWirelessExt.c.

00431 {
00432     const char *ssid = NULL;
00433     wireless_encr_type_t encrtype = encr_undefined_t;
00434     const char *encrkey = NULL;
00435     regWirelessSetting_t *wirelessSettings = NULL;
00436 
00437     CN_LOGPRINTF("entry");
00438 
00439     g_return_if_fail(settings != NULL);
00440     g_return_if_fail(settings->connection == wireless_t);
00441     
00442     wirelessSettings = settings->wirelessSettings;
00443     if (wirelessSettings)
00444     {
00445         ssid = wirelessSettings->SSID;
00446         encrtype =  wirelessSettings->encrType;
00447         encrkey = wirelessSettings->encrKey;
00448     }
00449     
00450     edit_wireless_ext_set_profile(settings);
00451     edit_wireless_ext_set_ssid(ssid);
00452     edit_wireless_ext_set_encrtype(encrtype);
00453     edit_wireless_ext_set_encrkey(encrkey);
00454     
00455     edit_wireless_ext_show_widgets(inputEncrKey_e);
00456     edit_wireless_ext_update_info_text(inputEncrKey_e);
00457 
00458     edit_wireless_ext_backup_network_settings();
00459 }

Here is the call graph for this function:

static void edit_wireless_ext_set_profile ( const regNetworkProfile_t settings  )  [static]

Definition at line 461 of file editScreenWirelessExt.c.

00462 {
00463     CN_LOGPRINTF("entry");
00464 
00465     bk_profile_entry_display(g_profile_entry, settings);
00466 }

Here is the call graph for this function:

static void edit_wireless_ext_set_ssid ( const char *  ssid  )  [static]

Definition at line 468 of file editScreenWirelessExt.c.

00469 {
00470     CN_LOGPRINTF("entry");
00471 
00472     if (g_ssid_value)
00473     {
00474         gtk_label_set_text(GTK_LABEL(g_ssid_value), ssid ? ssid : "");
00475     }
00476 }

void edit_wireless_ext_set_text ( void   ) 

Definition at line 307 of file editScreenWirelessExt.c.

00308 {
00309     GtkWidget *widget;
00310 
00311     CN_LOGPRINTF("entry");
00312 
00313     if (g_wireless_ext)
00314     {
00315         gtk_settingitem_set_header_text(GTK_SETTINGITEM(g_wireless_ext),
00316                                         _("Network profile"));
00317     }
00318     
00319     if (g_ssid_name)
00320     {
00321         gtk_label_set_text(GTK_LABEL(g_ssid_name), _("Network name (SSID):"));
00322     }
00323     
00324     if (g_encrtype_name)
00325     {
00326         gtk_label_set_text(GTK_LABEL(g_encrtype_name), _("Security type:"));
00327     }
00328     
00329     if (g_encrkey)
00330     {
00331         widget = g_encrkey->label;
00332         gtk_label_set_text(GTK_LABEL(widget), 
00333                 _("Enter the security key / passphrase:"));
00334 
00335         widget = g_encrkey->button;
00336         gtk_button_set_label(GTK_BUTTON(widget), _("Connect"));
00337     }
00338 
00339     if (g_advanced)
00340     {
00341         widget = g_advanced->details->label;
00342         gtk_label_set_text(GTK_LABEL(widget), 
00343                 _("Click the button for advanced settings."));
00344         widget = GTK_WIDGET(g_advanced->details->buttonList[0]);
00345         gtk_button_set_label(GTK_BUTTON(widget),  _("Advanced settings"));
00346     }
00347 }

Here is the call graph for this function:

static void edit_wireless_ext_show_widgets ( wlanExtStatus_t  mode  )  [static]

Definition at line 290 of file editScreenWirelessExt.c.

00291 {
00292     CN_LOGPRINTF("entry mode[%d]", mode);
00293    
00294     g_return_if_fail(g_advanced != NULL);
00295 
00296     switch (mode)
00297     {
00298         case advancedSettings_e:
00299             gtk_widget_show(g_advanced->background);
00300             break;
00301         default:
00302             gtk_widget_hide(g_advanced->background);
00303             break;
00304     }
00305 }

static void edit_wireless_ext_update_info_text ( wlanExtStatus_t  status  )  [static]

Definition at line 349 of file editScreenWirelessExt.c.

00350 {
00351     g_return_if_fail(g_info != NULL);
00352 
00353     CN_LOGPRINTF("entry");
00354 
00355     switch (status)
00356     {
00357         case inputEncrKey_e:
00358             gtk_infoitem_set_icon(GTK_INFOITEM(g_info), iconInfo_e); 
00359             gtk_infoitem_set_text(GTK_INFOITEM(g_info),
00360                     _("If you do not know the security key "
00361                       "for this access point. "
00362                       "Please ask your network administrator."));
00363             break;
00364         case wrongEncrKey_e:
00365             gtk_infoitem_set_icon(GTK_INFOITEM(g_info), iconFailed_e); 
00366             gtk_infoitem_set_text(GTK_INFOITEM(g_info),
00367                     _("Connection failed: Cannot connect to "
00368                       "the access point.\n"
00369                       "Check that the security key is correct "
00370                       "and for WPA check "
00371                       "that your router is set to PSK-TKIP mode. "
00372                       "If you do not know the settings "
00373                       "for this access point, "
00374                       "please ask your network administrator."));
00375             break;
00376         case advancedSettings_e:
00377             gtk_infoitem_set_icon(GTK_INFOITEM(g_info), iconFailed_e); 
00378             // TODO
00379             gtk_infoitem_set_text(GTK_INFOITEM(g_info),
00380                     _("Connection failed: Cannot connect to the internet "
00381                       "or iDS.\n"
00382                       "Click on 'Advanced settings' "
00383                       "to set a proxy server.\n"
00384                       "Please ask your network administrator "
00385                       "if you do not know the correct settings "
00386                       "for this network."));
00387             break;
00388         case pcshareSettings_e:
00389             gtk_infoitem_set_icon(GTK_INFOITEM(g_info), iconFailed_e); 
00390             gtk_infoitem_set_text(GTK_INFOITEM(g_info),
00391                     _("Connection failed: Cannot connect "
00392                       "to your computer.\n"
00393                       "Please check the 'Settings for Computer Connection' "
00394                       "in the iLiad Settings menu."));
00395             break;
00396         case wlanExtConnecting_e:
00397             gtk_infoitem_set_icon(GTK_INFOITEM(g_info), iconInfo_e); 
00398             gtk_infoitem_set_text(GTK_INFOITEM(g_info),
00399                 _("The iLiad is trying "
00400                   "to connect to the server."));
00401             break;
00402          case wlanExtConnected_e:
00403             gtk_infoitem_set_icon(GTK_INFOITEM(g_info), iconOk_e); 
00404             gtk_infoitem_set_text(GTK_INFOITEM(g_info),
00405                     _("Connection to the server "
00406                       "has been established."));
00407             break;
00408         case wlanExtAborting_e:
00409             gtk_infoitem_set_icon(GTK_INFOITEM(g_info), iconInfo_e); 
00410             gtk_infoitem_set_text(GTK_INFOITEM(g_info), 
00411                 _("The iLiad is aborting the connection."));
00412             break;
00413         case wlanExtAborted_e:
00414             gtk_infoitem_set_icon(GTK_INFOITEM(g_info), iconInfo_e);
00415             gtk_infoitem_set_text(GTK_INFOITEM(g_info), 
00416                 _("The connection has been aborted."));
00417             break;
00418         default:
00419             break;
00420     }
00421 }

Here is the call graph for this function:

void edit_wireless_ext_update_status ( pingStatus_t  status  )  [static]

Definition at line 423 of file editScreenWirelessExt.c.

00424 {
00425     CN_LOGPRINTF("entry");
00426 
00427     bk_profile_entry_update_status(g_profile_entry, status);
00428 }

Here is the call graph for this function:

static void on_advanced ( GtkToggleButton *  button,
gpointer  data 
) [static]

Definition at line 711 of file editScreenWirelessExt.c.

00712 {
00713     gboolean active;
00714 
00715     CN_LOGPRINTF("entry");
00716 
00717     active = gtk_toggle_button_get_active(button);
00718     if (active)
00719     {
00720         g_timeout_add(500, on_delayed_advanced, button);
00721     }
00722 }

Here is the call graph for this function:

static void on_connect ( GtkToggleButton *  button,
gpointer  data 
) [static]

Definition at line 676 of file editScreenWirelessExt.c.

00677 {
00678     gboolean active;
00679 
00680     CN_LOGPRINTF("entry");
00681 
00682     active = gtk_toggle_button_get_active(button);
00683     if (active)
00684     {
00685         g_timeout_add(500, on_delayed_connect, (gpointer)button);
00686     }
00687 }

Here is the call graph for this function:

static void on_connected ( int  profileIndex  )  [static]

Definition at line 774 of file editScreenWirelessExt.c.

00775 {
00776     GtkToggleButton *button;
00777 
00778     CN_LOGPRINTF("entry");
00779    
00780     edit_save_profile();
00781 
00782     edit_on_connected();    
00783 
00784     edit_wireless_ext_freeze_ui(FALSE);
00785 
00786     if (g_encrkey)
00787     {
00788         button = GTK_TOGGLE_BUTTON(g_encrkey->button);
00789         g_timeout_add(500, delayed_deactive_button, button);
00790     }
00791 }

Here is the call graph for this function:

static gboolean on_delayed_advanced ( gpointer  data  )  [static]

Definition at line 689 of file editScreenWirelessExt.c.

00690 {
00691     gboolean valid;
00692     GtkToggleButton *button;
00693 
00694     erbusy_blink();
00695 
00696     valid = edit_wireless_ext_check_network_settings();
00697     if (valid)
00698     {
00699         edit_wireless_ext_backup_network_settings();
00700 
00701         edit_goto_page(editScreenOverview_e);
00702         edit_overview_update_info_text(inputProxy_e);
00703     }
00704 
00705     button = GTK_TOGGLE_BUTTON(data);
00706     gtk_toggle_button_set_active(button, FALSE);
00707 
00708     return FALSE;
00709 }

Here is the call graph for this function:

static gboolean on_delayed_connect ( gpointer  data  )  [static]

Definition at line 648 of file editScreenWirelessExt.c.

00649 {
00650     gboolean valid;
00651     pingContext_t *ctxt;
00652     GtkToggleButton *button;
00653 
00654     erbusy_blink();
00655 
00656     valid = edit_wireless_ext_check_network_settings();
00657     if (valid)
00658     {
00659         edit_wireless_ext_freeze_ui(TRUE);
00660 
00661         edit_wireless_ext_restore_ping_ctxt();
00662 
00663         ctxt = cmgr_get_ping_ctxt();
00664         connect_ping_select_initial_profile(ctxt);
00665         connect_ping(ctxt, TRUE);
00666     }
00667     else
00668     {
00669         button = GTK_TOGGLE_BUTTON(data);
00670         gtk_toggle_button_set_active(button, FALSE);
00671     }
00672 
00673     return FALSE;
00674 }

Here is the call graph for this function:

gboolean on_edit_wireless_ext_keypress ( GdkEventKey *  event  ) 

Definition at line 894 of file editScreenWirelessExt.c.

00895 {
00896     pingContext_t *ctxt;
00897     GtkToggleButton *button;
00898     gboolean ret = FALSE;
00899 
00900     CN_LOGPRINTF("entry");
00901    
00902     ctxt = cmgr_get_ping_ctxt();
00903     switch (event->keyval)
00904     {
00905         case GDK_Return:
00906             // 'Enter' key is pressed
00907             if (!connect_ping_in_pinging(ctxt))
00908             {
00909                 // simulate clicking the 'Connect' button
00910                 if (g_encrkey)
00911                 {
00912                     button = GTK_TOGGLE_BUTTON(g_encrkey->button);
00913                     gtk_toggle_button_set_active(button, TRUE);
00914                 }
00915                 ret = TRUE;
00916             }
00917             break;
00918 
00919         case GDK_F5:
00920             // 'UP' key is pressed
00921             // goto the one top level page
00922             connect_ping_abort(ctxt);
00923             cmgr_up_page();
00924             ret = TRUE;
00925             break;
00926         default:
00927             erbusy_off();
00928             break;
00929     }
00930 
00931     return ret;
00932 }

Here is the call graph for this function:

static void on_failed ( void   )  [static]

Definition at line 793 of file editScreenWirelessExt.c.

00794 {
00795     GtkToggleButton *button;
00796 
00797     CN_LOGPRINTF("entry");
00798 
00799     edit_wireless_ext_freeze_ui(FALSE);
00800 
00801     if (g_encrkey)
00802     {
00803         button = GTK_TOGGLE_BUTTON(g_encrkey->button);
00804         gtk_toggle_button_set_active(button, FALSE);
00805     }
00806 }

Here is the call graph for this function:

static void ui_display_settings ( int  profileIndex,
gboolean  resetStatus 
) [static]

Definition at line 852 of file editScreenWirelessExt.c.

00853 {
00854     CN_LOGPRINTF("entry");
00855     // nothing to do
00856 }

static void ui_select_profile ( int  profileIndex  )  [static]

Definition at line 858 of file editScreenWirelessExt.c.

00859 {
00860     GtkProfileEntry *profileEntry;
00861     
00862     CN_LOGPRINTF("entry");
00863 
00864     if (g_profile_entry)
00865     {
00866         profileEntry = GTK_PROFILE_ENTRY(g_profile_entry->details);
00867         gtk_profile_entry_set_buttons_active(profileEntry, TRUE, FALSE);
00868 
00869         display_update_request_screen_refresh (STATUS_ITEM_CHANGE, 
00870                                                WAVEFORM_TYPING);
00871     }
00872 }

Here is the call graph for this function:

static void ui_unselect_all_profile ( void   )  [static]

Definition at line 874 of file editScreenWirelessExt.c.

00875 {
00876     GtkProfileEntry *profileEntry;
00877 
00878     CN_LOGPRINTF("entry");
00879 
00880     if (g_profile_entry)
00881     {
00882         profileEntry = GTK_PROFILE_ENTRY(g_profile_entry->details);
00883         gtk_profile_entry_set_buttons_active(profileEntry, FALSE, FALSE);
00884 
00885         display_update_request_screen_refresh(STATUS_ITEM_CHANGE, 
00886                                               WAVEFORM_TYPING);
00887     }
00888 }

Here is the call graph for this function:

static void ui_update_status ( int  profileIndex,
pingStatus_t  status 
) [static]

Definition at line 808 of file editScreenWirelessExt.c.

00809 {
00810     wlanExtStatus_t state;
00811 
00812     CN_LOGPRINTF("entry");
00813     
00814     edit_wireless_ext_update_status(status);
00815 
00816     switch (status)
00817     {
00818         case pingSucceeded_e:
00819             state = wlanExtConnected_e;
00820             break;
00821         case pingFailed_e:
00822             state = advancedSettings_e;
00823             break;
00824         case pingFailedPCShare_e:
00825             state = pcshareSettings_e;
00826             break;
00827         case pingFailedNetwork_e:
00828             state = wrongEncrKey_e;
00829             break;
00830         case pingConnecting_e:
00831             state = wlanExtConnecting_e;
00832             break;
00833         case pingAborting_e:
00834             state = wlanExtAborting_e;
00835             break;
00836         case pingAborted_e:
00837             state = wlanExtAborted_e;
00838             on_failed();
00839             break;
00840         default:
00841             state = undefWlanExtStatus_e;
00842             break;
00843     }
00844 
00845     edit_wireless_ext_show_widgets(state);
00846     edit_wireless_ext_update_info_text(state);
00847 
00848     display_update_request_screen_refresh (STATUS_ITEM_CHANGE, 
00849                                            WAVEFORM_TYPING);
00850 }

Here is the call graph for this function:


Variable Documentation

bkWdtLabelButton* g_advanced = NULL [static]

Definition at line 80 of file editScreenWirelessExt.c.

wdtLabelEntry* g_encrkey = NULL [static]

Definition at line 78 of file editScreenWirelessExt.c.

GtkWidget* g_encrtype_name = NULL [static]

Definition at line 76 of file editScreenWirelessExt.c.

GtkWidget* g_encrtype_value = NULL [static]

Definition at line 77 of file editScreenWirelessExt.c.

GtkWidget* g_info = NULL [static]

Definition at line 82 of file editScreenWirelessExt.c.

char* g_old_encrkey = NULL [static]

Definition at line 84 of file editScreenWirelessExt.c.

bkProfileEntry* g_profile_entry = NULL [static]

Definition at line 72 of file editScreenWirelessExt.c.

GtkWidget* g_ssid_name = NULL [static]

Definition at line 74 of file editScreenWirelessExt.c.

GtkWidget* g_ssid_value = NULL [static]

Definition at line 75 of file editScreenWirelessExt.c.

GtkWidget* g_wireless_ext = NULL [static]

Definition at line 70 of file editScreenWirelessExt.c.


Generated on Sun Dec 14 17:16:37 2008 by  doxygen 1.5.6