connectionMgr/inc/connectScreenOptions.h File Reference

connectionMgr - the first page of 'connect-to-server' screen the connection options configuration screen containing a selection widget lets users choose which server(iDS/PC) connect with a selection widget lets users choose the network type (wired/wireless/dialup) a information widget gives some feedback to users More...

#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

GtkWidget * connect_options_create (void)
void connect_options_set_text (void)
void connect_options_display (void)
gboolean on_connect_options_keypress (GdkEventKey *event)
void connect_options_restore_scan_ctxt (void)


Detailed Description

connectionMgr - the first page of 'connect-to-server' screen the connection options configuration screen containing a selection widget lets users choose which server(iDS/PC) connect with a selection widget lets users choose the network type (wired/wireless/dialup) a information widget gives some feedback to users

Copyright (C) 2007 iRex Technologies BV.

Definition in file connectScreenOptions.h.


Function Documentation

GtkWidget* connect_options_create ( void   ) 

Definition at line 106 of file connectScreenOptions.c.

00107 {
00108     CN_LOGPRINTF ("entry");
00109 
00110     GtkWidget *vbox;
00111     GtkWidget *itemConnectWith;
00112     GtkWidget *itemInfo;
00113 
00114     vbox = gtk_vbox_new (FALSE, VBOX_SPACING);
00115     gtk_widget_show(vbox);
00116     g_connect_options = vbox;
00117 
00118     itemConnectWith = create_connect_with ();
00119     gtk_box_pack_start (GTK_BOX (vbox), itemConnectWith, FALSE, FALSE, 0);
00120     gtk_widget_show(itemConnectWith);
00121 
00122     itemInfo = create_infomation ();
00123     gtk_box_pack_start (GTK_BOX (vbox), itemInfo, FALSE, FALSE, 0);
00124     gtk_widget_show(itemInfo);
00125 
00126     return vbox;
00127 }

Here is the call graph for this function:

void connect_options_display ( void   ) 

Definition at line 335 of file connectScreenOptions.c.

00336 {
00337     CN_LOGPRINTF ("entry");
00338 
00339     GtkWidget*       widget;
00340     GtkToggleButton* button;
00341   
00342     if (g_server_type)
00343     {
00344         // Display choice iDS / Computer
00345         //   - select which button must be selected
00346         switch (connect_data_get_connect_type())
00347         {
00348             case cmgrConnectIDS_e:
00349                 widget = GTK_WIDGET(g_server_type->details->buttonList[0]);
00350                 break;
00351             case cmgrConnectPCShare_e:
00352                 widget = GTK_WIDGET(g_server_type->details->buttonList[1]);
00353                 break;
00354             default:
00355                 // nothing selected (yet)
00356                 widget = GTK_WIDGET(g_server_type->details->buttonList[0]);
00357                 connect_data_set_connect_type(cmgrConnectIDS_e);
00358                 break;
00359         }
00360         //   - and select this button
00361         //     Note: when the button is already selected, 
00362         //     we de-select then select again;
00363         //           this ensures the signal handlers are called 
00364         //           regardless the old button state.
00365         button = GTK_TOGGLE_BUTTON(widget);
00366         if (g_first_display && gtk_toggle_button_get_active(button))
00367         {
00368             // button is selected, so first deselect it 
00369             // to make sure signal handler is called
00370             gtk_toggle_button_set_active(button, FALSE);
00371         }
00372         gtk_toggle_button_set_active(button, TRUE);
00373     }
00374 
00375     if (g_network_type)
00376     {
00377         // Display choice wired / wireless / dialup
00378         switch (connect_data_get_network_type())
00379         {
00380             case wired_t:
00381                 widget = GTK_WIDGET(g_network_type->details->buttonList[0]);
00382                 break;
00383             case wireless_t:
00384                 widget = GTK_WIDGET(g_network_type->details->buttonList[1]);
00385                 break;
00386             case dialup_t:
00387                 widget = GTK_WIDGET(g_network_type->details->buttonList[2]);
00388                 break;
00389             default:
00390                 // nothing selected (yet), using the default setting
00391                 // default is wireless, unless the device does not have wireless, then the default is wired
00392                 widget = GTK_WIDGET(g_network_type->details->buttonList[main_get_wifi_disabled() ? 0 : 1]);
00393                 connect_data_set_network_type (main_get_wifi_disabled() ? wired_t : wireless_t);
00394                 break;
00395         }
00396         //   - and select this button
00397         //     Note: when the button is already selected, 
00398         //     we de-select then select again;
00399         //           this ensures the signal handlers are called 
00400         //           regardless the old button state.
00401         button = GTK_TOGGLE_BUTTON(widget);
00402         if (g_first_display && gtk_toggle_button_get_active(button))
00403         {
00404             // button is selected, so first deselect it 
00405             // to make sure signal handler is called
00406             gtk_toggle_button_set_active(button, FALSE);
00407         }
00408         gtk_toggle_button_set_active(button, TRUE);
00409     }
00410 
00411     // force connect to iDS when no PC profile in registry
00412     const regPCProfile_t *pcshare = NULL;
00413     pcshare = connect_data_get_pcsharedata();
00414     if (pcshare == NULL
00415       || (pcshare->pcname == NULL || pcshare->pcname[0] == '\0')
00416       || (pcshare->sharename == NULL || pcshare->sharename[0] == '\0'))
00417     {
00418         CN_WARNPRINTF ("no PC profile in registry: force connect to iDS");
00419        
00420         if (g_server_type)
00421         {
00422             widget = GTK_WIDGET(g_server_type->details->buttonList[1]);
00423             gtk_widget_set_sensitive(widget, FALSE);
00424             
00425             widget = GTK_WIDGET(g_server_type->details->buttonList[0]);
00426             gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), TRUE);
00427         }
00428 
00429         connect_data_set_connect_type (cmgrConnectIDS_e);
00430     }
00431     
00432     if (main_get_wifi_disabled())
00433     {
00434         // set wifi button insensitive when wifi is disabled
00435         widget = GTK_WIDGET(g_network_type->details->buttonList[1]);
00436         gtk_widget_set_sensitive(widget, FALSE);
00437     }
00438 
00439     if (main_get_dialup_disabled())
00440     {
00441         // set dialup button insensitive when dialup is disabled
00442         widget = GTK_WIDGET(g_network_type->details->buttonList[2]);
00443         gtk_widget_set_sensitive(widget, FALSE);
00444     }
00445 
00446     connect_options_update_info(scanRunning_e);
00447 
00448     g_first_display = FALSE;
00449 }

