|
|
|
|
@ -5,8 +5,14 @@ config main_config;
|
|
|
|
|
//functions
|
|
|
|
|
|
|
|
|
|
void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
|
if (yon_config_load_register(type,"system","SERVICES_ENABLE SERVICES_DISABLE SERVICES_MASK",NULL)){
|
|
|
|
|
|
|
|
|
|
yon_config_clean();
|
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
|
if (type==YON_CONFIG_GLOBAL){
|
|
|
|
|
yon_config_load_config(type,config_get_global_command,NULL);
|
|
|
|
|
}
|
|
|
|
|
if (type==YON_CONFIG_LOCAL){
|
|
|
|
|
yon_config_load_config(type,config_get_local_command,NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -34,17 +40,21 @@ void on_config_global_load(GtkWidget *self,main_window *widgets){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_service_constant_update(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_global_local_save(){
|
|
|
|
|
yon_save_proceed(NULL,YON_CONFIG_BOTH,"system","SERVICES_ENABLE SERVICES_DISABLE SERVICES_MASK",NULL);
|
|
|
|
|
yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_global_command,NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_local_save(){
|
|
|
|
|
yon_save_proceed("system",YON_CONFIG_LOCAL,"system","SERVICES_ENABLE SERVICES_DISABLE SERVICES_MASK",NULL);
|
|
|
|
|
yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_local_command,NULL);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_global_save(){
|
|
|
|
|
yon_save_proceed("global",YON_CONFIG_GLOBAL,"system","SERVICES_ENABLE SERVICES_DISABLE SERVICES_MASK",NULL);
|
|
|
|
|
yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_global_command,NULL);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -121,7 +131,7 @@ void on_config_autostart_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
if (status==0){
|
|
|
|
|
if (place ==-1){
|
|
|
|
|
if (!yon_config_append("SERVICES_ENABLE",name,",")){
|
|
|
|
|
yon_config_register("SERVICES_ENABLE","[system]",name);
|
|
|
|
|
yon_config_register("SERVICES_ENABLE",SERVICES_ENABLE_get_command,name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
@ -155,7 +165,7 @@ void on_config_autostop_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
if (status==0){
|
|
|
|
|
if (place ==-1){
|
|
|
|
|
if (!yon_config_append("SERVICES_DISABLE",name,",")){
|
|
|
|
|
yon_config_register("SERVICES_DISABLE","[system]",name);
|
|
|
|
|
yon_config_register("SERVICES_DISABLE",SERVICES_DISABLE_get_command,name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
@ -190,7 +200,7 @@ void on_config_block_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
if (status==0){
|
|
|
|
|
if (place ==-1){
|
|
|
|
|
if (!yon_config_append("SERVICES_MASK",name,",")){
|
|
|
|
|
yon_config_register("SERVICES_MASK","[system]",name);
|
|
|
|
|
yon_config_register("SERVICES_MASK",SERVICES_MASK_get_command,name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
@ -734,9 +744,11 @@ void on_tree_selection_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MainTree)),&model,&iter)){
|
|
|
|
|
switch_status=1;
|
|
|
|
|
}
|
|
|
|
|
if (getuid()==0){
|
|
|
|
|
gtk_widget_set_sensitive(widgets->ConfigAutostartButton,switch_status);
|
|
|
|
|
gtk_widget_set_sensitive(widgets->ConfigAutostopButton,switch_status);
|
|
|
|
|
gtk_widget_set_sensitive(widgets->ConfigBlockButton,switch_status);
|
|
|
|
|
}
|
|
|
|
|
gtk_widget_set_sensitive(widgets->SystemAutostartButton,switch_status);
|
|
|
|
|
gtk_widget_set_sensitive(widgets->SystemLaunchButton,switch_status);
|
|
|
|
|
gtk_widget_set_sensitive(widgets->InfoButton,switch_status);
|
|
|
|
|
@ -833,6 +845,8 @@ int main(int argc, char *argv[]){
|
|
|
|
|
gtk_init(&argc,&argv);
|
|
|
|
|
template_main_window *widgets = yon_ubl_window_setup();
|
|
|
|
|
yon_main_window_complete((main_window*)widgets);
|
|
|
|
|
if (getuid()!=0)
|
|
|
|
|
yon_ubl_status_box_render(ROOT_WARNING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
gtk_main();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|