|
|
|
|
@ -200,12 +200,16 @@ void on_config_autostart_clicked(GtkCellRenderer *, char *path, main_window *wid
|
|
|
|
|
char *config_sting = yon_config_get_by_key("SERVICES_ENABLE");
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(config_sting,&size,",");
|
|
|
|
|
char *additional_name = NULL;
|
|
|
|
|
if (strstr(name,".service")){
|
|
|
|
|
char *temp = yon_char_divide_search(name,".",-1);
|
|
|
|
|
free(name);
|
|
|
|
|
name = temp;
|
|
|
|
|
char *temp = yon_char_new(name);
|
|
|
|
|
additional_name = yon_char_divide_search(temp,".",-1);
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
|
|
|
|
int place = yon_char_parsed_check_exist(parsed,size,name);
|
|
|
|
|
if (place==-1){
|
|
|
|
|
place = yon_char_parsed_check_exist(parsed,size,additional_name);
|
|
|
|
|
}
|
|
|
|
|
if (status==0){
|
|
|
|
|
if (place ==-1){
|
|
|
|
|
if (yon_char_parsed_check_exist(parsed,size,unit)==-1){
|
|
|
|
|
@ -215,7 +219,7 @@ void on_config_autostart_clicked(GtkCellRenderer *, char *path, main_window *wid
|
|
|
|
|
} else {
|
|
|
|
|
parsed = yon_char_parsed_rip(parsed,&size,place);
|
|
|
|
|
if (parsed)
|
|
|
|
|
yon_config_set("SERVICES_ENABLE",yon_char_parsed_to_string(parsed,size,","));
|
|
|
|
|
yon_config_register("SERVICES_ENABLE",SERVICES_ENABLE_get_command,yon_char_parsed_to_string(parsed,size,","));
|
|
|
|
|
else yon_config_remove_by_key("SERVICES_ENABLE");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -223,7 +227,7 @@ void on_config_autostart_clicked(GtkCellRenderer *, char *path, main_window *wid
|
|
|
|
|
if (place !=-1){
|
|
|
|
|
parsed = yon_char_parsed_rip(parsed,&size,place);
|
|
|
|
|
if (parsed)
|
|
|
|
|
yon_config_set("SERVICES_ENABLE",yon_char_parsed_to_string(parsed,size,","));
|
|
|
|
|
yon_config_register("SERVICES_ENABLE",SERVICES_ENABLE_get_command,yon_char_parsed_to_string(parsed,size,","));
|
|
|
|
|
else yon_config_remove_by_key("SERVICES_ENABLE");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -265,12 +269,16 @@ void on_config_autostop_clicked(GtkCellRenderer *, char *path, main_window *widg
|
|
|
|
|
char *config_sting = yon_config_get_by_key("SERVICES_DISABLE");
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(config_sting,&size,",");
|
|
|
|
|
char *additional_name = NULL;
|
|
|
|
|
if (strstr(name,".service")){
|
|
|
|
|
char *temp = yon_char_divide_search(name,".",-1);
|
|
|
|
|
free(name);
|
|
|
|
|
name = temp;
|
|
|
|
|
char *temp = yon_char_new(name);
|
|
|
|
|
additional_name = yon_char_divide_search(temp,".",-1);
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
|
|
|
|
int place = yon_char_parsed_check_exist(parsed,size,name);
|
|
|
|
|
if (place==-1){
|
|
|
|
|
place = yon_char_parsed_check_exist(parsed,size,additional_name);
|
|
|
|
|
}
|
|
|
|
|
if (status==0){
|
|
|
|
|
if (place ==-1){
|
|
|
|
|
if (yon_char_parsed_check_exist(parsed,size,unit)==-1){
|
|
|
|
|
@ -328,12 +336,16 @@ void on_config_block_clicked(GtkCellRenderer *, char *path, main_window *widgets
|
|
|
|
|
char *config_sting = yon_config_get_by_key(SERVICES_MASK_parameter);
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(config_sting,&size,",");
|
|
|
|
|
char *additional_name = NULL;
|
|
|
|
|
if (strstr(name,".service")){
|
|
|
|
|
char *temp = yon_char_divide_search(name,".",-1);
|
|
|
|
|
free(name);
|
|
|
|
|
name = temp;
|
|
|
|
|
char *temp = yon_char_new(name);
|
|
|
|
|
additional_name = yon_char_divide_search(temp,".",-1);
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
|
|
|
|
int place = yon_char_parsed_check_exist(parsed,size,name);
|
|
|
|
|
if (place==-1){
|
|
|
|
|
place = yon_char_parsed_check_exist(parsed,size,additional_name);
|
|
|
|
|
}
|
|
|
|
|
if (status==0){
|
|
|
|
|
if (place ==-1){
|
|
|
|
|
if (yon_char_parsed_check_exist(parsed,size,unit)==-1){
|
|
|
|
|
@ -608,6 +620,16 @@ void on_system_restart_clicked(GtkWidget *, main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_configs_selection_changed(GtkWidget *,main_window *widgets){
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ConfigMainTree)),&model,&iter)){
|
|
|
|
|
gtk_widget_set_sensitive(widgets->ConfigEditButton,1);
|
|
|
|
|
} else {
|
|
|
|
|
gtk_widget_set_sensitive(widgets->ConfigEditButton,0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_sessions_selection_changed(GtkWidget *, main_window *widgets){
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
@ -1388,9 +1410,15 @@ gboolean yon_interface_update_finish(main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
main_config.update_thread_active=0;
|
|
|
|
|
if (!getuid()){
|
|
|
|
|
char *final = yon_char_unite(yon_char_get_localised_from_lib(SUCCESS_LABEL),". ",main_config.load_mode==YON_CONFIG_GLOBAL?yon_char_get_localised_from_lib(GLOBAL_LOAD_SUCCESS_LABEL):yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),NULL);
|
|
|
|
|
yon_ubl_status_box_render(final,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
free(final);
|
|
|
|
|
} else {
|
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
|
yon_ubl_status_box_render(ROOT_WARNING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
textdomain(LocaleName);
|
|
|
|
|
}
|
|
|
|
|
return G_SOURCE_REMOVE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -2084,6 +2112,7 @@ void yon_main_window_complete(main_window *widgets){
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SessionStopButton),"clicked",G_CALLBACK(on_session_end),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SessionBlockButton),"clicked",G_CALLBACK(on_session_block),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SessionMainTree),"cursor-changed",G_CALLBACK(on_sessions_selection_changed),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->ConfigMainTree),"cursor-changed",G_CALLBACK(on_configs_selection_changed),widgets);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SystemServicesStatusMenuItem),"activate",G_CALLBACK(on_system_services_status),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->InstalledUnitsStatusMenuItem),"activate",G_CALLBACK(on_units_status),widgets);
|
|
|
|
|
|