#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>
Go to the source code of this file.
Functions | |
GtkWidget * | edit_search_create (void) |
void | edit_search_set_text (void) |
void | edit_search_restore_screen (void) |
gboolean | on_edit_search_keypress (GdkEventKey *event) |
Copyright (C) 2007 iRex Technologies BV.
Definition in file editScreenSearch.h.
GtkWidget* edit_search_create | ( | void | ) |
Definition at line 83 of file editScreenSearch.c.
00084 { 00085 GtkWidget *item; 00086 GtkWidget *vbox; 00087 bkWdtLabelButton *options; 00088 GtkWidget *profilelist; 00089 GtkWidget *info; 00090 GtkWidget *widget; 00091 00092 CN_LOGPRINTF("entry"); 00093 00094 // item 00095 item = gtk_settingitem_new(""); 00096 00097 // vbox 00098 vbox = gtk_vbox_new(FALSE, VBOX_SPACING); 00099 gtk_settingitem_add_details(GTK_SETTINGITEM(item), vbox); 00100 00101 // options 00102 options = bk_wdt_label_button_new(2, FALSE, 0, 1); 00103 gtk_box_pack_start(GTK_BOX(vbox), options->background, FALSE, FALSE, 0); 00104 00105 // profilelist 00106 profilelist = create_known_profiles(); 00107 gtk_box_pack_start(GTK_BOX(vbox), profilelist, FALSE, FALSE, 0); 00108 00109 // info 00110 info = gtk_infoitem_new(FALSE); 00111 gtk_box_pack_start(GTK_BOX(vbox), info, FALSE, FALSE, 0); 00112 00113 // signal handlers 00114 widget = options->details->selection; 00115 g_signal_connect (G_OBJECT (widget), "selection-update", 00116 G_CALLBACK (on_options_update), NULL); 00117 00118 // show widgets 00119 gtk_widget_show(item); 00120 gtk_widget_show(vbox); 00121 gtk_widget_show(options->background); 00122 gtk_widget_show(profilelist); 00123 gtk_widget_show(info); 00124 00125 // global variables 00126 g_search = item; 00127 g_options = options; 00128 g_info = info; 00129 00130 CN_LOGPRINTF("done"); 00131 00132 // return 00133 return item; 00134 }
void edit_search_restore_screen | ( | void | ) |
Definition at line 257 of file editScreenSearch.c.
00258 { 00259 GtkToggleButton *button; 00260 00261 // Search and Manually buttons 00262 button = g_options->details->buttonList[0]; 00263 gtk_toggle_button_set_active(button, FALSE); 00264 00265 button = g_options->details->buttonList[0]; 00266 gtk_toggle_button_set_active(button, FALSE); 00267 00268 // the profilelist 00269 edit_search_destroy_network_profiles(); 00270 edit_search_display_profilelist(); 00271 edit_search_update_profilelist_info(undefScanStatus_e); 00272 }
void edit_search_set_text | ( | void | ) |
Definition at line 155 of file editScreenSearch.c.
00156 { 00157 GtkProfileGroup *profileGroup; 00158 GtkWidget *widget = NULL; 00159 00160 CN_LOGPRINTF("entry"); 00161 00162 if (g_search) 00163 { 00164 gtk_settingitem_set_header_text(GTK_SETTINGITEM(g_search), 00165 _("Create new wireless network")); 00166 } 00167 00168 if (g_options) 00169 { 00170 widget = g_options->details->label; 00171 gtk_label_set_text(GTK_LABEL(widget), 00172 _("Select a way to create the network.")); 00173 00174 widget = GTK_WIDGET(g_options->details->buttonList[0]); 00175 gtk_button_set_label(GTK_BUTTON(widget), _("Search")); 00176 00177 widget = GTK_WIDGET(g_options->details->buttonList[1]); 00178 gtk_button_set_label(GTK_BUTTON(widget), _("Manually")); 00179 } 00180 00181 if (g_known_profiles) 00182 { 00183 profileGroup = GTK_PROFILE_GROUP(g_known_profiles); 00184 gtk_profile_group_set_header_text(profileGroup, 00185 _("Network profiles")); 00186 } 00187 00188 if (g_info) 00189 { 00190 gtk_infoitem_set_text(GTK_INFOITEM(g_info), 00191 _("When you click on 'Search' the device will scan for networks.\n" 00192 "Clicking 'Manually' requires all the settings.")); 00193 } 00194 }
gboolean on_edit_search_keypress | ( | GdkEventKey * | event | ) |
Definition at line 517 of file editScreenSearch.c.
00518 { 00519 GtkToggleButton *button; 00520 gboolean ret = FALSE; 00521 00522 CN_LOGPRINTF("entry"); 00523 00524 switch (event->keyval) 00525 { 00526 case GDK_Return: 00527 // 'Enter' key is pressed 00528 // simulate clicking the 'Manually' button 00529 if (g_options) 00530 { 00531 button = g_options->details->buttonList[1]; 00532 gtk_toggle_button_set_active(button, TRUE); 00533 } 00534 ret = TRUE; 00535 break; 00536 00537 case GDK_F5: 00538 // 'UP' key is pressed 00539 // goto the one top level page 00540 cmgr_up_page(); 00541 ret = TRUE; 00542 break; 00543 00544 case GDK_Down: 00545 case GDK_Up: 00546 case GDK_Page_Down: 00547 case GDK_Page_Up: 00548 default: 00549 erbusy_off(); 00550 break; 00551 } 00552 00553 return ret; 00554 }