|
|
|
|
@ -30,7 +30,7 @@ void on_resized(GtkWidget *window, GdkEventConfigure *event){
|
|
|
|
|
void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
|
monitorconfig *config = yon_dictionary_get_data(window->config,monitorconfig*);
|
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationPortCombo))==0){
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,MONITOR_PORT_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(MONITOR_PORT_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
config->main=0;
|
|
|
|
|
@ -44,7 +44,7 @@ void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
|
config->port=NULL;
|
|
|
|
|
config->resolution=NULL;
|
|
|
|
|
config->frequency=0;
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,MONITOR_PORT_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(MONITOR_PORT_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
config->port = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationPortCombo));
|
|
|
|
|
window->config->key = yon_char_new(config->port);
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->templateMonitorConfigurationParameterLineCheck))==0){
|
|
|
|
|
@ -97,7 +97,7 @@ void on_terminal_destroy(GtkWidget *self, widgets_dict *widgets){
|
|
|
|
|
gtk_widget_destroy(widgets->TerminalRevealer);
|
|
|
|
|
yon_proprieary_get();
|
|
|
|
|
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(PROPRIETARY_OPETAION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void child_ready(VteTerminal *terminal, GPid pid, GError *error, gpointer user_data)
|
|
|
|
|
@ -174,44 +174,44 @@ void yon_terminal_start(widgets_dict *widgets, char *usr_command){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_driver_pack_install(GtkWidget *self,widgets_dict *widgets){
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,PROPRIETARY_INSTALLING_IN_PROGRESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_INSTALLING_IN_PROGRESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
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)){
|
|
|
|
|
gtk_tree_model_get(list_s,&iter,1,&name,-1);
|
|
|
|
|
yon_terminal_start(widgets,yon_char_get_augumented(install_proprietary_command,name));
|
|
|
|
|
yon_terminal_start(widgets,yon_char_append(install_proprietary_command,name));
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_driver_install(GtkWidget *self,widgets_dict *widgets){
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,PROPRIETARY_INSTALLING_IN_PROGRESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_INSTALLING_IN_PROGRESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
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)){
|
|
|
|
|
gtk_tree_model_get(list_s,&iter,2,&name,-1);
|
|
|
|
|
yon_terminal_start(widgets,yon_char_get_augumented(install_proprietary_command,name));
|
|
|
|
|
yon_terminal_start(widgets,yon_char_append(install_proprietary_command,name));
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_driver_pack_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(PROPRIETARY_DELETING_IN_PROGRESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
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)){
|
|
|
|
|
gtk_tree_model_get(list_s,&iter,1,&name,-1);
|
|
|
|
|
yon_terminal_start(widgets,yon_char_get_augumented(delete_proprietary_command,name));
|
|
|
|
|
yon_terminal_start(widgets,yon_char_append(delete_proprietary_command,name));
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -253,16 +253,16 @@ void on_driver_selection_change(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(PROPRIETARY_DELETING_IN_PROGRESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
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)){
|
|
|
|
|
gtk_tree_model_get(list_s,&iter,2,&name,-1);
|
|
|
|
|
yon_terminal_start(widgets,yon_char_get_augumented(delete_proprietary_command,name));
|
|
|
|
|
yon_terminal_start(widgets,yon_char_append(delete_proprietary_command,name));
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -277,9 +277,9 @@ void on_driver_pack_info(GtkWidget *self, widgets_dict *widgets){
|
|
|
|
|
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->proprietaryTreeView));
|
|
|
|
|
if (gtk_tree_selection_get_selected(selection,&list_s,&iter)){
|
|
|
|
|
gtk_tree_model_get(list_s,&iter,1,&name,-1);
|
|
|
|
|
pthread_create(&tid,&attr,(void*)yon_launch_app,yon_char_get_augumented(get_info_proprietary_command,name));
|
|
|
|
|
pthread_create(&tid,&attr,(void*)yon_launch,yon_char_append(get_info_proprietary_command,name));
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -294,9 +294,9 @@ void on_driver_info(GtkWidget *self,widgets_dict *widgets){
|
|
|
|
|
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->driversTreeView));
|
|
|
|
|
if (gtk_tree_selection_get_selected(selection,&list_s,&iter)){
|
|
|
|
|
gtk_tree_model_get(list_s,&iter,2,&name,-1);
|
|
|
|
|
pthread_create(&tid,&attr,(void*)yon_launch_app,yon_char_get_augumented(get_info_proprietary_command,name));
|
|
|
|
|
pthread_create(&tid,&attr,(void*)yon_launch,yon_char_append(get_info_proprietary_command,name));
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -318,7 +318,7 @@ void on_port_chosen_changed(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
|
|
|
|
|
|
if (window->curport){
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(gtk_widget_get_toplevel(window->mainMonitorConfigurationBox)),window->curport);
|
|
|
|
|
dict=yon_dictionary_find(&videoconfig.supported_resolutions,window->curport);
|
|
|
|
|
dict=yon_dictionary_get(&videoconfig.supported_resolutions,window->curport);
|
|
|
|
|
if (dict){
|
|
|
|
|
resolution_supported *res = yon_dictionary_get_data(dict,resolution_supported*);
|
|
|
|
|
int found_size=0;
|
|
|
|
|
@ -336,7 +336,7 @@ void on_port_chosen_changed(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
yon_gtk_combo_box_fill(window->templateMonitorConfigurationResolutionCombo,config->resolutionCapabilities, config->resolution_size);
|
|
|
|
|
yon_gtk_combo_box_text_fill(window->templateMonitorConfigurationResolutionCombo,config->resolutionCapabilities, config->resolution_size);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -373,26 +373,26 @@ char *yon_configuration_get_save_command(char *command){
|
|
|
|
|
str=yon_char_new(command);
|
|
|
|
|
if (videoconfig.autoChooseDrivers==0){
|
|
|
|
|
if (strcmp(videoconfig.failsafenVidia, dntus)!=0)
|
|
|
|
|
str = yon_char_get_augumented(str, yon_char_get_augumented(" FAILSAFENVIDIA=", videoconfig.failsafenVidia));
|
|
|
|
|
str = yon_char_append(str, yon_char_append(" FAILSAFENVIDIA=", videoconfig.failsafenVidia));
|
|
|
|
|
else
|
|
|
|
|
str = yon_char_get_augumented(str," FAILSAFENVIDIA=\"\"");
|
|
|
|
|
str = yon_char_append(str," FAILSAFENVIDIA=\"\"");
|
|
|
|
|
if (strcmp(videoconfig.failsafeATI, dntus)!=0)
|
|
|
|
|
str = yon_char_get_augumented(str, yon_char_get_augumented(" FAILSAFEATI=", videoconfig.failsafeATI));
|
|
|
|
|
str = yon_char_append(str, yon_char_append(" FAILSAFEATI=", videoconfig.failsafeATI));
|
|
|
|
|
else
|
|
|
|
|
str = yon_char_get_augumented(str," FAILSAFEATI=\"\"");
|
|
|
|
|
str=yon_char_get_augumented(str," VGADRV_AUTO=NO");
|
|
|
|
|
str = yon_char_append(str," FAILSAFEATI=\"\"");
|
|
|
|
|
str=yon_char_append(str," VGADRV_AUTO=NO");
|
|
|
|
|
} else {
|
|
|
|
|
str = yon_char_unite(str, " FAILSAFENVIDIA=\"\" FAILSAFEATI=\"\" VGADRV_AUTO=YES", NULL);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (videoconfig.optirun&&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_append(str, yon_char_unite(" OPTIRUN=","\"",videoconfig.optirun,"\"",NULL));
|
|
|
|
|
else
|
|
|
|
|
str = yon_char_get_augumented(str, yon_char_unite(" OPTIRUN=\"\"",NULL));
|
|
|
|
|
str = yon_char_append(str, yon_char_unite(" OPTIRUN=\"\"",NULL));
|
|
|
|
|
if (videoconfig.primusrun&&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_append(str, yon_char_unite(" PRIMUSRUN=","\"", videoconfig.primusrun,"\"",NULL));
|
|
|
|
|
else
|
|
|
|
|
str = yon_char_get_augumented(str, yon_char_unite(" PRIMUSRUN=\"\"",NULL));
|
|
|
|
|
str = yon_char_append(str, yon_char_unite(" PRIMUSRUN=\"\"",NULL));
|
|
|
|
|
|
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
|
for (int i=0;i<videoconfig.portssize;i++)
|
|
|
|
|
@ -415,9 +415,9 @@ void on_resolutions_unsupported_show(GtkWidget *self, monitor_edit_window *windo
|
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationResolutionCombo),PARAMETER_DEFAULT_LABEL);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->templateMonitorConfigurationResolutionCombo),0);
|
|
|
|
|
if (((monitorconfig*)window->config->data)->show_usupported==1){
|
|
|
|
|
yon_gtk_combo_box_fill(window->templateMonitorConfigurationResolutionCombo,videoconfig.resolutions,videoconfig.resolutionssize);
|
|
|
|
|
yon_gtk_combo_box_text_fill(window->templateMonitorConfigurationResolutionCombo,videoconfig.resolutions,videoconfig.resolutionssize);
|
|
|
|
|
} else {
|
|
|
|
|
yon_gtk_combo_box_fill(window->templateMonitorConfigurationResolutionCombo,((monitorconfig*)window->config->data)->resolutionCapabilities,((monitorconfig*)window->config->data)->resolution_size);
|
|
|
|
|
yon_gtk_combo_box_text_fill(window->templateMonitorConfigurationResolutionCombo,((monitorconfig*)window->config->data)->resolutionCapabilities,((monitorconfig*)window->config->data)->resolution_size);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -427,13 +427,13 @@ char *yon_configuration_get_remove_command(char *command){
|
|
|
|
|
char *dntus = NULL;
|
|
|
|
|
dntus=_("Don't use");
|
|
|
|
|
str=yon_char_new(command);
|
|
|
|
|
str = yon_char_get_augumented(str, " FAILSAFENVIDIA");
|
|
|
|
|
str = yon_char_get_augumented(str, " FAILSAFATI");
|
|
|
|
|
str = yon_char_get_augumented(str, " OPTIRUN");
|
|
|
|
|
str = yon_char_get_augumented(str, " PRIMUSRUN");
|
|
|
|
|
str = yon_char_append(str, " FAILSAFENVIDIA");
|
|
|
|
|
str = yon_char_append(str, " FAILSAFATI");
|
|
|
|
|
str = yon_char_append(str, " OPTIRUN");
|
|
|
|
|
str = yon_char_append(str, " PRIMUSRUN");
|
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
|
for(int i=0;i<videoconfig.portssize;i++){
|
|
|
|
|
str = yon_char_get_augumented(str, yon_char_get_augumented(" ",XORG_MONITOR(videoconfig.ports[i])));
|
|
|
|
|
str = yon_char_append(str, yon_char_append(" ",XORG_MONITOR(videoconfig.ports[i])));
|
|
|
|
|
}
|
|
|
|
|
if (strcmp(str,command)!=0)
|
|
|
|
|
return str;
|
|
|
|
|
@ -447,15 +447,15 @@ void on_configuration_save_local(GtkWidget *self, widgets_dict *widgets)
|
|
|
|
|
char *delstr=NULL;
|
|
|
|
|
str=yon_configuration_get_save_command(save_drivers_local_command);
|
|
|
|
|
if (str){
|
|
|
|
|
yon_config_save(str);
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_launch(str);
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_configuration_save_local_global(GtkWidget *self, widgets_dict *widgets)
|
|
|
|
|
{
|
|
|
|
|
on_configuration_save_global_local(self, widgets);
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,GLOBAL_LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_configuration_save_global_local(GtkWidget *self, widgets_dict *widgets)
|
|
|
|
|
@ -465,8 +465,8 @@ void on_configuration_save_global_local(GtkWidget *self, widgets_dict *widgets)
|
|
|
|
|
char *delstr=NULL;
|
|
|
|
|
str=yon_configuration_get_save_command(save_drivers_global_local_command);
|
|
|
|
|
if (str){
|
|
|
|
|
yon_config_save(str);
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_launch(str);
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -477,8 +477,8 @@ void on_configuration_save_global(GtkWidget *self, widgets_dict *widgets)
|
|
|
|
|
char *delstr=NULL;
|
|
|
|
|
str=yon_configuration_get_save_command(save_drivers_global_command);
|
|
|
|
|
if (str){
|
|
|
|
|
yon_config_save(str);
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_launch(str);
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -500,7 +500,7 @@ void on_configuration_load_local(GtkWidget *self, widgets_dict *widgets)
|
|
|
|
|
yon_setup_config(load_drivers_local_command);
|
|
|
|
|
on_config_fill_interface(widgets);
|
|
|
|
|
yon_monitor_view_setup(widgets->mainMonitorVisualConfigurationBox);
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,LOCAL_LOAD_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_configuration_load_global(GtkWidget *self, widgets_dict *widgets)
|
|
|
|
|
@ -509,7 +509,7 @@ void on_configuration_load_global(GtkWidget *self, widgets_dict *widgets)
|
|
|
|
|
yon_setup_config(load_drivers_global_command);
|
|
|
|
|
on_config_fill_interface(widgets);
|
|
|
|
|
yon_monitor_view_setup(widgets->mainMonitorVisualConfigurationBox);
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,GLOBAL_LOAD_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**void on_monitor_delete(GtkWidget *self,monitor_view windowd)
|
|
|
|
|
@ -622,7 +622,7 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){
|
|
|
|
|
monitors->curport=NULL;
|
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
|
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_get(&videoconfig.monitors,videoconfig.ports[i]);
|
|
|
|
|
if (!check_if_exists||!yon_dictionary_get_data(check_if_exists,monitorconfig*)->stringparameters||check_if_exists==monitors->config)
|
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(monitors->templateMonitorConfigurationPortCombo),videoconfig.ports[i]);
|
|
|
|
|
|
|
|
|
|
@ -847,9 +847,9 @@ void yon_monitor_view_update(){
|
|
|
|
|
monitor_window *monitor = yon_dictionary_get_data(dict,monitor_window*);
|
|
|
|
|
monitorconfig *config = yon_dictionary_get_data(monitor->config,monitorconfig*);
|
|
|
|
|
if (strcmp(monitor->config->key,PARAMETER_DEFAULT_LABEL)!=0)
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoNameLabel),yon_char_get_augumented(MONITOR_LABEL,monitor->config->key));
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoNameLabel),yon_char_append(MONITOR_LABEL,monitor->config->key));
|
|
|
|
|
else
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoNameLabel),yon_char_get_augumented(MONITOR_LABEL,""));
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoNameLabel),yon_char_append(MONITOR_LABEL,""));
|
|
|
|
|
monitorconfig *params=yon_dictionary_get_data(yon_dictionary_get_data(dict,monitor_window*)->config,monitorconfig*);
|
|
|
|
|
gtk_widget_set_sensitive(yon_dictionary_get_data(dict,monitor_window*)->templateMonitorImage,params->enable);
|
|
|
|
|
if (config->resolution){
|
|
|
|
|
@ -893,7 +893,7 @@ char *yon_monitor_make_string(monitorconfig* config)
|
|
|
|
|
resolution=config->resolution;
|
|
|
|
|
first=0;
|
|
|
|
|
}else{
|
|
|
|
|
resolution=yon_char_get_augumented(",",config->resolution);
|
|
|
|
|
resolution=yon_char_append(",",config->resolution);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char *enable="";
|
|
|
|
|
@ -915,31 +915,31 @@ char *yon_monitor_make_string(monitorconfig* config)
|
|
|
|
|
char *position="";
|
|
|
|
|
if (config->position==1)
|
|
|
|
|
if (first==1){
|
|
|
|
|
position=yon_char_get_augumented("lo:",config->position_port);
|
|
|
|
|
position=yon_char_append("lo:",config->position_port);
|
|
|
|
|
first=0;
|
|
|
|
|
}else{
|
|
|
|
|
position=yon_char_get_augumented(",lo:",config->position_port);
|
|
|
|
|
position=yon_char_append(",lo:",config->position_port);
|
|
|
|
|
}
|
|
|
|
|
else if (config->position==2)
|
|
|
|
|
if (first==1){
|
|
|
|
|
position=yon_char_get_augumented("ro:",config->position_port);
|
|
|
|
|
position=yon_char_append("ro:",config->position_port);
|
|
|
|
|
first=0;
|
|
|
|
|
}else{
|
|
|
|
|
position=yon_char_get_augumented(",ro:",config->position_port);
|
|
|
|
|
position=yon_char_append(",ro:",config->position_port);
|
|
|
|
|
}
|
|
|
|
|
else if (config->position==3)
|
|
|
|
|
if (first==1){
|
|
|
|
|
position=yon_char_get_augumented("ab:",config->position_port);
|
|
|
|
|
position=yon_char_append("ab:",config->position_port);
|
|
|
|
|
first=0;
|
|
|
|
|
}else{
|
|
|
|
|
position=yon_char_get_augumented(",ab:",config->position_port);
|
|
|
|
|
position=yon_char_append(",ab:",config->position_port);
|
|
|
|
|
}
|
|
|
|
|
else if (config->position==4)
|
|
|
|
|
if (first==1){
|
|
|
|
|
position=yon_char_get_augumented("be:",config->position_port);
|
|
|
|
|
position=yon_char_append("be:",config->position_port);
|
|
|
|
|
first=0;
|
|
|
|
|
}else{
|
|
|
|
|
position=yon_char_get_augumented(",be:",config->position_port);
|
|
|
|
|
position=yon_char_append(",be:",config->position_port);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char *rotation="";
|
|
|
|
|
@ -1015,7 +1015,7 @@ char *yon_monitor_make_string(monitorconfig* config)
|
|
|
|
|
else if (config->frequency==2) frequency="x75";
|
|
|
|
|
}
|
|
|
|
|
if (strcmp(resolution,"")!=0)
|
|
|
|
|
resolution=yon_char_get_augumented(resolution,frequency);
|
|
|
|
|
resolution=yon_char_append(resolution,frequency);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char *stringparameters=yon_char_unite("",main,resolution,enable,position,rotation,dpms,cvt,reduced,gtf,NULL);
|
|
|
|
|
@ -1093,7 +1093,7 @@ void yon_proprietary_local_get(){
|
|
|
|
|
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||&videoconfig.proprietary,pack))){
|
|
|
|
|
// else if (strcmp(pack,"")!=0&&!(yon_dictionary_get(!videoconfig.proprietary||&videoconfig.proprietary,pack))){
|
|
|
|
|
// yon_dictionary_add_or_create_if_exists_with_data(videoconfig.proprietary,pack,rtn[dr_desc]);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
@ -1109,7 +1109,7 @@ void yon_proprietary_local_get(){
|
|
|
|
|
* [EN]
|
|
|
|
|
*/
|
|
|
|
|
dictionary *yon_proprieary_get(){
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,PROPRIETARY_LOADING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_LOADING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
videoconfig.proprietary=NULL;
|
|
|
|
|
int drivers_size=0;
|
|
|
|
|
int size=0;
|
|
|
|
|
@ -1130,14 +1130,14 @@ dictionary *yon_proprieary_get(){
|
|
|
|
|
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)){
|
|
|
|
|
else if (strcmp(pack,"")!=0&&!yon_dictionary_get(&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);
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,PROPRIETARY_OPETAION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_OPETAION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
} else {
|
|
|
|
|
drivers=yon_config_load(get_proprietary_drivers_local_command,&drivers_size);
|
|
|
|
|
if (drivers){
|
|
|
|
|
@ -1151,15 +1151,15 @@ dictionary *yon_proprieary_get(){
|
|
|
|
|
key = yon_char_divide_search(key,";",-1);
|
|
|
|
|
char *driver_name=yon_char_divide_search(yon_char_new(drivers[drivers_found])," ",-1);
|
|
|
|
|
if (strcmp(key,driver_name)==0)
|
|
|
|
|
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]);
|
|
|
|
|
if (i==0) videoconfig.proprietary=yon_dictionary_new_with_data(drivers[drivers_found],rtn[i]);
|
|
|
|
|
else videoconfig.proprietary=yon_dictionary_append_with_data(videoconfig.proprietary,drivers[drivers_found],rtn[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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(PROPRIETARY_USE_LOCAL_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,PROPRIETARY_LOADING_FAILED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_LOADING_FAILED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1252,7 +1252,7 @@ void yon_setup_config(char *configcommand)
|
|
|
|
|
dictionary *dct;
|
|
|
|
|
for(int i=0; i<videoconfig.portssize;i++)
|
|
|
|
|
{
|
|
|
|
|
command = yon_char_get_augumented(command, XORG_MONITOR(yon_char_divide_search(yon_char_new(videoconfig.ports[i]),"\n",-1)));
|
|
|
|
|
command = yon_char_append(command, XORG_MONITOR(yon_char_divide_search(yon_char_new(videoconfig.ports[i]),"\n",-1)));
|
|
|
|
|
}
|
|
|
|
|
videoconfig.configsize=0;
|
|
|
|
|
videoconfig.loaded_config = yon_ubl_load_global_config(command, &videoconfig.configsize);
|
|
|
|
|
@ -1332,9 +1332,9 @@ monitor_config yon_monitor_config_new(char *port){
|
|
|
|
|
monitor->reduced=0;
|
|
|
|
|
monitor->gtf=0;
|
|
|
|
|
if (videoconfig.monitors)
|
|
|
|
|
videoconfig.monitors=yon_dictionary_create_with_data_connected(videoconfig.monitors,port,monitor);
|
|
|
|
|
videoconfig.monitors=yon_dictionary_append_with_data(videoconfig.monitors,port,monitor);
|
|
|
|
|
else
|
|
|
|
|
videoconfig.monitors=yon_dictionary_create_with_data(port,monitor);
|
|
|
|
|
videoconfig.monitors=yon_dictionary_new_with_data(port,monitor);
|
|
|
|
|
return videoconfig.monitors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1429,8 +1429,8 @@ void yon_monitor_view_new(monitor_config monitor){
|
|
|
|
|
window->config=monitor;
|
|
|
|
|
gtk_widget_hide(window->templateMonitorInfoAddButton);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->templateMonitorInfoConfigureButton), "clicked", G_CALLBACK(on_monitor_configure), window);
|
|
|
|
|
if (videoconfig.monitor_visuals) videoconfig.monitor_visuals = yon_dictionary_create_with_data_connected(videoconfig.monitor_visuals, window->config->key,window);
|
|
|
|
|
else videoconfig.monitor_visuals = yon_dictionary_create_with_data(window->config->key,window);
|
|
|
|
|
if (videoconfig.monitor_visuals) videoconfig.monitor_visuals = yon_dictionary_append_with_data(videoconfig.monitor_visuals, window->config->key,window);
|
|
|
|
|
else videoconfig.monitor_visuals = yon_dictionary_new_with_data(window->config->key,window);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->templateMonitorDeleteButton), "clicked", G_CALLBACK(on_monitor_delete), videoconfig.monitor_visuals);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->templateMonitorSwitchButton), "clicked", G_CALLBACK(on_monitor_switch), window);
|
|
|
|
|
@ -1440,8 +1440,8 @@ void yon_monitor_view_new(monitor_config monitor){
|
|
|
|
|
gtk_widget_hide(window->templateMonitorSwitchButton);
|
|
|
|
|
gtk_widget_hide(window->templateMonitorInfoConfigureButton);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->templateMonitorInfoAddButton), "clicked", G_CALLBACK(on_monitor_add), window);
|
|
|
|
|
if (videoconfig.monitor_visuals) videoconfig.monitor_visuals = yon_dictionary_create_with_data_connected(videoconfig.monitor_visuals, "GENERIC",window);
|
|
|
|
|
else videoconfig.monitor_visuals = yon_dictionary_create_with_data("GENERIC",window);
|
|
|
|
|
if (videoconfig.monitor_visuals) videoconfig.monitor_visuals = yon_dictionary_append_with_data(videoconfig.monitor_visuals, "GENERIC",window);
|
|
|
|
|
else videoconfig.monitor_visuals = yon_dictionary_new_with_data("GENERIC",window);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1479,7 +1479,7 @@ void yon_monitor_set_resolutions(){
|
|
|
|
|
port_for_res=yon_char_new(dct->key);
|
|
|
|
|
}
|
|
|
|
|
if(port_for_res){
|
|
|
|
|
dct=yon_dictionary_find(&videoconfig.supported_resolutions,port_for_res);
|
|
|
|
|
dct=yon_dictionary_get(&videoconfig.supported_resolutions,port_for_res);
|
|
|
|
|
resolution_supported *sup=yon_dictionary_get_data(dct,resolution_supported*);
|
|
|
|
|
sup->size++;
|
|
|
|
|
sup->line=realloc(sup->line,sizeof(char*)*sup->size);
|
|
|
|
|
@ -1836,7 +1836,7 @@ int main(int argc, char *argv[])
|
|
|
|
|
// 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)));
|
|
|
|
|
// if (system(yon_char_append("/usr/bin/pkexec ubl-settings-video ",args)));
|
|
|
|
|
// return 0;
|
|
|
|
|
} else {
|
|
|
|
|
int ssize=0;
|
|
|
|
|
@ -1848,7 +1848,8 @@ int main(int argc, char *argv[])
|
|
|
|
|
// yon_gtk_list_store_fill_with_proprietaries(videoconfig.list);
|
|
|
|
|
// yon_gtk_list_store_fill_with_proprietaries(videoconfig.modulelist);
|
|
|
|
|
gtk_widget_show(widgets.MainWindow);
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,LOCAL_LOAD_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_status_box_setup(widgets.mainStatusIcon,widgets.mainStatusBox,widgets.mainStatusLabel);
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
on_config_fill_interface(&widgets);
|
|
|
|
|
yon_monitor_set_resolutions();
|
|
|
|
|
yon_adapter_window_setup(&widgets);
|
|
|
|
|
|