connectionMgr/src/connectScreenProfiles.c File Reference

connectionMgr - the second page of 'connect-to-server' screen the connection profiles screen containing a profile list and a new profile entry More...

#include <unistd.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <liberdm/connectionMgrConstants.h>
#include <libergtk/ergtk.h>
#include <liberipc/eripctoolbar.h>
#include "connectionMgrLog.h"
#include "displayStatus.h"
#include "background.h"
#include "gtkSettingItem.h"
#include "gtkInfoItem.h"
#include "gtkProfileEntry.h"
#include "gtkProfileGroup.h"
#include "widgetUtils.h"
#include "connectScreenData.h"
#include "connectionMgr.h"
#include "connectScreen.h"
#include "connectScreenOptions.h"
#include "connectScreenProfiles.h"
#include "connectPing.h"
#include "connectScan.h"
#include "connectBackground.h"
#include "editScreenData.h"
#include "editScreen.h"
#include "modemUtils.h"
#include "erbusy.h"
#include "pagebar.h"
#include "toolbar.h"
#include "languages.h"

Go to the source code of this file.

Functions

static GtkWidget * create_known_profiles (void)
static GtkWidget * create_profile_editor (void)
static GtkWidget * create_info (void)
static gboolean on_profile_entry_button_press (GtkProfileGroup *profileGroup, guint profileIndex, gboolean active)
static void on_profile_editor_toggled (GtkWidget *button, GdkEventButton *event, gpointer data)
static gboolean delay_profile_entry_selected (gpointer data)
static void connect_profiles_reset_active_reg_index (void)
static gboolean connect_profiles_start_fillin_profile (void)
static gboolean on_delay_start_fillin_profile (gpointer data)
static void connect_profiles_update_new_profile (void)
static gboolean delayed_on_profile_editor_toggled (gpointer data)
static void connect_profiles_on_failed_all (void)
GtkWidget * connect_profiles_create (void)
void connect_profiles_set_text (void)
static void connect_profiles_update_info (void)
void connect_profiles_display (void)
void connect_profiles_select_profile (int profileIndex)
void connect_profiles_unselect_profile (void)
void connect_profiles_update_status (int profileIndex, pingStatus_t status)
void connect_profiles_display_settings (int profileIndex, gboolean resetStatus)
gboolean on_connect_profiles_keypress (GdkEventKey *event)
static gboolean on_delay_back_page (gpointer data)
void on_connect_profiles_icon_clicked (int iconID, int iconState)
void connect_profiles_restore_ping_ctxt (void)

Variables

static GtkWidget * g_connect_profiles = NULL
static GtkWidget * g_known_profiles = NULL
static GtkWidget * g_profile_editor = NULL
static bkWdtLabelButtong_label_button = NULL
static GtkWidget * g_info = NULL


Detailed Description

connectionMgr - the second page of 'connect-to-server' screen the connection profiles screen containing a profile list and a new profile entry

Copyright (C) 2007 iRex Technologies BV.

Definition in file connectScreenProfiles.c.


Function Documentation

GtkWidget* connect_profiles_create ( void   ) 

Definition at line 107 of file connectScreenProfiles.c.

00108 {
00109     CN_LOGPRINTF ("entry");
00110 
00111     GtkWidget* vbox;
00112     GtkWidget* itemNetworks;
00113     GtkWidget* itemNewProfile;
00114     GtkWidget* itemInfo;
00115 
00116     // vbox
00117     vbox = gtk_vbox_new(FALSE, VBOX_SPACING);
00118     gtk_widget_show(vbox);
00119     g_connect_profiles = vbox;
00120 
00121     // itemNetworks
00122     itemNetworks = create_known_profiles();
00123     gtk_box_pack_start(GTK_BOX(vbox), itemNetworks, FALSE, FALSE, 0);
00124     gtk_widget_show(itemNetworks);
00125 
00126     // itemNewProfile
00127     itemNewProfile = create_profile_editor();
00128     gtk_box_pack_start(GTK_BOX(vbox), itemNewProfile, FALSE, FALSE, 0);
00129     gtk_widget_show(itemNewProfile);
00130 
00131     // itemInfo
00132     itemInfo = create_info();
00133     gtk_box_pack_start(GTK_BOX(vbox), itemInfo, FALSE, FALSE, 0);
00134     gtk_widget_show(itemInfo);
00135 
00136     return g_connect_profiles;
00137 }

