|
|
|
|
@ -2,14 +2,6 @@
|
|
|
|
|
|
|
|
|
|
config videoconfig;
|
|
|
|
|
|
|
|
|
|
void yon_on_plug_added(GtkSocket *self, gpointer user_data)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_on_plug_removed(GtkSocket *self, gpointer user_data)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_subwindow_close(GtkWidget *self)
|
|
|
|
|
{
|
|
|
|
|
gtk_widget_destroy(gtk_widget_get_toplevel(self));
|
|
|
|
|
@ -257,9 +249,11 @@ void on_port_chosen_changed(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
|
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(combo_text," ",-1);
|
|
|
|
|
char *resolution = yon_char_divide_search(yon_char_new(combo_text)," ",-1);
|
|
|
|
|
if (combo_text)
|
|
|
|
|
if (strcmp(combo_text,MONITOR_CHOOSE_PORT_LABEL)!=0){
|
|
|
|
|
if (strcmp(combo_text,MONITOR_CHOOSE_PORT_LABEL)==0)
|
|
|
|
|
return;
|
|
|
|
|
else{
|
|
|
|
|
dict=yon_dictionary_find(&videoconfig.supported_resolutions,resolution);
|
|
|
|
|
if (dict){
|
|
|
|
|
resolution_supported *res = yon_dictionary_get_data(dict,resolution_supported*);
|
|
|
|
|
@ -387,10 +381,6 @@ void on_configuration_save_local(GtkWidget *self, widgets_dict *widgets)
|
|
|
|
|
char *str=NULL;
|
|
|
|
|
char *delstr=NULL;
|
|
|
|
|
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){
|
|
|
|
|
yon_config_save(str);
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
@ -421,10 +411,6 @@ void on_configuration_save_global(GtkWidget *self, widgets_dict *widgets)
|
|
|
|
|
char *str=NULL;
|
|
|
|
|
char *delstr=NULL;
|
|
|
|
|
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){
|
|
|
|
|
yon_config_save(str);
|
|
|
|
|
yon_ubl_status_box_render(videoconfig.status_render,LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
@ -436,6 +422,7 @@ void yon_update_config(widgets_dict *widgets)
|
|
|
|
|
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)));
|
|
|
|
|
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)
|
|
|
|
|
videoconfig.primusrun = yon_char_new( (char *)gtk_entry_get_text(GTK_ENTRY(widgets->mainExtraLaunchPrismusunEntry)));
|
|
|
|
|
else videoconfig.primusrun = NULL;
|
|
|
|
|
@ -542,7 +529,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), "changed", G_CALLBACK(on_port_chosen_changed),monitors);
|
|
|
|
|
g_signal_connect(G_OBJECT(monitors->templateMonitorConfigurationPortCombo), "popup", 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);
|
|
|
|
|
|
|
|
|
|
@ -602,7 +589,8 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
free(user_data);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -624,7 +612,7 @@ void on_link(GtkWidget *self, char* link, gpointer user_data){
|
|
|
|
|
GtkWidget *textLabel=yon_gtk_builder_get_widget(builder,"helpText");
|
|
|
|
|
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(cancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(alwaysOpenCheck),"toggled",G_CALLBACK(on_toggle),&videoconfig.alwaysredirect);
|
|
|
|
|
@ -638,7 +626,7 @@ void on_link(GtkWidget *self, char* link, gpointer user_data){
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(sureWindow);
|
|
|
|
|
}else {
|
|
|
|
|
on_read_documentation(NULL,NULL);
|
|
|
|
|
on_read_documentation(NULL,link);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -665,6 +653,16 @@ void yon_monitor_window_update(monitor_edit_window *window){
|
|
|
|
|
if (found==-1)
|
|
|
|
|
found=0;
|
|
|
|
|
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_text_remove_all(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationFrequencyCombo));
|
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationFrequencyCombo),PARAMETER_DEFAULT_LABEL);
|
|
|
|
|
@ -689,7 +687,6 @@ void yon_monitor_window_update(monitor_edit_window *window){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**void yon_monitor_view_draw_all(GtkWidget *cnt)
|
|
|
|
|
* [EN]
|
|
|
|
|
*/
|
|
|
|
|
@ -1371,7 +1368,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,"NVidia")){
|
|
|
|
|
else if (strstr(vendor,"NVVIDIA")){
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
@ -1675,7 +1672,10 @@ int main(int argc, char *argv[])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
} else {
|
|
|
|
|
gtk_init(&argc, &argv);
|
|
|
|
|
|