|
|
|
|
@ -3,8 +3,8 @@
|
|
|
|
|
|
|
|
|
|
int yon_kernel_save(main_window *widgets){
|
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->KernelListBox));
|
|
|
|
|
char *config_val = config(modules_extra_parameter);
|
|
|
|
|
if (yon_char_is_empty(config_val)) yon_config_register(modules_extra_parameter,modules_extra_parameter_command,"");
|
|
|
|
|
char *config_val = config(packages_parameter);
|
|
|
|
|
if (yon_char_is_empty(config_val)) yon_config_register(packages_parameter,packages_parameter_command,"");
|
|
|
|
|
char *enabled_module = NULL;
|
|
|
|
|
int overall_size = 0;
|
|
|
|
|
int active_size = 0;
|
|
|
|
|
@ -12,7 +12,7 @@ int yon_kernel_save(main_window *widgets){
|
|
|
|
|
overall_size++;
|
|
|
|
|
kernel_row *row = g_object_get_data(G_OBJECT(iter->data),"kernel_row");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(row->InstallCheck))){
|
|
|
|
|
yon_config_append_element(modules_extra_parameter,row->package,",");
|
|
|
|
|
yon_config_append_element(packages_parameter,row->package,",");
|
|
|
|
|
active_size++;
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(row->EnableRadio))){
|
|
|
|
|
enabled_module = row->package;
|
|
|
|
|
@ -30,7 +30,7 @@ int yon_kernel_save(main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int yon_kernel_addon_save(main_window *widgets){
|
|
|
|
|
char *parameter = config(modules_extra_parameter);
|
|
|
|
|
char *parameter = config(packages_parameter);
|
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->KernelAddonListBox));
|
|
|
|
|
char *install_modules = yon_char_new(parameter);
|
|
|
|
|
for(GList *iter = list;iter;iter = iter->next){
|
|
|
|
|
@ -43,7 +43,7 @@ int yon_kernel_addon_save(main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(install_modules)){
|
|
|
|
|
yon_config_register(modules_extra_parameter,modules_extra_parameter_command,install_modules);
|
|
|
|
|
yon_config_register(packages_parameter,packages_parameter_command,install_modules);
|
|
|
|
|
free(install_modules);
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
|
@ -234,9 +234,9 @@ void yon_os_components_init(main_window *widgets){
|
|
|
|
|
int yon_software_save(main_window *widgets){
|
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->AdditionalComponentsList));
|
|
|
|
|
GList *iter;
|
|
|
|
|
char *config_val = config(modules_extra_parameter);
|
|
|
|
|
char *config_val = config(packages_parameter);
|
|
|
|
|
if (yon_char_is_empty(config_val)){
|
|
|
|
|
yon_config_register(modules_extra_parameter,modules_extra_parameter_command,"");
|
|
|
|
|
yon_config_register(packages_parameter,packages_parameter_command,"");
|
|
|
|
|
}
|
|
|
|
|
for(iter = list;iter;iter=iter->next){
|
|
|
|
|
os_row *row = g_object_get_data(iter->data,"kernel_row");
|
|
|
|
|
@ -244,7 +244,7 @@ int yon_software_save(main_window *widgets){
|
|
|
|
|
int status = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(row->InstallCheck));
|
|
|
|
|
if (status){
|
|
|
|
|
if (!yon_char_check_element(config_val,target,",")){
|
|
|
|
|
yon_config_append_element(modules_extra_parameter,target,",");
|
|
|
|
|
yon_config_append_element(packages_parameter,target,",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -257,9 +257,9 @@ gboolean yon_software_insert(struct row_data *row_input){
|
|
|
|
|
|
|
|
|
|
main_window *widgets = row_input->widgets;
|
|
|
|
|
gtk_list_box_insert(GTK_LIST_BOX(widgets->AdditionalComponentsList),row->row,-1);
|
|
|
|
|
yon_os_row_setup(row,row_input->name,row_input->version,row_input->tags,_(row_input->description),NULL,NULL);
|
|
|
|
|
yon_os_row_setup(row,row_input->name,row_input->version,row_input->tags,_(row_input->description),NULL,row_input->size);
|
|
|
|
|
|
|
|
|
|
char *modules = config(modules_extra_parameter);
|
|
|
|
|
char *modules = config(packages_parameter);
|
|
|
|
|
if (yon_char_check_element(modules,row_input->name,",")){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(row->InstallCheck),1);
|
|
|
|
|
} else {
|
|
|
|
|
@ -277,35 +277,39 @@ void yon_software_init(main_window *widgets){
|
|
|
|
|
free(row);
|
|
|
|
|
gtk_widget_destroy(GTK_WIDGET(iter->data));
|
|
|
|
|
}
|
|
|
|
|
// int base_size;
|
|
|
|
|
int base_size;
|
|
|
|
|
// config_str base = yon_config_load(get_available_modules_command,&base_size);
|
|
|
|
|
// for (int i=0;i<base_size;i++){
|
|
|
|
|
// yon_char_remove_last_symbol(base[i],'\n');
|
|
|
|
|
// int parsed_size;
|
|
|
|
|
// config_str parsed = yon_char_parse(base[i],&parsed_size,";");
|
|
|
|
|
// struct row_data *row = malloc(sizeof(struct row_data));
|
|
|
|
|
// row->version = parsed[1];
|
|
|
|
|
// row->name = parsed[0];
|
|
|
|
|
// row->tags = yon_char_replace(parsed[2]," ",", ");
|
|
|
|
|
// row->description = parsed[3];
|
|
|
|
|
// row->widgets=widgets;
|
|
|
|
|
// g_idle_add((GSourceFunc)yon_software_insert,row);
|
|
|
|
|
// }
|
|
|
|
|
GList *languages = yon_packages_search_all("ubm-.*");
|
|
|
|
|
for (iter=languages;iter;iter=iter->next){
|
|
|
|
|
char *name = (char*)iter->data;
|
|
|
|
|
yon_packages_info *info_struct = yon_packages_get_info_struct(YON_PACKAGES_ALL,name);
|
|
|
|
|
config_str base = yon_packages_find(YON_PACKAGES_ALL,"ubm-",(gsize*)&base_size);
|
|
|
|
|
for (int i=0;i<base_size;i++){
|
|
|
|
|
struct row_data *row = malloc(sizeof(struct row_data));
|
|
|
|
|
row->version = info_struct->version;
|
|
|
|
|
row->name = info_struct->package_name;
|
|
|
|
|
row->tags = info_struct->groups;
|
|
|
|
|
row->description = info_struct->description;
|
|
|
|
|
row->version = yon_packages_get_version(YON_PACKAGES_ALL,base[i]);
|
|
|
|
|
row->name = yon_char_new(base[i]);
|
|
|
|
|
row->tags = yon_packages_get_groups(YON_PACKAGES_ALL,base[i]);
|
|
|
|
|
row->description = yon_packages_get_description(YON_PACKAGES_ALL,base[i]);
|
|
|
|
|
long size = yon_packages_get_size(YON_PACKAGES_ALL,base[i]);
|
|
|
|
|
char mod = '\0';
|
|
|
|
|
double size_converted = yon_size_long_convert_automatic(size,&mod);
|
|
|
|
|
|
|
|
|
|
char *size_str = yon_char_unite(yon_char_from_double(size_converted)," ", yon_size_get_name_from_letter(mod),NULL);
|
|
|
|
|
row->size = size_str;
|
|
|
|
|
row->widgets=widgets;
|
|
|
|
|
g_idle_add((GSourceFunc)yon_software_insert,row);
|
|
|
|
|
yon_packages_info_struct_free(info_struct);
|
|
|
|
|
}
|
|
|
|
|
// GList *languages = yon_packages_search_all("ubm-.*");
|
|
|
|
|
// for (iter=languages;iter;iter=iter->next){
|
|
|
|
|
// char *name = (char*)iter->data;
|
|
|
|
|
// yon_packages_info *info_struct = yon_package(YON_PACKAGES_ALL,name);
|
|
|
|
|
// struct row_data *row = malloc(sizeof(struct row_data));
|
|
|
|
|
// row->version = info_struct->version;
|
|
|
|
|
// row->name = info_struct->package_name;
|
|
|
|
|
// row->tags = info_struct->groups;
|
|
|
|
|
// row->description = info_struct->description;
|
|
|
|
|
// row->widgets=widgets;
|
|
|
|
|
// g_idle_add((GSourceFunc)yon_software_insert,row);
|
|
|
|
|
// yon_packages_info_struct_free(info_struct);
|
|
|
|
|
// }
|
|
|
|
|
g_idle_add((GSourceFunc)yon_spinner_switch_off,widgets->OSSpinner);
|
|
|
|
|
// yon_char_parsed_free(base,base_size);
|
|
|
|
|
yon_char_parsed_free(base,base_size);
|
|
|
|
|
return ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|