Here is the call graph for this function:

void connect_profiles_display ( void   ) 

Definition at line 311 of file connectScreenProfiles.c.

00312 {
00313     CN_LOGPRINTF ("entry");
00314     
00315     GtkProfileGroup           *profileGroup;
00316     const networkProfile_t    *settings;
00317     int                       i, profileIndex;
00318     int                       nProfiles, nDisplayed;
00319     int                       quality;
00320     GtkToggleButton           *button;
00321  
00322     connect_profiles_update_info();
00323 
00324     // show the accurate profile entries
00325     profileGroup = GTK_PROFILE_GROUP(g_known_profiles);   
00326  
00327     // show dialup signal widgets or not
00328     switch (connect_data_get_network_type())
00329     {
00330         case wired_t:
00331         case wireless_t:
00332             gtk_profile_group_show_dialup(profileGroup, FALSE);
00333             break;
00334         case dialup_t:
00335             quality = get_modem_signal_strength() * 100 / 32;
00336             gtk_profile_group_set_dialup_signal_image(profileGroup, quality);
00337             gtk_profile_group_show_dialup(profileGroup, TRUE);
00338             break;
00339         default:
00340             break;
00341     }
00342 
00343     // display the profile list
00344     nProfiles = connect_data_get_n_network_profiles();
00345     nDisplayed = ((nProfiles < MAX_PROFILES_PER_PAGE) ? nProfiles: MAX_PROFILES_PER_PAGE);
00346 
00347     if (nDisplayed > 0)
00348     {
00349         for (i = 0; i < nDisplayed; i++)
00350         {
00351             settings = connect_data_get_network_profile(i);
00352             gtk_profile_group_display_settings(profileGroup, i, 
00353                                                settings, TRUE);
00354         }
00355     }
00356     gtk_profile_group_show_profile_entries(profileGroup, nDisplayed);
00357 
00358     // deselect all profile index
00359     profileIndex = gtk_profile_group_get_selected_profile_index(profileGroup);
00360     if (profileIndex != -1)
00361     {
00362         gtk_profile_group_unselect_profile(profileGroup, profileIndex);
00363     }
00364 
00365     // deselect the 'profile editor' button   
00366     if (g_label_button)
00367     {
00368         button = g_label_button->details->buttonList[0];
00369         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE);
00370     }
00371 }

Here is the call graph for this function:

void connect_profiles_display_settings ( int  profileIndex,
gboolean  resetStatus 
)

Definition at line 452 of file connectScreenProfiles.c.

00454 {
00455     GtkProfileGroup           *profileGroup;
00456     const networkProfile_t    *settings;
00457     int max, nProfiles, nDisplayed;
00458     
00459     CN_LOGPRINTF("entry profileIndex[%d]", profileIndex);
00460 
00461     max = MAX_PROFILES_PER_PAGE;
00462     nProfiles = connect_data_get_n_network_profiles();
00463     nDisplayed = ((nProfiles < max) ? nProfiles: max);
00464     if (nDisplayed > 0)
00465     {
00466         if ((profileIndex >= 0) && (profileIndex < nDisplayed))
00467         {
00468             profileGroup = GTK_PROFILE_GROUP(g_known_profiles);
00469             settings = connect_data_get_network_profile(profileIndex);
00470             gtk_profile_group_display_settings(profileGroup, profileIndex, 
00471                                                settings, resetStatus);
00472             display_update_request_screen_refresh(STATUS_ITEM_CHANGE, 
00473                                                   WAVEFORM_TYPING);
00474         }
00475     }
00476 }

Here is the call graph for this function:

static void connect_profiles_on_failed_all ( void   )  [static]

Definition at line 947 of file connectScreenProfiles.c.

