diff --git a/source/ubinstall-gtk-config-hub.c b/source/ubinstall-gtk-config-hub.c index 1aef884..61415eb 100644 --- a/source/ubinstall-gtk-config-hub.c +++ b/source/ubinstall-gtk-config-hub.c @@ -27,6 +27,7 @@ int yon_configuration_hub_save(main_window *){ DOMAIN_admanger_parameter, KERNEL_BOOT_parameter, SERVICES_ENABLE_parameter, + AUTOEXEC_parameter, GRUB_SUPERUSERS_parameter, GRUB_TIMEOUT_parameter, GRUB_DEFAULT_parameter, diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index d937eea..a6421fb 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -210,6 +210,9 @@ int yon_page_save(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_STARTUP: return yon_startup_save(widgets); break; + case YON_PAGE_APP_STARTUP: + return yon_startup_app_save(widgets); + break; case YON_PAGE_BOOTLOADER: return yon_bootloader_save(widgets); break; diff --git a/source/ubinstall-gtk-startup-apps.c b/source/ubinstall-gtk-startup-apps.c index 26e8d45..2f6ae60 100644 --- a/source/ubinstall-gtk-startup-apps.c +++ b/source/ubinstall-gtk-startup-apps.c @@ -106,7 +106,7 @@ void yon_startup_apps_setup(main_window *widgets){ } void on_startup_app_add_accept(GtkWidget *self, main_window *widgets){ - startup_app_window *window = g_object_get_data(G_OBJECT(self),"startup_app_window"); + startup_service_window *window = g_object_get_data(G_OBJECT(self),"startup_service_window"); const char *unit = gtk_entry_get_text(GTK_ENTRY(window->UnitEntry)); const char *app = gtk_entry_get_text(GTK_ENTRY(window->ServiceEntry)); const char *description = gtk_entry_get_text(GTK_ENTRY(window->DescriptionEntry)); @@ -125,7 +125,7 @@ void on_startup_app_edit_accept(GtkWidget *self, main_window *widgets){ GtkTreeIter iter; GtkTreeModel *model; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->StartupServicesTree)),&model,&iter)){ - startup_app_window *window = g_object_get_data(G_OBJECT(self),"startup_app_window"); + startup_service_window *window = g_object_get_data(G_OBJECT(self),"startup_service_window"); const char *unit = gtk_entry_get_text(GTK_ENTRY(window->UnitEntry)); const char *app = gtk_entry_get_text(GTK_ENTRY(window->ServiceEntry)); const char *description = gtk_entry_get_text(GTK_ENTRY(window->DescriptionEntry)); @@ -139,8 +139,8 @@ void on_startup_app_edit_accept(GtkWidget *self, main_window *widgets){ on_subwindow_close(self); } -startup_app_window *yon_startup_app_window_new(){ - startup_app_window *window = new(startup_app_window); +startup_service_window *yon_startup_app_window_new(){ + startup_service_window *window = new(startup_service_window); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_service); @@ -158,13 +158,13 @@ startup_app_window *yon_startup_app_window_new(){ gtk_label_set_text(GTK_LABEL(window->AppLabel),GROUP_LABEL); g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); - g_object_set_data(G_OBJECT(window->AcceptButton),"startup_app_window",window); + g_object_set_data(G_OBJECT(window->AcceptButton),"startup_service_window",window); return window; } void on_startup_app_add(GtkWidget *, main_window *widgets){ - startup_app_window *window = yon_startup_app_window_new(); + startup_service_window *window = yon_startup_app_window_new(); yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow),SERVICE_ADD_TITLE_LABEL,icon_path,"app_add_window"); g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_startup_app_add_accept),widgets); gtk_widget_show(window->Window); @@ -177,7 +177,7 @@ void on_startup_app_edit(GtkWidget *, main_window *widgets){ int status; gtk_tree_model_get(GTK_TREE_MODEL(widgets->StartupAppsList),&iter,1,&unit,2,&app,3,&description,4,&status,-1); if (status){ - startup_app_window *window = yon_startup_app_window_new(); + startup_service_window *window = yon_startup_app_window_new(); yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow),SERVICE_EDIT_TITLE_LABEL,icon_path,"app_add_window"); g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_startup_app_edit_accept),widgets); gtk_entry_set_text(GTK_ENTRY(window->UnitEntry),unit); @@ -190,7 +190,7 @@ void on_startup_app_edit(GtkWidget *, main_window *widgets){ int yon_startup_app_save(main_window *widgets){ GtkTreeIter iter; - GtkTreeModel *model = GTK_TREE_MODEL(widgets->StartupList); + GtkTreeModel *model = GTK_TREE_MODEL(widgets->StartupAppsList); int size = 0; int list_size=0; config_str modules = NULL; @@ -204,15 +204,11 @@ int yon_startup_app_save(main_window *widgets){ } } if (size){ - if (list_size==size){ - yon_config_register(SERVICES_ENABLE_parameter,SERVICES_ENABLE_parameter_command,"auto"); - } else { char *final = yon_char_parsed_to_string(modules,size,","); - yon_config_register(SERVICES_ENABLE_parameter,SERVICES_ENABLE_parameter_command,final); - } + yon_config_register(AUTOEXEC_parameter,AUTOEXEC_parameter_command,final); yon_char_parsed_free(modules,size); } else { - yon_config_remove_by_key(SERVICES_ENABLE_parameter); + yon_config_remove_by_key(AUTOEXEC_parameter); } return 1; } \ No newline at end of file diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index ac06a20..a41c645 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -235,6 +235,8 @@ layout && /description:/ {\ #define KERNEL_BOOT_parameter_command "ubconfig --source global get autoinstall AUTOINSTALL['ubconfig set [boot] KERNEL_BOOT']" #define SERVICES_ENABLE_parameter "AUTOINSTALL[ubconfig set [boot] SERVICES_ENABLE]" #define SERVICES_ENABLE_parameter_command "ubconfig get autoinstall AUTOINSTALL['ubconfig set [boot] SERVICES_ENABLE']" +#define AUTOEXEC_parameter "AUTOINSTALL[ubconfig set [desktop] AUTOEXEC[@users]]" +#define AUTOEXEC_parameter_command "ubconfig get autoinstall AUTOINSTALL['ubconfig set [desktop] AUTOEXEC[@users]']" #define GRUB_SUPERUSERS_parameter "AUTOINSTALL[ubconfig set [boot] GRUB_SUPERUSERS]" #define GRUB_SUPERUSERS_parameter_command "ubconfig get autoinstall AUTOINSTALL['ubconfig set [boot] GRUB_SUPERUSERS']" #define GRUB_TIMEOUT_parameter "AUTOINSTALL[ubconfig set [boot] GRUB_TIMEOUT]" @@ -959,16 +961,6 @@ typedef struct { char *description; } os_row; -typedef struct { - GtkWidget *Window; - GtkWidget *StatusBox; - GtkWidget *UnitEntry; - GtkWidget *ServiceEntry; - GtkWidget *DescriptionEntry; - GtkWidget *CancelButton; - GtkWidget *AcceptButton; -} startup_service_window; - typedef struct { GtkWidget *Window; GtkWidget *StatusBox; @@ -980,7 +972,7 @@ typedef struct { GtkWidget *AppLabel; GtkWidget *GroupLabel; GtkWidget *DescriptionLabel; -} startup_app_window; +} startup_service_window; struct pacman_struct{ main_window *widgets; @@ -1431,7 +1423,7 @@ void on_startup_apps_remove(GtkWidget *self,main_window *widgets); void yon_startup_apps_setup(main_window *widgets); void on_startup_app_add_accept(GtkWidget *self, main_window *widgets); void on_startup_app_edit_accept(GtkWidget *self, main_window *widgets); -startup_app_window *yon_startup_app_window_new(); +startup_service_window *yon_startup_app_window_new(); void on_startup_app_add(GtkWidget *, main_window *widgets); void on_startup_app_edit(GtkWidget *, main_window *widgets); int yon_startup_app_save(main_window *widgets); \ No newline at end of file