Added command for saving local and global config

pull/11/head
parent 1403282c55
commit 20eee2ebbe

@ -372,10 +372,10 @@ void on_configuration_save_local(GtkWidget *self, widgets_dict *widgets)
char *str=NULL;
char *delstr=NULL;
str=yon_configuration_get_save_command(save_drivers_local_command);
delstr=yon_configuration_get_remove_command(remove_drivers_local_command);
if (delstr){
yon_config_save(delstr);
}
// delstr=yon_configuration_get_remove_command(remove_drivers_local_command);
// if (delstr){
// yon_config_save(delstr);
// }
if (str){
yon_config_save(str);
@ -389,23 +389,37 @@ void on_configuration_save_local(GtkWidget *self, widgets_dict *widgets)
void on_configuration_save_local_global(GtkWidget *self, widgets_dict *widgets)
{
on_configuration_save_global(self, widgets);
on_configuration_save_local(self, widgets);
on_configuration_save_global_local(self, widgets);
videoconfig.status_render.text_to_render=GLOBAL_LOCAL_SAVE_SUCCESS;
videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE;
yon_ubl_status_box_render(&videoconfig.status_render);
}
void on_configuration_save_global_local(GtkWidget *self, widgets_dict *widgets)
{
yon_update_config(widgets);
char *str=NULL;
char *delstr=NULL;
str=yon_configuration_get_save_command(save_drivers_global_local_command);
if (str){
yon_config_save(str);
videoconfig.status_render.text_to_render=LOCAL_SAVE_SUCCESS;
videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE;
yon_ubl_status_box_render(&videoconfig.status_render);
}
}
void on_configuration_save_global(GtkWidget *self, widgets_dict *widgets)
{
yon_update_config(widgets);
char *str=NULL;
char *delstr=NULL;
str=yon_configuration_get_save_command(save_drivers_global_command);
delstr=yon_configuration_get_remove_command(remove_drivers_global_command);
if (delstr){
yon_config_save(delstr);
}
// delstr=yon_configuration_get_remove_command(remove_drivers_global_command);
// if (delstr){
// yon_config_save(delstr);
// }
if (str){
yon_config_save(str);

@ -47,6 +47,8 @@
#define save_drivers_global_command "pkexec /usr/bin/ubconfig --target global --noexecute set video "
#define save_drivers_global_local_command "pkexec /usr/bin/ubconfig --noexecute set video "
#define load_drivers_local_command "/usr/bin/ubconfig --default --source system get video FAILSAFENVIDIA FAILSAFEATI OPTIRUN PRIMUSRUN VGADRV_AUTO "
#define save_drivers_local_command "pkexec /usr/bin/ubconfig --target system --noexecute set video "
@ -344,6 +346,7 @@ void yon_monitor_set_resolutions();
monitor_config yon_monitor_config_new(char *port);
void yon_monitor_config_update(monitorconfig* monitor, char *port, char *config_string);
void yon_monitor_view_new(monitor_config monitor);
void on_configuration_save_global_local(GtkWidget *self, widgets_dict *widgets);
// void on_confugure_monitor_settings(GtkWidget *self, MonitorSettings *settings);
void yon_monitor_view_draw_all(GtkWidget *cnt);
void on_monitor_configure(GtkWidget *self,monitor_window *window);

Loading…
Cancel
Save