test fix for service start/stop

pull/72/head
parent ef8830ba7e
commit 982fbf53c0

@ -471,7 +471,7 @@ void on_filter_changed(GtkWidget *self, main_window *widgets){
void on_system_kill_confirmed(GtkWidget *self,char *service_name){ void on_system_kill_confirmed(GtkWidget *self,char *service_name){
if (self){}; 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){ 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)); dialog_confirmation_data *data = malloc(sizeof(dialog_confirmation_data));
data->action_text=SERVICE_STOP_WARNING_LABEL(service_name); data->action_text=SERVICE_STOP_WARNING_LABEL(service_name);
data->data=service_stop_command(service_name); data->data=service_stop_command(service_name);
data->function=(void*)(void*)on_system_kill_confirmed; data->function=NULL;
int size; int size;
config_str result = yon_config_load(service_check_active_command(service_name),&size); config_str result = yon_config_load(service_check_active_command(service_name),&size);
yon_char_remove_last_symbol(result[0],'\n'); 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); int responce = yon_confirmation_dialog_call(widgets->Window,data);
if (responce == GTK_RESPONSE_ACCEPT){ if (responce == GTK_RESPONSE_ACCEPT){
on_system_kill_confirmed(NULL,data->data);
result = yon_config_load(service_check_active_command(service_name),&size); result = yon_config_load(service_check_active_command(service_name),&size);
yon_char_remove_last_symbol(result[0],'\n'); yon_char_remove_last_symbol(result[0],'\n');
if (strcmp(result[0],"active")){ 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); yon_char_parsed_free(result,size);
} else { } else {
@ -523,10 +527,11 @@ void on_system_launch_clicked(GtkWidget *self, char *path, main_window *widgets)
int size; int size;
config_str result = yon_config_load(service_check_active_command(service_name),&size); config_str result = yon_config_load(service_check_active_command(service_name),&size);
yon_char_remove_last_symbol(result[0],'\n'); 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); int responce = yon_confirmation_dialog_call(widgets->Window,data);
if (responce == GTK_RESPONSE_ACCEPT){ if (responce == GTK_RESPONSE_ACCEPT){
gtk_list_store_set(GTK_LIST_STORE(model),&iter,4,1,-1); 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);
} }
} }
} }

Loading…
Cancel
Save