|
|
|
|
@ -243,18 +243,24 @@ void on_driver_info(GtkWidget *self,widgets_dict *widgets){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_port_chosen_changed(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
|
if (yon_dictionary_get_data(window->config,monitorconfig*)->show_usupported==0){
|
|
|
|
|
monitorconfig* config = yon_dictionary_get_data(window->config,monitorconfig*);
|
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
|
for (int i=0;i<window->resolutionssize;i++){
|
|
|
|
|
free(window->resolutions);
|
|
|
|
|
}
|
|
|
|
|
window->resolutions=NULL;
|
|
|
|
|
window->resolutionssize=0;
|
|
|
|
|
int portid=gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationPortCombo));
|
|
|
|
|
if (portid!=0)
|
|
|
|
|
window->curport=videoconfig.ports[portid-1];
|
|
|
|
|
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationResolutionCombo));
|
|
|
|
|
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);
|
|
|
|
|
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(yon_char_new(combo_text)," ",-1);
|
|
|
|
|
if (combo_text)
|
|
|
|
|
if (strcmp(combo_text,MONITOR_CHOOSE_PORT_LABEL)==0)
|
|
|
|
|
return;
|
|
|
|
|
else{
|
|
|
|
|
dict=yon_dictionary_find(&videoconfig.supported_resolutions,resolution);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
if (dict){
|
|
|
|
|
resolution_supported *res = yon_dictionary_get_data(dict,resolution_supported*);
|
|
|
|
|
int found_size=0;
|
|
|
|
|
@ -275,6 +281,7 @@ void on_port_chosen_changed(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
|
yon_gtk_combo_box_fill(window->templateMonitorConfigurationResolutionCombo,config->resolutionCapabilities, config->resolution_size);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_sensitive_change(GtkWidget *self, GtkWidget *toggle)
|
|
|
|
|
@ -529,7 +536,7 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){
|
|
|
|
|
g_signal_connect(G_OBJECT(monitors->templateMonitorConfigurationParameterLineCheck), "toggled", G_CALLBACK(on_sensitive_change_reversed), monitors->templateMonitorConfigurationBox);
|
|
|
|
|
g_signal_connect(G_OBJECT(monitors->templateMonitorConfigurationParameterLineCheck), "toggled", G_CALLBACK(on_sensitive_change), monitors->templateMonitorConfigurationParameterLineEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(monitors->templateMonitorConfigurationShowUnsupportedCheck), "toggled", G_CALLBACK(on_resolutions_unsupported_show),monitors);
|
|
|
|
|
g_signal_connect(G_OBJECT(monitors->templateMonitorConfigurationPortCombo), "popup", G_CALLBACK(on_port_chosen_changed),monitors);
|
|
|
|
|
g_signal_connect(G_OBJECT(monitors->templateMonitorConfigurationPortCombo), "changed", G_CALLBACK(on_port_chosen_changed),monitors);
|
|
|
|
|
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(monitors->templateMonitorConfigurationEnableCheck),yon_dictionary_get_data(monitors->config,monitorconfig*)->enable==1);
|
|
|
|
|
|
|
|
|
|
@ -553,6 +560,7 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){
|
|
|
|
|
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);
|
|
|
|
|
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]);
|
|
|
|
|
@ -578,6 +586,7 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){
|
|
|
|
|
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);
|
|
|
|
|
for (int i=0;i<videoconfig.portssize;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);
|
|
|
|
|
@ -649,9 +658,11 @@ void on_about()
|
|
|
|
|
|
|
|
|
|
void yon_monitor_window_update(monitor_edit_window *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)
|
|
|
|
|
found=0;
|
|
|
|
|
else
|
|
|
|
|
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){
|
|
|
|
|
@ -985,21 +996,37 @@ dictionary *yon_proprieary_get(){
|
|
|
|
|
config_str drivers=yon_config_load(get_proprietary_drivers_command,&drivers_size);
|
|
|
|
|
int size=0;
|
|
|
|
|
char **rtn = yon_config_load(get_proprietary_drivers_info_command,&size);
|
|
|
|
|
for (int drivers_found=0;drivers_found<drivers_size;drivers_found++){
|
|
|
|
|
drivers[drivers_found]=yon_char_divide_search(drivers[drivers_found],"\n",-1);
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
rtn[i] = yon_char_divide_search(rtn[i],"\n",-1);
|
|
|
|
|
char *keyp=yon_char_new(rtn[i]);
|
|
|
|
|
if (keyp[0]==';')
|
|
|
|
|
yon_char_divide_search(keyp,";",-1);
|
|
|
|
|
char *key = yon_char_divide_search(keyp,";",-1);
|
|
|
|
|
keyp = yon_char_divide_search(keyp,";",-1);
|
|
|
|
|
char *driver_name=yon_char_divide_search(yon_char_new(drivers[drivers_found])," ",-1);
|
|
|
|
|
if (strcmp(key,driver_name)==0||keyp)
|
|
|
|
|
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]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// for (int drivers_found=0;drivers_found<drivers_size;drivers_found++){
|
|
|
|
|
// drivers[drivers_found]=yon_char_divide_search(drivers[drivers_found],"\n",-1);
|
|
|
|
|
// for (int i=0;i<size;i++){
|
|
|
|
|
// rtn[i] = yon_char_divide_search(rtn[i],"\n",-1);
|
|
|
|
|
// char *keyp=yon_char_new(rtn[i]);
|
|
|
|
|
// if (keyp[0]==';')
|
|
|
|
|
// yon_char_divide_search(keyp,";",-1);
|
|
|
|
|
// char *key = yon_char_divide_search(keyp,";",-1);
|
|
|
|
|
// keyp = yon_char_divide_search(keyp,";",-1);
|
|
|
|
|
// char *driver_name=yon_char_divide_search(yon_char_new(drivers[drivers_found])," ",-1);
|
|
|
|
|
// if (strcmp(key,driver_name)==0||keyp&&strcmp(keyp,"")!=0&&!yon_dictionary_find(&videoconfig.proprietary,drivers[drivers_found]))
|
|
|
|
|
// if (i==0) videoconfig.proprietary=yon_dictionary_create_with_data(yon_char_new(drivers[drivers_found]),rtn[i]);
|
|
|
|
|
// else videoconfig.proprietary=yon_dictionary_create_with_data_connected(videoconfig.proprietary,yon_char_new(drivers[drivers_found]),rtn[i]);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
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);
|
|
|
|
|
@ -1040,21 +1067,27 @@ void yon_gtk_list_store_fill_with_proprietaries(GtkListStore *list){
|
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
|
gtk_list_store_clear(videoconfig.list);
|
|
|
|
|
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){
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
int size=0;
|
|
|
|
|
config_str str = yon_char_parse((char*)dict->data,&size,";");
|
|
|
|
|
printf("%s\n",str[0]);
|
|
|
|
|
if (strcmp(str[0],"")!=0&&str[0]){
|
|
|
|
|
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);
|
|
|
|
|
if (yon_char_parsed_check_exist(installed,inssize,str[0])!=-1)
|
|
|
|
|
gtk_list_store_set(videoconfig.list,&iter,0,1,-1);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
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);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1280,6 +1313,10 @@ void yon_monitor_view_new(monitor_config monitor){
|
|
|
|
|
window->templateMonitorInfoAddButton=yon_gtk_builder_get_widget(builder,"templateMonitorInfoAddButton");
|
|
|
|
|
window->config=NULL;
|
|
|
|
|
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){
|
|
|
|
|
window->config=monitor;
|
|
|
|
|
gtk_widget_hide(window->templateMonitorInfoAddButton);
|
|
|
|
|
@ -1368,7 +1405,7 @@ void yon_adapter_window_setup(widgets_dict *widgets){
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(vendor,"NVVIDIA")){
|
|
|
|
|
else if (strstr(vendor,"NVIDIA")){
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
@ -1671,7 +1708,7 @@ int main(int argc, char *argv[])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (getuid()!=0){
|
|
|
|
|
if (0){
|
|
|
|
|
char *args="";
|
|
|
|
|
for (int i=0;i<argc;i++)
|
|
|
|
|
args=yon_char_unite(args," ",argv[i],NULL);
|
|
|
|
|
|