|
|
|
@ -95,19 +95,23 @@ void on_language_window_accept(GtkWidget *,dictionary *dict);
|
|
|
|
void on_language_window_accept(GtkWidget *,dictionary *dict){
|
|
|
|
void on_language_window_accept(GtkWidget *,dictionary *dict){
|
|
|
|
main_window *widgets= yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
main_window *widgets= yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
ubinstall_language_window *window = yon_dictionary_get_data(dict->first->next,ubinstall_language_window*);
|
|
|
|
ubinstall_language_window *window = yon_dictionary_get_data(dict->first->next,ubinstall_language_window*);
|
|
|
|
yon_gtk_list_store_copy_full(widgets->LanguagesList,window->liststore1);
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->DefaultCheck))){
|
|
|
|
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter));
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),"");
|
|
|
|
config_str parsed = NULL;
|
|
|
|
} else {
|
|
|
|
int size;
|
|
|
|
yon_gtk_list_store_copy_full(widgets->LanguagesList,window->liststore1);
|
|
|
|
GtkTreeIter iter;
|
|
|
|
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter));
|
|
|
|
for_iter(GTK_TREE_MODEL(window->liststore1),&iter){
|
|
|
|
config_str parsed = NULL;
|
|
|
|
char *current;
|
|
|
|
int size;
|
|
|
|
int status;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->liststore1),&iter,0,&status,1,¤t,-1);
|
|
|
|
for_iter(GTK_TREE_MODEL(window->liststore1),&iter){
|
|
|
|
if (status)
|
|
|
|
char *current;
|
|
|
|
yon_char_parsed_add_or_create_if_exists(parsed,&size,current);
|
|
|
|
int status;
|
|
|
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->liststore1),&iter,0,&status,1,¤t,-1);
|
|
|
|
|
|
|
|
if (status)
|
|
|
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(parsed,&size,current);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),yon_char_parsed_to_string(parsed,size,", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),yon_char_parsed_to_string(parsed,size,", "));
|
|
|
|
|
|
|
|
on_subwindow_close(window->MainWindow);
|
|
|
|
on_subwindow_close(window->MainWindow);
|
|
|
|
free(window);
|
|
|
|
free(window);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -167,7 +171,7 @@ void config_init(){
|
|
|
|
main_config.slider_thread=0;
|
|
|
|
main_config.slider_thread=0;
|
|
|
|
main_config.config_save_thread=NULL;
|
|
|
|
main_config.config_save_thread=NULL;
|
|
|
|
main_config.install_thread=NULL;
|
|
|
|
main_config.install_thread=NULL;
|
|
|
|
main_config.progress_thread=NULL;
|
|
|
|
main_config.progress_thread=0;
|
|
|
|
main_config.install_complete=0;
|
|
|
|
main_config.install_complete=0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -281,15 +285,15 @@ void *yon_installation_start(main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void *yon_installation_progress_update(void *data);
|
|
|
|
gboolean yon_installation_progress_update(void *data);
|
|
|
|
void *yon_installation_progress_update(void *data){
|
|
|
|
gboolean yon_installation_progress_update(void *data){
|
|
|
|
main_window *widgets = (main_window*)data;
|
|
|
|
main_window *widgets = (main_window*)data;
|
|
|
|
FILE *file = NULL;
|
|
|
|
FILE *file = NULL;
|
|
|
|
char *current = g_malloc0(4096);
|
|
|
|
char *current = g_malloc0(4096);
|
|
|
|
clock_t last_time = 0;
|
|
|
|
clock_t last_time = 0;
|
|
|
|
clock_t current_time;
|
|
|
|
clock_t current_time;
|
|
|
|
while (main_config.install_thread){
|
|
|
|
|
|
|
|
while (1){
|
|
|
|
while (1){
|
|
|
|
|
|
|
|
while (gtk_events_pending()) gtk_main_iteration();
|
|
|
|
current_time = clock();
|
|
|
|
current_time = clock();
|
|
|
|
if ((double)(current_time - last_time) / CLOCKS_PER_SEC >= 0.5){
|
|
|
|
if ((double)(current_time - last_time) / CLOCKS_PER_SEC >= 0.5){
|
|
|
|
if (!file)
|
|
|
|
if (!file)
|
|
|
|
@ -304,7 +308,7 @@ void *yon_installation_progress_update(void *data){
|
|
|
|
free(yon_char_divide(current_copy,0));
|
|
|
|
free(yon_char_divide(current_copy,0));
|
|
|
|
free(yon_char_divide(percentage,0));
|
|
|
|
free(yon_char_divide(percentage,0));
|
|
|
|
if (strcmp(percentage,"#pb")){
|
|
|
|
if (strcmp(percentage,"#pb")){
|
|
|
|
double fraction = atof(percentage);
|
|
|
|
double fraction = atof(percentage);
|
|
|
|
gtk_label_set_text(GTK_LABEL(widgets->InstallationLabel),current_copy);
|
|
|
|
gtk_label_set_text(GTK_LABEL(widgets->InstallationLabel),current_copy);
|
|
|
|
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress),fraction/100);
|
|
|
|
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress),fraction/100);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -312,11 +316,12 @@ void *yon_installation_progress_update(void *data){
|
|
|
|
config_str parsed = yon_char_parse(current_copy,&size," ");
|
|
|
|
config_str parsed = yon_char_parse(current_copy,&size," ");
|
|
|
|
double fraction = atof(parsed[3])/100;
|
|
|
|
double fraction = atof(parsed[3])/100;
|
|
|
|
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),fraction/100);
|
|
|
|
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),fraction/100);
|
|
|
|
parsed = yon_char_parsed_rip(parsed,&size,3);
|
|
|
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),yon_char_parsed_to_string(parsed,size," "));
|
|
|
|
gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),yon_char_parsed_to_string(parsed,size," "));
|
|
|
|
|
|
|
|
yon_char_parsed_free(parsed,size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
last_time = current_time;
|
|
|
|
last_time = current_time;
|
|
|
|
|
|
|
|
free(current_copy);
|
|
|
|
|
|
|
|
free(percentage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -326,8 +331,9 @@ void *yon_installation_progress_update(void *data){
|
|
|
|
fclose(file);
|
|
|
|
fclose(file);
|
|
|
|
file=NULL;
|
|
|
|
file=NULL;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
if (main_config.install_thread){
|
|
|
|
return NULL;
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
} else return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets);
|
|
|
|
void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets);
|
|
|
|
@ -363,7 +369,7 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){
|
|
|
|
// if (!main_config.install_thread&&!main_config.install_complete)
|
|
|
|
// if (!main_config.install_thread&&!main_config.install_complete)
|
|
|
|
// main_config.install_thread = g_thread_new("InstallThread",(GThreadFunc)yon_installation_start,widgets);
|
|
|
|
// main_config.install_thread = g_thread_new("InstallThread",(GThreadFunc)yon_installation_start,widgets);
|
|
|
|
if (!main_config.progress_thread)
|
|
|
|
if (!main_config.progress_thread)
|
|
|
|
main_config.progress_thread = g_thread_new("ProgressThread",(GThreadFunc)yon_installation_progress_update,widgets);
|
|
|
|
main_config.progress_thread = gdk_threads_add_timeout(500,(GSourceFunc)yon_installation_progress_update,widgets);
|
|
|
|
|
|
|
|
|
|
|
|
if (!main_config.slider_thread)
|
|
|
|
if (!main_config.slider_thread)
|
|
|
|
main_config.slider_thread = g_timeout_add(5000,(GSourceFunc)on_image_slide,widgets);
|
|
|
|
main_config.slider_thread = g_timeout_add(5000,(GSourceFunc)on_image_slide,widgets);
|
|
|
|
@ -395,6 +401,34 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void *on_setup_system_configuration(void *);
|
|
|
|
|
|
|
|
void *on_setup_system_configuration(void *){
|
|
|
|
|
|
|
|
int size;
|
|
|
|
|
|
|
|
config_str all_parameters = yon_config_get_selection_by_key(&size,
|
|
|
|
|
|
|
|
user_gecos_parameter,
|
|
|
|
|
|
|
|
user_password_parameter,
|
|
|
|
|
|
|
|
root_password_parameter,
|
|
|
|
|
|
|
|
autologin_parameter,
|
|
|
|
|
|
|
|
xkbmodel_parameter,
|
|
|
|
|
|
|
|
xkblayout_parameter,
|
|
|
|
|
|
|
|
xkbvariant_parameter,
|
|
|
|
|
|
|
|
xkboptions_parameter,
|
|
|
|
|
|
|
|
hostname_parameter,
|
|
|
|
|
|
|
|
zone_parameter,
|
|
|
|
|
|
|
|
lang_parameter,
|
|
|
|
|
|
|
|
locale_parameter,
|
|
|
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (all_parameters){
|
|
|
|
|
|
|
|
char *parameter_string = yon_char_parsed_to_string(all_parameters,size," ");
|
|
|
|
|
|
|
|
char *command = set_user_config_command(parameter_string);
|
|
|
|
|
|
|
|
if (system(command)){};
|
|
|
|
|
|
|
|
yon_char_parsed_free(all_parameters,size);
|
|
|
|
|
|
|
|
free(command);
|
|
|
|
|
|
|
|
if (parameter_string) free(parameter_string);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_page_navigation_clicked(GtkWidget *self, main_window *widgets);
|
|
|
|
void on_page_navigation_clicked(GtkWidget *self, main_window *widgets);
|
|
|
|
void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
int mode = self==widgets->NextButton ? 1 : self == widgets->BackButton ? -1 : self==widgets->CancelInstallButton?-2:0;
|
|
|
|
int mode = self==widgets->NextButton ? 1 : self == widgets->BackButton ? -1 : self==widgets->CancelInstallButton?-2:0;
|
|
|
|
@ -436,28 +470,28 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),ZONE_EMPTY_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),ZONE_EMPTY_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
yon_ubl_status_highlight_incorrect(widgets->ZoneCombo);
|
|
|
|
yon_ubl_status_highlight_incorrect(widgets->ZoneCombo);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
} else if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->AvailableLanguagesEntry)))){
|
|
|
|
}
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),LANGUAGES_EMPTY_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
char *languages = "";
|
|
|
|
yon_ubl_status_highlight_incorrect(widgets->AvailableLanguagesEntry);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
} else if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->LanguagesCombo))==-1){
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),LOCALE_EMPTY_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
yon_ubl_status_highlight_incorrect(widgets->LanguagesCombo);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
char *region = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo));
|
|
|
|
|
|
|
|
char *zone = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo));
|
|
|
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->LanguagesFilter);
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->LanguagesFilter);
|
|
|
|
char *languages = "";
|
|
|
|
|
|
|
|
char *lang_code=NULL;
|
|
|
|
char *lang_code=NULL;
|
|
|
|
for_iter(model,&iter){
|
|
|
|
for_iter(model,&iter){
|
|
|
|
gtk_tree_model_get(model,&iter,1,&lang_code,-1);
|
|
|
|
gtk_tree_model_get(model,&iter,1,&lang_code,-1);
|
|
|
|
yon_char_unite(languages,",",lang_code,NULL);
|
|
|
|
languages = yon_char_unite(languages,",",lang_code,NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
char *language = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->LanguagesCombo));
|
|
|
|
if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->AvailableLanguagesEntry)))){
|
|
|
|
yon_config_register(locale_parameter,locale_parameter_command,languages);
|
|
|
|
yon_config_remove_by_key(locale_parameter);
|
|
|
|
yon_config_register(lang_parameter,lang_parameter_command,language);
|
|
|
|
} else {
|
|
|
|
|
|
|
|
yon_config_register(locale_parameter,locale_parameter_command,languages);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->LanguagesCombo))==-1){
|
|
|
|
|
|
|
|
yon_config_remove_by_key(lang_parameter);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
char *language = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->LanguagesCombo));
|
|
|
|
|
|
|
|
yon_config_register(lang_parameter,lang_parameter_command,language);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
char *region = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo));
|
|
|
|
|
|
|
|
char *zone = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo));
|
|
|
|
yon_config_register(zone_parameter,zone_parameter_command,yon_char_unite(region,"/",zone,NULL));
|
|
|
|
yon_config_register(zone_parameter,zone_parameter_command,yon_char_unite(region,"/",zone,NULL));
|
|
|
|
|
|
|
|
|
|
|
|
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page+1);
|
|
|
|
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page+1);
|
|
|
|
@ -596,45 +630,103 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION_BEGIN);
|
|
|
|
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION_BEGIN);
|
|
|
|
}break;
|
|
|
|
}break;
|
|
|
|
case YON_PAGE_USERS:{ //users
|
|
|
|
case YON_PAGE_USERS:{ //users
|
|
|
|
|
|
|
|
|
|
|
|
if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)))){
|
|
|
|
if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)))){
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
yon_config_remove_by_key(user_gecos_parameter);
|
|
|
|
yon_ubl_status_highlight_incorrect(widgets->UserNameEntry);
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
char *username = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry));
|
|
|
|
} else if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->LoginEntry)))){
|
|
|
|
yon_config_register(user_gecos_parameter,user_gecos_parameter_command,username);
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
}
|
|
|
|
yon_ubl_status_highlight_incorrect(widgets->LoginEntry);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->PasswordCombo))==1&&yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->PasswordEntry)))){
|
|
|
|
if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->LoginEntry)))){
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
yon_config_remove_by_key(user_name_parameter);
|
|
|
|
yon_ubl_status_highlight_incorrect(widgets->PasswordEntry);
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
char *login = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry));
|
|
|
|
|
|
|
|
yon_config_register(user_name_parameter,user_name_parameter_command,login);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo))==1&&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 if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->HotnameEntry)))){
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
yon_config_register(user_password_parameter,user_password_parameter_command,PASSWORD_DEFAULT);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo))==1){
|
|
|
|
yon_ubl_status_highlight_incorrect(widgets->HotnameEntry);
|
|
|
|
if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->AdminPasswordEntry)))){
|
|
|
|
return;
|
|
|
|
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_register(user_password_parameter,user_password_parameter_command,PASSWORD_DEFAULT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
char *username = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry));
|
|
|
|
|
|
|
|
char *login = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry));
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck))){
|
|
|
|
char *password = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry));
|
|
|
|
yon_config_register(hostname_parameter,hostname_parameter_command,"auto");
|
|
|
|
char *root_password = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry));
|
|
|
|
} else {
|
|
|
|
char *hostname = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry));
|
|
|
|
if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->HotnameEntry)))){
|
|
|
|
|
|
|
|
yon_config_remove_by_key(hostname_parameter);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
char *hostname = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry));
|
|
|
|
|
|
|
|
yon_config_register(hostname_parameter,hostname_parameter_command,hostname);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char *autologin = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutologinCheck))?"yes":"no";
|
|
|
|
char *autologin = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutologinCheck))?"yes":"no";
|
|
|
|
yon_config_register(user_name_parameter,user_name_parameter_command,login);
|
|
|
|
|
|
|
|
yon_config_register(user_gecos_parameter,user_gecos_parameter_command,username);
|
|
|
|
|
|
|
|
yon_config_register(user_password_parameter,user_password_parameter_command,password);
|
|
|
|
|
|
|
|
yon_config_register(root_password_parameter,root_password_parameter_command,root_password);
|
|
|
|
|
|
|
|
yon_config_register(autologin_parameter,autologin_parameter_command,autologin);
|
|
|
|
yon_config_register(autologin_parameter,autologin_parameter_command,autologin);
|
|
|
|
yon_config_register(xkbmodel_parameter,xkbmodel_parameter_command,hostname);
|
|
|
|
|
|
|
|
yon_config_register(hostname_parameter,hostname_parameter_command,root_password);
|
|
|
|
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);
|
|
|
|
|
|
|
|
free(locales);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
char *model = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo));
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(model)){
|
|
|
|
|
|
|
|
yon_config_register(xkbmodel_parameter,xkbmodel_parameter_command,model);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
yon_config_remove_by_key(xkbmodel_parameter);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char *options = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo));
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(options)){
|
|
|
|
|
|
|
|
yon_config_register(xkboptions_parameter,xkboptions_parameter_command,options);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
yon_config_remove_by_key(xkboptions_parameter);
|
|
|
|
|
|
|
|
}
|
|
|
|
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION);
|
|
|
|
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION);
|
|
|
|
|
|
|
|
if (gtk_progress_bar_get_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress))>0.9){
|
|
|
|
|
|
|
|
pthread_t tid;
|
|
|
|
|
|
|
|
pthread_create(&tid,NULL,on_setup_system_configuration,NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
gtk_widget_set_sensitive(widgets->CancelInstallButton,0);
|
|
|
|
gtk_widget_set_sensitive(widgets->CancelInstallButton,0);
|
|
|
|
gtk_widget_set_sensitive(widgets->NextButton,0);
|
|
|
|
gtk_widget_set_sensitive(widgets->NextButton,0);
|
|
|
|
gtk_widget_set_sensitive(widgets->BackButton,0);
|
|
|
|
gtk_widget_set_sensitive(widgets->BackButton,0);
|
|
|
|
@ -839,6 +931,11 @@ void on_same_installation_device_changed(GtkWidget *, main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_gparted_open();
|
|
|
|
|
|
|
|
void on_gparted_open(){
|
|
|
|
|
|
|
|
yon_launch_app_with_arguments(open_gparted_command,NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_main_window_complete(main_window *widgets)
|
|
|
|
/**yon_main_window_complete(main_window *widgets)
|
|
|
|
* [EN]
|
|
|
|
* [EN]
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -862,6 +959,7 @@ main_window *yon_main_window_complete(){
|
|
|
|
widgets->SectionsToggle=yon_gtk_builder_get_widget(builder,"SectionsToggle");
|
|
|
|
widgets->SectionsToggle=yon_gtk_builder_get_widget(builder,"SectionsToggle");
|
|
|
|
widgets->UsersToggle=yon_gtk_builder_get_widget(builder,"USersToggle");
|
|
|
|
widgets->UsersToggle=yon_gtk_builder_get_widget(builder,"USersToggle");
|
|
|
|
widgets->SummaryToggle=yon_gtk_builder_get_widget(builder,"SummaryToggle");
|
|
|
|
widgets->SummaryToggle=yon_gtk_builder_get_widget(builder,"SummaryToggle");
|
|
|
|
|
|
|
|
widgets->CompletionToggle=yon_gtk_builder_get_widget(builder,"CompletionToggle");
|
|
|
|
widgets->InstallationToggle=yon_gtk_builder_get_widget(builder,"InstallationToggle");
|
|
|
|
widgets->InstallationToggle=yon_gtk_builder_get_widget(builder,"InstallationToggle");
|
|
|
|
widgets->LanguageCombo=yon_gtk_builder_get_widget(builder,"LanguageCombo");
|
|
|
|
widgets->LanguageCombo=yon_gtk_builder_get_widget(builder,"LanguageCombo");
|
|
|
|
widgets->RegionCombo=yon_gtk_builder_get_widget(builder,"RegionCombo");
|
|
|
|
widgets->RegionCombo=yon_gtk_builder_get_widget(builder,"RegionCombo");
|
|
|
|
@ -891,6 +989,7 @@ main_window *yon_main_window_complete(){
|
|
|
|
widgets->AdminPasswordEntry=yon_gtk_builder_get_widget(builder,"AdminPasswordEntry");
|
|
|
|
widgets->AdminPasswordEntry=yon_gtk_builder_get_widget(builder,"AdminPasswordEntry");
|
|
|
|
widgets->AdminPasswordButton=yon_gtk_builder_get_widget(builder,"AdminPasswordButton");
|
|
|
|
widgets->AdminPasswordButton=yon_gtk_builder_get_widget(builder,"AdminPasswordButton");
|
|
|
|
widgets->HotnameEntry=yon_gtk_builder_get_widget(builder,"HotnameEntry");
|
|
|
|
widgets->HotnameEntry=yon_gtk_builder_get_widget(builder,"HotnameEntry");
|
|
|
|
|
|
|
|
widgets->AutoHostnameCheck=yon_gtk_builder_get_widget(builder,"AutoHostnameCheck");
|
|
|
|
widgets->CancelInstallButton=yon_gtk_builder_get_widget(builder,"CancelInstallButton");
|
|
|
|
widgets->CancelInstallButton=yon_gtk_builder_get_widget(builder,"CancelInstallButton");
|
|
|
|
widgets->BackButton=yon_gtk_builder_get_widget(builder,"BackButton");
|
|
|
|
widgets->BackButton=yon_gtk_builder_get_widget(builder,"BackButton");
|
|
|
|
widgets->NextButton=yon_gtk_builder_get_widget(builder,"NextButton");
|
|
|
|
widgets->NextButton=yon_gtk_builder_get_widget(builder,"NextButton");
|
|
|
|
@ -932,6 +1031,9 @@ main_window *yon_main_window_complete(){
|
|
|
|
widgets->CommonInstallationFilesystemTypeCombo = yon_gtk_builder_get_widget(builder,"CommonInstallationFilesystemTypeCombo");
|
|
|
|
widgets->CommonInstallationFilesystemTypeCombo = yon_gtk_builder_get_widget(builder,"CommonInstallationFilesystemTypeCombo");
|
|
|
|
widgets->CommonInstallationSectionNameEntry = yon_gtk_builder_get_widget(builder,"CommonInstallationSectionNameEntry");
|
|
|
|
widgets->CommonInstallationSectionNameEntry = yon_gtk_builder_get_widget(builder,"CommonInstallationSectionNameEntry");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
widgets->GpartedNearButton = yon_gtk_builder_get_widget(builder,"GpartedNearButton");
|
|
|
|
|
|
|
|
widgets->GpartedSameButton = yon_gtk_builder_get_widget(builder,"GpartedSameButton");
|
|
|
|
|
|
|
|
|
|
|
|
widgets->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
|
|
|
|
widgets->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
|
|
|
|
widgets->AdditionalSoftwareCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"AdditionalSoftwareCell"));
|
|
|
|
widgets->AdditionalSoftwareCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"AdditionalSoftwareCell"));
|
|
|
|
|
|
|
|
|
|
|
|
@ -942,6 +1044,9 @@ main_window *yon_main_window_complete(){
|
|
|
|
widgets->AdditionalSoftwareList = GTK_LIST_STORE(gtk_builder_get_object(builder,"AdditionalSoftwareList"));
|
|
|
|
widgets->AdditionalSoftwareList = GTK_LIST_STORE(gtk_builder_get_object(builder,"AdditionalSoftwareList"));
|
|
|
|
widgets->PartitionsList = GTK_LIST_STORE(gtk_builder_get_object(builder,"PartitionsList"));
|
|
|
|
widgets->PartitionsList = GTK_LIST_STORE(gtk_builder_get_object(builder,"PartitionsList"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->GpartedSameButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->GpartedNearButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->Notebook),"switch-page",G_CALLBACK(on_page_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->Notebook),"switch-page",G_CALLBACK(on_page_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainWindow),"check-resize",G_CALLBACK(on_region_resized),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainWindow),"check-resize",G_CALLBACK(on_region_resized),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->BackButton),"clicked",G_CALLBACK(on_page_navigation_clicked),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->BackButton),"clicked",G_CALLBACK(on_page_navigation_clicked),widgets);
|
|
|
|
@ -958,6 +1063,7 @@ main_window *yon_main_window_complete(){
|
|
|
|
g_signal_connect(G_OBJECT(widgets->LocationToggle),"toggled",G_CALLBACK(on_toggle_block),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->LocationToggle),"toggled",G_CALLBACK(on_toggle_block),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SectionsToggle),"toggled",G_CALLBACK(on_toggle_block),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SectionsToggle),"toggled",G_CALLBACK(on_toggle_block),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->InstallationToggle),"toggled",G_CALLBACK(on_toggle_block),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->InstallationToggle),"toggled",G_CALLBACK(on_toggle_block),NULL);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->CompletionToggle),"toggled",G_CALLBACK(on_toggle_block),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->InstallationNearSysDevicesTree),"cursor-changed",G_CALLBACK(on_near_installation_device_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->InstallationNearSysDevicesTree),"cursor-changed",G_CALLBACK(on_near_installation_device_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SamePlaceDeviceTree),"cursor-changed",G_CALLBACK(on_near_installation_device_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SamePlaceDeviceTree),"cursor-changed",G_CALLBACK(on_near_installation_device_changed),widgets);
|
|
|
|
|
|
|
|
|
|
|
|
@ -969,6 +1075,8 @@ main_window *yon_main_window_complete(){
|
|
|
|
g_signal_connect(G_OBJECT(widgets->AdditionalSoftwareCell),"toggled",G_CALLBACK(on_additional_software_toggled),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->AdditionalSoftwareCell),"toggled",G_CALLBACK(on_additional_software_toggled),widgets);
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->ManualLayoutRadio),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),gtk_widget_get_parent(gtk_widget_get_parent(widgets->AddButton)));
|
|
|
|
g_signal_connect(G_OBJECT(widgets->ManualLayoutRadio),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),gtk_widget_get_parent(gtk_widget_get_parent(widgets->AddButton)));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->AutoHostnameCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->HotnameEntry);
|
|
|
|
// g_signal_connect(G_OBJECT(widgets->InstallationToggle),"toggled",G_CALLBACK(on_toggle_block),widgets);
|
|
|
|
// g_signal_connect(G_OBJECT(widgets->InstallationToggle),"toggled",G_CALLBACK(on_toggle_block),widgets);
|
|
|
|
|
|
|
|
|
|
|
|
gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter),0);
|
|
|
|
gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter),0);
|
|
|
|
|