Here is the call graph for this function:

void connect_options_restore_scan_ctxt ( void   ) 

Definition at line 779 of file connectScreenOptions.c.

00780 {
00781     scanContext_t *ctxt;
00782     connection_t networkType;
00783     char *ssidList;
00784 
00785     CN_LOGPRINTF("entry");
00786     
00787     ctxt = cmgr_get_scan_ctxt();
00788     if (ctxt)
00789     {
00790         connect_scan_ctxt_set_mode(ctxt, connectScan_e);
00791         
00792         networkType = connect_data_get_network_type();
00793         connect_scan_ctxt_set_network_type(ctxt, networkType);
00794         
00795         connect_scan_ctxt_set_done_callbacks(ctxt,
00796                     connect_data_init_network_profiles,
00797                     connect_options_scan_networks_done);
00798 
00799         ssidList = connect_data_get_hidden_ssid_list();
00800         connect_scan_ctxt_set_ssidlist(ctxt, ssidList);
00801         g_free(ssidList);
00802     }
00803 }

Here is the call graph for this function:

void connect_options_set_text ( void   ) 

Definition at line 284 of file connectScreenOptions.c.

00285 {
00286     GtkWidget *widget;
00287 
00288     CN_LOGPRINTF ("entry");
00289 
00290     if (g_connect_with)
00291     {
00292         // selection iDS / PC
00293         gtk_settingitem_set_header_text (GTK_SETTINGITEM (g_connect_with), 
00294                                          _("Connection settings"));
00295     }
00296 
00297     if (g_server_type)
00298     {
00299         widget = g_server_type->details->label;
00300         gtk_label_set_text (GTK_LABEL (widget),
00301                             _("Select to connect to the iDS "
00302                               "(iRex Delivery Service) or to "
00303                               "your computer."));
00304 
00305         widget = GTK_WIDGET(g_server_type->details->buttonList[0]);
00306         gtk_button_set_label (GTK_BUTTON (widget), _("iDS"));
00307        
00308         widget = GTK_WIDGET(g_server_type->details->buttonList[1]);
00309         gtk_button_set_label (GTK_BUTTON (widget), _("Computer"));
00310     }
00311 
00312     if (g_network_type)
00313     {
00314         widget = g_network_type->details->label;
00315         gtk_label_set_text (GTK_LABEL (widget),
00316                             _("Select a connection type or accept "
00317                               "the default."));
00318 
00319         widget = GTK_WIDGET(g_network_type->details->buttonList[0]);
00320         gtk_button_set_label (GTK_BUTTON (widget), _("Wired"));
00321         
00322         widget = GTK_WIDGET(g_network_type->details->buttonList[1]);
00323         gtk_button_set_label (GTK_BUTTON (widget), _("Wireless"));
00324 
00325         widget = GTK_WIDGET(g_network_type->details->buttonList[2]);
00326         gtk_button_set_label (GTK_BUTTON (widget), _("Dial-up"));
00327     }
00328 }

Here is the call graph for this function:

gboolean on_connect_options_keypress ( GdkEventKey *  event  ) 

Definition at line 805 of file connectScreenOptions.c.

00806 {
00807     scanContext_t *ctxt;
00808     gboolean ret = FALSE;
00809 
00810     CN_LOGPRINTF("entry");
00811 
00812     switch (event->keyval)
00813     {
00814         case GDK_Return:
00815             // 'Enter' key is pressed
00816             ret = TRUE;
00817             break;
00818 
00819         case GDK_F5:
00820             // 'UP' key is pressed
00821             // goto the one top level page
00822             remove_timeout_ids();
00823 
00824             ctxt = cmgr_get_scan_ctxt();
00825             connect_scan_abort(ctxt);
00826             
00827             cmgr_up_page();
00828             
00829             ret = TRUE;
00830             break;
00831 
00832         default:
00833             erbusy_off();
00834     }
00835     
00836     return ret;
00837 }

Here is the call graph for this function:


Generated on Sun Dec 14 17:15:32 2008 by  doxygen 1.5.6