#include "config.h"
#include <arpa/inet.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/socket.h>
#include <gtk/gtk.h>
#include <liberregxml/erregapi.h>
#include <libergtk/ergtk.h>
#include "setupLog.h"
#include "displayStatus.h"
#include "gtkSettingItem.h"
#include "gtkSettingItemTextEntry.h"
#include "gtkInfoItem.h"
#include "iLiadPCConnectScreen.h"
#include "iLiadPCConnectData.h"
#include "languages.h"
Go to the source code of this file.
Defines | |
| #define | _GNU_SOURCE |
Enumerations | |
| enum | screen_mode_t { e_screen_show_all, e_screen_enter_pcname, e_screen_enter_sharename, e_screen_enter_workgroup, e_screen_enter_user_password } |
Functions | |
| static GtkWidget * | create_user_password_widget (void) |
| static void | iLiad_pc_connect_set_screenmode (const screen_mode_t mode) |
| static gboolean | pcname_check_split (const gchar *pcname_old, gchar **pcname_new, const gchar *workgroup_old, gchar **workgroup_new) |
| static void | on_pcname_changed (GtkWidget *widget, const gchar *value) |
| static void | on_pcname_validate (GtkWidget *widget, const gchar *text, gchar **newtext) |
| static void | on_pcname_button_press (GtkWidget *widget) |
| static void | on_pcname_info_button_clicked (GtkWidget *widget, const gboolean button_active) |
| static void | on_sharename_changed (GtkWidget *widget, const gchar *value) |
| static void | on_sharename_button_press (GtkWidget *widget) |
| static void | on_sharename_info_button_clicked (GtkWidget *widget, const gboolean button_active) |
| static void | on_workgroup_changed (GtkWidget *widget, const gchar *value) |
| static void | on_workgroup_validate (GtkWidget *widget, const gchar *text, gchar **newtext) |
| static void | on_workgroup_button_press (GtkWidget *widget) |
| static void | on_workgroup_info_button_clicked (GtkWidget *widget, const gboolean button_active) |
| static void | on_username_changed (GtkEditable *editable, gpointer user_data) |
| static void | on_password_changed (GtkEditable *editable, gpointer user_data) |
| static gboolean | on_user_password_button_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
| static void | on_user_password_info_button_clicked (GtkWidget *widget, const gboolean button_active) |
| GtkWidget * | iLiad_pc_connect_screen_create (void) |
| void | iLiad_pc_connect_screen_set_text (void) |
| void | iLiad_pc_connect_screen_display_settings () |
Variables | |
| static screen_mode_t | g_screen_mode = e_screen_show_all |
| static GtkWidget * | g_edit_pc_connect = NULL |
| static GtkWidget * | g_pcname = NULL |
| static GtkWidget * | g_pcname_info = NULL |
| static GtkWidget * | g_sharename = NULL |
| static GtkWidget * | g_sharename_info = NULL |
| static GtkWidget * | g_workgroup = NULL |
| static GtkWidget * | g_workgroup_info = NULL |
| static GtkWidget * | g_user_password = NULL |
| static GtkWidget * | g_user_password_info = NULL |
| static GtkWidget * | g_user_password_label = NULL |
| static GtkWidget * | g_user_label = NULL |
| static GtkWidget * | g_user_entry = NULL |
| static GtkWidget * | g_password_label = NULL |
| static GtkWidget * | g_password_entry = NULL |
Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.
Definition in file iLiadPCConnectScreen.c.
| #define _GNU_SOURCE |
Definition at line 29 of file iLiadPCConnectScreen.c.
| enum screen_mode_t |
| e_screen_show_all | |
| e_screen_enter_pcname | |
| e_screen_enter_sharename | |
| e_screen_enter_workgroup | |
| e_screen_enter_user_password |
Definition at line 54 of file iLiadPCConnectScreen.c.
00055 { 00056 e_screen_show_all, 00057 e_screen_enter_pcname, 00058 e_screen_enter_sharename, 00059 e_screen_enter_workgroup, 00060 e_screen_enter_user_password, 00061 } screen_mode_t;
| static GtkWidget * create_user_password_widget | ( | void | ) | [static] |
Definition at line 253 of file iLiadPCConnectScreen.c.
00254 { 00255 GtkWidget *background; 00256 GtkWidget *alignment; 00257 GtkWidget *vbox; 00258 GtkWidget *user_password_label; 00259 GtkWidget *hbox; 00260 GtkWidget *user_label; 00261 GtkWidget *user_entry; 00262 GtkWidget *password_label; 00263 GtkWidget *password_entry; 00264 00265 ST_LOGPRINTF("entry"); 00266 00267 // background 00268 background = gtk_event_box_new(); 00269 gtk_widget_set_name(background, "pc_connect_user_password_widget"); 00270 gtk_widget_set_size_request(GTK_WIDGET(background), 00271 PC_CONNECT_USER_PASSWORD_BK_WIDTH, PC_CONNECT_USER_PASSWORD_BK_HEIGHT); 00272 // alignment 00273 alignment = gtk_alignment_new(0, 0, 0, 0); 00274 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 00275 PC_CONNECT_SCREEN_PADDING_TOP, PC_CONNECT_SCREEN_PADDING_BOTTOM, 00276 PC_CONNECT_SCREEN_PADDING_LEFT, PC_CONNECT_SCREEN_PADDING_RIGHT ); 00277 gtk_container_add(GTK_CONTAINER(background), alignment); 00278 gtk_widget_show(alignment); 00279 // vbox 00280 vbox = gtk_vbox_new(FALSE, PC_CONNECT_SCREEN_USER_PASSWORD_SPACING_V); 00281 gtk_container_add(GTK_CONTAINER(alignment), vbox); 00282 gtk_widget_show(vbox); 00283 // user_password_label 00284 user_password_label = gtk_label_new(""); 00285 gtk_widget_set_name(user_password_label, "pc_connect_screen_info_text"); 00286 gtk_widget_set_size_request(user_password_label, (-1), (-1)); 00287 gtk_misc_set_alignment(GTK_MISC(user_password_label), 0.0, 0.5); 00288 gtk_label_set_justify(GTK_LABEL(user_password_label), GTK_JUSTIFY_LEFT); 00289 gtk_box_pack_start(GTK_BOX(vbox), user_password_label, FALSE, FALSE, 0); 00290 gtk_widget_show(user_password_label); 00291 // hbox 00292 hbox = gtk_hbox_new(FALSE, PC_CONNECT_SCREEN_USER_PASSWORD_SPACING_H); 00293 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); 00294 gtk_widget_show(hbox); 00295 // vbox 00296 vbox = gtk_vbox_new(FALSE, PC_CONNECT_SCREEN_USER_PASSWORD_SPACING_V); 00297 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); 00298 gtk_widget_show(vbox); 00299 // user_label 00300 user_label = gtk_label_new(""); 00301 gtk_widget_set_name(user_label, "pc_connect_screen_info_text"); 00302 gtk_widget_set_size_request(user_label, PC_CONNECT_INPUT_ENTRY_WIDTH, (-1)); 00303 gtk_misc_set_alignment(GTK_MISC(user_label), 0.0, 0.5); 00304 gtk_label_set_justify(GTK_LABEL(user_label), GTK_JUSTIFY_LEFT); 00305 gtk_box_pack_start(GTK_BOX(vbox), user_label, FALSE, FALSE, 0); 00306 gtk_widget_show(user_label); 00307 // user_entry 00308 user_entry = ergtk_entry_new(); 00309 gtk_widget_set_size_request(user_entry, PC_CONNECT_INPUT_ENTRY_WIDTH, PC_CONNECT_INPUT_ENTRY_HEIGHT); 00310 gtk_box_pack_start(GTK_BOX(vbox), user_entry, FALSE, FALSE, 0); 00311 gtk_widget_show(user_entry); 00312 // vbox 00313 vbox = gtk_vbox_new(FALSE, PC_CONNECT_SCREEN_USER_PASSWORD_SPACING_V); 00314 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); 00315 gtk_widget_show(vbox); 00316 // password_label 00317 password_label = gtk_label_new(""); 00318 gtk_widget_set_name(password_label, "pc_connect_screen_info_text"); 00319 gtk_widget_set_size_request(password_label, PC_CONNECT_INPUT_ENTRY_WIDTH, (-1)); 00320 gtk_misc_set_alignment(GTK_MISC(password_label), 0.0, 0.5); 00321 gtk_label_set_justify(GTK_LABEL(password_label), GTK_JUSTIFY_LEFT); 00322 gtk_box_pack_start(GTK_BOX(vbox), password_label, FALSE, FALSE, 0); 00323 gtk_widget_show(password_label); 00324 // password_entry 00325 password_entry = ergtk_entry_new(); 00326 gtk_widget_set_size_request(password_entry, PC_CONNECT_INPUT_ENTRY_WIDTH, PC_CONNECT_INPUT_ENTRY_HEIGHT); 00327 gtk_entry_set_visibility(GTK_ENTRY(password_entry), FALSE); 00328 gtk_box_pack_start(GTK_BOX(vbox), password_entry, FALSE, FALSE, 0); 00329 gtk_widget_show(password_entry); 00330 00331 // signals functions 00332 g_signal_connect(GTK_OBJECT(user_entry), "changed-stable", G_CALLBACK(on_username_changed), NULL); 00333 g_signal_connect(GTK_OBJECT(password_entry), "changed-stable", G_CALLBACK(on_password_changed), NULL); 00334 g_signal_connect(GTK_OBJECT(user_entry), "button-press-event", G_CALLBACK(on_user_password_button_press), NULL); 00335 g_signal_connect(GTK_OBJECT(password_entry), "button-press-event", G_CALLBACK(on_user_password_button_press), NULL); 00336 00337 // global variables 00338 g_user_password_label = user_password_label; 00339 g_user_label = user_label; 00340 g_user_entry = user_entry; 00341 g_password_label = password_label; 00342 g_password_entry = password_entry; 00343 00344 return background; 00345 }

| GtkWidget* iLiad_pc_connect_screen_create | ( | void | ) |
Definition at line 129 of file iLiadPCConnectScreen.c.
00130 { 00131 GtkWidget *item; 00132 GtkWidget *top_vbox; 00133 GtkWidget *vbox; 00134 GtkWidget *pcname; 00135 GtkWidget *pcname_info; 00136 GtkWidget *sharename; 00137 GtkWidget *sharename_info; 00138 GtkWidget *workgroup; 00139 GtkWidget *workgroup_info; 00140 GtkWidget *user_password; 00141 GtkWidget *user_password_info; 00142 00143 ST_LOGPRINTF("entry"); 00144 00145 // g_edit_pc_connect 00146 item = gtk_settingitem_new(""); 00147 gtk_widget_set_size_request(item, PC_CONNECT_SCREEN_WIDTH, -1); 00148 // top_vbox 00149 top_vbox = gtk_vbox_new(FALSE, PC_CONNECT_SCREEN_SPACING_V); 00150 gtk_settingitem_add_details(GTK_SETTINGITEM(item), top_vbox); 00151 gtk_widget_show(top_vbox); 00152 // vbox 00153 vbox = gtk_vbox_new(FALSE, 1); 00154 gtk_box_pack_start(GTK_BOX(top_vbox), vbox, FALSE, FALSE, 0); 00155 gtk_widget_show(vbox); 00156 // pcname 00157 pcname = gtk_settingitem_textentry_new(); 00158 gtk_widget_set_size_request(pcname, -1, PC_CONNECT_PCNAME_HEIGHT); 00159 gtk_box_pack_start(GTK_BOX(vbox), pcname, FALSE, FALSE, 0); 00160 // pcname_info 00161 pcname_info = gtk_infoitem_new(TRUE); 00162 gtk_box_pack_start(GTK_BOX(vbox), pcname_info, FALSE, FALSE, 0); 00163 // vbox 00164 vbox = gtk_vbox_new(FALSE, 1); 00165 gtk_box_pack_start(GTK_BOX(top_vbox), vbox, FALSE, FALSE, 0); 00166 gtk_widget_show(vbox); 00167 // sharename 00168 sharename = gtk_settingitem_textentry_new(); 00169 gtk_widget_set_size_request(sharename, -1, PC_CONNECT_SHARENAME_HEIGHT); 00170 gtk_box_pack_start(GTK_BOX(vbox), sharename, FALSE, FALSE, 0); 00171 // sharename_info 00172 sharename_info = gtk_infoitem_new(TRUE); 00173 gtk_box_pack_start(GTK_BOX(vbox), sharename_info, FALSE, FALSE, 0); 00174 // vbox 00175 vbox = gtk_vbox_new(FALSE, 1); 00176 gtk_box_pack_start(GTK_BOX(top_vbox), vbox, FALSE, FALSE, 0); 00177 gtk_widget_show(vbox); 00178 // workgroup 00179 workgroup = gtk_settingitem_textentry_new(); 00180 gtk_widget_set_size_request(workgroup, -1, PC_CONNECT_WORKGROUP_HEIGHT); 00181 gtk_box_pack_start(GTK_BOX(vbox), workgroup, FALSE, FALSE, 0); 00182 // workgroup_info 00183 workgroup_info = gtk_infoitem_new(TRUE); 00184 gtk_box_pack_start(GTK_BOX(vbox), workgroup_info, FALSE, FALSE, 0); 00185 // vbox 00186 vbox = gtk_vbox_new(FALSE, 1); 00187 gtk_box_pack_start(GTK_BOX(top_vbox), vbox, FALSE, FALSE, 0); 00188 gtk_widget_show(vbox); 00189 // user_password widget 00190 user_password = create_user_password_widget(); 00191 gtk_box_pack_start(GTK_BOX(vbox), user_password, FALSE, FALSE, 0); 00192 // user_password_info 00193 user_password_info = gtk_infoitem_new(TRUE); 00194 gtk_box_pack_start(GTK_BOX(vbox), user_password_info, FALSE, FALSE, 0); 00195 00196 // signals functions 00197 gtk_settingitem_textentry_callback_on_changed(GTK_SETTINGITEM_TEXTENTRY(pcname), on_pcname_changed); 00198 gtk_settingitem_textentry_callback_on_validate(GTK_SETTINGITEM_TEXTENTRY(pcname), on_pcname_validate); 00199 gtk_settingitem_textentry_callback_on_button_press(GTK_SETTINGITEM_TEXTENTRY(pcname), on_pcname_button_press); 00200 gtk_infoitem_callback_on_buttonclicked(GTK_INFOITEM(pcname_info), on_pcname_info_button_clicked); 00201 00202 gtk_settingitem_textentry_callback_on_changed(GTK_SETTINGITEM_TEXTENTRY(sharename), on_sharename_changed); 00203 gtk_settingitem_textentry_callback_on_button_press(GTK_SETTINGITEM_TEXTENTRY(sharename), on_sharename_button_press); 00204 gtk_infoitem_callback_on_buttonclicked(GTK_INFOITEM(sharename_info), on_sharename_info_button_clicked); 00205 00206 gtk_settingitem_textentry_callback_on_changed(GTK_SETTINGITEM_TEXTENTRY(workgroup), on_workgroup_changed); 00207 gtk_settingitem_textentry_callback_on_validate(GTK_SETTINGITEM_TEXTENTRY(workgroup), on_workgroup_validate); 00208 gtk_settingitem_textentry_callback_on_button_press(GTK_SETTINGITEM_TEXTENTRY(workgroup), on_workgroup_button_press); 00209 gtk_infoitem_callback_on_buttonclicked(GTK_INFOITEM(workgroup_info), on_workgroup_info_button_clicked); 00210 00211 gtk_infoitem_callback_on_buttonclicked(GTK_INFOITEM(user_password_info), on_user_password_info_button_clicked); 00212 00213 // global variables 00214 g_edit_pc_connect = item; 00215 g_pcname = pcname; 00216 g_pcname_info = pcname_info; 00217 g_sharename = sharename; 00218 g_sharename_info = sharename_info; 00219 g_workgroup = workgroup; 00220 g_workgroup_info = workgroup_info; 00221 g_user_password = user_password; 00222 g_user_password_info = user_password_info; 00223 // show hide widgets 00224 gtk_widget_show(item); 00225 gtk_widget_show(pcname); 00226 gtk_widget_hide(pcname_info); 00227 gtk_widget_show(sharename); 00228 gtk_widget_hide(sharename_info); 00229 gtk_widget_show(workgroup); 00230 gtk_widget_hide(workgroup_info); 00231 gtk_widget_show(user_password); 00232 gtk_widget_hide(user_password_info); 00233 00234 ST_LOGPRINTF("done"); 00235 // return 00236 return g_edit_pc_connect; 00237 }

| void iLiad_pc_connect_screen_display_settings | ( | ) |
Definition at line 423 of file iLiadPCConnectScreen.c.
00424 { 00425 ST_LOGPRINTF("entry"); 00426 00427 const regPCProfile_t *setting = iLiad_pc_connect_get_profiledata(0); 00428 00429 // set screen objects 00430 if (NULL == setting) 00431 { 00432 gtk_settingitem_textentry_settext(GTK_SETTINGITEM_TEXTENTRY(g_pcname), ""); 00433 gtk_settingitem_textentry_settext(GTK_SETTINGITEM_TEXTENTRY(g_sharename), ""); 00434 gtk_settingitem_textentry_settext(GTK_SETTINGITEM_TEXTENTRY(g_workgroup), ""); 00435 gtk_entry_set_text(GTK_ENTRY(g_user_entry), ""); 00436 gtk_entry_set_text(GTK_ENTRY(g_password_entry), ""); 00437 } 00438 else 00439 { 00440 gtk_settingitem_textentry_settext(GTK_SETTINGITEM_TEXTENTRY(g_pcname), setting->pcname ); 00441 gtk_settingitem_textentry_settext(GTK_SETTINGITEM_TEXTENTRY(g_sharename), setting->sharename); 00442 gtk_settingitem_textentry_settext(GTK_SETTINGITEM_TEXTENTRY(g_workgroup), setting->workgroup); 00443 gtk_entry_set_text(GTK_ENTRY(g_user_entry), setting->username); 00444 gtk_entry_set_text(GTK_ENTRY(g_password_entry), setting->password); 00445 } 00446 00447 // set screen mode 00448 iLiad_pc_connect_set_screenmode(e_screen_show_all); 00449 }

| void iLiad_pc_connect_screen_set_text | ( | void | ) |
Definition at line 347 of file iLiadPCConnectScreen.c.
00348 { 00349 ST_LOGPRINTF("entry"); 00350 00351 gchar *info_proceed = _("Proceed"); 00352 00353 // title 00354 if (g_edit_pc_connect) 00355 { 00356 gtk_settingitem_set_header_text(GTK_SETTINGITEM(g_edit_pc_connect), 00357 _("iLiad settings / Setting for computer connection ")); 00358 } 00359 // pcname 00360 if (g_pcname) 00361 { 00362 gtk_settingitem_textentry_setlabel(GTK_SETTINGITEM_TEXTENTRY(g_pcname), 00363 _("STEP 1: Please type the name of your computer.")); 00364 } 00365 if (g_pcname_info) 00366 { 00367 gtk_infoitem_set_text(GTK_INFOITEM(g_pcname_info), 00368 _("You can create a connection between the iLiad" 00369 " and your computer by entering the specifications" 00370 " of your PC.\n" 00371 "The \"full computer name\" is located at the system" 00372 " properties of your computer.")); 00373 gtk_infoitem_set_buttontext(GTK_INFOITEM(g_pcname_info), info_proceed); 00374 } 00375 // sharename 00376 if (g_sharename) 00377 { 00378 gtk_settingitem_textentry_setlabel(GTK_SETTINGITEM_TEXTENTRY(g_sharename), 00379 _("STEP 2: Please enter the name of the \"shared\" destination folder.")); 00380 } 00381 if (g_sharename_info) 00382 { 00383 gtk_infoitem_set_text(GTK_INFOITEM(g_sharename_info), 00384 _("Create a destination folder on your computer. In the folder properties" 00385 " you can \"share this folder\".")); 00386 gtk_infoitem_set_buttontext(GTK_INFOITEM(g_sharename_info), info_proceed); 00387 } 00388 // workgroup 00389 if (g_workgroup) 00390 { 00391 gtk_settingitem_textentry_setlabel(GTK_SETTINGITEM_TEXTENTRY(g_workgroup), 00392 _("STEP 3: Please enter the domain group / work group of your computer.")); 00393 } 00394 if (g_workgroup_info) 00395 { 00396 gtk_infoitem_set_text(GTK_INFOITEM(g_workgroup_info), 00397 _("When the computer is part of a business network, you can enter the domain group.\n" 00398 "In most cases you can leave this entry field blank.")); 00399 gtk_infoitem_set_buttontext(GTK_INFOITEM(g_workgroup_info), info_proceed); 00400 } 00401 if (g_user_password_label) 00402 { 00403 gtk_label_set_text(GTK_LABEL(g_user_password_label), _("STEP 4: Please enter the username and password of your computer.")); 00404 } 00405 if (g_user_label) 00406 { 00407 gtk_label_set_text(GTK_LABEL(g_user_label), _("User name")); 00408 } 00409 if (g_password_label) 00410 { 00411 gtk_label_set_text(GTK_LABEL(g_password_label), _("Password")); 00412 } 00413 if (g_user_password_info) 00414 { 00415 gtk_infoitem_set_text(GTK_INFOITEM(g_user_password_info), 00416 _("You can leave this entry field blank when you didn't create a user name and password.")); 00417 gtk_infoitem_set_buttontext(GTK_INFOITEM(g_user_password_info), info_proceed); 00418 } 00419 00420 ST_LOGPRINTF("done"); 00421 }

| static void iLiad_pc_connect_set_screenmode | ( | const screen_mode_t | mode | ) | [static] |
Definition at line 452 of file iLiadPCConnectScreen.c.
00453 { 00454 ST_LOGPRINTF("entry: mode [%d]", mode); 00455 00456 if (mode != g_screen_mode) 00457 { 00458 g_screen_mode = mode; 00459 00460 if (mode == e_screen_show_all) 00461 { 00462 gtk_widget_set_size_request(g_pcname, PC_CONNECT_SCREEN_WIDTH, PC_CONNECT_PCNAME_HEIGHT ); 00463 gtk_widget_set_size_request(g_sharename, PC_CONNECT_SCREEN_WIDTH, PC_CONNECT_SHARENAME_HEIGHT ); 00464 gtk_widget_set_size_request(g_workgroup, PC_CONNECT_SCREEN_WIDTH, PC_CONNECT_WORKGROUP_HEIGHT ); 00465 gtk_widget_set_size_request(g_user_password, PC_CONNECT_SCREEN_WIDTH, PC_CONNECT_USER_PASSWORD_BK_HEIGHT); 00466 } 00467 else 00468 { 00469 gtk_widget_set_size_request(g_pcname, PC_CONNECT_SCREEN_WIDTH, PC_CONNECT_PCNAME_HEIGHT - 15); 00470 gtk_widget_set_size_request(g_sharename, PC_CONNECT_SCREEN_WIDTH, PC_CONNECT_SHARENAME_HEIGHT - 15); 00471 gtk_widget_set_size_request(g_workgroup, PC_CONNECT_SCREEN_WIDTH, PC_CONNECT_WORKGROUP_HEIGHT - 15); 00472 gtk_widget_set_size_request(g_user_password, PC_CONNECT_SCREEN_WIDTH, PC_CONNECT_USER_PASSWORD_BK_HEIGHT - 15); 00473 } 00474 00475 switch (mode) 00476 { 00477 case e_screen_enter_pcname: 00478 gtk_widget_show(g_pcname); 00479 gtk_settingitem_textentry_grabfocus(GTK_SETTINGITEM_TEXTENTRY(g_pcname)); 00480 gtk_widget_show(g_pcname_info); 00481 gtk_widget_hide(g_sharename); 00482 gtk_widget_hide(g_sharename_info); 00483 gtk_widget_hide(g_workgroup); 00484 gtk_widget_hide(g_workgroup_info); 00485 gtk_widget_hide(g_user_password); 00486 gtk_widget_hide(g_user_password_info); 00487 break; 00488 00489 case e_screen_enter_sharename: 00490 gtk_widget_show(g_pcname); 00491 gtk_widget_hide(g_pcname_info); 00492 gtk_widget_show(g_sharename); 00493 gtk_settingitem_textentry_grabfocus(GTK_SETTINGITEM_TEXTENTRY(g_sharename)); 00494 gtk_widget_show(g_sharename_info); 00495 gtk_widget_hide(g_workgroup); 00496 gtk_widget_hide(g_workgroup_info); 00497 gtk_widget_hide(g_user_password); 00498 gtk_widget_hide(g_user_password_info); 00499 break; 00500 00501 case e_screen_enter_workgroup: 00502 gtk_widget_show(g_pcname); 00503 gtk_widget_hide(g_pcname_info); 00504 gtk_widget_show(g_sharename); 00505 gtk_widget_hide(g_sharename_info); 00506 gtk_widget_show(g_workgroup); 00507 gtk_settingitem_textentry_grabfocus(GTK_SETTINGITEM_TEXTENTRY(g_workgroup)); 00508 gtk_widget_show(g_workgroup_info); 00509 gtk_widget_hide(g_user_password); 00510 gtk_widget_hide(g_user_password_info); 00511 break; 00512 00513 case e_screen_enter_user_password: 00514 gtk_widget_show(g_pcname); 00515 gtk_widget_hide(g_pcname_info); 00516 gtk_widget_show(g_sharename); 00517 gtk_widget_hide(g_sharename_info); 00518 gtk_widget_show(g_workgroup); 00519 gtk_widget_hide(g_workgroup_info); 00520 gtk_widget_show(g_user_password); 00521 gtk_widget_show(g_user_password_info); 00522 gtk_widget_grab_focus(g_user_entry); 00523 break; 00524 00525 case e_screen_show_all: 00526 gtk_widget_show(g_pcname); 00527 gtk_widget_hide(g_pcname_info); 00528 gtk_widget_show(g_sharename); 00529 gtk_widget_hide(g_sharename_info); 00530 gtk_widget_show(g_workgroup); 00531 gtk_widget_hide(g_workgroup_info); 00532 gtk_widget_show(g_user_password); 00533 gtk_widget_hide(g_user_password_info); 00534 break; 00535 00536 default: 00537 /* ignore */ ; 00538 } 00539 display_update_request_screen_refresh(SETUP_PAGE_LAYOUT_CHANGE, WAVEFORM_FULLSCREEN); 00540 } 00541 }

| static void on_password_changed | ( | GtkEditable * | editable, | |
| gpointer | user_data | |||
| ) | [static] |
Definition at line 708 of file iLiadPCConnectScreen.c.
00709 { 00710 ST_LOGPRINTF("entry"); 00711 00712 g_return_if_fail(ERGTK_IS_ENTRY(editable)); 00713 00714 GtkEntry* entry = GTK_ENTRY(editable); 00715 const gchar* value = gtk_entry_get_text(entry); 00716 00717 iLiad_pc_connect_set_profile_field(0, e_pcfield_password, value); 00718 }

| static void on_pcname_button_press | ( | GtkWidget * | widget | ) | [static] |
Definition at line 551 of file iLiadPCConnectScreen.c.
00552 { 00553 ST_LOGPRINTF("entry"); 00554 iLiad_pc_connect_set_screenmode(e_screen_enter_pcname); 00555 }

| static void on_pcname_changed | ( | GtkWidget * | widget, | |
| const gchar * | value | |||
| ) | [static] |
Definition at line 544 of file iLiadPCConnectScreen.c.
00545 { 00546 ST_LOGPRINTF("entry"); 00547 00548 iLiad_pc_connect_set_profile_field(0, e_pcfield_pcname, value); 00549 }

| static void on_pcname_info_button_clicked | ( | GtkWidget * | widget, | |
| const gboolean | button_active | |||
| ) | [static] |
Definition at line 557 of file iLiadPCConnectScreen.c.
00558 { 00559 GtkInfoItem *item = GTK_INFOITEM(widget); 00560 ST_LOGPRINTF("entry"); 00561 00562 if (button_active) 00563 { 00564 gtk_infoitem_set_buttonstate(item, FALSE); 00565 iLiad_pc_connect_set_screenmode(e_screen_enter_sharename); 00566 } 00567 }

| static void on_pcname_validate | ( | GtkWidget * | widget, | |
| const gchar * | text, | |||
| gchar ** | newtext | |||
| ) | [static] |
Definition at line 569 of file iLiadPCConnectScreen.c.
00570 { 00571 gboolean do_split; 00572 const gchar* pcname_old = text; 00573 gchar* pcname_new = NULL; 00574 const gchar* workgroup_old = gtk_settingitem_textentry_gettext(GTK_SETTINGITEM_TEXTENTRY(g_workgroup)); 00575 gchar* workgroup_new = NULL; 00576 00577 ST_LOGPRINTF("entry: text [%s]", text); 00578 00579 // check for domain name in pcname 00580 do_split = pcname_check_split(pcname_old, &pcname_new, workgroup_old, &workgroup_new); 00581 if (do_split) 00582 { 00583 gtk_settingitem_textentry_settext(GTK_SETTINGITEM_TEXTENTRY(g_workgroup), workgroup_new); 00584 iLiad_pc_connect_set_profile_field(0, e_pcfield_pcname, pcname_new ); 00585 iLiad_pc_connect_set_profile_field(0, e_pcfield_workgroup, workgroup_new); 00586 g_free(workgroup_new); 00587 } 00588 *newtext = pcname_new; 00589 }

| static void on_sharename_button_press | ( | GtkWidget * | widget | ) | [static] |
Definition at line 629 of file iLiadPCConnectScreen.c.
00630 { 00631 ST_LOGPRINTF("entry"); 00632 iLiad_pc_connect_set_screenmode(e_screen_enter_sharename); 00633 }

| static void on_sharename_changed | ( | GtkWidget * | widget, | |
| const gchar * | value | |||
| ) | [static] |
Definition at line 622 of file iLiadPCConnectScreen.c.
00623 { 00624 ST_LOGPRINTF("entry"); 00625 00626 iLiad_pc_connect_set_profile_field(0, e_pcfield_sharename, value); 00627 }

| static void on_sharename_info_button_clicked | ( | GtkWidget * | widget, | |
| const gboolean | button_active | |||
| ) | [static] |
Definition at line 635 of file iLiadPCConnectScreen.c.
00636 { 00637 GtkInfoItem *item = GTK_INFOITEM(widget); 00638 ST_LOGPRINTF("entry"); 00639 00640 if (button_active) 00641 { 00642 gtk_infoitem_set_buttonstate(item, FALSE); 00643 iLiad_pc_connect_set_screenmode(e_screen_enter_workgroup); 00644 } 00645 }

| static gboolean on_user_password_button_press | ( | GtkWidget * | widget, | |
| GdkEventButton * | event, | |||
| gpointer | user_data | |||
| ) | [static] |
Definition at line 720 of file iLiadPCConnectScreen.c.
00721 { 00722 ST_LOGPRINTF("entry"); 00723 iLiad_pc_connect_set_screenmode(e_screen_enter_user_password); 00724 00725 return FALSE; // continue GTK signal handling 00726 }

| static void on_user_password_info_button_clicked | ( | GtkWidget * | widget, | |
| const gboolean | button_active | |||
| ) | [static] |
Definition at line 728 of file iLiadPCConnectScreen.c.
00729 { 00730 GtkInfoItem *item = GTK_INFOITEM(widget); 00731 ST_LOGPRINTF("entry"); 00732 00733 if (button_active) 00734 { 00735 gtk_infoitem_set_buttonstate(item, FALSE); 00736 iLiad_pc_connect_set_screenmode(e_screen_show_all); 00737 } 00738 }

| static void on_username_changed | ( | GtkEditable * | editable, | |
| gpointer | user_data | |||
| ) | [static] |
Definition at line 696 of file iLiadPCConnectScreen.c.
00697 { 00698 ST_LOGPRINTF("entry"); 00699 00700 g_return_if_fail(ERGTK_IS_ENTRY(editable)); 00701 00702 GtkEntry* entry = GTK_ENTRY(editable); 00703 const gchar* value = gtk_entry_get_text(entry); 00704 00705 iLiad_pc_connect_set_profile_field(0, e_pcfield_username, value); 00706 }

| static void on_workgroup_button_press | ( | GtkWidget * | widget | ) | [static] |
Definition at line 677 of file iLiadPCConnectScreen.c.
00678 { 00679 ST_LOGPRINTF("entry"); 00680 iLiad_pc_connect_set_screenmode(e_screen_enter_workgroup); 00681 }

| static void on_workgroup_changed | ( | GtkWidget * | widget, | |
| const gchar * | value | |||
| ) | [static] |
Definition at line 648 of file iLiadPCConnectScreen.c.
00649 { 00650 ST_LOGPRINTF("entry"); 00651 00652 iLiad_pc_connect_set_profile_field(0, e_pcfield_workgroup, value); 00653 }

| static void on_workgroup_info_button_clicked | ( | GtkWidget * | widget, | |
| const gboolean | button_active | |||
| ) | [static] |
Definition at line 683 of file iLiadPCConnectScreen.c.
00684 { 00685 GtkInfoItem *item = GTK_INFOITEM(widget); 00686 ST_LOGPRINTF("entry"); 00687 00688 if (button_active) 00689 { 00690 gtk_infoitem_set_buttonstate(item, FALSE); 00691 iLiad_pc_connect_set_screenmode(e_screen_enter_user_password); 00692 } 00693 }

| static void on_workgroup_validate | ( | GtkWidget * | widget, | |
| const gchar * | text, | |||
| gchar ** | newtext | |||
| ) | [static] |
Definition at line 655 of file iLiadPCConnectScreen.c.
00656 { 00657 gboolean do_split; 00658 const gchar* pcname_old = gtk_settingitem_textentry_gettext(GTK_SETTINGITEM_TEXTENTRY(g_pcname)); 00659 gchar* pcname_new = NULL; 00660 const gchar* workgroup_old = text; 00661 gchar* workgroup_new = NULL; 00662 00663 ST_LOGPRINTF("entry: text [%s]", text); 00664 00665 // check for domain name in pcname 00666 do_split = pcname_check_split(pcname_old, &pcname_new, workgroup_old, &workgroup_new); 00667 if (do_split) 00668 { 00669 gtk_settingitem_textentry_settext(GTK_SETTINGITEM_TEXTENTRY(g_pcname), pcname_new); 00670 iLiad_pc_connect_set_profile_field(0, e_pcfield_pcname, pcname_new ); 00671 iLiad_pc_connect_set_profile_field(0, e_pcfield_workgroup, workgroup_new); 00672 g_free(pcname_new); 00673 } 00674 *newtext = workgroup_new; 00675 }

| static gboolean pcname_check_split | ( | const gchar * | pcname_old, | |
| gchar ** | pcname_new, | |||
| const gchar * | workgroup_old, | |||
| gchar ** | workgroup_new | |||
| ) | [static] |
Definition at line 591 of file iLiadPCConnectScreen.c.
00593 { 00594 gboolean do_split = FALSE; // return 00595 gchar* cp; 00596 struct in_addr ip_addr; 00597 00598 ST_LOGPRINTF("entry"); 00599 00600 // check for domain name in pcname 00601 cp = strchr(pcname_old, '.'); 00602 if (cp && inet_aton(pcname_old, &ip_addr) == 0) 00603 { 00604 // pcname seems to contain domain name and is not a valid IP address 00605 if ( workgroup_old[0] == '\0' 00606 || strcmp(cp + 1, workgroup_old) == 0 ) 00607 { 00608 // workgroup is empty or pcname ends on workgroup: 00609 // strip domain from pcname and move it to workgroup 00610 *pcname_new = g_strdup(pcname_old); 00611 cp = strchr(*pcname_new, '.'); 00612 *cp = '\0'; 00613 *workgroup_new = g_strdup(cp + 1); 00614 // report split required 00615 do_split = TRUE; 00616 } 00617 } 00618 return do_split; 00619 }
GtkWidget* g_edit_pc_connect = NULL [static] |
Definition at line 66 of file iLiadPCConnectScreen.c.
GtkWidget* g_password_entry = NULL [static] |
Definition at line 83 of file iLiadPCConnectScreen.c.
GtkWidget* g_password_label = NULL [static] |
Definition at line 82 of file iLiadPCConnectScreen.c.
GtkWidget* g_pcname = NULL [static] |
Definition at line 68 of file iLiadPCConnectScreen.c.
GtkWidget* g_pcname_info = NULL [static] |
Definition at line 69 of file iLiadPCConnectScreen.c.
screen_mode_t g_screen_mode = e_screen_show_all [static] |
Definition at line 63 of file iLiadPCConnectScreen.c.
GtkWidget* g_sharename = NULL [static] |
Definition at line 71 of file iLiadPCConnectScreen.c.
GtkWidget* g_sharename_info = NULL [static] |
Definition at line 72 of file iLiadPCConnectScreen.c.
GtkWidget* g_user_entry = NULL [static] |
Definition at line 81 of file iLiadPCConnectScreen.c.
GtkWidget* g_user_label = NULL [static] |
Definition at line 80 of file iLiadPCConnectScreen.c.
GtkWidget* g_user_password = NULL [static] |
Definition at line 77 of file iLiadPCConnectScreen.c.
GtkWidget* g_user_password_info = NULL [static] |
Definition at line 78 of file iLiadPCConnectScreen.c.
GtkWidget* g_user_password_label = NULL [static] |
Definition at line 79 of file iLiadPCConnectScreen.c.
GtkWidget* g_workgroup = NULL [static] |
Definition at line 74 of file iLiadPCConnectScreen.c.
GtkWidget* g_workgroup_info = NULL [static] |
Definition at line 75 of file iLiadPCConnectScreen.c.
1.5.6