WIP reloading at config page opening; Removed global configuration

pull/300/head
parent 3cc7aab0e5
commit 03d7554362

@ -41,7 +41,7 @@ int yon_bootloader_save(main_window *widgets){
char *user_string = yon_char_parsed_to_string(user_parameters,param_size," ");
yon_char_parsed_free(user_parameters,param_size);
int size;
config_str parameters = yon_config_get_save_parameters_by_key(&size,GRUB_TIMEOUT_parameter,AUTOLOGINUSER_parameter,GRUB_SUPERUSERS_parameter,NULL);
config_str parameters = yon_config_get_save_parameters_by_key(&size,GRUB_TIMEOUT_parameter,GRUB_SUPERUSERS_parameter,NULL);
if (parameters||user_parameters){
char *command_parameters = yon_char_parsed_to_string(parameters,size," -- ");
char *command = yon_char_unite(ubconfig_dull_command,"--target system remove [autoinstall] ",GRUB_PASSWORD_parameter_all,"; ",ubconfig_dull_command,"--target system ",command_parameters, " ", user_string, NULL);
@ -455,6 +455,20 @@ void yon_bootloader_interface_update(main_window *widgets){
}
void yon_bootloader_init(main_window *widgets){
if (!main_config.configure_mode){
int size = 0;
config_str users = yon_config_get_all_by_key(GRUB_PASSWORD_parameter_search,&size);
yon_config_remove_by_list(users,(size_t)size);
yon_config_remove_by_args(GRUB_TIMEOUT_parameter,GRUB_SUPERUSERS_parameter,NULL);
char *command = yon_config_parameter_prepare_command(GRUB_TIMEOUT_parameter,main_config.config_load_path,NULL,NULL);
char *command2 = yon_config_parameter_prepare_command(GRUB_SUPERUSERS_parameter,main_config.config_load_path,NULL,NULL);
char *command3 = yon_config_parameter_prepare_command(GRUB_PASSWORD_parameter_all,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command,command2,command3,NULL);
yon_char_parsed_free(users,size);
free(command);
free(command2);
free(command3);
}
gtk_list_store_clear(widgets->BootloadUsersList);
char *timeout = config(GRUB_TIMEOUT_parameter);
char *os = config(GRUB_DEFAULT_parameter);

@ -36,15 +36,7 @@ int yon_kernel_save(main_window *widgets){
}
if (!main_config.configure_mode){
int size;
config_str parameters = yon_config_get_save_parameters_by_key(&size,packages_parameter, KERNEL_BOOT_parameter,NULL);
if (parameters){
char *command_parameters = yon_char_parsed_to_string(parameters,size," -- ");
char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL);
if (!system(yon_debug_output("%s\n",command))){}
free(command);
yon_char_parsed_free(parameters,size);
}
yon_config_save_args_simple(main_config.config_load_path,packages_parameter, KERNEL_BOOT_parameter,NULL);
}
return 1;
@ -437,6 +429,10 @@ gboolean yon_software_insert(struct row_data *row_input){
}
void yon_software_init(main_window *widgets){
yon_config_remove_by_args(packages_parameter,NULL);
char *command = yon_config_parameter_prepare_command(packages_parameter_command,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command,NULL);
free(command);
GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->AdditionalComponentsList));
GList *iter;
for (iter=list;iter;iter=iter->next){
@ -506,6 +502,10 @@ int yon_pacman_software_save(main_window *widgets){
}
void yon_pacman_init(main_window *widgets){
yon_config_remove_by_args(packages_parameter,NULL);
char *command = yon_config_parameter_prepare_command(packages_parameter_command,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command,NULL);
free(command);
gtk_list_store_clear(widgets->PacmanSoftwareChosenList);
char *pacman_packages = config(packages_parameter);

@ -187,6 +187,14 @@ void yon_kernel_addon_resize(main_window *widgets){
}
void yon_kernel_init(main_window *widgets){
if (!main_config.configure_mode){
yon_config_remove_by_args(packages_parameter,KERNEL_BOOT_parameter,NULL);
char *command = yon_config_parameter_prepare_command(packages_parameter_command,main_config.config_load_path,NULL,NULL);
char *command2 = yon_config_parameter_prepare_command(KERNEL_BOOT_parameter,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command,command2,NULL);
free(command);
free(command2);
}
GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->KernelListBox));
GList *iter;
for (iter = list; iter; iter = iter->next){
@ -392,6 +400,10 @@ void yon_kernel_addon_row_setup(kernel_addon_row *row, char *name, char *modules
}
void yon_kernel_addon_init(main_window *widgets){
yon_config_remove_by_args(packages_parameter,NULL);
char *command = yon_config_parameter_prepare_command(packages_parameter_command,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command,NULL);
free(command);
GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->KernelAddonListBox));
GList *iter;
for (iter = list; iter; iter = iter->next){

@ -49,7 +49,7 @@ int yon_keyboard_save(main_window *widgets){
}
if (!main_config.configure_mode){
int size;
config_str parameters = yon_config_get_save_parameters_by_key(&size,xkbmodel_parameter,xkbmodel_parameter,num_lock_boot_parameter,NULL);
config_str parameters = yon_config_get_save_parameters_by_key(&size,xkbmodel_parameter,num_lock_boot_parameter,NULL);
if (parameters){
char *command_parameters = yon_char_parsed_to_string(parameters,size," -- ");
char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL);
@ -63,6 +63,14 @@ int yon_keyboard_save(main_window *widgets){
}
void yon_keyboard_init(main_window *widgets){
if (!main_config.configure_mode){
yon_config_remove_by_args(xkbmodel_parameter,num_lock_boot_parameter,NULL);
char *command1 = yon_config_parameter_prepare_command(xkbmodel_parameter_command,main_config.config_load_path,NULL,NULL);
char *command2 = yon_config_parameter_prepare_command(num_lock_boot_parameter_command,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command1,command2,NULL);
free(command1);
free(command2);
}
g_signal_handlers_block_by_func(G_OBJECT(widgets->KeyboardModelCombo),G_CALLBACK(on_model_changed),widgets);
g_signal_handlers_block_by_func(G_OBJECT(widgets->KeyboardDefaultLayoutsSwitch),G_CALLBACK(on_layout_default_toggled),widgets);
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->KeyboardModelCombo));

@ -288,5 +288,12 @@ int yon_language_save(main_window *widgets){
}
void yon_language_init(main_window *widgets){
if (!main_config.configure_mode){
yon_config_remove_by_args(lang_parameter, locale_parameter,NULL);
char *command = yon_config_parameter_prepare_command(lang_parameter_command,main_config.config_load_path,NULL,NULL);
char *command2 = yon_config_parameter_prepare_command(locale_parameter_command,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command,command2,NULL);
free(command);
}
yon_language_update(widgets);
}

@ -230,7 +230,7 @@ int yon_network_save(main_window *widgets){
hostname = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->HotnameEntry));
}
if (yon_char_is_empty(hostname)){
yon_ubl_status_box_render(_EMPTY_IMPORTANT_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),_EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(widgets->HotnameEntry);
return 0;
}
@ -326,6 +326,22 @@ int yon_network_save(main_window *widgets){
}
void yon_network_init(main_window *widgets){
if (!main_config.configure_mode){
int size = 0;
config_str users = yon_config_get_all_by_key(NETWORK_parameter_search,&size);
yon_config_remove_by_list(users,(size_t)size);
yon_config_remove_by_args(DOMAIN_parameter,DOMAIN_admanger_parameter,NTPSERVERS_parameter,hostname_parameter,NULL);
char *command = yon_config_parameter_prepare_command(DOMAIN_parameter,main_config.config_load_path,NULL,NULL);
char *command2 = yon_config_parameter_prepare_command(DOMAIN_admanger_parameter,main_config.config_load_path,NULL,NULL);
char *command3 = yon_config_parameter_prepare_command(NTPSERVERS_parameter,main_config.config_load_path,NULL,NULL);
char *command4 = yon_config_parameter_prepare_command(hostname_parameter,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command,command2,command3,command4,NULL);
yon_char_parsed_free(users,size);
free(command);
free(command2);
free(command3);
free(command4);
}
GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->NetworkConnectionsBox));
GList *iter;
for (iter=list;iter;iter=iter->next){

@ -71,6 +71,12 @@ GtkTreeIter *yon_subcategory_check(GtkTreeStore *target, GtkTreeIter *parent_ite
}
void yon_packages_tab_init(main_window *widgets){
if (!main_config.configure_mode){
yon_config_remove_by_args(packages_parameter,NULL);
char *command = yon_config_parameter_prepare_command(packages_parameter_command,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command,NULL);
free(command);
}
gtk_tree_store_clear(widgets->PackagesList);
char *modules = config(modules_parameter);
if (modules&&!strcmp(modules,"auto")){

@ -208,6 +208,7 @@ void yon_navigation_buttons_set_sensetiveness(main_window *widgets){
case YON_PAGE_BOOTLOADER:
case YON_PAGE_PACKAGES:
case YON_PAGE_NETWORK:{
gtk_button_set_label(GTK_BUTTON(widgets->CancelInstallButton),CANCEL_LABEL);
gtk_widget_show(widgets->NextButton);
gtk_widget_hide(widgets->BackButton);
gtk_button_set_label(GTK_BUTTON(widgets->NextButton),BACK_LABEL);
@ -479,6 +480,17 @@ void yon_page_init(main_window *widgets, enum YON_PAGES page){
case YON_PAGE_RECOVERY_USRDATA_ONLY:
case YON_PAGE_INSTALLATION_BEGIN:
yon_install_init(widgets,page);
{
int size=0;
char *command = yon_config_parameter_prepare_command(AUTOINSTALL_TYPE_INSTALL_command,"system",NULL,NULL);
config_str autoinstall_param = yon_config_load(command,&size);
if (size&&!yon_char_is_empty(autoinstall_param[0])&&strcmp(autoinstall_param[0],"(null)\n")&&!main_config.configure_mode){
gtk_widget_show(widgets->StartScenarioButton);
} else {
gtk_widget_hide(widgets->StartScenarioButton);
}
yon_char_parsed_free(autoinstall_param,size);
}
break;
case YON_PAGE_INSTALLATION:
yon_install_slider_init(widgets);

@ -197,6 +197,10 @@ void on_region_entry_changed(GtkWidget *, main_window *widgets){
}
void yon_region_init(main_window *widgets){
yon_config_remove_by_args(zone_parameter,NULL);
char *command = yon_config_parameter_prepare_command(zone_parameter_command,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command,NULL);
free(command);
yon_timezone_init();
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->RegionCombo));
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->KeyboardNumLockCombo));

@ -43,24 +43,9 @@ void on_config_local_load(GtkWidget *,main_window *widgets){
yon_page_init(widgets,gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)));
}
void on_config_global_load(GtkWidget *,main_window *widgets){
if (!yon_char_is_empty(main_config.force_ini)) {
on_config_custom_load_last(NULL,widgets);
return;
}
if (!yon_char_is_empty(main_config.config_load_path)) free(main_config.config_load_path);
main_config.config_load_path = yon_char_new("global");
yon_load_proceed(YON_CONFIG_GLOBAL);
main_config.load_mode=YON_CONFIG_GLOBAL;
yon_main_window_update_locale(widgets);
yon_page_init(widgets,gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)));
}
void on_config_custom_load(GtkWidget *,main_window *){
yon_load_proceed(YON_CONFIG_CUSTOM);
// yon_page_init(widgets,gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)));
main_config.load_mode=YON_CONFIG_CUSTOM;
// yon_main_window_update_locale(widgets);
}
void on_config_custom_load_last(GtkWidget *,main_window *){
@ -69,9 +54,7 @@ void on_config_custom_load_last(GtkWidget *,main_window *){
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
char *command = config_get_command(main_config.config_load_path);
yon_config_load_config(YON_CONFIG_CUSTOM,command,NULL);
// yon_page_init(widgets,gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)));
main_config.load_mode=YON_CONFIG_CUSTOM;
// yon_main_window_update_locale(widgets);
}
void on_config_global_local_save(GtkWidget *,main_window *widgets){

@ -42,6 +42,12 @@ void on_startup_apps_remove(GtkWidget *self,main_window *widgets){
}
void yon_startup_apps_init(main_window *widgets){
if (!main_config.configure_mode){
yon_config_remove_by_args(AUTOEXEC_parameter,NULL);
char *command = yon_config_parameter_prepare_command(AUTOEXEC_parameter_command,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command,NULL);
free(command);
}
GtkTreeIter iter;
gtk_list_store_clear(widgets->StartupAppsList);
int size;

@ -50,6 +50,12 @@ void on_startup_services_remove(GtkWidget *self,main_window *widgets){
}
void yon_startup_services_init(main_window *widgets){
if (!main_config.configure_mode){
yon_config_remove_by_args(SERVICES_ENABLE_parameter,NULL);
char *command = yon_config_parameter_prepare_command(SERVICES_ENABLE_parameter_command,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command,NULL);
free(command);
}
GtkTreeIter iter;
gtk_list_store_clear(widgets->StartupList);
int size;

@ -146,6 +146,19 @@ yon_user_struct *yon_user_struct_new(){
}
void yon_user_init(main_window *widgets){
if (!main_config.configure_mode){
int size = 0;
config_str users = yon_config_get_all_by_key(USERADD_parameter_search,&size);
yon_config_remove_by_list(users,(size_t)size);
yon_config_remove_by_args(autologin_parameter,root_password_parameter,NULL);
char *command1 = yon_config_parameter_prepare_command(autologin_parameter_command,main_config.config_load_path,NULL,NULL);
char *command2 = yon_config_parameter_prepare_command(root_password_parameter_command,main_config.config_load_path,NULL,NULL);
char *command3 = yon_config_parameter_prepare_command(USERADD_parameter_all,main_config.config_load_path,NULL,NULL);
yon_config_load_config(YON_CONFIG_CUSTOM,command1,command2,command3,NULL);
free(command1);
free(command2);
free(command3);
}
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->UserRootPasswordCombo));
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widgets->UserRootPasswordCombo),NULL,DEFAULT_LABEL);
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widgets->UserRootPasswordCombo),NULL,SET_PASSWORD_LABEL);