00948 {
00949     connect_profiles_unselect_profile();
00950 
00951     if (main_get_connect_after_reboot())
00952     {
00953         CN_LOGPRINTF("It's connection after rebooting, exit.");
00954         main_quit();
00955     }
00956 }

Here is the call graph for this function:

static void connect_profiles_reset_active_reg_index ( void   )  [static]

Definition at line 575 of file connectScreenProfiles.c.

00576 {
00577     int i, nProfiles;
00578     networkProfile_t* settings = NULL;
00579 
00580     nProfiles = connect_data_get_n_network_profiles();
00581     for (i = 0; i < nProfiles; i++)
00582     {
00583         settings = (networkProfile_t*)connect_data_get_network_profile(i);
00584         g_return_if_fail(settings != NULL);
00585         if (settings->nRegProfiles > 0
00586             && settings->regSettingsList
00587             && settings->regIndexList
00588             && ((settings->nActiveIndex > 0) 
00589             && (settings->nActiveIndex < settings->nRegProfiles)))
00590         {
00591             settings->nActiveIndex = 0;
00592             connect_profiles_display_settings(i, FALSE);
00593         }
00594     }
00595 }

Here is the call graph for this function:

void connect_profiles_restore_ping_ctxt ( void   ) 

void connect_profiles_select_profile ( int  profileIndex  ) 

Definition at line 373 of file connectScreenProfiles.c.

00374 {
00375     CN_LOGPRINTF("entry");
00376     
00377     GtkProfileGroup*  profileGroup;
00378 
00379     profileGroup = GTK_PROFILE_GROUP(g_known_profiles);
00380     gtk_profile_group_select_profile(profileGroup, profileIndex);
00381     display_update_request_screen_refresh(STATUS_ITEM_CHANGE, 
00382                                           WAVEFORM_TYPING);
00383 }

Here is the call graph for this function:

void connect_profiles_set_text ( void   ) 

Definition at line 203 of file connectScreenProfiles.c.

00204 {
00205     GtkProfileGroup *profileGroup;
00206     GtkWidget *widget;
00207 
00208     CN_LOGPRINTF ("entry");
00209 
00210     if (g_known_profiles)
00211     {
00212         profileGroup = GTK_PROFILE_GROUP(g_known_profiles);
00213         gtk_profile_group_set_dialup_text(profileGroup,
00214                         _("Signal strength of network:"));
00215     }
00216 
00217     if (g_profile_editor)
00218     {
00219         gtk_settingitem_set_header_text(GTK_SETTINGITEM(g_profile_editor), 
00220                                         _("Setup a network profile"));
00221     }
00222     
00223     if (g_label_button)
00224     {
00225         widget = g_label_button->details->label;
00226         gtk_label_set_text (GTK_LABEL(widget),
00227                             _("You can create or edit a network profile "
00228                               "by clicking the button below."));
00229 
00230         widget = GTK_WIDGET(g_label_button->details->buttonList[0]);
00231         gtk_button_set_label (GTK_BUTTON(widget), _("Profile editor"));
00232     }
00233 }

Here is the call graph for this function:

static gboolean connect_profiles_start_fillin_profile ( void   )  [static]

Definition at line 605 of file connectScreenProfiles.c.

