From 982fbf53c0a0047731b7b071ed416227bb2ec66e Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Sat, 27 Apr 2024 17:09:17 +0600 Subject: [PATCH] test fix for service start/stop --- source/ubl-settings-services.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/ubl-settings-services.c b/source/ubl-settings-services.c index da50d7c..587d41a 100644 --- a/source/ubl-settings-services.c +++ b/source/ubl-settings-services.c @@ -471,7 +471,7 @@ void on_filter_changed(GtkWidget *self, main_window *widgets){ void on_system_kill_confirmed(GtkWidget *self,char *service_name){ if (self){}; - yon_launch_app_with_arguments(service_name,""); + yon_launch(service_name); } void on_system_launch_clicked(GtkWidget *self, char *path, main_window *widgets){ @@ -497,13 +497,14 @@ void on_system_launch_clicked(GtkWidget *self, char *path, main_window *widgets) dialog_confirmation_data *data = malloc(sizeof(dialog_confirmation_data)); data->action_text=SERVICE_STOP_WARNING_LABEL(service_name); data->data=service_stop_command(service_name); - data->function=(void*)(void*)on_system_kill_confirmed; + data->function=NULL; int size; config_str result = yon_config_load(service_check_active_command(service_name),&size); yon_char_remove_last_symbol(result[0],'\n'); if (size>0&&!strcmp(result[0],"active")){ int responce = yon_confirmation_dialog_call(widgets->Window,data); if (responce == GTK_RESPONSE_ACCEPT){ + on_system_kill_confirmed(NULL,data->data); result = yon_config_load(service_check_active_command(service_name),&size); yon_char_remove_last_symbol(result[0],'\n'); if (strcmp(result[0],"active")){ @@ -513,6 +514,9 @@ void on_system_launch_clicked(GtkWidget *self, char *path, main_window *widgets) } } + } else { + gtk_list_store_set(GTK_LIST_STORE(model),&iter,4,0,-1); + } yon_char_parsed_free(result,size); } else { @@ -523,10 +527,11 @@ void on_system_launch_clicked(GtkWidget *self, char *path, main_window *widgets) int size; config_str result = yon_config_load(service_check_active_command(service_name),&size); yon_char_remove_last_symbol(result[0],'\n'); - if (size>0&&!strcmp(result[0],"active")){ + if (size>0&&strcmp(result[0],"active")){ int responce = yon_confirmation_dialog_call(widgets->Window,data); if (responce == GTK_RESPONSE_ACCEPT){ gtk_list_store_set(GTK_LIST_STORE(model),&iter,4,1,-1); + yon_ubl_status_box_render(SERVICE_RELOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); } } }