@ -2,19 +2,31 @@
config videoconfig ;
config videoconfig ;
void yon_on_plug_added ( GtkSocket * self , gpointer user_data )
// void on_apps_chooser_open(GtkWidget *self){
{
// int size=0;
}
// config_str categories=yon_char_parsed_new(NULL,&size,"GTK",NULL);
// config_str names=yon_char_parsed_new(NULL,&size,"XFCE",NULL);
// config_str icons=yon_char_parsed_new(NULL,&size,"org.xfce.panel.Launcher",NULL);
// yon_app_chooser_show(categories,names,icons,size);
// }
void yon_on_plug_removed ( GtkSocket * self , gpointer user_data )
{
}
void on_subwindow_close ( GtkWidget * self )
void on_subwindow_close ( GtkWidget * self )
{
{
gtk_widget_destroy ( gtk_widget_get_toplevel ( self ) ) ;
gtk_widget_destroy ( gtk_widget_get_toplevel ( self ) ) ;
}
}
void on_resized ( GtkWidget * window , GdkEventConfigure * event ) {
float time_passed = ( float ) clock ( ) / ( float ) CLOCKS_PER_SEC ;
if ( time_passed > 2 ) {
int width = gdk_window_get_width ( gtk_widget_get_window ( videoconfig . pack_box ) ) ;
int children_width = 138 * g_list_length ( gtk_container_get_children ( GTK_CONTAINER ( ( GtkWidget * ) videoconfig . monitor_output_layers - > first - > data ) ) ) ;
if ( width < children_width | | width > children_width + 150 )
yon_monitor_view_draw_all ( ) ;
}
}
void on_monitor_config_save ( GtkWidget * self , monitor_edit_window * window ) {
void on_monitor_config_save ( GtkWidget * self , monitor_edit_window * window ) {
monitorconfig * config = yon_dictionary_get_data ( window - > config , monitorconfig * ) ;
monitorconfig * config = yon_dictionary_get_data ( window - > config , monitorconfig * ) ;
if ( gtk_combo_box_get_active ( GTK_COMBO_BOX ( window - > templateMonitorConfigurationPortCombo ) ) = = 0 ) {
if ( gtk_combo_box_get_active ( GTK_COMBO_BOX ( window - > templateMonitorConfigurationPortCombo ) ) = = 0 ) {
@ -118,6 +130,7 @@ void yon_terminal_start(widgets_dict *widgets, char *usr_command){
widgets - > TerminalInfoLabel = yon_gtk_builder_get_widget ( builder , " TerminalInfoLabel " ) ;
widgets - > TerminalInfoLabel = yon_gtk_builder_get_widget ( builder , " TerminalInfoLabel " ) ;
GtkWidget * terminal = yon_gtk_builder_get_widget ( builder , " TerminalTerminal " ) ;
GtkWidget * terminal = yon_gtk_builder_get_widget ( builder , " TerminalTerminal " ) ;
gtk_button_set_label ( GTK_BUTTON ( widgets - > TerminalMoreButton ) , MORE_LABEL ) ;
vte_terminal_set_size ( VTE_TERMINAL ( terminal ) , 10 , 15 ) ;
vte_terminal_set_size ( VTE_TERMINAL ( terminal ) , 10 , 15 ) ;
gtk_widget_set_app_paintable ( terminal , 1 ) ;
gtk_widget_set_app_paintable ( terminal , 1 ) ;
gtk_style_context_add_class ( gtk_widget_get_style_context ( terminal ) , " opacited " ) ;
gtk_style_context_add_class ( gtk_widget_get_style_context ( terminal ) , " opacited " ) ;
@ -202,6 +215,43 @@ void on_driver_pack_delete(GtkWidget *self,widgets_dict *widgets){
}
}
}
}
void on_driver_pack_selection_change ( GtkWidget * self , widgets_dict * widgets ) {
GtkTreeIter iter ;
char * name ;
GtkTreeModel * list_s = GTK_TREE_MODEL ( videoconfig . list ) ;
GtkTreeSelection * selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( widgets - > proprietaryTreeView ) ) ;
if ( gtk_tree_selection_get_selected ( selection , & list_s , & iter ) ) {
int installed = 0 ;
gtk_tree_model_get ( gtk_tree_view_get_model ( GTK_TREE_VIEW ( widgets - > proprietaryTreeView ) ) , & iter , 0 , & installed , - 1 ) ;
if ( installed = = 1 ) {
gtk_widget_set_sensitive ( widgets - > proprietaryInstallButton , 0 ) ;
gtk_widget_set_sensitive ( widgets - > proprietaryDeleteButton , 1 ) ;
} else {
gtk_widget_set_sensitive ( widgets - > proprietaryInstallButton , 1 ) ;
gtk_widget_set_sensitive ( widgets - > proprietaryDeleteButton , 0 ) ;
}
}
}
void on_driver_selection_change ( GtkWidget * self , widgets_dict * widgets ) {
GtkTreeIter iter ;
char * name ;
GtkTreeModel * list_s = GTK_TREE_MODEL ( videoconfig . list ) ;
GtkTreeSelection * selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( widgets - > driversTreeView ) ) ;
if ( gtk_tree_selection_get_selected ( selection , & list_s , & iter ) ) {
int installed = 0 ;
gtk_tree_model_get ( gtk_tree_view_get_model ( GTK_TREE_VIEW ( widgets - > driversTreeView ) ) , & iter , 0 , & installed , - 1 ) ;
if ( installed = = 1 ) {
gtk_widget_set_sensitive ( widgets - > driversInstallButton , 0 ) ;
gtk_widget_set_sensitive ( widgets - > driversDeleteButton , 1 ) ;
} else {
gtk_widget_set_sensitive ( widgets - > driversInstallButton , 1 ) ;
gtk_widget_set_sensitive ( widgets - > driversDeleteButton , 0 ) ;
}
}
}
void on_driver_delete ( GtkWidget * self , widgets_dict * widgets ) {
void on_driver_delete ( GtkWidget * self , widgets_dict * widgets ) {
yon_ubl_status_box_render ( videoconfig . status_render , PROPRIETARY_DELETING_IN_PROGRESS_LABEL , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
yon_ubl_status_box_render ( videoconfig . status_render , PROPRIETARY_DELETING_IN_PROGRESS_LABEL , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
GtkTreeIter iter ;
GtkTreeIter iter ;
@ -251,34 +301,43 @@ void on_driver_info(GtkWidget *self,widgets_dict *widgets){
}
}
void on_port_chosen_changed ( GtkWidget * self , monitor_edit_window * window ) {
void on_port_chosen_changed ( GtkWidget * self , monitor_edit_window * window ) {
monitorconfig * config = yon_dictionary_get_data ( window - > config , monitorconfig * ) ;
if ( yon_dictionary_get_data ( window - > config , monitorconfig * ) - > show_usupported = = 0 ) {
dictionary * dict = NULL ;
monitorconfig * config = yon_dictionary_get_data ( window - > config , monitorconfig * ) ;
gtk_combo_box_text_remove_all ( GTK_COMBO_BOX_TEXT ( window - > templateMonitorConfigurationResolutionCombo ) ) ;
dictionary * dict = NULL ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( window - > templateMonitorConfigurationResolutionCombo ) , PARAMETER_DEFAULT_LABEL ) ;
for ( int i = 0 ; i < window - > resolutionssize ; i + + ) {
gtk_combo_box_set_active ( GTK_COMBO_BOX ( window - > templateMonitorConfigurationResolutionCombo ) , 0 ) ;
free ( window - > resolutions ) ;
char * combo_text = yon_char_new ( ( char * ) gtk_combo_box_text_get_active_text ( GTK_COMBO_BOX_TEXT ( window - > templateMonitorConfigurationPortCombo ) ) ) ;
}
char * resolution = yon_char_divide_search ( combo_text , " " , - 1 ) ;
window - > resolutions = NULL ;
if ( combo_text )
window - > resolutionssize = 0 ;
if ( strcmp ( combo_text , MONITOR_CHOOSE_PORT_LABEL ) ! = 0 ) {
int portid = gtk_combo_box_get_active ( GTK_COMBO_BOX ( window - > templateMonitorConfigurationPortCombo ) ) ;
dict = yon_dictionary_find ( & videoconfig . supported_resolutions , resolution ) ;
if ( portid ! = 0 )
if ( dict ) {
window - > curport = videoconfig . ports [ portid - 1 ] ;
resolution_supported * res = yon_dictionary_get_data ( dict , resolution_supported * ) ;
gtk_combo_box_text_remove_all ( GTK_COMBO_BOX_TEXT ( window - > templateMonitorConfigurationResolutionCombo ) ) ;
int found_size = 0 ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( window - > templateMonitorConfigurationResolutionCombo ) , PARAMETER_DEFAULT_LABEL ) ;
for ( int i = 0 ; i < res - > size ; i + + ) {
gtk_combo_box_set_active ( GTK_COMBO_BOX ( window - > templateMonitorConfigurationResolutionCombo ) , 0 ) ;
char * check_line ;
for ( int j = 0 ; j < videoconfig . resolutionssize ; j + + ) {
if ( window - > curport ) {
check_line = yon_char_new ( videoconfig . resolutions [ j ] ) ;
gtk_window_set_title ( GTK_WINDOW ( gtk_widget_get_toplevel ( window - > mainMonitorConfigurationBox ) ) , window - > curport ) ;
check_line = yon_char_divide_search ( check_line , " " , - 1 ) ;
dict = yon_dictionary_find ( & videoconfig . supported_resolutions , window - > curport ) ;
if ( strstr ( videoconfig . resolutions [ j ] , res - > line [ i ] ) ) {
if ( dict ) {
found_size + + ;
resolution_supported * res = yon_dictionary_get_data ( dict , resolution_supported * ) ;
if ( ! config - > resolutionCapabilities ) config - > resolutionCapabilities = new ( char * ) ;
int found_size = 0 ;
else config - > resolutionCapabilities = realloc ( config - > resolutionCapabilities , sizeof ( char * ) * found_size ) ;
for ( int i = 0 ; i < res - > size ; i + + ) {
config - > resolutionCapabilities [ found_size - 1 ] = videoconfig . resolutions [ j ] ;
char * check_line ;
config - > resolution_size = found_size ;
for ( int j = 0 ; j < videoconfig . resolutionssize ; j + + ) {
check_line = yon_char_new ( videoconfig . resolutions [ j ] ) ;
check_line = yon_char_divide_search ( check_line , " " , - 1 ) ;
if ( strstr ( videoconfig . resolutions [ j ] , res - > line [ i ] ) ) {
found_size + + ;
if ( ! config - > resolutionCapabilities ) config - > resolutionCapabilities = new ( char * ) ;
else config - > resolutionCapabilities = realloc ( config - > resolutionCapabilities , sizeof ( char * ) * found_size ) ;
config - > resolutionCapabilities [ found_size - 1 ] = videoconfig . resolutions [ j ] ;
config - > resolution_size = found_size ;
}
}
}
}
}
yon_gtk_combo_box_fill ( window - > templateMonitorConfigurationResolutionCombo , config - > resolutionCapabilities , config - > resolution_size ) ;
}
}
yon_gtk_combo_box_fill ( window - > templateMonitorConfigurationResolutionCombo , config - > resolutionCapabilities , config - > resolution_size ) ;
}
}
}
}
}
}
@ -387,10 +446,6 @@ void on_configuration_save_local(GtkWidget *self, widgets_dict *widgets)
char * str = NULL ;
char * str = NULL ;
char * delstr = NULL ;
char * delstr = NULL ;
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);
// if (delstr){
// yon_config_save(delstr);
// }
if ( str ) {
if ( str ) {
yon_config_save ( str ) ;
yon_config_save ( str ) ;
yon_ubl_status_box_render ( videoconfig . status_render , LOCAL_SAVE_SUCCESS , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
yon_ubl_status_box_render ( videoconfig . status_render , LOCAL_SAVE_SUCCESS , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
@ -421,10 +476,6 @@ void on_configuration_save_global(GtkWidget *self, widgets_dict *widgets)
char * str = NULL ;
char * str = NULL ;
char * delstr = NULL ;
char * delstr = NULL ;
str = yon_configuration_get_save_command ( save_drivers_global_command ) ;
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);
// }
if ( str ) {
if ( str ) {
yon_config_save ( str ) ;
yon_config_save ( str ) ;
yon_ubl_status_box_render ( videoconfig . status_render , LOCAL_SAVE_SUCCESS , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
yon_ubl_status_box_render ( videoconfig . status_render , LOCAL_SAVE_SUCCESS , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
@ -436,6 +487,7 @@ void yon_update_config(widgets_dict *widgets)
if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( widgets - > mainExtraLaunchOptirunCheck ) ) = = 1 )
if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( widgets - > mainExtraLaunchOptirunCheck ) ) = = 1 )
videoconfig . optirun = yon_char_new ( ( char * ) gtk_entry_get_text ( GTK_ENTRY ( widgets - > mainExtraLaunchOptirunEntry ) ) ) ;
videoconfig . optirun = yon_char_new ( ( char * ) gtk_entry_get_text ( GTK_ENTRY ( widgets - > mainExtraLaunchOptirunEntry ) ) ) ;
else videoconfig . optirun = NULL ;
else videoconfig . optirun = NULL ;
videoconfig . descreteOnly = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( widgets - > mainHybridGraphicsDiscreteCheck ) ) ;
if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( widgets - > mainExtraLaunchPrismusunCheck ) ) = = 1 )
if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( widgets - > mainExtraLaunchPrismusunCheck ) ) = = 1 )
videoconfig . primusrun = yon_char_new ( ( char * ) gtk_entry_get_text ( GTK_ENTRY ( widgets - > mainExtraLaunchPrismusunEntry ) ) ) ;
videoconfig . primusrun = yon_char_new ( ( char * ) gtk_entry_get_text ( GTK_ENTRY ( widgets - > mainExtraLaunchPrismusunEntry ) ) ) ;
else videoconfig . primusrun = NULL ;
else videoconfig . primusrun = NULL ;
@ -448,6 +500,7 @@ void on_configuration_load_local(GtkWidget *self, widgets_dict *widgets)
yon_setup_config ( load_drivers_local_command ) ;
yon_setup_config ( load_drivers_local_command ) ;
on_config_fill_interface ( widgets ) ;
on_config_fill_interface ( widgets ) ;
yon_monitor_view_setup ( widgets - > mainMonitorVisualConfigurationBox ) ;
yon_monitor_view_setup ( widgets - > mainMonitorVisualConfigurationBox ) ;
yon_ubl_status_box_render ( videoconfig . status_render , LOCAL_LOAD_SUCCESS , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
}
}
void on_configuration_load_global ( GtkWidget * self , widgets_dict * widgets )
void on_configuration_load_global ( GtkWidget * self , widgets_dict * widgets )
@ -456,6 +509,7 @@ void on_configuration_load_global(GtkWidget *self, widgets_dict *widgets)
yon_setup_config ( load_drivers_global_command ) ;
yon_setup_config ( load_drivers_global_command ) ;
on_config_fill_interface ( widgets ) ;
on_config_fill_interface ( widgets ) ;
yon_monitor_view_setup ( widgets - > mainMonitorVisualConfigurationBox ) ;
yon_monitor_view_setup ( widgets - > mainMonitorVisualConfigurationBox ) ;
yon_ubl_status_box_render ( videoconfig . status_render , GLOBAL_LOAD_SUCCESS , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
}
}
/**void on_monitor_delete(GtkWidget *self,monitor_view windowd)
/**void on_monitor_delete(GtkWidget *self,monitor_view windowd)
@ -495,7 +549,7 @@ void on_monitor_add(GtkWidget *self,monitor_window *window){
}
}
void on_proprietary_get ( GtkWidget * notebook , GtkWidget * page , int pagen , gpointer data ) {
void on_proprietary_get ( GtkWidget * notebook , GtkWidget * page , int pagen , gpointer data ) {
if ( pagen = = 1 ) {
if ( pagen = = 1 & & videoconfig . dblock = = 0 ) {
GtkTreeIter iter ;
GtkTreeIter iter ;
if ( ! gtk_tree_model_get_iter_first ( GTK_TREE_MODEL ( videoconfig . list ) , & iter ) ) {
if ( ! gtk_tree_model_get_iter_first ( GTK_TREE_MODEL ( videoconfig . list ) , & iter ) ) {
pthread_t tid ;
pthread_t tid ;
@ -566,6 +620,7 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){
gtk_button_set_label ( GTK_BUTTON ( monitors - > templateMonitorConfigurationSaveButton ) , MONITOR_SAVE_LABEL ) ;
gtk_button_set_label ( GTK_BUTTON ( monitors - > templateMonitorConfigurationSaveButton ) , MONITOR_SAVE_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( monitors - > templateMonitorConfigurationPortCombo ) , MONITOR_CHOOSE_PORT_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( monitors - > templateMonitorConfigurationPortCombo ) , MONITOR_CHOOSE_PORT_LABEL ) ;
monitors - > curport = NULL ;
dictionary * dict = NULL ;
dictionary * dict = NULL ;
for ( int i = 0 ; i < videoconfig . portssize ; i + + ) {
for ( int i = 0 ; i < videoconfig . portssize ; i + + ) {
dictionary * check_if_exists = yon_dictionary_find ( & videoconfig . monitors , videoconfig . ports [ i ] ) ;
dictionary * check_if_exists = yon_dictionary_find ( & videoconfig . monitors , videoconfig . ports [ i ] ) ;
@ -591,7 +646,8 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){
gtk_combo_box_set_active ( GTK_COMBO_BOX ( monitors - > templateMonitorConfigurationPositionPosCombo ) , 0 ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( monitors - > templateMonitorConfigurationPositionPosCombo ) , 0 ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( monitors - > templateMonitorConfigurationPositionPortCombo ) , PARAMETER_DEFAULT_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( monitors - > templateMonitorConfigurationPositionPortCombo ) , PARAMETER_DEFAULT_LABEL ) ;
for ( int i = 0 ; i < videoconfig . portssize ; i + + ) {
for ( int i = 0 ; i < videoconfig . portssize ; i + + ) {
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( monitors - > templateMonitorConfigurationPositionPortCombo ) , videoconfig . ports [ i ] ) ;
if ( videoconfig . ports [ i ] ! = monitors - > config - > key )
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( monitors - > templateMonitorConfigurationPositionPortCombo ) , videoconfig . ports [ i ] ) ;
}
}
gtk_combo_box_set_active ( GTK_COMBO_BOX ( monitors - > templateMonitorConfigurationPositionPortCombo ) , 0 ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( monitors - > templateMonitorConfigurationPositionPortCombo ) , 0 ) ;
@ -602,7 +658,7 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){
}
}
void on_read_documentation ( GtkWidget * self , gpointer user_data ) {
void on_read_documentation ( GtkWidget * self , gpointer user_data ) {
yon_ubl_browser_window_open ( UBLINUX_WIKI_LINK , WEB_VIEW_TITLE_LABEL ) ;
yon_ubl_browser_window_open ( user_data , WEB_VIEW_TITLE_LABEL ) ;
}
}
@ -614,6 +670,8 @@ void on_link(GtkWidget *self, char* link, gpointer user_data){
if ( GTK_IS_ABOUT_DIALOG ( self ) ) {
if ( GTK_IS_ABOUT_DIALOG ( self ) ) {
gtk_widget_destroy ( self ) ;
gtk_widget_destroy ( self ) ;
}
}
if ( ! link )
link = UBLINUX_WIKI_LINK ;
if ( videoconfig . alwaysredirect = = 0 ) {
if ( videoconfig . alwaysredirect = = 0 ) {
GtkBuilder * builder = gtk_builder_new_from_file ( glade_path ) ;
GtkBuilder * builder = gtk_builder_new_from_file ( glade_path ) ;
GtkWidget * sureWindow = yon_gtk_builder_get_widget ( builder , " HelpSureWindow " ) ;
GtkWidget * sureWindow = yon_gtk_builder_get_widget ( builder , " HelpSureWindow " ) ;
@ -624,7 +682,7 @@ void on_link(GtkWidget *self, char* link, gpointer user_data){
GtkWidget * textLabel = yon_gtk_builder_get_widget ( builder , " helpText " ) ;
GtkWidget * textLabel = yon_gtk_builder_get_widget ( builder , " helpText " ) ;
GtkWidget * alwaysOpenCheck = yon_gtk_builder_get_widget ( builder , " AlwaysOpenHelpCheckbox " ) ;
GtkWidget * alwaysOpenCheck = yon_gtk_builder_get_widget ( builder , " AlwaysOpenHelpCheckbox " ) ;
g_signal_connect ( G_OBJECT ( readButton ) , " clicked " , G_CALLBACK ( on_read_documentation ) , NULL ) ;
g_signal_connect ( G_OBJECT ( readButton ) , " clicked " , G_CALLBACK ( on_read_documentation ) , yon_char_new ( link ) ) ;
g_signal_connect ( G_OBJECT ( readButton ) , " clicked " , G_CALLBACK ( on_subwindow_close ) , NULL ) ;
g_signal_connect ( G_OBJECT ( readButton ) , " clicked " , G_CALLBACK ( on_subwindow_close ) , NULL ) ;
g_signal_connect ( G_OBJECT ( cancelButton ) , " clicked " , G_CALLBACK ( on_subwindow_close ) , NULL ) ;
g_signal_connect ( G_OBJECT ( cancelButton ) , " clicked " , G_CALLBACK ( on_subwindow_close ) , NULL ) ;
g_signal_connect ( G_OBJECT ( alwaysOpenCheck ) , " toggled " , G_CALLBACK ( on_toggle ) , & videoconfig . alwaysredirect ) ;
g_signal_connect ( G_OBJECT ( alwaysOpenCheck ) , " toggled " , G_CALLBACK ( on_toggle ) , & videoconfig . alwaysredirect ) ;
@ -638,7 +696,7 @@ void on_link(GtkWidget *self, char* link, gpointer user_data){
gtk_widget_show ( sureWindow ) ;
gtk_widget_show ( sureWindow ) ;
} else {
} else {
on_read_documentation ( NULL , NULL ) ;
on_read_documentation ( NULL , link ) ;
}
}
}
}
@ -661,10 +719,22 @@ void on_about()
void yon_monitor_window_update ( monitor_edit_window * window ) {
void yon_monitor_window_update ( monitor_edit_window * window ) {
if ( window ) {
if ( window ) {
int found = yon_ gtk_combo_box_text_find( window - > templateMonitorConfigurationPortCombo , window - > config - > key ) ;
int found = yon_ char_parsed_check_exist( videoconfig . ports , videoconfig . portssize , window - > config - > key ) ;
if ( found = = - 1 )
if ( found = = - 1 )
found = 0 ;
found = 0 ;
else
found + + ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( window - > templateMonitorConfigurationPortCombo ) , found ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( window - > templateMonitorConfigurationPortCombo ) , found ) ;
on_resolutions_unsupported_show ( window - > templateMonitorConfigurationShowUnsupportedCheck , window ) ;
if ( ( ( monitorconfig * ) window - > config - > data ) - > resolutionCapabilities ) {
// printf("%s\n",((monitorconfig*)window->config->data)->resolution);
found = yon_gtk_combo_box_text_find ( window - > templateMonitorConfigurationResolutionCombo , ( ( monitorconfig * ) window - > config - > data ) - > resolution ) ;
} else {
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( window - > templateMonitorConfigurationShowUnsupportedCheck ) , 1 ) ;
found = yon_gtk_combo_box_text_find ( window - > templateMonitorConfigurationResolutionCombo , ( ( monitorconfig * ) window - > config - > data ) - > resolution ) ;
}
if ( found = = - 1 )
found = 0 ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( window - > templateMonitorConfigurationResolutionCombo ) , found ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( window - > templateMonitorConfigurationResolutionCombo ) , found ) ;
gtk_combo_box_text_remove_all ( GTK_COMBO_BOX_TEXT ( window - > templateMonitorConfigurationFrequencyCombo ) ) ;
gtk_combo_box_text_remove_all ( GTK_COMBO_BOX_TEXT ( window - > templateMonitorConfigurationFrequencyCombo ) ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( window - > templateMonitorConfigurationFrequencyCombo ) , PARAMETER_DEFAULT_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( window - > templateMonitorConfigurationFrequencyCombo ) , PARAMETER_DEFAULT_LABEL ) ;
@ -689,33 +759,62 @@ void yon_monitor_window_update(monitor_edit_window *window){
}
}
/**void yon_monitor_view_draw_all(GtkWidget *cnt)
/**void yon_monitor_view_draw_all(GtkWidget *cnt)
* [ EN ]
* [ EN ]
*/
*/
void yon_monitor_view_draw_all ( GtkWidget * cnt ) {
void yon_monitor_view_draw_all ( ) {
monitor_view dict = NULL ;
monitor_view dict = NULL ;
GtkWidget * container = NULL ;
GtkWidget * container = NULL ;
if ( ! container & & cnt ) container = cnt ;
if ( videoconfig . monitor_visuals ) {
if ( videoconfig . monitor_visuals ) {
for_dictionaries ( dict , videoconfig . monitor_visuals ) {
for_dictionaries ( dict , videoconfig . monitor_visuals ) {
monitor_window * window = yon_dictionary_get_data ( dict , monitor_window * ) ;
monitor_window * window = yon_dictionary_get_data ( dict , monitor_window * ) ;
if ( ! container ) container = gtk_widget_get_parent ( window - > templateMonitorscreenOverlay ) ;
container = gtk_widget_get_parent ( window - > templateMonitorscreenOverlay ) ;
if ( container ) {
if ( container ) {
g_object_ref ( G_OBJECT ( window - > templateMonitorscreenOverlay ) ) ;
g_object_ref ( G_OBJECT ( window - > templateMonitorscreenOverlay ) ) ;
gtk_container_remove ( GTK_CONTAINER ( container ) , window - > templateMonitorscreenOverlay ) ;
gtk_container_remove ( GTK_CONTAINER ( container ) , window - > templateMonitorscreenOverlay ) ;
}
}
}
}
if ( container )
dictionary * boxes = NULL ;
if ( videoconfig . monitor_output_layers )
for_dictionaries ( boxes , videoconfig . monitor_output_layers ) {
gtk_widget_destroy ( ( GtkWidget * ) boxes - > data ) ;
if ( boxes - > prev )
free ( boxes - > prev ) ;
boxes - > prev = NULL ;
}
free ( boxes ) ;
videoconfig . monitor_output_layers = NULL ;
int overall_width = 0 ;
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . monitor_output_layers , " Box " , gtk_box_new ( GTK_ORIENTATION_HORIZONTAL , 0 ) ) ;
gtk_box_pack_start ( GTK_BOX ( videoconfig . pack_box ) , & * ( GtkWidget * ) videoconfig . monitor_output_layers - > data , 0 , 0 , 0 ) ;
gtk_widget_show ( ( GtkWidget * ) videoconfig . monitor_output_layers - > data ) ;
for_dictionaries ( dict , videoconfig . monitor_visuals ) {
for_dictionaries ( dict , videoconfig . monitor_visuals ) {
monitor_window * window = yon_dictionary_get_data ( dict , monitor_window * ) ;
monitor_window * window = yon_dictionary_get_data ( dict , monitor_window * ) ;
if ( dict - > first = = dict ) { }
if ( dict - > first = = dict ) { }
else {
else {
gtk_box_pack_start ( GTK_BOX ( container ) , window - > templateMonitorscreenOverlay , 0 , 0 , 0 ) ;
overall_width + = 138 ;
GtkWidget * boxpack = ( GtkWidget * ) videoconfig . monitor_output_layers - > data ;
gtk_box_pack_start ( GTK_BOX ( boxpack ) , window - > templateMonitorscreenOverlay , 0 , 0 , 0 ) ;
}
int width = 0 ;
GdkWindow * cur_window = gtk_widget_get_window ( videoconfig . pack_box ) ;
if ( cur_window )
width = gdk_window_get_width ( cur_window ) ;
if ( overall_width + 138 > width ) {
overall_width = 0 ;
GtkWidget * boxpack = NULL ;
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . monitor_output_layers , " Box " , ( boxpack = gtk_box_new ( GTK_ORIENTATION_HORIZONTAL , 0 ) ) ) ;
gtk_widget_show ( ( GtkWidget * ) videoconfig . monitor_output_layers - > data ) ;
gtk_box_pack_start ( GTK_BOX ( videoconfig . pack_box ) , boxpack , 0 , 0 , 0 ) ;
}
}
}
}
gtk_widget_show ( ( GtkWidget * ) videoconfig . monitor_output_layers - > data ) ;
monitor_window * window = yon_dictionary_get_data ( videoconfig . monitor_visuals - > first , monitor_window * ) ;
monitor_window * window = yon_dictionary_get_data ( videoconfig . monitor_visuals - > first , monitor_window * ) ;
gtk_box_pack_start ( GTK_BOX ( container ) , window - > templateMonitorscreenOverlay , 0 , 0 , 0 ) ;
gtk_box_pack_start ( GTK_BOX ( ( ( GtkWidget * ) videoconfig . monitor_output_layers - > data ) ) , window - > templateMonitorscreenOverlay , 0 , 0 , 0 ) ;
}
}
yon_monitor_view_update ( ) ;
yon_monitor_view_update ( ) ;
}
}
@ -983,27 +1082,50 @@ void on_config_fill_interface(widgets_dict *widgets)
*/
*/
dictionary * yon_proprieary_get ( ) {
dictionary * yon_proprieary_get ( ) {
yon_ubl_status_box_render ( videoconfig . status_render , PROPRIETARY_LOADING_LABEL , BACKGROUND_IMAGE_FAIL_TYPE ) ;
yon_ubl_status_box_render ( videoconfig . status_render , PROPRIETARY_LOADING_LABEL , BACKGROUND_IMAGE_FAIL_TYPE ) ;
videoconfig . dblock = 1 ;
videoconfig . proprietary = NULL ;
videoconfig . proprietary = NULL ;
int drivers_size = 0 ;
int drivers_size = 0 ;
config_str drivers = yon_config_load ( get_proprietary_drivers_command , & drivers_size ) ;
int size = 0 ;
int size = 0 ;
char * * rtn = yon_config_load ( get_proprietary_drivers_info_command , & size ) ;
config_str drivers = NULL ;
for ( int drivers_found = 0 ; drivers_found < drivers_size ; drivers_found + + ) {
config_str rtn = NULL ;
drivers [ drivers_found ] = yon_char_divide_search ( drivers [ drivers_found ] , " \n " , - 1 ) ;
rtn = yon_config_load ( get_proprietary_drivers_info_command , & size ) ;
for ( int i = 0 ; i < size ; i + + ) {
// drivers=yon_config_load(get_proprietary_installed_command,&drivers_size);
rtn [ i ] = yon_char_divide_search ( rtn [ i ] , " \n " , - 1 ) ;
// for (int dr_desc=0;dr_desc<drivers_size;dr_desc++){
char * keyp = yon_char_new ( rtn [ i ] ) ;
// for (int dr_foun=0;dr_foun<drivers_size;dr_foun++){
if ( keyp [ 0 ] = = ' ; ' )
// drivers[dr_foun]=yon_char_divide_search(drivers[dr_foun],"\n",-1);
yon_char_divide_search ( keyp , " ; " , - 1 ) ;
// char *pack=yon_char_new(rtn[dr_desc]);
char * key = yon_char_divide_search ( keyp , " ; " , - 1 ) ;
// char *ubm=yon_char_divide_search(pack,";",-1);
keyp = yon_char_divide_search ( keyp , " ; " , - 1 ) ;
// pack=yon_char_divide_search(pack,";",-1);
char * driver_name = yon_char_divide_search ( yon_char_new ( drivers [ drivers_found ] ) , " " , - 1 ) ;
// if (strcmp(drivers[dr_foun],ubm)==0){
if ( strcmp ( key , driver_name ) = = 0 | | keyp )
// yon_dictionary_add_or_create_if_exists_with_data(videoconfig.proprietary,drivers[dr_foun],rtn[dr_desc]);
if ( i = = 0 ) videoconfig . proprietary = yon_dictionary_create_with_data ( drivers [ drivers_found ] , rtn [ i ] ) ;
// }
else videoconfig . proprietary = yon_dictionary_create_with_data_connected ( videoconfig . proprietary , drivers [ drivers_found ] , rtn [ i ] ) ;
// // else if (strcmp(pack,"")!=0&&!(yon_dictionary_find(!videoconfig.proprietary||&videoconfig.proprietary,pack))){
// // yon_dictionary_add_or_create_if_exists_with_data(videoconfig.proprietary,pack,rtn[dr_desc]);
// // }
// }
// }
if ( videoconfig . proprietary ) {
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . list ) ;
videoconfig . proprietary = NULL ;
}
drivers = yon_config_load ( get_proprietary_drivers_command , & drivers_size ) ;
printf ( " begin loading information \n " ) ;
for ( int dr_desc = 0 ; dr_desc < size ; dr_desc + + ) {
for ( int dr_foun = 0 ; dr_foun < drivers_size ; dr_foun + + ) {
drivers [ dr_foun ] = yon_char_divide_search ( drivers [ dr_foun ] , " \n " , - 1 ) ;
char * pack = yon_char_new ( rtn [ dr_desc ] ) ;
char * ubm = yon_char_divide_search ( pack , " ; " , - 1 ) ;
pack = yon_char_divide_search ( pack , " ; " , - 1 ) ;
if ( strcmp ( drivers [ dr_foun ] , ubm ) = = 0 ) {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , drivers [ dr_foun ] , rtn [ dr_desc ] ) ;
}
else if ( strcmp ( pack , " " ) ! = 0 & & ! yon_dictionary_find ( & videoconfig . proprietary , pack ) ) {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , pack , rtn [ dr_desc ] ) ;
}
}
}
}
}
if ( videoconfig . proprietary ) {
if ( videoconfig . proprietary ) {
printf ( " printing information \n " ) ;
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . list ) ;
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . list ) ;
yon_ubl_status_box_render ( videoconfig . status_render , PROPRIETARY_OPETAION_DONE_LABEL , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
yon_ubl_status_box_render ( videoconfig . status_render , PROPRIETARY_OPETAION_DONE_LABEL , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
} else {
} else {
@ -1027,8 +1149,8 @@ dictionary *yon_proprieary_get(){
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . list ) ;
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . list ) ;
yon_ubl_status_box_render ( videoconfig . status_render , PROPRIETARY_USE_LOCAL_LABEL , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
yon_ubl_status_box_render ( videoconfig . status_render , PROPRIETARY_USE_LOCAL_LABEL , BACKGROUND_IMAGE_SUCCESS_TYPE ) ;
} else
} else {
{
videoconfig . dblock = 0 ;
yon_ubl_status_box_render ( videoconfig . status_render , PROPRIETARY_LOADING_FAILED_LABEL , BACKGROUND_IMAGE_FAIL_TYPE ) ;
yon_ubl_status_box_render ( videoconfig . status_render , PROPRIETARY_LOADING_FAILED_LABEL , BACKGROUND_IMAGE_FAIL_TYPE ) ;
}
}
}
}
@ -1043,21 +1165,28 @@ void yon_gtk_list_store_fill_with_proprietaries(GtkListStore *list){
dictionary * dict = NULL ;
dictionary * dict = NULL ;
gtk_list_store_clear ( videoconfig . list ) ;
gtk_list_store_clear ( videoconfig . list ) ;
gtk_list_store_clear ( videoconfig . list2 ) ;
gtk_list_store_clear ( videoconfig . list2 ) ;
int inssize = 0 ;
config_str installed = yon_config_load ( get_proprietary_installed_command , & inssize ) ;
for ( int i = 0 ; i < inssize ; i + + )
installed [ i ] = yon_char_divide_search ( installed [ i ] , " \n " , - 1 ) ;
for_dictionaries ( dict , videoconfig . proprietary ) {
for_dictionaries ( dict , videoconfig . proprietary ) {
GtkTreeIter iter ;
GtkTreeIter iter ;
int size = 0 ;
int size = 0 ;
config_str str = yon_char_parse ( ( char * ) dict - > data , & size , " ; " ) ;
config_str str = yon_char_parse ( ( char * ) dict - > data , & size , " ; " ) ;
printf ( " %s \n " , str [ 0 ] ) ;
if ( strcmp ( str [ 0 ] , " " ) ! = 0 & & str [ 0 ] ) {
if ( strcmp ( str [ 0 ] , " " ) ! = 0 & & str [ 0 ] ) {
gtk_list_store_append ( videoconfig . list , & iter ) ;
gtk_list_store_append ( videoconfig . list , & iter ) ;
gtk_list_store_set ( videoconfig . list , & iter , 1 , str [ 0 ] , 2 , str [ 1 ] , 3 , str [ 2 ] , 4 , _ ( str [ 3 ] ) , 5 , _ ( str [ 4 ] ) , - 1 ) ;
gtk_list_store_set ( videoconfig . list , & iter , 1 , str [ 0 ] , 2 , str [ 1 ] , 3 , str [ 2 ] , 4 , _ ( str [ 3 ] ) , 5 , _ ( str [ 4 ] ) , - 1 ) ;
if ( yon_char_parsed_check_exist ( installed , inssize , str [ 0 ] ) ! = - 1 )
gtk_list_store_set ( videoconfig . list , & iter , 0 , 1 , - 1 ) ;
}
}
else {
else {
gtk_list_store_append ( videoconfig . list2 , & iter ) ;
gtk_list_store_append ( videoconfig . list2 , & iter ) ;
gtk_list_store_set ( videoconfig . list2 , & iter , 1 , str [ 0 ] , 2 , str [ 1 ] , 3 , str [ 2 ] , 4 , _ ( str [ 3 ] ) , 5 , _ ( str [ 4 ] ) , - 1 ) ;
gtk_list_store_set ( videoconfig . list2 , & iter , 1 , str [ 0 ] , 2 , str [ 1 ] , 3 , str [ 2 ] , 4 , _ ( str [ 3 ] ) , 5 , _ ( str [ 4 ] ) , - 1 ) ;
if ( yon_char_parsed_check_exist ( installed , inssize , str [ 1 ] ) ! = - 1 ) {
gtk_list_store_set ( videoconfig . list2 , & iter , 0 , 1 , - 1 ) ;
}
}
}
if ( strstr ( dict - > key , " installed " ) )
gtk_list_store_set ( videoconfig . list , & iter , 0 , 1 , - 1 ) ;
}
}
}
}
}
}
@ -1093,6 +1222,7 @@ void yon_setup_config(char *configcommand)
videoconfig . failsafenVidia = NULL ;
videoconfig . failsafenVidia = NULL ;
videoconfig . gapfix = 0 ;
videoconfig . gapfix = 0 ;
videoconfig . loaded_config = NULL ;
videoconfig . loaded_config = NULL ;
videoconfig . dblock = 0 ;
if ( videoconfig . optirun )
if ( videoconfig . optirun )
free ( videoconfig . optirun ) ;
free ( videoconfig . optirun ) ;
videoconfig . optirun = NULL ;
videoconfig . optirun = NULL ;
@ -1283,6 +1413,10 @@ void yon_monitor_view_new(monitor_config monitor){
window - > templateMonitorInfoAddButton = yon_gtk_builder_get_widget ( builder , " templateMonitorInfoAddButton " ) ;
window - > templateMonitorInfoAddButton = yon_gtk_builder_get_widget ( builder , " templateMonitorInfoAddButton " ) ;
window - > config = NULL ;
window - > config = NULL ;
gtk_overlay_add_overlay ( GTK_OVERLAY ( window - > templateMonitorscreenOverlay ) , window - > templateMonitorInfoBox ) ;
gtk_overlay_add_overlay ( GTK_OVERLAY ( window - > templateMonitorscreenOverlay ) , window - > templateMonitorInfoBox ) ;
gtk_widget_set_tooltip_text ( window - > templateMonitorDeleteButton , DELETE_LABEL ) ;
gtk_widget_set_tooltip_text ( window - > templateMonitorInfoConfigureButton , CONFIGURE_LABEL ) ;
gtk_widget_set_tooltip_text ( window - > templateMonitorSwitchButton , SWITCH_LABEL ) ;
gtk_widget_set_tooltip_text ( window - > templateMonitorInfoAddButton , ADD_LABEL ) ;
if ( monitor ) {
if ( monitor ) {
window - > config = monitor ;
window - > config = monitor ;
gtk_widget_hide ( window - > templateMonitorInfoAddButton ) ;
gtk_widget_hide ( window - > templateMonitorInfoAddButton ) ;
@ -1357,9 +1491,10 @@ void yon_adapter_window_setup(widgets_dict *widgets){
yon_char_divide_search ( product , " = " , - 1 ) ;
yon_char_divide_search ( product , " = " , - 1 ) ;
char * vendor = yon_config_get_parameter ( rtn , size , " vendor " ) ;
char * vendor = yon_config_get_parameter ( rtn , size , " vendor " ) ;
yon_char_divide_search ( vendor , " = " , - 1 ) ;
yon_char_divide_search ( vendor , " = " , - 1 ) ;
char * driver_use = yon_config_get_parameter ( rtn , size , " Kernel _driver_in_ use" ) ;
char * driver_use = yon_config_get_parameter ( rtn , size , " Kernel -driver-in- use" ) ;
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 " ) ;
driver_all = yon_char_replace ( driver_all , " - " , " " ) ;
yon_char_divide_search ( driver_all , " = " , - 1 ) ;
yon_char_divide_search ( driver_all , " = " , - 1 ) ;
char * final_text = yon_char_unite ( " <span size= \" 12pt \" ><span weight='bold' color='#1a5fb4'> " , DESCRIPTION_LABEL , " :</span> " , _ ( desc ) ,
char * final_text = yon_char_unite ( " <span size= \" 12pt \" ><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 ,
@ -1371,7 +1506,7 @@ void yon_adapter_window_setup(widgets_dict *widgets){
GtkIconTheme * icthm = gtk_icon_theme_get_default ( ) ;
GtkIconTheme * icthm = gtk_icon_theme_get_default ( ) ;
gtk_image_set_from_pixbuf ( GTK_IMAGE ( widgets - > InformationCompanyLogoImage ) , gtk_icon_info_load_icon ( gtk_icon_theme_lookup_icon_for_scale ( icthm , " com.ublinux.ubl-settings-video.intel-logo " , 64 , 1 , GTK_ICON_LOOKUP_FORCE_SVG ) , NULL ) ) ;
gtk_image_set_from_pixbuf ( GTK_IMAGE ( widgets - > InformationCompanyLogoImage ) , gtk_icon_info_load_icon ( gtk_icon_theme_lookup_icon_for_scale ( icthm , " com.ublinux.ubl-settings-video.intel-logo " , 64 , 1 , GTK_ICON_LOOKUP_FORCE_SVG ) , NULL ) ) ;
}
}
else if ( strstr ( vendor , " NV idia " ) ) {
else if ( strstr ( vendor , " NV IDIA " ) ) {
GtkIconTheme * icthm = gtk_icon_theme_get_default ( ) ;
GtkIconTheme * icthm = gtk_icon_theme_get_default ( ) ;
gtk_image_set_from_pixbuf ( GTK_IMAGE ( widgets - > InformationCompanyLogoImage ) , gtk_icon_info_load_icon ( gtk_icon_theme_lookup_icon_for_scale ( icthm , " com.ublinux.ubl-settings-video.nvidia-logo " , 64 , 1 , GTK_ICON_LOOKUP_FORCE_SVG ) , NULL ) ) ;
gtk_image_set_from_pixbuf ( GTK_IMAGE ( widgets - > InformationCompanyLogoImage ) , gtk_icon_info_load_icon ( gtk_icon_theme_lookup_icon_for_scale ( icthm , " com.ublinux.ubl-settings-video.nvidia-logo " , 64 , 1 , GTK_ICON_LOOKUP_FORCE_SVG ) , NULL ) ) ;
}
}
@ -1494,8 +1629,9 @@ void yon_setup_widgets(widgets_dict *widgets)
widgets - > driverDriverColumn = GTK_TREE_VIEW_COLUMN ( gtk_builder_get_object ( widgets - > builder , " driverDriverColumn " ) ) ;
widgets - > driverDriverColumn = GTK_TREE_VIEW_COLUMN ( gtk_builder_get_object ( widgets - > builder , " driverDriverColumn " ) ) ;
widgets - > driverDescriptionColumn = GTK_TREE_VIEW_COLUMN ( gtk_builder_get_object ( widgets - > builder , " driverDescriptionColumn " ) ) ;
widgets - > driverDescriptionColumn = GTK_TREE_VIEW_COLUMN ( gtk_builder_get_object ( widgets - > builder , " driverDescriptionColumn " ) ) ;
widgets - > driverSupportedColumn = GTK_TREE_VIEW_COLUMN ( gtk_builder_get_object ( widgets - > builder , " driverSupportedColumn " ) ) ;
widgets - > driverSupportedColumn = GTK_TREE_VIEW_COLUMN ( gtk_builder_get_object ( widgets - > builder , " driverSupportedColumn " ) ) ;
videoconfig . pack_box = widgets - > mainMonitorVisualConfigurationBox ;
gtk_window_set_title ( GTK_WINDOW ( widgets - > MainWindow ) , TITLE_LABEL ) ;
// g_signal_connect(G_OBJECT(widgets->MainWindow), "check-resize", G_CALLBACK(on_resized), NULL);
gtk_window_set_title ( GTK_WINDOW ( widgets - > MainWindow ) , SETTINGS_VIDEO_TITLE_LABEL ) ;
videoconfig . list = GTK_LIST_STORE ( gtk_builder_get_object ( widgets - > builder , " liststore6 " ) ) ;
videoconfig . list = GTK_LIST_STORE ( gtk_builder_get_object ( widgets - > builder , " liststore6 " ) ) ;
videoconfig . list2 = GTK_LIST_STORE ( gtk_builder_get_object ( widgets - > builder , " liststore1 " ) ) ;
videoconfig . list2 = GTK_LIST_STORE ( gtk_builder_get_object ( widgets - > builder , " liststore1 " ) ) ;
@ -1507,6 +1643,8 @@ void yon_setup_widgets(widgets_dict *widgets)
g_signal_connect ( G_OBJECT ( widgets - > proprietaryDeleteButton ) , " clicked " , G_CALLBACK ( on_driver_pack_delete ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > proprietaryDeleteButton ) , " clicked " , G_CALLBACK ( on_driver_pack_delete ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > proprietaryInstallButton ) , " clicked " , G_CALLBACK ( on_driver_pack_install ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > proprietaryInstallButton ) , " clicked " , G_CALLBACK ( on_driver_pack_install ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > proprietaryInfoButton ) , " clicked " , G_CALLBACK ( on_driver_pack_info ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > proprietaryInfoButton ) , " clicked " , G_CALLBACK ( on_driver_pack_info ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > proprietaryTreeView ) , " cursor-changed " , G_CALLBACK ( on_driver_pack_selection_change ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > driversTreeView ) , " cursor-changed " , G_CALLBACK ( on_driver_selection_change ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > driversDeleteButton ) , " clicked " , G_CALLBACK ( on_driver_delete ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > driversDeleteButton ) , " clicked " , G_CALLBACK ( on_driver_delete ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > driversInstallButton ) , " clicked " , G_CALLBACK ( on_driver_install ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > driversInstallButton ) , " clicked " , G_CALLBACK ( on_driver_install ) , widgets ) ;
@ -1521,7 +1659,7 @@ void yon_setup_widgets(widgets_dict *widgets)
g_signal_connect ( G_OBJECT ( widgets - > MainWindow ) , " destroy " , G_CALLBACK ( gtk_main_quit ) , NULL ) ;
g_signal_connect ( G_OBJECT ( widgets - > MainWindow ) , " destroy " , G_CALLBACK ( gtk_main_quit ) , NULL ) ;
// g_signal_connect(G_OBJECT(widgets->extraOptirunChooseAppsButton), "clicked", G_CALLBACK(on_apps_chooser_open), widgets );
// g_signal_connect(G_OBJECT(widgets->extraOptirunChooseAppsButton), "clicked", G_CALLBACK(on_apps_chooser_open), NULL );
// g_signal_connect(G_OBJECT(widgets->extraPrimusunChooseAppsButton), "clicked", G_CALLBACK(on_apps_chooser_open), widgets);
// g_signal_connect(G_OBJECT(widgets->extraPrimusunChooseAppsButton), "clicked", G_CALLBACK(on_apps_chooser_open), widgets);
g_signal_connect ( G_OBJECT ( widgets - > mainHeaderSettingsAboutMenuItem ) , " activate " , G_CALLBACK ( on_about ) , NULL ) ;
g_signal_connect ( G_OBJECT ( widgets - > mainHeaderSettingsAboutMenuItem ) , " activate " , G_CALLBACK ( on_about ) , NULL ) ;
@ -1539,9 +1677,11 @@ void yon_setup_widgets(widgets_dict *widgets)
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainDriverFailsafeAMDCombo ) , OFF_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainDriverFailsafeAMDCombo ) , OFF_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 ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainExtraFixGapCombo ) , SWITCHED_OFF_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainExtraFixGapCombo ) , GAP_FIX_1_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainExtraFixGapCombo ) , GAP_FIX_1_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainExtraFixGapCombo ) , GAP_FIX_2_LABEL ) ;
gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( widgets - > mainExtraFixGapCombo ) , GAP_FIX_2_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > headInfoLabel ) , HEADER_LABEL ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > mainExtraFixGapCombo ) , 0 ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > headInfoLabel ) , SETTINGS_VIDEO_TITLE_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainDriverFailsafeNvidiaLabel ) , FAILSAFE_NVIDIA_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainDriverFailsafeNvidiaLabel ) , FAILSAFE_NVIDIA_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainDriverFailsafeAMDLabel ) , FAILSAFE_ATI_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainDriverFailsafeAMDLabel ) , FAILSAFE_ATI_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainDriverFrameLabel ) , DRIVER_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainDriverFrameLabel ) , DRIVER_LABEL ) ;
@ -1549,7 +1689,7 @@ void yon_setup_widgets(widgets_dict *widgets)
gtk_label_set_text ( GTK_LABEL ( widgets - > mainHybridGraphicsFrameLabel ) , HYBRID_GRAPHICS_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainHybridGraphicsFrameLabel ) , HYBRID_GRAPHICS_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainExtraFixGapLabel ) , FIX_GAP_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainExtraFixGapLabel ) , FIX_GAP_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainExtraFrameLabel ) , EXTRA_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainExtraFrameLabel ) , EXTRA_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainHeaderTitleLabel ) , TITLE_LABEL) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainHeaderTitleLabel ) , SETTINGS_VIDEO_ TITLE_LABEL) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainHeaderConfigLoadLabel ) , LOAD_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainHeaderConfigLoadLabel ) , LOAD_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainHeaderSaveConfigurationLabel ) , SAVE_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( widgets - > mainHeaderSaveConfigurationLabel ) , SAVE_LABEL ) ;
@ -1675,9 +1815,14 @@ int main(int argc, char *argv[])
}
}
if ( getuid ( ) ! = 0 ) {
if ( getuid ( ) ! = 0 ) {
system ( " /usr/bin/pkexec ubl-settings-video " ) ;
char * args = " " ;
for ( int i = 0 ; i < argc ; i + + )
args = yon_char_unite ( args , " " , argv [ i ] , NULL ) ;
if ( system ( yon_char_get_augumented ( " /usr/bin/pkexec ubl-settings-video " , args ) ) ) ;
return 0 ;
return 0 ;
} else {
} else {
int ssize = 0 ;
yon_config_load ( " pkexec pacman -Sy " , & ssize ) ;
gtk_init ( & argc , & argv ) ;
gtk_init ( & argc , & argv ) ;
GError error ;
GError error ;
yon_setup_config ( load_drivers_local_command ) ;
yon_setup_config ( load_drivers_local_command ) ;
@ -1697,6 +1842,7 @@ int main(int argc, char *argv[])
- 1 ) ;
- 1 ) ;
yon_monitor_view_update ( ) ;
yon_monitor_view_update ( ) ;
yon_ubl_setup_sockets ( widgets . PlugBox , widgets . PlugLoadBox , widgets . PlugSaveBox , videoconfig . socket_id , videoconfig . load_socket_id , videoconfig . save_socket_id ) ;
yon_ubl_setup_sockets ( widgets . PlugBox , widgets . PlugLoadBox , widgets . PlugSaveBox , videoconfig . socket_id , videoconfig . load_socket_id , videoconfig . save_socket_id ) ;
g_signal_connect ( G_OBJECT ( gtk_widget_get_parent ( widgets . mainPlugBox ) ) , " check-resize " , G_CALLBACK ( on_resized ) , NULL ) ;
gtk_main ( ) ;
gtk_main ( ) ;
return 0 ;
return 0 ;
}
}