00606 {
00607     pingContext_t *ctxt;
00608     gint profileIndex;
00609     const networkProfile_t* settings;
00610     regNetworkProfile_t *regSettings;
00611     connection_t networkType;
00612     gboolean needEdit = FALSE;
00613     GtkProfileGroup *profileGroup;
00614 
00615     CN_LOGPRINTF("entry");
00616 
00617     ctxt = cmgr_get_ping_ctxt();
00618     profileIndex = connect_ping_get_selected_profile_index(ctxt);
00619     g_return_val_if_fail(profileIndex != -1, FALSE);
00620 
00621     settings = connect_data_get_network_profile(profileIndex);
00622     g_return_val_if_fail(settings != NULL, FALSE);
00623 
00624     if ( (settings->nRegProfiles == 0) && settings->scanSettings)
00625     {
00626         if (settings->scanSettings->encryption == encr_none_t)
00627         {
00628             CN_LOGPRINTF("The %dth profile needs to save before ping.", 
00629                           profileIndex);
00630             if (!connect_data_reach_max_profiles())
00631             {
00632                 // set the edit mode
00633                 edit_set_mode(editModeConnectCreate_e);
00634 
00635                 regSettings = network_spec_to_reg_network(settings->scanSettings);
00636                 
00637                 // set the network type for edit
00638                 networkType = regSettings->connection;
00639                 edit_data_set_network_type(networkType);
00640            
00641                 // initilize the edit data
00642                 edit_data_init_network_profiles();
00643 
00644                 // set the edit mode to be wizard
00645                 edit_set_wizard_mode(TRUE);
00646 
00647                 // set the fields of widgets
00648                 edit_set_network_settings(regSettings);
00649 
00650                 // save it
00651                 edit_save_profile();
00652                 
00653                 // update
00654                 connect_profiles_update_new_profile();
00655 
00656                 erRegFreeNetworkProfile(regSettings);
00657             }
00658         }
00659         else
00660         {
00661             CN_LOGPRINTF("The %dth profile needs encryption key.", 
00662                           profileIndex);
00663 
00664             if (!connect_data_reach_max_profiles())
00665             {
00666                 needEdit = TRUE;
00667                 
00668                 profileGroup = GTK_PROFILE_GROUP(g_known_profiles);
00669                 gtk_profile_group_set_status_text(profileGroup, 
00670                                              profileIndex, 
00671                                              _("Open network profile..."), 
00672                                              FALSE);
00673                 display_update_request_screen_refresh(STATUS_ITEM_CHANGE, 
00674                                                       WAVEFORM_TYPING);
00675 
00676                 g_timeout_add(500, 
00677                         on_delay_start_fillin_profile, 
00678                         (gpointer)settings);
00679             }
00680         }
00681     }
00682 
00683     return needEdit;
00684 }

Here is the call graph for this function:

void connect_profiles_unselect_profile ( void   ) 

Definition at line 385 of file connectScreenProfiles.c.

00386 {
00387     CN_LOGPRINTF ("entry");
00388 
00389     GtkProfileGroup *profileGroup;
00390     gint             profileIndex;
00391 
00392     profileGroup = GTK_PROFILE_GROUP(g_known_profiles);  
00393     profileIndex = gtk_profile_group_get_selected_profile_index(profileGroup);
00394     if (profileIndex != -1)
00395     {
00396         gtk_profile_group_unselect_profile(profileGroup, profileIndex);
00397     }
00398 }

Here is the call graph for this function:

static void connect_profiles_update_info ( void   )  [static]

Definition at line 238 of file connectScreenProfiles.c.

00239 {
00240     connection_t networkType;
00241     char* cpTitle = NULL, *cpDetails = NULL;
00242     char* cpInfo = NULL;
00243     GtkProfileGroup *profileGroup;
00244    
00245     networkType = connect_data_get_network_type();
00246     switch(networkType)
00247     {
00248         case wired_t:
00249             cpTitle = _("Available wired networks");
00250             cpDetails = _("No wired profiles exist, "
00251                           "please use the button below "
00252                           "to create a profile.");
00253             cpInfo = _("You need to connect your travel hub "
00254                        "and ethernet cable "
00255                        "to your iLiad.\n"
00256                        "The default profile uses DHCP and no proxy.");
00257             break;
00258         case dialup_t:
00259             cpTitle = _("Available dial-up networks");
00260             cpDetails = _("No dial-up profiles exist, "
00261                           "please use the button below "
00262                           "to create a profile.");
00263             cpInfo =  _("In order to use a dial-up network, "
00264                         "you need a CF modem.\n"
00265                         "Bluetooth dial-up connections "
00266                         "are not yet supported.");
00267             break;
00268         case wireless_t:
00269             cpTitle = _("Available wireless networks");
00270             cpDetails = _("No wireless profiles exist, "
00271                           "please use the button below "
00272                           "to create a profile.");
00273             cpInfo =  _("When the access point is secured with "
00274                         "an encryption key,"
00275                         " click on the corresponding network button "
00276                         "to open the configuration screen.\n"
00277                         "By clicking the 'Profile editor' button "
00278                         "you can create a network profile"
00279                         " for a non broadcasting (hidden) access point.");
00280             break;
00281         default:
00282             CN_WARNPRINTF("Invalid network type[%d].", networkType);
00283             break;
00284     }
00285 
00286     // show the information wiget with the correct text 
00287     if (g_known_profiles)
00288     {
00289         profileGroup = GTK_PROFILE_GROUP(g_known_profiles);
00290         
00291         gtk_profile_group_set_header_text(profileGroup, cpTitle);
00292         
00293         if (connect_data_get_n_network_profiles())
00294         {
00295             gtk_profile_group_set_info_text(profileGroup,
00296                                 _("Accept the automatic search "
00297                                   "or select the network of your choice."));
00298         }
00299         else
00300         {
00301             gtk_profile_group_set_info_text(profileGroup, cpDetails);
00302         }
00303     }
00304 
00305     if (g_info)
00306     {
00307         gtk_infoitem_set_text(GTK_INFOITEM(g_info), cpInfo);
00308     }
00309 }