@ -316,7 +316,6 @@ void yon_main_window_create(main_window *widgets){
widgets->DocumentationMenuItem = yon_ubl_menu_item_documentation_new(DOCUMENTATION_LABEL);
widgets->AboutMenuItem = yon_ubl_menu_item_about_new(ABOUT_LABEL);
widgets->LoadGlobalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"LoadGlobalConfigurationMenuItem");
widgets->LoadLocalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"LoadLocalConfigurationMenuItem");
widgets->LoadExternalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"LoadExternalConfigurationMenuItem");
@ -618,7 +617,6 @@ void yon_main_window_create(main_window *widgets){
{
g_signal_connect(G_OBJECT(widgets->LicenseAgreeRadio),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->NextButton);
g_signal_connect(G_OBJECT(widgets->LoadGlobalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_load),widgets);
g_signal_connect(G_OBJECT(widgets->LoadLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets);
g_signal_connect(G_OBJECT(widgets->LoadExternalConfigurationMenuItem),"activate",G_CALLBACK(on_config_custom_load),widgets);
@ -865,23 +863,11 @@ void yon_main_window_create(main_window *widgets){
g_thread_new("Partitions_thread",(GThreadFunc)yon_partitions_list_load,widgets);
{
if (main_config.lock_load_global == 1){
gtk_widget_set_sensitive(widgets->LoadGlobalConfigurationMenuItem,0);
}
gtk_window_set_title(GTK_WINDOW(widgets->MainWindow),TITLE_LABEL);
gtk_label_set_text(GTK_LABEL(gtk_builder_get_object(builder,"headerTopic")),TITLE_LABEL);
gtk_window_set_icon_name(GTK_WINDOW(widgets->MainWindow),icon_path);
}
gtk_builder_connect_signals(builder,NULL);
if (!yon_char_is_empty(config(AUTOINSTALL_TYPE_INSTALL))){
gtk_widget_show(widgets->StartScenarioButton);
if (main_config.autoinstall){
gtk_button_clicked(GTK_BUTTON(widgets->StartScenarioButton));
}
} else {
gtk_widget_hide(widgets->StartScenarioButton);
}
if (getuid()){
gtk_menu_item_activate(GTK_MENU_ITEM(widgets->ConfigurationModeMenuItem));
if (yon_char_is_empty(main_config.config_save_path)){
@ -983,7 +969,7 @@ int main(int argc, char *argv[]){
{
widgets = yon_main_window_complete();
on_config_global_load(NULL,widgets);
on_config_local_load(NULL,widgets);
}
main_config.launch_arguments=yon_char_parsed_copy(argv,argc);

@ -493,7 +493,6 @@ typedef struct
GtkListStore *LayoutsList;
GtkListStore *PartitionsList;
GtkWidget *LoadGlobalConfigurationMenuItem;
GtkWidget *LoadLocalConfigurationMenuItem;
GtkWidget *LoadExternalConfigurationMenuItem;
@ -1273,7 +1272,6 @@ void on_config_local_save(GtkWidget *, main_window *widgets);
void on_config_global_local_save(GtkWidget *, main_window *widgets);
void on_config_custom_load_last(GtkWidget *, main_window *widgets);
void on_config_custom_load(GtkWidget *, main_window *);
void on_config_global_load(GtkWidget *, main_window *);
void on_config_local_load(GtkWidget *, main_window *widgets);
void yon_config_save_proceed(char *path, YON_CONFIG_TYPE type);
void on_page_next_clicked(GtkWidget *, main_window *widgets);

@ -68,7 +68,7 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="UnitEntry">
<object class="GtkEntry" id="ServiceEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
@ -104,7 +104,7 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="ServiceEntry">
<object class="GtkEntry" id="UnitEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>

@ -207,7 +207,7 @@
<columns>
<!-- column-name Chosen -->
<column type="gboolean"/>
<!-- column-name Name Render -->
<!-- column-name Name -->
<column type="gchararray"/>
<!-- column-name Description -->
<column type="gchararray"/>
@ -621,16 +621,6 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="reserve-toggle-size">False</property>
<child>
<object class="GtkMenuItem" id="LoadGlobalConfigurationMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Load global configuration</property>
<style>
<class name="menuitemtop"/>
</style>
</object>
</child>
<child>
<object class="GtkMenuItem" id="LoadLocalConfigurationMenuItem">
<property name="visible">True</property>
@ -5663,22 +5653,22 @@ Select a different installation source.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Unit</property>
<property name="title" translatable="yes">Service</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">1</attribute>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Service</property>
<property name="title" translatable="yes">Unit</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">2</attribute>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>

Loading…
Cancel
Save