@ -288,7 +288,7 @@ void on_sensitive_change_reversed(GtkWidget *self, GtkWidget *toggle)
void on_auto_choose_drivers ( GtkWidget * self , widgets_dict * widgets )
void on_auto_choose_drivers ( GtkWidget * self , widgets_dict * widgets )
{
{
int state = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( self ) ) ;
int state = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( self ) ) ;
videoconfig . autoChooseDrivers = state ;
gtk_widget_set_sensitive ( widgets - > mainDriverFailsafeNvidiaLabel , ! state ) ;
gtk_widget_set_sensitive ( widgets - > mainDriverFailsafeNvidiaLabel , ! state ) ;
gtk_widget_set_sensitive ( widgets - > mainDriverFailsafeAMDCombo , ! state ) ;
gtk_widget_set_sensitive ( widgets - > mainDriverFailsafeAMDCombo , ! state ) ;
gtk_widget_set_sensitive ( widgets - > mainDriverFailsafeAMDLabel , ! state ) ;
gtk_widget_set_sensitive ( widgets - > mainDriverFailsafeAMDLabel , ! state ) ;
@ -303,20 +303,33 @@ char *yon_configuration_get_save_command(char *command){
if ( videoconfig . autoChooseDrivers = = 0 ) {
if ( videoconfig . autoChooseDrivers = = 0 ) {
if ( strcmp ( videoconfig . failsafenVidia , dntus ) ! = 0 )
if ( strcmp ( videoconfig . failsafenVidia , dntus ) ! = 0 )
str = yon_char_get_augumented ( str , yon_char_get_augumented ( " FAILSAFENVIDIA= " , videoconfig . failsafenVidia ) ) ;
str = yon_char_get_augumented ( str , yon_char_get_augumented ( " FAILSAFENVIDIA= " , videoconfig . failsafenVidia ) ) ;
else
str = yon_char_get_augumented ( str , " FAILSAFENVIDIA= \" \" " ) ;
if ( strcmp ( videoconfig . failsafeATI , dntus ) ! = 0 )
if ( strcmp ( videoconfig . failsafeATI , dntus ) ! = 0 )
str = yon_char_get_augumented ( str , yon_char_get_augumented ( " FAILSAFEATI= " , videoconfig . failsafeATI ) ) ;
str = yon_char_get_augumented ( str , yon_char_get_augumented ( " FAILSAFEATI= " , videoconfig . failsafeATI ) ) ;
else
str = yon_char_get_augumented ( str , " FAILSAFEATI= \" \" " ) ;
str = yon_char_get_augumented ( str , " VGADRV_AUTO=NO " ) ;
} else {
str = yon_char_unite ( str , " FAILSAFENVIDIA= \" \" FAILSAFEATI= \" \" VGADRV_AUTO=YES " , NULL ) ;
}
}
if ( strcmp ( videoconfig . optirun , dntus ) ! = 0 & & strcmp ( videoconfig . optirun , " " ) ! = 0 )
if ( strcmp ( videoconfig . optirun , dntus ) ! = 0 & & strcmp ( videoconfig . optirun , " " ) ! = 0 )
str = yon_char_get_augumented ( str , yon_char_unite ( " OPTIRUN= " , " \" " , videoconfig . optirun , " \" " , NULL ) ) ;
str = yon_char_get_augumented ( str , yon_char_unite ( " OPTIRUN= " , " \" " , videoconfig . optirun , " \" " , NULL ) ) ;
else
str = yon_char_get_augumented ( str , yon_char_unite ( " OPTIRUN= \" \" " , NULL ) ) ;
if ( strcmp ( videoconfig . primusrun , dntus ) ! = 0 & & strcmp ( videoconfig . primusrun , " " ) ! = 0 )
if ( strcmp ( videoconfig . primusrun , dntus ) ! = 0 & & strcmp ( videoconfig . primusrun , " " ) ! = 0 )
str = yon_char_get_augumented ( str , yon_char_unite ( " PRIMUSRUN= " , " \" " , videoconfig . primusrun , " \" " , NULL ) ) ;
str = yon_char_get_augumented ( str , yon_char_unite ( " PRIMUSRUN= " , " \" " , videoconfig . primusrun , " \" " , NULL ) ) ;
else
str = yon_char_get_augumented ( str , yon_char_unite ( " PRIMUSRUN= \" \" " , NULL ) ) ;
dictionary * dict = NULL ;
dictionary * dict = NULL ;
for ( int i = 0 ; i < videoconfig . portssize ; i + + )
str = yon_char_unite ( str , " XORG_MONITOR[ " , videoconfig . ports [ i ] , " ]= \" \" " , NULL ) ;
if ( videoconfig . monitors )
for_dictionaries ( dict , videoconfig . monitors ) {
for_dictionaries ( dict , videoconfig . monitors ) {
if ( yon_dictionary_get_data ( dict , monitorconfig * ) - > stringparameters ) {
if ( yon_dictionary_get_data ( dict , monitorconfig * ) - > stringparameters ) {
str = yon_char_unite ( str , " XORG_MONITOR[ " , dict - > key , " ]= \" " , yon_dictionary_get_data ( dict , monitorconfig * ) - > stringparameters , " \" " , NULL ) ;
str = yon_char_unite ( str , " XORG_MONITOR[ " , dict - > key , " ]= \" " , yon_dictionary_get_data ( dict , monitorconfig * ) - > stringparameters , " \" " , NULL ) ;
}
}
}
}
@ -348,8 +361,8 @@ char *yon_configuration_get_remove_command(char *command){
str = yon_char_get_augumented ( str , " OPTIRUN " ) ;
str = yon_char_get_augumented ( str , " OPTIRUN " ) ;
str = yon_char_get_augumented ( str , " PRIMUSRUN " ) ;
str = yon_char_get_augumented ( str , " PRIMUSRUN " ) ;
dictionary * dict = NULL ;
dictionary * dict = NULL ;
for_dictionaries ( dict , videoconfig . monitors ) {
for ( int i = 0 ; i < videoconfig . portssize ; i + + ) {
str = yon_char_get_augumented ( str , yon_char_get_augumented ( " " , XORG_MONITOR ( dict- > key ) ) ) ;
str = yon_char_get_augumented ( str , yon_char_get_augumented ( " " , XORG_MONITOR ( videoconfig. ports [ i ] ) ) ) ;
}
}
if ( strcmp ( str , command ) ! = 0 )
if ( strcmp ( str , command ) ! = 0 )
return str ;
return str ;
@ -364,9 +377,11 @@ void on_configuration_save_local(GtkWidget *self, widgets_dict *widgets)
str = yon_configuration_get_save_command ( save_drivers_local_command ) ;
str = yon_configuration_get_save_command ( save_drivers_local_command ) ;
delstr = yon_configuration_get_remove_command ( remove_drivers_local_command ) ;
delstr = yon_configuration_get_remove_command ( remove_drivers_local_command ) ;
if ( delstr ) {
if ( delstr ) {
printf ( " %s \n \n " , delstr ) ;
yon_config_save ( delstr ) ;
yon_config_save ( delstr ) ;
}
}
if ( str ) {
if ( str ) {
printf ( " %s \n \n " , str ) ;
yon_config_save ( str ) ;
yon_config_save ( str ) ;
videoconfig . status_render . text_to_render = LOCAL_SAVE_SUCCESS ;
videoconfig . status_render . text_to_render = LOCAL_SAVE_SUCCESS ;
@ -456,9 +471,9 @@ void on_monitor_delete(GtkWidget *self,monitor_view windowd){
monitor_window * window = yon_dictionary_get_data ( windowd , monitor_window * ) ;
monitor_window * window = yon_dictionary_get_data ( windowd , monitor_window * ) ;
if ( window & & window - > config ) {
if ( window & & window - > config ) {
gtk_container_remove ( GTK_CONTAINER ( gtk_widget_get_parent ( window - > templateMonitorscreenOverlay ) ) , window - > templateMonitorscreenOverlay ) ;
gtk_container_remove ( GTK_CONTAINER ( gtk_widget_get_parent ( window - > templateMonitorscreenOverlay ) ) , window - > templateMonitorscreenOverlay ) ;
yon_dictionary_rip ( windowd ) ;
videoconfig . monitor_visuals = yon_dictionary_rip ( windowd ) ;
gtk_widget_destroy ( window - > templateMonitorscreenOverlay ) ;
gtk_widget_destroy ( window - > templateMonitorscreenOverlay ) ;
yon_dictionary_rip ( window - > config ) ;
videoconfig . monitors = yon_dictionary_rip ( window - > config ) ;
free ( window ) ;
free ( window ) ;
}
}
}
}
@ -898,7 +913,7 @@ void on_config_fill_interface(widgets_dict *widgets)
str = videoconfig . failsafenVidia ;
str = videoconfig . failsafenVidia ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainDriverFailsafeNvidiaCombo ) , DONT_USE_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainDriverFailsafeNvidiaCombo ) , DONT_USE_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainDriverFailsafeNvidiaCombo ) , FBDEV_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainDriverFailsafeNvidiaCombo ) , FBDEV_LABEL ) ;
if ( str )
if ( str & & videoconfig . autoChooseDrivers = = 0 )
{
{
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > mainDriverFailsafeNvidiaCombo ) , 1 ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > mainDriverFailsafeNvidiaCombo ) , 1 ) ;
}
}
@ -909,12 +924,15 @@ void on_config_fill_interface(widgets_dict *widgets)
str = videoconfig . failsafeATI ;
str = videoconfig . failsafeATI ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainDriverFailsafeAMDCombo ) , DONT_USE_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainDriverFailsafeAMDCombo ) , DONT_USE_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainDriverFailsafeAMDCombo ) , FBDEV_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainDriverFailsafeAMDCombo ) , FBDEV_LABEL ) ;
if ( str )
if ( str & & videoconfig . autoChooseDrivers = = 0 )
{
{
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > mainDriverFailsafeAMDCombo ) , 1 ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > mainDriverFailsafeAMDCombo ) , 1 ) ;
}
}
else
else
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > mainDriverFailsafeAMDCombo ) , 0 ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > mainDriverFailsafeAMDCombo ) , 0 ) ;
if ( videoconfig . autoChooseDrivers = = 1 ) {
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( widgets - > mainDriverAutomaticallyChooseCheck ) , 1 ) ;
}
dictionary * dict = NULL ;
dictionary * dict = NULL ;
}
}
@ -943,6 +961,7 @@ dictionary *yon_proprieary_get(){
}
}
}
}
/**void yon_gtk_list_store_fill_with_proprietaries(GtkListStore *list)
/**void yon_gtk_list_store_fill_with_proprietaries(GtkListStore *list)
* [ EN ]
* [ EN ]
*/
*/
@ -989,15 +1008,24 @@ void yon_setup_config(char *configcommand)
videoconfig . configsize = 0 ;
videoconfig . configsize = 0 ;
videoconfig . loaded_config = yon_ubl_load_global_config ( command , & videoconfig . configsize ) ;
videoconfig . loaded_config = yon_ubl_load_global_config ( command , & videoconfig . configsize ) ;
char * param = NULL ;
char * param = NULL ;
param = yon_config_get_parameter ( videoconfig . loaded_config , videoconfig . configsize , " VGADRV_AUTO " ) ;
if ( param ) {
yon_char_divide_search ( param , " = " , - 1 ) ;
if ( strcmp ( param , " " ) ! = 0 )
videoconfig . autoChooseDrivers = 1 ;
}
param = yon_config_get_parameter ( videoconfig . loaded_config , videoconfig . configsize , " FAILSAFENVIDIA " ) ;
param = yon_config_get_parameter ( videoconfig . loaded_config , videoconfig . configsize , " FAILSAFENVIDIA " ) ;
if ( param ) {
if ( param ) {
yon_char_divide_search ( param , " = " , - 1 ) ;
yon_char_divide_search ( param , " = " , - 1 ) ;
if ( strcmp ( param , " " ) ! = 0 )
videoconfig . failsafenVidia = yon_char_new ( param ) ;
videoconfig . failsafenVidia = yon_char_new ( param ) ;
}
}
param = yon_config_get_parameter ( videoconfig . loaded_config , videoconfig . configsize , " FAILSAFEATI " ) ;
param = yon_config_get_parameter ( videoconfig . loaded_config , videoconfig . configsize , " FAILSAFEATI " ) ;
if ( param ) {
if ( param ) {
yon_char_divide_search ( param , " = " , - 1 ) ;
yon_char_divide_search ( param , " = " , - 1 ) ;
if ( strcmp ( param , " " ) ! = 0 )
videoconfig . failsafeATI = yon_char_new ( param ) ;
videoconfig . failsafeATI = yon_char_new ( param ) ;
}
}
@ -1005,18 +1033,22 @@ void yon_setup_config(char *configcommand)
if ( param ) {
if ( param ) {
yon_char_divide_search ( param , " = " , - 1 ) ;
yon_char_divide_search ( param , " = " , - 1 ) ;
videoconfig . optirun = yon_char_remove_brackets ( yon_char_new ( param ) ) ;
videoconfig . optirun = yon_char_remove_brackets ( yon_char_new ( param ) ) ;
if ( strcmp ( videoconfig . optirun , " " ) = = 0 ) videoconfig . optirun = NULL ;
}
}
param = yon_config_get_parameter ( videoconfig . loaded_config , videoconfig . configsize , " PRIMUSRUN " ) ;
param = yon_config_get_parameter ( videoconfig . loaded_config , videoconfig . configsize , " PRIMUSRUN " ) ;
if ( param ) {
if ( param ) {
yon_char_divide_search ( param , " = " , - 1 ) ;
yon_char_divide_search ( param , " = " , - 1 ) ;
videoconfig . primusrun = yon_char_remove_brackets ( yon_char_new ( param ) ) ;
videoconfig . primusrun = yon_char_remove_brackets ( yon_char_new ( param ) ) ;
if ( strcmp ( videoconfig . primusrun , " " ) = = 0 ) videoconfig . primusrun = NULL ;
}
}
for ( int i = 0 ; i < videoconfig . portssize ; i + + ) {
for ( int i = 0 ; i < videoconfig . portssize ; i + + ) {
videoconfig . ports [ i ] = yon_char_divide_search ( videoconfig . ports [ i ] , " \n " , - 1 ) ;
videoconfig . ports [ i ] = yon_char_divide_search ( videoconfig . ports [ i ] , " \n " , - 1 ) ;
param = yon_config_get_parameter ( videoconfig . loaded_config , videoconfig . configsize , XORG_MONITOR ( videoconfig . ports [ i ] ) ) ;
param = yon_config_get_parameter ( videoconfig . loaded_config , videoconfig . configsize , XORG_MONITOR ( videoconfig . ports [ i ] ) ) ;
if ( param ) {
char * leftover = yon_char_new ( param ) ;
yon_char_divide_search ( leftover , " = " , - 1 ) ;
if ( param & & strcmp ( leftover , " " ) ! = 0 ) {
videoconfig . monitors = yon_monitor_config_new ( videoconfig . ports [ i ] ) ;
videoconfig . monitors = yon_monitor_config_new ( videoconfig . ports [ i ] ) ;
yon_char_divide_search ( param , " = " , - 1 ) ;
yon_char_divide_search ( param , " = " , - 1 ) ;
yon_monitor_config_update ( yon_dictionary_get_data ( videoconfig . monitors , monitorconfig * ) , videoconfig . ports [ i ] , param ) ;
yon_monitor_config_update ( yon_dictionary_get_data ( videoconfig . monitors , monitorconfig * ) , videoconfig . ports [ i ] , param ) ;
@ -1218,7 +1250,7 @@ void yon_adapter_window_setup(widgets_dict *widgets){
yon_char_divide_search ( driver_use , " = " , - 1 ) ;
yon_char_divide_search ( driver_use , " = " , - 1 ) ;
char * driver_all = yon_config_get_parameter ( rtn , size , " Kernel_modules " ) ;
char * driver_all = yon_config_get_parameter ( rtn , size , " Kernel_modules " ) ;
yon_char_divide_search ( driver_all , " = " , - 1 ) ;
yon_char_divide_search ( driver_all , " = " , - 1 ) ;
char * final_text = yon_char_unite ( " <span size= \" 1 5 pt\" ><span weight='bold' color='#1a5fb4'> " , DESCRIPTION_LABEL , " :</span> " , _ ( desc ) ,
char * final_text = yon_char_unite ( " <span size= \" 1 2 pt\" ><span weight='bold' color='#1a5fb4'> " , DESCRIPTION_LABEL , " :</span> " , _ ( desc ) ,
" \n <span weight='bold' color='#1a5fb4'> " , VENDOR_LABEL , " :</span> " , vendor ,
" \n <span weight='bold' color='#1a5fb4'> " , VENDOR_LABEL , " :</span> " , vendor ,
" \n <span weight='bold' color='#1a5fb4'> " , MODEL_LABEL , " :</span> " , product ,
" \n <span weight='bold' color='#1a5fb4'> " , MODEL_LABEL , " :</span> " , product ,
" \n <span weight='bold' color='#1a5fb4'> " , USED_KERNEL_DRIVER_LABEL , " :</span> " , driver_use ,
" \n <span weight='bold' color='#1a5fb4'> " , USED_KERNEL_DRIVER_LABEL , " :</span> " , driver_use ,
@ -1448,6 +1480,7 @@ int main(int argc, char *argv[])
widgets_dict widgets ;
widgets_dict widgets ;
yon_setup_widgets ( & widgets ) ;
yon_setup_widgets ( & widgets ) ;
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . list ) ;
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . list ) ;
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . modulelist ) ;
gtk_widget_show ( widgets . MainWindow ) ;
gtk_widget_show ( widgets . MainWindow ) ;
// yon_fill_ui(&widgets);
// yon_fill_ui(&widgets);
videoconfig . status_render . text_to_render = LOCAL_LOAD_SUCCESS ;
videoconfig . status_render . text_to_render = LOCAL_LOAD_SUCCESS ;