Here is the call graph for this function:

static void connect_profiles_update_new_profile ( void   )  [static]

Definition at line 728 of file connectScreenProfiles.c.

00729 {
00730     networkProfile_t *settings;
00731     pingContext_t *ctxt;
00732     gint profileIndex;
00733 
00734     CN_LOGPRINTF("entry");
00735 
00736     ctxt = cmgr_get_ping_ctxt();
00737     profileIndex = connect_ping_get_selected_profile_index(ctxt);
00738     g_return_if_fail(profileIndex != -1);
00739 
00740     settings = (networkProfile_t*)connect_data_get_network_profile(profileIndex);
00741     g_return_if_fail(settings != NULL);
00742 
00743     if ( (settings->nRegProfiles == 0) && settings->scanSettings)
00744     {
00745         connect_data_update_network_profile_with_last(settings);
00746     }
00747 }

Here is the call graph for this function:

void connect_profiles_update_status ( int  profileIndex,
pingStatus_t  status 
)

Definition at line 400 of file connectScreenProfiles.c.

00401 {
00402     CN_LOGPRINTF("entry");
00403     
00404     int               nProfiles;
00405     GtkProfileGroup*  profileGroup;
00406     gchar*            text;
00407     gboolean          flashing = FALSE;
00408 
00409     nProfiles = connect_data_get_n_network_profiles();
00410     if ((profileIndex >= 0) && (profileIndex < nProfiles))
00411     {
00412         switch (status)
00413         {
00414             case pingSucceeded_e:
00415                 text = _("Connected");
00416                 break;
00417             case pingFailed_e:
00418             case pingFailedPCShare_e:
00419             case pingFailedNetwork_e:
00420                 text = _("Unsuccessful");
00421                 break;
00422             case pingSkipped_e:
00423                 text = _("Skipped");
00424                 break;
00425             case pingNeedKey_e:
00426                 text = _("Security key required");
00427                 break;
00428             case pingAborted_e:
00429                 text = _("Aborted");
00430                 break;
00431             case pingAborting_e:
00432                 text = _("Aborting...");
00433                 flashing = TRUE;
00434                 break;
00435             case pingConnecting_e:
00436                 text = _("Connecting...");
00437                 flashing = TRUE;
00438                 break;
00439             default:
00440                 text = "";
00441                 break;
00442         }
00443 
00444         profileGroup = GTK_PROFILE_GROUP(g_known_profiles);
00445         gtk_profile_group_set_status_text(profileGroup, profileIndex, 
00446                                           text, flashing);
00447         display_update_request_screen_refresh (STATUS_ITEM_CHANGE, 
00448                                                WAVEFORM_TYPING);
00449     }
00450 }

Here is the call graph for this function:

static GtkWidget * create_info ( void   )  [static]

Definition at line 191 of file connectScreenProfiles.c.

