Updating for new libraries version

pull/28/head
parent 931134a137
commit c54b834d63

@ -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;
}

@ -48,6 +48,18 @@
#define start_log_command(target) yon_char_append("journalctl --all --no-pager --unit ",target)
#define config_get_local_command "ubconfig --source system get system SERVICES_ENABLE SERVICES_DISABLE SERVICES_MASK"
#define config_get_global_command "ubconfig --source global get system SERVICES_ENABLE SERVICES_DISABLE SERVICES_MASK"
#define config_get_default_command ""
#define config_get_global_only_parameters ""
#define config_get_local_only_parameters ""
#define SERVICES_ENABLE_get_command "ubconfig --source global get [system] SERVICES_ENABLE"
#define SERVICES_DISABLE_get_command "ubconfig --source global get [system] SERVICES_DISABLE"
#define SERVICES_MASK_get_command "ubconfig --source global get [system] SERVICES_MASK"
#define CONSOLE_FONT_get_command "ubconfig --source global get [locale] CONSOLE_FONT"
typedef char* string;
string version_application;
@ -200,6 +212,8 @@ void on_config_local_save();
void on_config_global_save();
void on_service_constant_update();
log_window *yon_log_window_new();
gboolean yon_interface_update(main_window *widgets);

@ -7,7 +7,7 @@ GenericName[ru]=Службы и процесссы systemd
Comment=System cervices and processes configuration
Comment[ru]=Настройка работы служб и процессов системы
Type=Application
Exec=pkexec ubl-settings-services
Exec=ubl-settings-services
Icon=com.ublinux.ubl-settings-services
Terminal=false
X-XfcePluggable=true

Loading…
Cancel
Save