|
|
|
|
@ -229,9 +229,22 @@ void on_system_launch_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
gboolean status = 0;
|
|
|
|
|
char *service_name;
|
|
|
|
|
gtk_tree_model_get(model,&iter,4,&status,5,&service_name,-1);
|
|
|
|
|
gtk_list_store_set(GTK_LIST_STORE(widgets->liststore2),&iter,4,!status,-1);
|
|
|
|
|
yon_launch((!status)==1 ? service_start_command(service_name) : \
|
|
|
|
|
service_stop_command(service_name));
|
|
|
|
|
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){
|
|
|
|
|
if (!strcmp(result[0],"active")){
|
|
|
|
|
gtk_list_store_set(GTK_LIST_STORE(widgets->liststore2),&iter,4,1,-1);
|
|
|
|
|
if (status){
|
|
|
|
|
yon_ubl_status_box_render(SWITCH_OFF_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
gtk_list_store_set(GTK_LIST_STORE(widgets->liststore2),&iter,4,0,-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(result,size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|