diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 170dc3e..86abd05 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -1672,112 +1672,112 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ case YON_PAGE_USERS:{ //users - if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)))||!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->UsernameSensitiveCheck))){ - yon_config_remove_by_key(user_gecos_parameter); - } else { - char *username = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)); - yon_config_register(user_gecos_parameter,user_gecos_parameter_command,username); - } - - if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->LoginEntry)))||!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->LoginSensitiveCheck))){ - yon_config_remove_by_key(user_name_parameter); - } else { - char *login = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->LoginEntry)); - yon_config_register(user_name_parameter,user_name_parameter_command,login); - - } - - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->PasswordSensitiveCheck))){ - if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->PasswordCombo))==1){ - if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->PasswordEntry)))){ - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - yon_ubl_status_highlight_incorrect(widgets->PasswordEntry); - return; - } else { - char *password = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->PasswordEntry)); + // if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)))||!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->UsernameSensitiveCheck))){ + // yon_config_remove_by_key(user_gecos_parameter); + // } else { + // char *username = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)); + // yon_config_register(user_gecos_parameter,user_gecos_parameter_command,username); + // } + + // if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->LoginEntry)))||!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->LoginSensitiveCheck))){ + // yon_config_remove_by_key(user_name_parameter); + // } else { + // char *login = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->LoginEntry)); + // yon_config_register(user_name_parameter,user_name_parameter_command,login); + + // } + + // if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->PasswordSensitiveCheck))){ + // if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->PasswordCombo))==1){ + // if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->PasswordEntry)))){ + // yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + // yon_ubl_status_highlight_incorrect(widgets->PasswordEntry); + // return; + // } else { + // char *password = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->PasswordEntry)); - yon_config_register(user_password_parameter,user_password_parameter_command,password); + // yon_config_register(user_password_parameter,user_password_parameter_command,password); - } - } else { - yon_config_remove_by_key(user_password_parameter); - } - }else { - yon_config_remove_by_key(user_password_parameter); - - } - - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->RootPasswordSensitiveCheck))){ - if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo))==1){ - if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->AdminPasswordEntry)))){ - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - yon_ubl_status_highlight_incorrect(widgets->AdminPasswordEntry); - return; - } else { - char *root_password = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->AdminPasswordEntry)); - yon_config_register(root_password_parameter,root_password_parameter_command,root_password); + // } + // } else { + // yon_config_remove_by_key(user_password_parameter); + // } + // }else { + // yon_config_remove_by_key(user_password_parameter); + + // } + + // if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->RootPasswordSensitiveCheck))){ + // if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo))==1){ + // if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->AdminPasswordEntry)))){ + // yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + // yon_ubl_status_highlight_incorrect(widgets->AdminPasswordEntry); + // return; + // } else { + // char *root_password = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->AdminPasswordEntry)); + // yon_config_register(root_password_parameter,root_password_parameter_command,root_password); - } - } else { - yon_config_remove_by_key(root_password_parameter); - } - } else { - yon_config_remove_by_key(root_password_parameter); - } - - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->HostnameSensitiveCheck))){ - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck))){ - yon_config_register(hostname_parameter,hostname_parameter_command,"auto"); - } else { - if (!yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->HotnameEntry)))){ - char *hostname = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->HotnameEntry)); - yon_config_register(hostname_parameter,hostname_parameter_command,hostname); - - } else { - yon_config_remove_by_key(hostname_parameter); + // } + // } else { + // yon_config_remove_by_key(root_password_parameter); + // } + // } else { + // yon_config_remove_by_key(root_password_parameter); + // } + + // if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->HostnameSensitiveCheck))){ + // if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck))){ + // yon_config_register(hostname_parameter,hostname_parameter_command,"auto"); + // } else { + // if (!yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->HotnameEntry)))){ + // char *hostname = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->HotnameEntry)); + // yon_config_register(hostname_parameter,hostname_parameter_command,hostname); + + // } else { + // yon_config_remove_by_key(hostname_parameter); - } - } - } else { - yon_config_remove_by_key(hostname_parameter); - } + // } + // } + // } else { + // yon_config_remove_by_key(hostname_parameter); + // } - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutologinSensitiveCheck))){ - char *autologin = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutologinCheck))?"yes":"no"; - yon_config_register(autologin_parameter,autologin_parameter_command,autologin); - } else { - yon_config_remove_by_key(autologin_parameter); - } - - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->LayoutSensitiveCheck))){ - GtkTreeIter iter; - if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->LayoutsFilter),&iter)){ - char *locales=""; - for_iter (GTK_TREE_MODEL(widgets->LayoutsFilter),&iter){ - char *id; - int status; - gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutsFilter),&iter,0,&id,3,&status,-1); - if (status){ - char *temp = yon_char_unite(locales,!yon_char_is_empty(locales)?",":"",id,NULL); - locales=temp; - } - } - if (!yon_char_is_empty(locales)){ - yon_config_register(xkblayout_parameter,xkblayout_parameter_command,locales); - } else { - yon_config_remove_by_key(xkblayout_parameter); - } - } - } else { - yon_config_remove_by_key(xkblayout_parameter); - } - - if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->LayoutBindingCombo))&>k_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->OptionsSensitiveCheck))){ - char *options = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo)); - yon_config_register(xkboptions_parameter,xkboptions_parameter_command,options); - } else { - yon_config_remove_by_key(xkboptions_parameter); - } + // if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutologinSensitiveCheck))){ + // char *autologin = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutologinCheck))?"yes":"no"; + // yon_config_register(autologin_parameter,autologin_parameter_command,autologin); + // } else { + // yon_config_remove_by_key(autologin_parameter); + // } + + // if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->LayoutSensitiveCheck))){ + // GtkTreeIter iter; + // if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->LayoutsFilter),&iter)){ + // char *locales=""; + // for_iter (GTK_TREE_MODEL(widgets->LayoutsFilter),&iter){ + // char *id; + // int status; + // gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutsFilter),&iter,0,&id,3,&status,-1); + // if (status){ + // char *temp = yon_char_unite(locales,!yon_char_is_empty(locales)?",":"",id,NULL); + // locales=temp; + // } + // } + // if (!yon_char_is_empty(locales)){ + // yon_config_register(xkblayout_parameter,xkblayout_parameter_command,locales); + // } else { + // yon_config_remove_by_key(xkblayout_parameter); + // } + // } + // } else { + // yon_config_remove_by_key(xkblayout_parameter); + // } + + // if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->LayoutBindingCombo))&>k_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->OptionsSensitiveCheck))){ + // char *options = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo)); + // yon_config_register(xkboptions_parameter,xkboptions_parameter_command,options); + // } else { + // yon_config_remove_by_key(xkboptions_parameter); + // } if (!main_config.configure_mode){ yon_debug_output("%s\n","Entered saving");