|
|
|
|
@ -111,12 +111,12 @@ void yon_interface_save(){
|
|
|
|
|
break;
|
|
|
|
|
case 1:yon_config_register(INTEGRATEDVGA,INTEGRATEDVGA_command,"no");
|
|
|
|
|
break;
|
|
|
|
|
case 2:yon_config_register(INTEGRATEDVGA,INTEGRATEDVGA_command,"yes ");
|
|
|
|
|
case 2:yon_config_register(INTEGRATEDVGA,INTEGRATEDVGA_command,"yes");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_interface_update(){
|
|
|
|
|
void yon_interface_update(){
|
|
|
|
|
g_hash_table_remove_all(main_config.ports_table);
|
|
|
|
|
yon_monitor_set_resolutions();
|
|
|
|
|
g_hash_table_remove_all(main_config.resolutions);
|
|
|
|
|
@ -151,7 +151,7 @@ void yon_interface_update(){
|
|
|
|
|
else if (!yon_char_is_empty(autodrivers)&&!strcmp(autodrivers,"no"))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->AutoDriverCombo),1);
|
|
|
|
|
else
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->AutoDriverCombo),0);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets->AutoDriverCombo)," ");
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(freedrivers)&&!strcmp(freedrivers,"yes"))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FreeDriverCombo),1);
|
|
|
|
|
@ -162,12 +162,12 @@ void yon_interface_update(){
|
|
|
|
|
else if (!yon_char_is_empty(freedrivers)&&!strcmp(freedrivers,"no"))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FreeDriverCombo),4);
|
|
|
|
|
else
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FreeDriverCombo),0);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets->FreeDriverCombo)," ");
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(dpi)&&!strcmp(dpi,"auto"))
|
|
|
|
|
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->DisplayScalingCombo),0);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets->DisplayScalingCombo)," ");
|
|
|
|
|
else{
|
|
|
|
|
if (!strcmp(dpi,"2K")||!strcmp(dpi,"4K")){
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets),dpi);
|
|
|
|
|
@ -181,14 +181,14 @@ void yon_interface_update(){
|
|
|
|
|
else if (!yon_char_is_empty(failsafenvidia)&&!strcmp(failsafenvidia,"no"))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FailsafeNvidiaCombo),1);
|
|
|
|
|
else
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FailsafeNvidiaCombo),0);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets->FailsafeNvidiaCombo)," ");
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(failsafeati)&&!strcmp(failsafeati,"fbdev"))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FailsafeAMDCombo),2);
|
|
|
|
|
else if (!yon_char_is_empty(failsafeati)&&!strcmp(failsafeati,"no"))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FailsafeAMDCombo),1);
|
|
|
|
|
else
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->FailsafeAMDCombo),0);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets->FailsafeAMDCombo)," ");
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(optirun)){
|
|
|
|
|
if (strcmp(optirun,"no")){
|
|
|
|
|
@ -198,9 +198,9 @@ void yon_interface_update(){
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->OptirunCombo),1);
|
|
|
|
|
}
|
|
|
|
|
} else if (yon_char_is_empty(optirun))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->OptirunCombo),0);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets->OptirunCombo)," ");
|
|
|
|
|
else
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->OptirunCombo),0);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets->OptirunCombo)," ");
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(primusrun)){
|
|
|
|
|
if (strcmp(primusrun,"no")){
|
|
|
|
|
@ -210,23 +210,23 @@ void yon_interface_update(){
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->PrimusrunCombo),1);
|
|
|
|
|
}
|
|
|
|
|
} else if (yon_char_is_empty(primusrun))
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->PrimusrunCombo),0);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets->PrimusrunCombo)," ");
|
|
|
|
|
else
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->PrimusrunCombo),0);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets->PrimusrunCombo)," ");
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets->DontSwitchDisplaysOffCombo)," ");
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(main_config.widgets->DisplayDiscreteOnly)," ");
|
|
|
|
|
|
|
|
|
|
yon_monitor_view_update();
|
|
|
|
|
}
|
|
|
|
|
@ -249,7 +249,14 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
|
case YON_CONFIG_CUSTOM:
|
|
|
|
|
char *path = NULL;
|
|
|
|
|
path=yon_custom_config_init(GTK_FILE_CHOOSER_ACTION_OPEN);
|
|
|
|
|
yon_char_remove_brackets(path);
|
|
|
|
|
if (!yon_char_is_empty(path)){
|
|
|
|
|
if ((access(path,0)==F_OK&&access(path,4)!=F_OK)){
|
|
|
|
|
if (yon_status_box_is_set()){
|
|
|
|
|
yon_ubl_status_box_render(ACCESS_DENIED_LABEL(path),BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
yon_config_clean();
|
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
|
yon_ubl_status_box_render(yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
@ -393,12 +400,17 @@ void yon_proprietary_get_thread(GtkWidget *,main_window *widgets){
|
|
|
|
|
|
|
|
|
|
void yon_all_resolutions_update(){
|
|
|
|
|
main_config.resolutions_sorted = yon_resource_open_file(get_resolutions_supportable_command,&main_config.resolutions_size);
|
|
|
|
|
for (int i=1;i<main_config.resolutions_size;i++){
|
|
|
|
|
char *table_str = yon_char_parsed_to_string(main_config.resolutions_sorted,main_config.resolutions_size,"\n");
|
|
|
|
|
int format_size;
|
|
|
|
|
config_str resolutions_formatted = yon_config_load(table_format_command(table_str),&format_size);
|
|
|
|
|
for (int i=0;i<format_size;i++){
|
|
|
|
|
yon_char_remove_last_symbol(resolutions_formatted[i],'\n');
|
|
|
|
|
int parsed_size;
|
|
|
|
|
config_str parsed = yon_char_parse(main_config.resolutions_sorted[i],&parsed_size,";");
|
|
|
|
|
g_hash_table_insert(main_config.resolutions,yon_char_new(parsed[0]),yon_char_replace(main_config.resolutions_sorted[i],";","\t"));
|
|
|
|
|
g_hash_table_insert(main_config.resolutions,yon_char_new(parsed[0]),yon_char_new(resolutions_formatted[i]));
|
|
|
|
|
yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(resolutions_formatted,format_size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_monitor_set_resolutions(){
|
|
|
|
|
@ -830,6 +842,7 @@ template_main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MoreButton),"clicked",G_CALLBACK(on_terminal_revealer_open),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->TerminalCancelButton),"clicked",G_CALLBACK(on_command_cancel),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UnlockPacmanButton),"clicked",G_CALLBACK(on_pacman_db_unlock),NULL);
|
|
|
|
|
// g_signal_connect(G_OBJECT(widgets->InstallTerminal),"child-ready",G_CALLBACK(on_driver_child_ready),NULL);
|
|
|
|
|
char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL);
|
|
|
|
|
yon_window_config_load(path);
|
|
|
|
|
gtk_overlay_add_overlay(GTK_OVERLAY(widgets->MainOverlay),widgets->MainSpinner);
|
|
|
|
|
@ -875,6 +888,7 @@ template_main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
|
{
|
|
|
|
|
yon_combo_box_set_default(GTK_COMBO_BOX_TEXT(widgets->PrimusrunCombo),PRIMUSRUN_command,yon_primusrun_default);
|
|
|
|
|
}
|
|
|
|
|
while(gtk_events_pending()) gtk_main_iteration();
|
|
|
|
|
yon_adapter_window_setup(widgets);
|
|
|
|
|
|
|
|
|
|
yon_save_window_set_postsave_function(on_save_done,widgets);
|
|
|
|
|
|