|
|
|
|
@ -450,6 +450,15 @@ void yon_interface_save(){
|
|
|
|
|
yon_config_remove_by_key(GL_YIELD);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(main_config.widgets->DisplayDiscreteOnly))){
|
|
|
|
|
case 0:
|
|
|
|
|
yon_config_remove_by_key(INTEGRATEDVGA);
|
|
|
|
|
break;
|
|
|
|
|
case 1:yon_config_register(INTEGRATEDVGA,INTEGRATEDVGA_command,"no");
|
|
|
|
|
break;
|
|
|
|
|
case 2:yon_config_register(INTEGRATEDVGA,INTEGRATEDVGA_command,"yes ");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_interface_update(){
|
|
|
|
|
@ -464,8 +473,8 @@ void yon_interface_update(){
|
|
|
|
|
char *freedrivers = yon_config_get_by_key(VGADRV_NOFREE);
|
|
|
|
|
char *dpms= yon_config_get_by_key(XORG_EXT);
|
|
|
|
|
char *dpi = yon_config_get_by_key(XORG_DPI);
|
|
|
|
|
char *failsafenvidia = yon_config_get_by_key(FAILSAFEATI);
|
|
|
|
|
char *failsafeati = yon_config_get_by_key(FAILSAFENVIDIA);
|
|
|
|
|
char *failsafenvidia = yon_config_get_by_key(FAILSAFENVIDIA);
|
|
|
|
|
char *failsafeati = yon_config_get_by_key(FAILSAFEATI);
|
|
|
|
|
char *optirun = yon_config_get_by_key(OPTIRUN);
|
|
|
|
|
char *primusrun = yon_config_get_by_key(PRIMUSRUN);
|
|
|
|
|
char *discrete = yon_config_get_by_key(INTEGRATEDVGA);
|
|
|
|
|
@ -491,9 +500,9 @@ void yon_interface_update(){
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FreeDriverCombo),0);
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(dpi)&&!strcmp(dpi,"auto"))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FailsafeAMDCombo),1);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->DisplayScalingCombo),1);
|
|
|
|
|
else if (yon_char_is_empty(dpi))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FailsafeAMDCombo),0);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->DisplayScalingCombo),0);
|
|
|
|
|
else{
|
|
|
|
|
if (!strcmp(dpi,"2K")||!strcmp(dpi,"4K")){
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets),dpi);
|
|
|
|
|
@ -539,6 +548,20 @@ void yon_interface_update(){
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->PrimusrunCombo),0);
|
|
|
|
|
else
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->PrimusrunCombo),0);
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(dpms)&&!strcmp(dpms,"dpms"))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->DontSwitchDisplaysOffCombo),2);
|
|
|
|
|
else if (!yon_char_is_empty(dpms)&&!strcmp(dpms,"nodpms"))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->DontSwitchDisplaysOffCombo),1);
|
|
|
|
|
else
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->DontSwitchDisplaysOffCombo),0);
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(discrete)&&!strcmp(discrete,"yes"))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->DisplayDiscreteOnly),2);
|
|
|
|
|
else if (!yon_char_is_empty(discrete)&&!strcmp(discrete,"no"))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->DisplayDiscreteOnly),1);
|
|
|
|
|
else
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->DisplayDiscreteOnly),0);
|
|
|
|
|
|
|
|
|
|
// if (!yon_char_is_empty(gapfix1))
|
|
|
|
|
// gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FailsafeNvidiaCombo),2);
|
|
|
|
|
@ -563,7 +586,7 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(dialog),NULL,TITLE_LABEL,icon_name,"FileChooserWindow");
|
|
|
|
|
textdomain(LocaleName);
|
|
|
|
|
gtk_window_set_icon_name(GTK_WINDOW(dialog),"com.ublinux.ubl-settings-services");
|
|
|
|
|
gtk_window_set_icon_name(GTK_WINDOW(dialog),"com.ublinux.ubl-settings-video");
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(dialog),TITLE_LABEL);
|
|
|
|
|
GtkFileFilter *filter = gtk_file_filter_new();
|
|
|
|
|
gtk_file_filter_add_pattern(filter,"*.ini");
|
|
|
|
|
@ -644,6 +667,10 @@ void on_monitor_delete(GtkWidget *self,monitor_data *window){
|
|
|
|
|
GtkWidget *target = gtk_widget_get_parent(window->ScreenOverlay);
|
|
|
|
|
GtkWidget *flow_box = gtk_widget_get_parent(target);
|
|
|
|
|
gtk_container_remove(GTK_CONTAINER(flow_box),target);
|
|
|
|
|
const char *target_monitor = gtk_label_get_text(GTK_LABEL(window->NameLabel));
|
|
|
|
|
if (!yon_char_is_empty(target_monitor)){
|
|
|
|
|
yon_config_remove_by_key(XORG_MONITOR((char*)target_monitor));
|
|
|
|
|
}
|
|
|
|
|
free(window);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -688,6 +715,7 @@ void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
|
int modeline_cvt = 0;
|
|
|
|
|
int cvt_reduced = 0;
|
|
|
|
|
int modeline_gtf = 0;
|
|
|
|
|
int do_not_switch_off = 0;
|
|
|
|
|
enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnableCheck));
|
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->PortCombo))){
|
|
|
|
|
target = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->PortCombo));
|
|
|
|
|
@ -704,6 +732,7 @@ void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
|
modeline_cvt = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->ModelineCVTCheck));
|
|
|
|
|
cvt_reduced = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UseCVTReducedCheck));
|
|
|
|
|
modeline_gtf = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->ModelineGTFCheck));
|
|
|
|
|
do_not_switch_off = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->DoNotSwitchOffCheck));
|
|
|
|
|
|
|
|
|
|
int final_size;
|
|
|
|
|
config_str final_parsed=NULL;
|
|
|
|
|
@ -721,6 +750,11 @@ void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(final_parsed,&final_size,"disable");
|
|
|
|
|
if (main_display)
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(final_parsed,&final_size,"primary");
|
|
|
|
|
if (do_not_switch_off){
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(final_parsed,&final_size,"dpms");
|
|
|
|
|
}else{
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(final_parsed,&final_size,"nodpms");
|
|
|
|
|
}
|
|
|
|
|
if (position)
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(final_parsed,&final_size,position);
|
|
|
|
|
if (rotate)
|
|
|
|
|
@ -751,8 +785,10 @@ void yon_monitor_parse(monitor_edit_window *window, char *string){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->UseCVTReducedCheck),1);
|
|
|
|
|
|
|
|
|
|
} else if (!strcmp(parsed[i],"dpms")){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->DoNotSwitchOffCheck),1);
|
|
|
|
|
|
|
|
|
|
} else if (!strcmp(parsed[i],"nodpms")){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->DoNotSwitchOffCheck),0);
|
|
|
|
|
|
|
|
|
|
} else if (!strcmp(parsed[i],"enable")){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->EnableCheck),1);
|
|
|
|
|
@ -768,7 +804,8 @@ void yon_monitor_parse(monitor_edit_window *window, char *string){
|
|
|
|
|
|
|
|
|
|
} else if (strstr(parsed[i],"lo:")||strstr(parsed[i],"LeftOf:")){
|
|
|
|
|
char *location = yon_char_divide_search(parsed[i],":",-1);
|
|
|
|
|
yon_gtk_combo_box_text_find(window->PositionPortCombo,parsed[i]);
|
|
|
|
|
int target = yon_gtk_combo_box_text_find(window->PositionPortCombo,parsed[i]);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationCombo),target);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PositionPosCombo),1);
|
|
|
|
|
|
|
|
|
|
} else if (strstr(parsed[i],"ro:")||strstr(parsed[i],"RightOf:")){
|
|
|
|
|
@ -855,7 +892,7 @@ void on_monitor_configure(GtkWidget *self,monitor_data *window){
|
|
|
|
|
}
|
|
|
|
|
for (int i=0;i<main_config.portssize;i++){
|
|
|
|
|
int found = yon_char_parsed_check_exist(config_ports,config_size,main_config.ports[i]);
|
|
|
|
|
if (found==-1||(!yon_char_is_empty(target)&&!strcmp(target,main_config.ports[i]))){
|
|
|
|
|
if (found==-1||(!yon_char_is_empty(target)&&!strcmp(target,main_config.ports[i]))||yon_config_get_status(XORG_MONITOR(main_config.ports[i]))==-1){
|
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(monitors->PortCombo),main_config.ports[i]);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|