00192 {
00193     GtkWidget* item;
00194 
00195     item = gtk_infoitem_new(FALSE);
00196     g_info = item;
00197     return item;
00198 }

Here is the call graph for this function:

static GtkWidget * create_known_profiles ( void   )  [static]

Definition at line 142 of file connectScreenProfiles.c.

00143 {
00144     GtkWidget* item;
00145     
00146     // item
00147     item = gtk_profile_group_new(MAX_PROFILES_PER_PAGE, connectMode_e);
00148     gtk_profile_group_show_dialup(GTK_PROFILE_GROUP(item), FALSE);
00149     gtk_profile_group_callback_on_buttons_press(GTK_PROFILE_GROUP(item), 
00150                                     on_profile_entry_button_press, NULL);
00151     g_known_profiles = item;
00152 
00153     return item;
00154 }

Here is the call graph for this function:

static GtkWidget * create_profile_editor ( void   )  [static]

Definition at line 159 of file connectScreenProfiles.c.

00160 {
00161     GtkWidget *item;
00162     bkWdtLabelButton *widget;
00163     GtkToggleButton  *button;
00164 
00165     // item
00166     item = gtk_settingitem_new("");
00167 
00168     // widget
00169     widget = bk_wdt_label_button_new(1, FALSE, 0, 1);
00170     gtk_settingitem_add_details(GTK_SETTINGITEM(item), widget->background);
00171 
00172     // signal handlers
00173     button = widget->details->buttonList[0];
00174     g_signal_connect(G_OBJECT(button), "toggled", 
00175                  G_CALLBACK(on_profile_editor_toggled), 0);
00176 
00177     // show widget
00178     gtk_widget_show(widget->background);
00179 
00180     // global variable
00181     g_profile_editor = item;
00182     g_label_button = widget;
00183 
00184     // return
00185     return item;
00186 }

Here is the call graph for this function:

static gboolean delay_profile_entry_selected ( gpointer  data  )  [static]

Definition at line 542 of file connectScreenProfiles.c.

00543 {
00544     pingContext_t* ctxt;
00545     guint profileIndex = (guint)data;
00546 
00547     ctxt  = cmgr_get_ping_ctxt();
00548     if (connect_ping_freeze_ui(ctxt))
00549     {
00550         CN_WARNPRINTF("call me later...");
00551         return TRUE;  // TRUE = please call again
00552     }
00553 
00554     connect_profiles_reset_active_reg_index();
00555 
00556     // set the profile index of starting to ping or to edit
00557     connect_ping_set_pinging_profile_index_start(ctxt, profileIndex);
00558 
00559     // set the selected profile index
00560     connect_ping_set_selected_profile_index(ctxt, profileIndex);
00561 
00562     // update the ui
00563     connect_profiles_select_profile(profileIndex);
00564 
00565     if (!connect_profiles_start_fillin_profile())
00566     {
00567         // connecting using this profile
00568         connect_profiles_restore_ping_ctxt(); 
00569         connect_ping(ctxt, TRUE);
00570     }
00571 
00572     return FALSE;  // FALSE = don't call me again
00573 }

Here is the call graph for this function:

static gboolean delayed_on_profile_editor_toggled ( gpointer  data  )  [static]

Definition at line 782 of file connectScreenProfiles.c.

00783 {
00784     pingContext_t* ctxt;
00785     connection_t networkType;
00786    
00787     erbusy_blink();
00788 
00789     ctxt = cmgr_get_ping_ctxt();
00790     if (connect_ping_freeze_ui(ctxt))
00791     {
00792         CN_LOGPRINTF("call me later...");
00793         return TRUE;
00794     }
00795 
00796     // set the connection mgr mode
00797     cmgr_set_screen_mode(cmgrScreenEdit_e);
00798 
00799     // set the edit mode
00800     edit_set_mode(editModeConnectNormal_e);
00801 
00802     // set the network type for edit
00803     networkType = connect_data_get_network_type();
00804     edit_data_set_network_type(networkType);
00805     
00806     // initilize the edit data
00807     edit_data_init_network_profiles();
00808 
00809     // go to the edit profiles page
00810     edit_goto_page(editScreenProfiles_e);
00811 
00812     // screen refresh
00813     display_update_request_screen_refresh(MAIN_WINDOW_EXPOSE_LEVEL, 
00814                                           WAVEFORM_FULLSCREEN);
00815 
00816     return FALSE;
00817 }

