mirror of
https://github.com/lakinduakash/linux-wifi-hotspot.git
synced 2024-11-21 19:40:11 +00:00
Merge pull request #71 from lakinduakash/dev
Fix not initializing correct values at beginning of the program
This commit is contained in:
commit
f05ff0bdf9
37
src/ui/ui.c
37
src/ui/ui.c
@ -438,6 +438,9 @@ void init_ui_from_config(){
|
||||
gtk_entry_set_text(entry_ssd,values->ssid);
|
||||
if(values->pass!=NULL)
|
||||
gtk_entry_set_text(entry_pass,values->pass);
|
||||
|
||||
if(strcmp(values->pass,"")==0|| values->pass==NULL)
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cb_open),TRUE);
|
||||
|
||||
if(values->iface_wifi!=NULL){
|
||||
int idw=find_str(values->iface_wifi,wifi_iface_list,wifi_iface_list_length);
|
||||
@ -455,6 +458,40 @@ void init_ui_from_config(){
|
||||
}
|
||||
}
|
||||
|
||||
if(strcmp(values->hidden,"1")==0){
|
||||
|
||||
gtk_toggle_button_set_active((GtkToggleButton*) cb_hidden,TRUE);
|
||||
}
|
||||
|
||||
if(strcmp(values->use_psk,"1")==0){
|
||||
|
||||
gtk_toggle_button_set_active((GtkToggleButton*) cb_psk,TRUE);
|
||||
}
|
||||
|
||||
if(strcmp(values->channel,"")!=0 && strcmp(values->channel,"default")!=0){
|
||||
gtk_toggle_button_set_active((GtkToggleButton*) cb_channel,TRUE);
|
||||
gtk_entry_set_text(entry_channel,values->channel);
|
||||
}
|
||||
|
||||
if(strcmp(values->freq,"2.4")==0 || strcmp(values->freq,"5")==0 ){
|
||||
|
||||
if(strcmp(values->freq,"2.4")==0){
|
||||
gtk_toggle_button_set_active((GtkToggleButton*) rb_freq_2,TRUE);
|
||||
}
|
||||
else{
|
||||
gtk_toggle_button_set_active((GtkToggleButton*) rb_freq_5,TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
if(strcmp(values->mac,"")!=0){
|
||||
gtk_toggle_button_set_active((GtkToggleButton*) cb_mac,TRUE);
|
||||
gtk_entry_set_text(entry_mac,values->mac);
|
||||
}
|
||||
|
||||
if(strcmp(values->no_virt,"1")==0){
|
||||
gtk_toggle_button_set_active((GtkToggleButton*) cb_novirt,TRUE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user