connectionMgr/inc/connectScreenProfiles.h 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 <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>
#include "connectPing.h"

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

Go to the source code of this file.

Functions

GtkWidget * connect_profiles_create (void)
void connect_profiles_set_text (void)
void connect_profiles_display (void)
gboolean on_connect_profiles_keypress (GdkEventKey *event)
void on_connect_profiles_icon_clicked (int iconID, int iconState)
void connect_profiles_restore_ping_ctxt (void)


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.h.


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_restore_ping_ctxt ( void   ) 

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:

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:


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