Here is the call graph for this function:

void on_connect_profiles_icon_clicked ( int  iconID,
int  iconState 
)

Definition at line 879 of file connectScreenProfiles.c.

00880 {
00881     pingContext_t *ctxt;
00882 
00883     CN_LOGPRINTF("entry iconID[%d] iconState[%d]", iconID, iconState);
00884 
00885     switch (iconID)
00886     {
00887         case iconID_back:
00888             if (iconState == iconState_normal)
00889             {
00890                 ctxt = cmgr_get_ping_ctxt();
00891                 if (connect_ping_freeze_ui(ctxt))
00892                 {
00893                     CN_WARNPRINTF("Please wait when freezing UI...");
00894                     return;
00895                 }
00896                 
00897                 // aborting pinging firstly
00898                 connect_ping_abort(ctxt);
00899 
00900                 // wait for ping aborting doen, then back one page
00901                 g_timeout_add(200, on_delay_back_page, NULL);
00902             }
00903             break;
00904         default:
00905             break;
00906     }
00907 }

Here is the call graph for this function:

gboolean on_connect_profiles_keypress ( GdkEventKey *  event  ) 

Definition at line 822 of file connectScreenProfiles.c.

00823 {
00824     pingContext_t *ctxt;
00825     gboolean ret = FALSE;
00826 
00827     CN_LOGPRINTF ("entry");
00828 
00829     switch (event->keyval)
00830     {
00831         case GDK_Return:
00832             // 'Enter' key is pressed
00833             ret = TRUE;
00834             break;
00835 
00836         case GDK_F5:
00837             // 'UP' key is pressed
00838             // goto the one top level page
00839             ctxt = cmgr_get_ping_ctxt();
00840             connect_ping_abort(ctxt);
00841             cmgr_up_page();
00842             ret = TRUE;
00843             break;
00844 
00845         case GDK_Down:
00846         case GDK_Up:
00847         case GDK_Page_Down:
00848         case GDK_Page_Up:
00849         default:
00850             erbusy_off();
00851     }
00852     
00853     return ret;
00854 }

Here is the call graph for this function:

static gboolean on_delay_back_page ( gpointer  data  )  [static]

Definition at line 859 of file connectScreenProfiles.c.

00860 {
00861     pingContext_t *ctxt;
00862 
00863     CN_LOGPRINTF("entry");
00864 
00865     ctxt = cmgr_get_ping_ctxt();
00866     if (connect_ping_freeze_ui(ctxt))
00867     {
00868         CN_WARNPRINTF("call me later...");
00869         return TRUE;// TRUE = please call again
00870     }
00871 
00872     toolbar_setIconState(iconID_back, iconState_selected);
00873     cmgr_add_on_toolbar_sync_action(cmgr_back_page);
00874     toolbar_synchronise();
00875 
00876     return FALSE;
00877 }

Here is the call graph for this function:

static gboolean on_delay_start_fillin_profile ( gpointer  data  )  [static]

Definition at line 686 of file connectScreenProfiles.c.

00687 {
00688     networkProfile_t* settings;
00689     regNetworkProfile_t* regSettings;
00690     connection_t networkType;
00691     
00692     settings = (networkProfile_t*)data;
00693     if (settings)
00694     {
00695         CN_LOGPRINTF("Opening the profile editor...");
00696 
00697         cmgr_set_screen_mode(cmgrScreenEdit_e);
00698 
00699         // set the edit mode
00700         edit_set_mode(editModeConnectFillIn_e);
00701  
00702         regSettings = network_spec_to_reg_network(settings->scanSettings);
00703        
00704         // set the network type for edit
00705         networkType = regSettings->connection;
00706         edit_data_set_network_type(networkType);
00707    
00708         // initilize the edit data
00709         edit_data_init_network_profiles();
00710 
00711         // set the edit mode to be wizard
00712         edit_set_wizard_mode(TRUE);
00713         edit_set_back_overview(FALSE);
00714 
00715         // set the fields of widgets
00716         edit_set_network_settings(regSettings);
00717         
00718         // go to the wireless ext page 
00719         edit_goto_page(editScreenWirelessExt_e);
00720        
00721         erRegFreeNetworkProfile(regSettings);
00722         regSettings = NULL;
00723     }
00724 
00725     return FALSE;
00726 }

Here is the call graph for this function:

static void on_profile_editor_toggled ( GtkWidget *  button,
GdkEventButton *  event,
gpointer  data 
) [static]

Definition at line 749 of file connectScreenProfiles.c.

00752 {
00753     gboolean active;
00754     pingContext_t* ctxt;
00755 
00756     CN_LOGPRINTF("entry");
00757 
00758     // check if it is a "active event"
00759     active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
00760     ctxt = cmgr_get_ping_ctxt();
00761 
00762     if (connect_ping_freeze_ui(ctxt))
00763     {
00764         CN_WARNPRINTF("Please wait when freezing UI...");
00765         if (active)
00766         {
00767             gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE);
00768         }
00769         return;
00770     }
00771     
00772     if (active)
00773     {
00774         // if already pinging, abort pinging firstly
00775         connect_ping_abort(ctxt);
00776 
00777         // show button selected, then start to launch profile editor
00778         g_timeout_add(500, delayed_on_profile_editor_toggled, data);
00779     }   
00780 }

Here is the call graph for this function:

static gboolean on_profile_entry_button_press ( GtkProfileGroup profileGroup,
guint  profileIndex,
gboolean  active 
) [static]

Definition at line 489 of file connectScreenProfiles.c.

00492 {
00493     pingContext_t* ctxt;
00494     gint pingingProfileIndex;
00495 
00496     CN_LOGPRINTF("entry");
00497     
00498     g_return_val_if_fail(IS_GTK_PROFILE_GROUP(profileGroup), FALSE);
00499     g_return_val_if_fail (profileIndex != -1, FALSE);
00500     
00501     ctxt = cmgr_get_ping_ctxt();
00502     if (connect_ping_freeze_ui(ctxt))
00503     {
00504         CN_WARNPRINTF("Please wait when freezing UI...");
00505         return TRUE;
00506     }
00507 
00508     // note: current state is de-active means it's going to be active
00509     if (active)
00510     {
00511         pingingProfileIndex = connect_ping_get_pinging_profile_index(ctxt);
00512         if (profileIndex == pingingProfileIndex)
00513         {
00514             CN_LOGPRINTF("button-press-event happens "
00515                          "on the current pinging button[%d]",
00516                          pingingProfileIndex);
00517             // return TRUE to prevent 
00518             // the standard button-press-event handler
00519             return TRUE;
00520         }
00521         else
00522         {
00523             return FALSE;
00524         }
00525     }
00526     else
00527     {
00528         // if already pinging, abort pinging firstly
00529         connect_ping_abort(ctxt);
00530        
00531         // wait for ping done, then further actions
00532         g_timeout_add(200, 
00533                 delay_profile_entry_selected, 
00534                 (gpointer)profileIndex);
00535 
00536         // return TRUE, to prevent standard button-press-event handler
00537         // select this button in delay_profile_entry_selected later
00538         return TRUE;
00539     }
00540 }

Here is the call graph for this function:


Variable Documentation

GtkWidget* g_connect_profiles = NULL [static]

Definition at line 62 of file connectScreenProfiles.c.

GtkWidget* g_info = NULL [static]

Definition at line 72 of file connectScreenProfiles.c.

GtkWidget* g_known_profiles = NULL [static]

Definition at line 65 of file connectScreenProfiles.c.

bkWdtLabelButton* g_label_button = NULL [static]

Definition at line 69 of file connectScreenProfiles.c.

GtkWidget* g_profile_editor = NULL [static]

Definition at line 68 of file connectScreenProfiles.c.


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