From d8383c3197b4830d2fb3028669b466826bda503b Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 28 Apr 2023 16:39:50 +0600 Subject: [PATCH 01/15] driver processes outputs are shown in status bar --- source/ubl-settings-video.c | 318 ++++++++++++++++++++---------------- source/ubl-settings-video.h | 6 + 2 files changed, 179 insertions(+), 145 deletions(-) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index 4161d57..2f0ea9b 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -18,7 +18,9 @@ void on_subwindow_close(GtkWidget *self) 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.box,videoconfig.status_render.icon,videoconfig.status_render.label,MONITOR_PORT_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + videoconfig.status_render.text_to_render=MONITOR_PORT_ERROR_LABEL; + videoconfig.status_render.type=BACKGROUND_IMAGE_FAIL_TYPE; + yon_ubl_status_box_render(&videoconfig.status_render); return; } config->main=0; @@ -32,7 +34,9 @@ void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){ config->port=NULL; config->resolution=NULL; config->frequency=NULL; - _yon_ubl_status_box_render(videoconfig.status_render.box,videoconfig.status_render.icon,videoconfig.status_render.label,MONITOR_PORT_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + videoconfig.status_render.text_to_render=MONITOR_PORT_SUCCESS_LABEL; + videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; + yon_ubl_status_box_render(&videoconfig.status_render); 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){ @@ -68,73 +72,85 @@ void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){ on_subwindow_close(self); } -// void on_save_window_configuration(GtkWidget *self, MonitorSettings *monitor){ -// char *port=NULL; -// port=gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(monitor->templateMonitorConfigurationPortCombo)); -// if (!monitor->curconfig){ -// monitorconfig *confi = new(monitorconfig); -// if (!videoconfig.monitors) videoconfig.monitors=yon_dictionary_create_with_data(port,confi); -// else videoconfig.monitors=yon_dictionary_create_with_data_connected(videoconfig.monitors,port,confi); -// monitor->curconfig=videoconfig.monitors; -// } -// char *freq=NULL; -// char *res=NULL; -// char *rot=NULL; -// char *entr=NULL; -// char *def=NULL; -// def=_("Default settings"); -// if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(monitor->templateMonitorConfigurationMainRadio))==1) -// yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->main=1; -// if (strcmp((freq=yon_char_new((char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(monitor->templateMonitorConfigurationFrequencyCombo)))),def)!=0) -// yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->frequency=freq; -// else yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->frequency=NULL; -// if (strcmp((res=yon_char_new((char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(monitor->templateMonitorConfigurationResolutionCombo)))),def)!=0) -// yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->resolution=res; -// else yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->resolution=NULL; -// if (strcmp((rot=yon_char_new((char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(monitor->templateMonitorConfigurationRotationCombo)))),def)!=0) -// yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->rotation=rot; -// else yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->rotation=NULL; -// if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(monitor->templateMonitorConfigurationParameterLineCheck))){ -// entr=yon_char_new((char*)gtk_entry_get_text(GTK_ENTRY(monitor->templateMonitorConfigurationParameterLineEntry))); -// yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->stringparameters=entr; -// } else { -// char *str=NULL; -// str = ""; -// if (yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->frequency!=NULL) -// str=yon_char_get_augumented(str,yon_char_get_augumented(yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->frequency,",")); -// if (yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->resolution!=NULL) -// str=yon_char_get_augumented(str,yon_char_get_augumented(yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->resolution,",")); -// if (yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->rotation!=NULL) -// if (strcmp(yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->rotation,_("Right"))==0) -// str=yon_char_get_augumented(str,"rotation:right,"); -// else if (strcmp(yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->rotation,_("Left"))==0) -// str=yon_char_get_augumented(str,"rotation:left,"); -// else if (strcmp(yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->rotation,_("Invert"))==0) -// str=yon_char_get_augumented(str,"rotation:invert,"); -// else -// str=yon_char_get_augumented(str,"rotation:normal,"); - -// if (yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->main!=0) -// str=yon_char_get_augumented(str,"primary,"); -// if (strcmp(str,"")!=0) -// yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->stringparameters=str; - -// } -// dictionary *dict=NULL; -// // for_dictionaries (dict,videoconfig.videoconfig){ -// // MonitorSettings *monitorsett=yon_dictionary_get_data(dict,MonitorSettings*); -// // if (monitorsett->curconfig==monitor->curconfig){ -// // yon_parse_monitor(monitorsett->curconfig,yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->stringparameters); -// // gtk_label_set_text(GTK_LABEL(monitorsett->templateMonitorInfoResolutionLabel),yon_dictionary_get_data(monitor->curconfig,monitorconfig*)->resolution); -// // if (yon_dictionary_get_data(monitorsett->curconfig,monitorconfig*)->main==0) -// // gtk_label_set_text(GTK_LABEL(monitorsett->templateMonitorInfoNameLabel), yon_char_get_augumented("Monitor ", ((monitorconfig *)monitorsett->curconfig->data)->port)); -// // if (yon_dictionary_get_data(monitorsett->curconfig,monitorconfig*)->main==1) -// // gtk_label_set_text(GTK_LABEL(monitorsett->templateMonitorInfoNameLabel), yon_char_get_augumented("Monitor ", yon_char_get_augumented(((monitorconfig *)monitorsett->curconfig->data)->port,"*"))); - -// // } -// // } -// on_subwindow_close(self); -// }; +void on_driver_pack_install(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)); + gtk_tree_selection_get_selected(selection,&list_s,&iter); + gtk_tree_model_get(list_s,&iter,1,&name,-1); + pthread_t tid; + pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(install_proprietary_command,name)); + +} + +void on_driver_install(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)); + gtk_tree_selection_get_selected(selection,&list_s,&iter); + gtk_tree_model_get(list_s,&iter,1,&name,-1); + pthread_t tid; + pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(install_proprietary_command,name)); + +} + +void on_driver_pack_delete(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)); + gtk_tree_selection_get_selected(selection,&list_s,&iter); + gtk_tree_model_get(list_s,&iter,1,&name,-1); + pthread_t tid; + pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name)); + +} + +void on_driver_delete(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)); + gtk_tree_selection_get_selected(selection,&list_s,&iter); + gtk_tree_model_get(list_s,&iter,1,&name,-1); + pthread_t tid; + pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name)); + +} + +void on_driver_pack_info(GtkWidget *self, widgets_dict *widgets){ + + pthread_attr_t attr; + pthread_t tid; + pthread_attr_init(&attr); + GtkTreeIter iter; + char *name; + GtkTreeModel *list_s=GTK_TREE_MODEL(videoconfig.list); + GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->proprietaryTreeView)); + 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)); +} + +void on_driver_info(GtkWidget *self,widgets_dict *widgets){ + + pthread_attr_t attr; + pthread_t tid; + pthread_attr_init(&attr); + GtkTreeIter iter; + char *name; + GtkTreeModel *list_s=GTK_TREE_MODEL(videoconfig.list); + GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->driversTreeView)); + 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)); + +} void on_port_chosen_changed(GtkWidget *self, monitor_edit_window *window){ monitorconfig* config = yon_dictionary_get_data(window->config,monitorconfig*); @@ -286,7 +302,10 @@ void on_configuration_save_local(GtkWidget *self, widgets_dict *widgets) if (str){ printf(str); yon_config_save(str); - yon_ubl_status_box_render(widgets->mainStatusBox, widgets->mainStatusIcon, widgets->mainStatusLabel, _("Local configuration saving succseeded."), BACKGROUND_IMAGE_SUCCESS_TYPE); + + videoconfig.status_render.text_to_render=LOCAL_SAVE_SUCCESS; + videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; + yon_ubl_status_box_render(&videoconfig.status_render); } // else // yon_ubl_status_box_render(widgets->mainStatusBox, widgets->mainStatusIcon, widgets->mainStatusLabel, _("Local configuration saving failed."), BACKGROUND_IMAGE_FAIL_TYPE); @@ -296,12 +315,16 @@ void on_configuration_save_local_global(GtkWidget *self, widgets_dict *widgets) { on_configuration_save_global(self, widgets); on_configuration_save_local(self, widgets); - yon_ubl_status_box_render(widgets->mainStatusBox, widgets->mainStatusIcon, widgets->mainStatusLabel, _("Local and global configuration saving succseeded."), BACKGROUND_IMAGE_SUCCESS_TYPE); + videoconfig.status_render.text_to_render=GLOBAL_LOCAL_SAVE_SUCCESS; + videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; + yon_ubl_status_box_render(&videoconfig.status_render); } void on_configuration_save_global(GtkWidget *self, widgets_dict *widgets) { - yon_ubl_status_box_render(widgets->mainStatusBox, widgets->mainStatusIcon, widgets->mainStatusLabel, _("Global configuration saving succseeded."), BACKGROUND_IMAGE_SUCCESS_TYPE); + videoconfig.status_render.text_to_render=GLOBAL_SAVE_SUCCESS; + videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; + yon_ubl_status_box_render(&videoconfig.status_render); yon_update_config(widgets); char *str = NULL; if (videoconfig.failsafenVidia) @@ -326,7 +349,9 @@ void yon_update_config(widgets_dict *widgets) void on_configuration_load_local(GtkWidget *self, widgets_dict *widgets) { - yon_ubl_status_box_render(widgets->mainStatusBox, widgets->mainStatusIcon, widgets->mainStatusLabel, _("Local configuration loading succseeded."), BACKGROUND_IMAGE_SUCCESS_TYPE); + videoconfig.status_render.text_to_render=LOCAL_LOAD_SUCCESS; + videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; + yon_ubl_status_box_render(&videoconfig.status_render); char *command = load_drivers_local_command; dictionary *dct; for_dictionaries(dct, videoconfig.monitors) @@ -342,7 +367,9 @@ void on_configuration_load_local(GtkWidget *self, widgets_dict *widgets) void on_configuration_load_global(GtkWidget *self, widgets_dict *widgets) { - yon_ubl_status_box_render(widgets->mainStatusBox, widgets->mainStatusIcon, widgets->mainStatusLabel, _("Global configuration loading succseeded."), BACKGROUND_IMAGE_SUCCESS_TYPE); + videoconfig.status_render.text_to_render=GLOBAL_LOAD_SUCCESS; + videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; + yon_ubl_status_box_render(&videoconfig.status_render); char *command = load_drivers_global_command; dictionary *dct; for_dictionaries(dct, videoconfig.monitors) @@ -531,6 +558,34 @@ void yon_monitor_window_update(monitor_edit_window *window){ } +void yon_popen(thread_input *input){ + *(FILE**)input->data=popen(input->command,"r"); +} + +void yon_launch_with_output(char *command){ + pthread_t tid; + FILE *output =NULL; + FILE **output_file=&output; + thread_input input; + input.command=command; + input.data=output_file; + pthread_create(&tid,NULL,(void*)yon_popen,&input); + char **output_strings = NULL; + output_strings = malloc(sizeof(char)); + int i = 0; + char str[1000]; + memset(str, 0, 1000); + while (1){ + if (output){ + if (fgets(str, 1000, output)){ + videoconfig.status_render.text_to_render=str; + videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; + _yon_ubl_status_box_render(&videoconfig.status_render); + } + } + } +} + /**void yon_monitor_view_draw_all(GtkWidget *cnt) * [EN] */ @@ -999,76 +1054,6 @@ void yon_monitor_config_update(monitorconfig* monitor, char *port, char *config_ } } -// MonitorSettings *yon_setup_monitor_settings() -// { -// int monitors_n = videoconfig.portssize; -// MonitorSettings *monitors = NULL; -// monitors = malloc(sizeof(MonitorSettings) * (monitors_n+1)); -// // videoconfig.videoconfig=videoconfig.videoconfig->first; -// int i=0; -// if (videoconfig.monitors){ -// for (i = 0; i < monitors_n; i++) -// { -// GtkBuilder *builder = gtk_builder_new_from_file(glade_path); -// monitors[i].templateMonitorscreenOverlay = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorscreenOverlay")); -// monitors[i].templateMonitorInfoBox = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorInfoBox")); -// monitors[i].templateMonitorInfoNameLabel = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorInfoNameLabel")); -// monitors[i].templateMonitorImage = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorImage")); -// monitors[i].templateMonitorInfoResolutionLabel = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorInfoResolutionLabel")); -// monitors[i].templateMonitorInfoConfigureButton = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorInfoConfigureButton")); -// monitors[i].templateMonitorDeleteButton = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorDeleteButton")); -// monitors[i].templateMonitorSwitchButton = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorSwitchButton")); -// monitors[i].curconfig = yon_dictionary_get_nth(videoconfig.monitors, i); -// printf("%d\n", i); -// if (yon_dictionary_get_data(monitors[i].curconfig,monitorconfig*)->main==0) -// gtk_label_set_text(GTK_LABEL(monitors[i].templateMonitorInfoNameLabel), yon_char_get_augumented("Monitor ", ((monitorconfig *)monitors[i].curconfig->data)->port)); -// if (yon_dictionary_get_data(monitors[i].curconfig,monitorconfig*)->main==1) -// gtk_label_set_text(GTK_LABEL(monitors[i].templateMonitorInfoNameLabel), yon_char_get_augumented("Monitor ", yon_char_get_augumented(((monitorconfig *)monitors[i].curconfig->data)->port,"*"))); -// char *res = yon_char_get_augumented(((monitorconfig *)monitors[i].curconfig->data)->resolution, ""); -// if (yon_dictionary_get_data(monitors[i].curconfig,monitorconfig*)->enable==1) -// gtk_widget_set_sensitive(monitors[i].templateMonitorImage,1); -// if (!res) -// res = _("Default settings"); -// gtk_label_set_text(GTK_LABEL(monitors[i].templateMonitorInfoResolutionLabel), res); -// gtk_overlay_add_overlay(GTK_OVERLAY(monitors[i].templateMonitorscreenOverlay), monitors[i].templateMonitorInfoBox); -// g_signal_connect(G_OBJECT(monitors[i].templateMonitorInfoConfigureButton), "clicked", G_CALLBACK(on_confugure_monitor_settings), &monitors[i]); -// g_signal_connect(G_OBJECT(monitors[i].templateMonitorDeleteButton), "clicked", G_CALLBACK(on_confugure_monitor_settings), &monitors[i]); -// g_signal_connect(G_OBJECT(monitors[i].templateMonitorSwitchButton), "clicked", G_CALLBACK(on_confugure_monitor_settings), &monitors[i]); -// if (i==0) -// videoconfig.videoconfig = yon_dictionary_create_with_data(((monitorconfig *)monitors[i].curconfig->data)->port,&monitors[i]); -// else -// videoconfig.videoconfig = yon_dictionary_create_with_data_connected(videoconfig.videoconfig,((monitorconfig *)monitors[i].curconfig->data)->port,&monitors[i]); -// if (videoconfig.monitors->next) -// videoconfig.monitors = videoconfig.monitors->next; -// } -// } -// GtkBuilder *builder = gtk_builder_new_from_file(glade_path); -// monitors[i].templateMonitorscreenOverlay = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorscreenOverlay")); -// monitors[i].templateMonitorInfoBox = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorInfoBox")); -// monitors[i].templateMonitorInfoNameLabel = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorInfoNameLabel")); -// monitors[i].templateMonitorImage = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorImage")); -// monitors[i].templateMonitorInfoResolutionLabel = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorInfoResolutionLabel")); -// monitors[i].templateMonitorInfoConfigureButton = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorInfoConfigureButton")); -// monitors[i].templateMonitorDeleteButton = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorDeleteButton")); -// monitors[i].templateMonitorSwitchButton = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorSwitchButton")); -// monitors[i].templateMonitorInfoAddButton = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorInfoAddButton")); -// gtk_widget_show(monitors[i].templateMonitorInfoAddButton); -// gtk_widget_hide(monitors[i].templateMonitorSwitchButton); -// gtk_widget_hide(monitors[i].templateMonitorDeleteButton); -// gtk_widget_hide(monitors[i].templateMonitorInfoConfigureButton); -// monitors[i].curconfig = NULL; -// gtk_label_set_text(GTK_LABEL(monitors[i].templateMonitorInfoNameLabel), ""); -// gtk_widget_set_sensitive(monitors[i].templateMonitorImage,0); -// gtk_label_set_text(GTK_LABEL(monitors[i].templateMonitorInfoResolutionLabel), ""); -// gtk_overlay_add_overlay(GTK_OVERLAY(monitors[i].templateMonitorscreenOverlay), monitors[i].templateMonitorInfoBox); -// g_signal_connect(G_OBJECT(monitors[i].templateMonitorInfoAddButton), "clicked", G_CALLBACK(on_confugure_monitor_settings), &monitors[i]); -// if (i==0) -// videoconfig.videoconfig = yon_dictionary_create_with_data("TEMPLATE",&monitors[i]); -// else -// videoconfig.videoconfig = yon_dictionary_create_with_data_connected(videoconfig.videoconfig,"TEMPLATE",&monitors[i]); -// return monitors; -// } - int yon_char_get_if_resolution(char *parsed_string){ char *left=NULL, *right=NULL; right=yon_char_new(parsed_string); @@ -1230,8 +1215,42 @@ void yon_setup_widgets(widgets_dict *widgets) widgets->templateMonitorConfigurationDoNotSwitchOffLabel = yon_gtk_builder_get_widget(widgets->builder, "templateMonitorConfigurationDoNotSwitchOffLabel"); widgets->templateMonitorConfigurationDoNotSwitchOffCheck = yon_gtk_builder_get_widget(widgets->builder, "templateMonitorConfigurationDoNotSwitchOffCheck"); + widgets->proprietaryTreeView = yon_gtk_builder_get_widget(widgets->builder, "proprietaryTreeView"); + widgets->proprietaryInfoButton = yon_gtk_builder_get_widget(widgets->builder, "proprietaryInfoButton"); + widgets->proprietaryDeleteButton = yon_gtk_builder_get_widget(widgets->builder, "proprietaryDeleteButton"); + widgets->proprietaryInstallButton = yon_gtk_builder_get_widget(widgets->builder, "proprietaryInstallButton"); + widgets->proprietaryTreeSelection = GTK_TREE_SELECTION(gtk_builder_get_object(widgets->builder, "proprietaryTreeSelection")); + widgets->driversTreeView = yon_gtk_builder_get_widget(widgets->builder, "driversTreeView"); + widgets->driversInfoButton = yon_gtk_builder_get_widget(widgets->builder, "driversInfoButton"); + widgets->driversDeleteButton = yon_gtk_builder_get_widget(widgets->builder, "driversDeleteButton"); + widgets->driversInstallButton = yon_gtk_builder_get_widget(widgets->builder, "driversInstallButton"); + widgets->driversTreeSelection = GTK_TREE_SELECTION(gtk_builder_get_object(widgets->builder, "driversTreeSelection")); + + widgets->proprietartInstalledColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "proprietartInstalledColumn")); + widgets->ProprietaryPackageColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "ProprietaryPackageColumn")); + widgets->ProprietaryDriverColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "ProprietaryDriverColumn")); + widgets->ProprietaryDescriptionColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "ProprietaryDescriptionColumn")); + widgets->ProprietarySupportedColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "ProprietarySupportedColumn")); + + widgets->driverInstalledColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "driverInstalledColumn")); + widgets->driverPackageColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "driverPackageColumn")); + 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->driverSupportedColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "driverSupportedColumn")); + + videoconfig.list = GTK_LIST_STORE(gtk_builder_get_object(widgets-> builder, "liststore6")); + gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->proprietaryTreeView),GTK_TREE_MODEL(videoconfig.list)); + + 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->proprietaryInfoButton), "clicked", G_CALLBACK(on_driver_pack_info), 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->driversInfoButton), "clicked", G_CALLBACK(on_driver_info), widgets); + g_signal_connect(G_OBJECT(widgets->mainDriverAutomaticallyChooseCheck), "toggled", G_CALLBACK(on_auto_choose_drivers), widgets); // g_signal_connect(G_OBJECT(widgets->mainHybridGraphicsDiscreteCheck), "toggled", G_CALLBACK(on_sensitive_change), widgets); g_signal_connect(G_OBJECT(widgets->mainExtraLaunchOptirunCheck), "toggled", G_CALLBACK(on_sensitive_change), widgets->mainExtraLaunchOptirunEntry); @@ -1239,6 +1258,7 @@ void yon_setup_widgets(widgets_dict *widgets) g_signal_connect(G_OBJECT(widgets->mainExtraLaunchOptirunCheck), "toggled", G_CALLBACK(on_sensitive_change), widgets->extraOptirunChooseAppsButton); g_signal_connect(G_OBJECT(widgets->mainExtraLaunchPrismusunCheck), "toggled", G_CALLBACK(on_sensitive_change), widgets->extraPrimusunChooseAppsButton); + 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->extraPrimusunChooseAppsButton), "clicked", G_CALLBACK(on_apps_chooser_open), widgets); @@ -1286,6 +1306,12 @@ void yon_setup_widgets(widgets_dict *widgets) gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSaveLocalMenuItem), _("Save to local configuration")); gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSettingsDocumentationMenuItem), _("Documentation")); gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSettingsAboutMenuItem), _("About")); + + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Installed")); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Package")); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Supported Devices")); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Driver")); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDescriptionColumn), _("Description")); // gtk_button_set_label(GTK_BUTTON(widgets->mainExtraLaunchThroughButton),_("Change")); yon_ubl_header_setup(widgets->mainHeadOverlay, widgets->headBox, widgets->mainHeadBackgroundImage, banner_path); // gtk_overlay_add_overlay(GTK_OVERLAY(widgets->mainHeadOverlay),widgets->headBox); @@ -1317,7 +1343,9 @@ int main(int argc, char *argv[]) yon_gtk_list_store_fill_with_proprietaries(videoconfig.list); gtk_widget_show(widgets.MainWindow); // yon_fill_ui(&widgets); - yon_ubl_status_box_render(widgets.mainStatusBox, widgets.mainStatusIcon, widgets.mainStatusLabel, _("Configuration has been loaded"), BACKGROUND_IMAGE_SUCCESS_TYPE); + videoconfig.status_render.text_to_render=LOCAL_LOAD_SUCCESS; + videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; + yon_ubl_status_box_render(&videoconfig.status_render); on_config_fill_interface(&widgets); yon_monitor_set_resolutions(); GtkCssProvider *css = gtk_css_provider_new(); diff --git a/source/ubl-settings-video.h b/source/ubl-settings-video.h index f286018..4708913 100644 --- a/source/ubl-settings-video.h +++ b/source/ubl-settings-video.h @@ -62,6 +62,11 @@ #define XORG_MONITOR(port) yon_char_get_augumented(" XORG_MONITOR[",yon_char_get_augumented(port,"] ")) +typedef struct{ + char* command; + void *data; +} thread_input; + char *local; typedef char *string; @@ -308,4 +313,5 @@ void on_monitor_delete(GtkWidget *self,monitor_view windowd); void yon_monitor_view_update(); void yon_monitor_window_update(monitor_edit_window *window); char *yon_monitor_make_string(monitorconfig* config); +void yon_launch_with_output(char *command); #endif \ No newline at end of file From b4acaaaf680ea821717ae27f2b70ffb4837eaca4 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 28 Apr 2023 16:40:29 +0600 Subject: [PATCH 02/15] library updates --- source/ubl-utils.c | 27 +++++++++++++++++---------- source/ubl-utils.h | 19 ++++++++++++++++--- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/source/ubl-utils.c b/source/ubl-utils.c index fd78093..fb74917 100644 --- a/source/ubl-utils.c +++ b/source/ubl-utils.c @@ -907,8 +907,9 @@ void _yon_ubl_header_setup(GtkWidget *Overlay, GtkWidget *Head, GtkWidget *Image gtk_image_set_from_file(GTK_IMAGE(Image), image_path); } -void _yon_ubl_status_box_render(GtkWidget *StatusBox, GtkWidget *StatusIcon, GtkWidget *StatusLabel, char *StatusText, BACKGROUND_IMAGE_TYPE BackgroundClass) +void _yon_ubl_status_box_render(render_data *datav) { + render_data data = *(render_data*)datav; GtkIconTheme *ictheme = gtk_icon_theme_get_default(); GError *err = NULL; if (err) @@ -916,18 +917,24 @@ void _yon_ubl_status_box_render(GtkWidget *StatusBox, GtkWidget *StatusIcon, Gtk printf("%s\n", err->message); g_error_free(err); } - gtk_label_set_text(GTK_LABEL(StatusLabel), StatusText); - if (BackgroundClass == BACKGROUND_IMAGE_SUCCESS_TYPE) + if (data.type == BACKGROUND_IMAGE_SUCCESS_TYPE||! data.type) { - gtk_style_context_remove_class(gtk_widget_get_style_context(StatusBox), "boxInfoMessError"); - gtk_style_context_add_class(gtk_widget_get_style_context(StatusBox), "boxInfoMessOK"); - gtk_image_set_from_pixbuf(GTK_IMAGE(StatusIcon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-video.checked", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, &err)); + gtk_style_context_remove_class(gtk_widget_get_style_context(data.box), "boxInfoMessError"); + gtk_style_context_add_class(gtk_widget_get_style_context(data.box), "boxInfoMessOK"); + gtk_image_set_from_pixbuf(GTK_IMAGE(data.icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-video.checked", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, &err)); } - else if (BackgroundClass == BACKGROUND_IMAGE_FAIL_TYPE) + else if (data.type == BACKGROUND_IMAGE_FAIL_TYPE) { - gtk_style_context_remove_class(gtk_widget_get_style_context(StatusBox), "boxInfoMessOK"); - gtk_style_context_add_class(gtk_widget_get_style_context(StatusBox), "boxInfoMessError"); - gtk_image_set_from_pixbuf(GTK_IMAGE(StatusIcon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-video.warning", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, &err)); + gtk_style_context_remove_class(gtk_widget_get_style_context(data.box), "boxInfoMessOK"); + gtk_style_context_add_class(gtk_widget_get_style_context(data.box), "boxInfoMessError"); + gtk_image_set_from_pixbuf(GTK_IMAGE(data.icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-video.warning", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, &err)); } + if (data.text_to_render) + gtk_label_set_text(GTK_LABEL(data.label), data.text_to_render); + else + for (int i=0;i Date: Fri, 28 Apr 2023 18:05:48 +0600 Subject: [PATCH 03/15] removed status box output --- source/CMakeLists.txt | 4 +++- source/ubl-settings-video.c | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 009e8d4..dc25088 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -8,6 +8,7 @@ include_directories(${GTK_INCLUDE_DIRS}) link_directories(${GTK_LIBRARY_DIRS}) add_definitions(${GTK_CFLAGS_OTHER}) + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -lm") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ @@ -22,7 +23,8 @@ set(SOURCE_FILES set(LIBRARIES ${GTK_LIBRARIES} - pthread) + pthread + vte) add_executable(ubl-settings-video ${SOURCE_FILES}) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index 2f0ea9b..944aff4 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -570,20 +570,20 @@ void yon_launch_with_output(char *command){ input.command=command; input.data=output_file; pthread_create(&tid,NULL,(void*)yon_popen,&input); - char **output_strings = NULL; - output_strings = malloc(sizeof(char)); - int i = 0; - char str[1000]; - memset(str, 0, 1000); - while (1){ - if (output){ - if (fgets(str, 1000, output)){ - videoconfig.status_render.text_to_render=str; - videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; - _yon_ubl_status_box_render(&videoconfig.status_render); - } - } - } + // char **output_strings = NULL; + // output_strings = malloc(sizeof(char)); + // int i = 0; + // char str[1000]; + // memset(str, 0, 1000); + // while (1){ + // if (output){ + // if (fgets(str, 1000, output)){ + // videoconfig.status_render.text_to_render=str; + // videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; + // _yon_ubl_status_box_render(&videoconfig.status_render); + // } + // } + // } } /**void yon_monitor_view_draw_all(GtkWidget *cnt) From 6d38b0e3c89aeaa17a48bc09917095787eb39ef3 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 28 Apr 2023 18:06:13 +0600 Subject: [PATCH 04/15] Updated strings --- source/ubl-settings-video-strings.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/ubl-settings-video-strings.h b/source/ubl-settings-video-strings.h index f15d6ef..cf942d2 100644 --- a/source/ubl-settings-video-strings.h +++ b/source/ubl-settings-video-strings.h @@ -40,4 +40,11 @@ #define MONITOR_ROTATE_INVERTED_PARAMETER _("invert") #define MONITOR_PORT_ERROR_LABEL _("Error: Port must be chosen to save") -#define MONITOR_PORT_SUCCESS_LABEL _("Monitor configuration succeedeed") \ No newline at end of file +#define MONITOR_PORT_SUCCESS_LABEL _("Monitor configuration succeedeed") + +#define GLOBAL_LOAD_SUCCESS _("Global configuration loading succseeded.") +#define LOCAL_LOAD_SUCCESS _("Local configuration loading succseeded.") + +#define GLOBAL_LOCAL_SAVE_SUCCESS _("Local and global configuration saving succseeded.") +#define GLOBAL_SAVE_SUCCESS _("Global configuration saving succseeded.") +#define LOCAL_SAVE_SUCCESS _("Local configuration saving succseeded.") \ No newline at end of file From a8a324789fcc5492e9880527e7364270d1f92cb8 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 28 Apr 2023 18:07:22 +0600 Subject: [PATCH 05/15] interface minor updates --- ubl-settings-video.glade | 65 ++++++++++++---------------------------- 1 file changed, 19 insertions(+), 46 deletions(-) diff --git a/ubl-settings-video.glade b/ubl-settings-video.glade index dcdaae5..b6a02ac 100644 --- a/ubl-settings-video.glade +++ b/ubl-settings-video.glade @@ -1583,7 +1583,7 @@ True True - + True True 5 @@ -1591,10 +1591,10 @@ 1 True - + - + Installed @@ -1664,7 +1664,7 @@ center 5 - + Установить True True @@ -1679,7 +1679,7 @@ - + Удалить True True @@ -1694,7 +1694,7 @@ - + Подробнее True True @@ -1743,19 +1743,20 @@ True True - + True True 5 liststore6 0 + vertical True 2 - + - + Installed @@ -1766,7 +1767,7 @@ - + Package @@ -1777,7 +1778,7 @@ - + Driver @@ -1788,7 +1789,7 @@ - + Description @@ -1799,7 +1800,7 @@ - + Supported Devices @@ -1825,7 +1826,7 @@ center 5 - + Установить True True @@ -1840,7 +1841,7 @@ - + Удалить True True @@ -1855,7 +1856,7 @@ - + Подробнее True True @@ -1936,38 +1937,10 @@ True False - - True - False - start - 75 - appointment-new-symbolic - - - False - True - 0 - + - - True - False - start - start - 10 - 5 - 10 - 5 - 10 - 10 - label - - - False - True - 1 - + From c787feb47e64c23de37e6600698e3907493830ba Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 2 May 2023 16:41:19 +0600 Subject: [PATCH 06/15] Integrated terminal for drivers deleting and installing test --- source/CMakeLists.txt | 2 +- source/ubl-settings-video.c | 110 +++++++++++++++++++++++++++--------- source/ubl-settings-video.h | 8 ++- ubl-settings-video.glade | 97 ++++++++++++++++++++++++++----- 4 files changed, 175 insertions(+), 42 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index dc25088..b0fba42 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -24,7 +24,7 @@ set(SOURCE_FILES set(LIBRARIES ${GTK_LIBRARIES} pthread - vte) + vte-2.91) add_executable(ubl-settings-video ${SOURCE_FILES}) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index 944aff4..d758d57 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -72,6 +72,12 @@ void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){ on_subwindow_close(self); } +static void child_ready(VteTerminal *terminal, GPid pid, GError *error, gpointer user_data) +{ + if (!terminal) return; + if (pid == -1) printf("Error\n\n\n"); +} + void on_driver_pack_install(GtkWidget *self,widgets_dict *widgets){ GtkTreeIter iter; char *name; @@ -80,7 +86,50 @@ void on_driver_pack_install(GtkWidget *self,widgets_dict *widgets){ gtk_tree_selection_get_selected(selection,&list_s,&iter); gtk_tree_model_get(list_s,&iter,1,&name,-1); pthread_t tid; - pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(install_proprietary_command,name)); + char **command=new_arr(char*,2); + gchar **envp = g_get_environ(); + command[0]=(gchar *)g_strdup(g_environ_getenv(envp, "SHELL")); + command[1]=NULL; + char **env=new_arr(char*,2); + env[0]=""; + env[1]=NULL; + + GtkWidget *terminal = vte_terminal_new(); + // vte_terminal_set_size(VTE_TERMINAL(terminal),50,100); + gtk_box_pack_start(GTK_BOX(widgets->TerminalBox),terminal,1,1,0); + VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL); + // VtePty *pty = vte_terminal_pty_new_sync(VTE_TERMINAL(terminal),VTE_PTY_DEFAULT,NULL,NULL); + vte_terminal_set_pty(VTE_TERMINAL(terminal),pty); + vte_terminal_spawn_async(VTE_TERMINAL(terminal), + VTE_PTY_DEFAULT, + NULL, /* working directory */ + command, /* command */ + NULL, /* environment */ + 0, /* spawn flags */ + NULL, NULL, /* child setup */ + NULL, /* child pid */ + -1, /* timeout */ + NULL, /* cancellable */ + child_ready, /* callback */ + NULL); /* user_data */ + vte_pty_spawn_async(pty, + NULL, /* working directory */ + command, /* command */ + NULL, /* environment */ + 0, /* spawn flags */ + NULL, NULL, /* child setup */ + NULL, /* child pid */ + -1, /* timeout */ + NULL, /* cancellable */ + NULL, /* callback */ + NULL); /* user_data */ + char *install_command=yon_char_unite(install_proprietary_command,name,"\n",NULL); + vte_terminal_feed_child(VTE_TERMINAL(terminal),install_command,strlen(install_command)); + vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), 0); + vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), FALSE); + vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), TRUE); + gtk_widget_show_all(widgets->TerminalWindow); + // pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(install_proprietary_command,name)); } @@ -93,7 +142,7 @@ void on_driver_install(GtkWidget *self,widgets_dict *widgets){ gtk_tree_selection_get_selected(selection,&list_s,&iter); gtk_tree_model_get(list_s,&iter,1,&name,-1); pthread_t tid; - pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(install_proprietary_command,name)); + // pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(install_proprietary_command,name)); } @@ -106,7 +155,7 @@ void on_driver_pack_delete(GtkWidget *self,widgets_dict *widgets){ gtk_tree_selection_get_selected(selection,&list_s,&iter); gtk_tree_model_get(list_s,&iter,1,&name,-1); pthread_t tid; - pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name)); + // pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name)); } @@ -119,7 +168,7 @@ void on_driver_delete(GtkWidget *self,widgets_dict *widgets){ gtk_tree_selection_get_selected(selection,&list_s,&iter); gtk_tree_model_get(list_s,&iter,1,&name,-1); pthread_t tid; - pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name)); + // pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name)); } @@ -562,29 +611,33 @@ void yon_popen(thread_input *input){ *(FILE**)input->data=popen(input->command,"r"); } -void yon_launch_with_output(char *command){ - pthread_t tid; - FILE *output =NULL; - FILE **output_file=&output; - thread_input input; - input.command=command; - input.data=output_file; - pthread_create(&tid,NULL,(void*)yon_popen,&input); - // char **output_strings = NULL; - // output_strings = malloc(sizeof(char)); - // int i = 0; - // char str[1000]; - // memset(str, 0, 1000); - // while (1){ - // if (output){ - // if (fgets(str, 1000, output)){ - // videoconfig.status_render.text_to_render=str; - // videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; - // _yon_ubl_status_box_render(&videoconfig.status_render); - // } - // } - // } -} +// void yon_launch_with_output(char *command){ +// pthread_t tid; +// FILE *output =NULL; +// FILE **output_file=&output; +// thread_input input; +// input.command=command; +// input.data=output_file; +// pthread_create(&tid,NULL,(void*)yon_popen,&input); +// char *output_strings = ""; +// int i = 0; +// char str[1000]; +// memset(str, 0, 1000); +// while (1){ +// clock(); +// if (output){ +// if (fgets(str, 1000, output)){ +// output_strings=yon_char_get_augumented(output_strings,str); +// videoconfig.status_render.text_to_render=output_strings; +// videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; +// _yon_ubl_status_box_render(&videoconfig.status_render); +// } +// } +// float passed = clock(); +// if ((passed=passed/_SC_CLK_TCK)<0.5) +// sleep(passed); +// } +// } /**void yon_monitor_view_draw_all(GtkWidget *cnt) * [EN] @@ -1224,6 +1277,9 @@ void yon_setup_widgets(widgets_dict *widgets) widgets->driversInfoButton = yon_gtk_builder_get_widget(widgets->builder, "driversInfoButton"); widgets->driversDeleteButton = yon_gtk_builder_get_widget(widgets->builder, "driversDeleteButton"); widgets->driversInstallButton = yon_gtk_builder_get_widget(widgets->builder, "driversInstallButton"); + widgets->TerminalWindow = yon_gtk_builder_get_widget(widgets->builder, "TerminalWindow"); + widgets->TerminalBox = yon_gtk_builder_get_widget(widgets->builder, "TerminalBox"); + widgets->TerminalHeaderTitleLabel = yon_gtk_builder_get_widget(widgets->builder, "TerminalHeaderTitleLabel"); widgets->driversTreeSelection = GTK_TREE_SELECTION(gtk_builder_get_object(widgets->builder, "driversTreeSelection")); widgets->proprietartInstalledColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "proprietartInstalledColumn")); diff --git a/source/ubl-settings-video.h b/source/ubl-settings-video.h index 4708913..9845eba 100644 --- a/source/ubl-settings-video.h +++ b/source/ubl-settings-video.h @@ -1,7 +1,9 @@ #include #include +#include #include #include +#include #include #include #include @@ -51,7 +53,7 @@ #define remove_drivers_local_command "/usr/bin/ubconfig --target global remove video " -#define install_proprietary_command "pkexec pacman -Sy --noconfirm " +#define install_proprietary_command "pkexec pacman -Sy " #define delete_proprietary_command "pkexec pacman -R --noconfirm " @@ -230,6 +232,10 @@ typedef struct GtkTreeViewColumn *driverDriverColumn; GtkTreeViewColumn *driverDescriptionColumn; GtkTreeViewColumn *driverSupportedColumn; + + GtkWidget *TerminalWindow; + GtkWidget *TerminalBox; + GtkWidget *TerminalHeaderTitleLabel; } widgets_dict; typedef struct diff --git a/ubl-settings-video.glade b/ubl-settings-video.glade index b6a02ac..a7e9fd4 100644 --- a/ubl-settings-video.glade +++ b/ubl-settings-video.glade @@ -99,6 +99,59 @@ + + 800 + 400 + False + 800 + 400 + com.ublinux.ubl-settings-video + + + True + False + vertical + + + + + + + + True + False + True + + + True + False + start + 5 + 5 + 5 + 5 + False + UBlinux Video Configuration + + + + + + + + True + False + 5 + 5 + 5 + 5 + 32 + com.ublinux.ubl-settings-video + + + + + False @@ -989,20 +1042,38 @@ - + True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - - - - + True + + + True + False + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + + + + + + + + + + True From a30135ef12c92f783f9d8afada49de1a266d3bca Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 3 May 2023 18:16:50 +0600 Subject: [PATCH 07/15] Integrated info menu implementation --- source/ubl-settings-video-strings.h | 5 +- source/ubl-settings-video.c | 221 +- source/ubl-settings-video.h | 10 +- source/ubl-utils.c | 18 +- source/ubl-utils.h | 2 + ubl-settings-video.css | 9 +- ubl-settings-video.glade | 3029 ++++++++++++++------------- 7 files changed, 1834 insertions(+), 1460 deletions(-) diff --git a/source/ubl-settings-video-strings.h b/source/ubl-settings-video-strings.h index cf942d2..e0594d1 100644 --- a/source/ubl-settings-video-strings.h +++ b/source/ubl-settings-video-strings.h @@ -47,4 +47,7 @@ #define GLOBAL_LOCAL_SAVE_SUCCESS _("Local and global configuration saving succseeded.") #define GLOBAL_SAVE_SUCCESS _("Global configuration saving succseeded.") -#define LOCAL_SAVE_SUCCESS _("Local configuration saving succseeded.") \ No newline at end of file +#define LOCAL_SAVE_SUCCESS _("Local configuration saving succseeded.") + +#define YES_LABEL _("Yes") +#define NO_LABEL _("No") \ No newline at end of file diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index d758d57..ac02960 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -72,10 +72,101 @@ void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){ on_subwindow_close(self); } +void on_terminal_done(GtkWidget *terminal, int size, widgets_dict *widgets){ + char *text=vte_terminal_get_text_range(VTE_TERMINAL(terminal),0,0,0,10,NULL,NULL,NULL); + printf("\"%s\"\n",text); + gtk_widget_destroy(terminal); + // vte_terminal_reset(VTE_TERMINAL(terminal),0,1); + // gtk_widget_destroy(terminal); + // gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalBox),0); +} + +void on_terminal_more(GtkWidget *self, widgets_dict *widgets){ + int active = gtk_revealer_get_child_revealed(GTK_REVEALER(widgets->TerminalMoreRevieler)); + if (active ==1) active = 0; + else active=1; +gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalMoreRevieler),active); +} + + +void on_terminal_destroy(GtkWidget *self, widgets_dict *widgets){ + gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalRevealer),0); + gtk_widget_destroy(widgets->TerminalRevealer); +} + static void child_ready(VteTerminal *terminal, GPid pid, GError *error, gpointer user_data) { if (!terminal) return; if (pid == -1) printf("Error\n\n\n"); + else vte_terminal_feed_child(VTE_TERMINAL(terminal),(char*)user_data,strlen((char*)user_data)); +} + +void on_terminal_check_progress(VteTerminal *terminal, widgets_dict *widgets){ + char *text = vte_terminal_get_text(terminal,NULL,NULL,NULL); + // printf("%d - %s\n",rows, text); + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->TerminalInfoLabel),(double)yon_char_find_count(text,"::")/4); +} + +void yon_terminal_start(widgets_dict *widgets, char *usr_command){ + char **command=new_arr(char*,2); + gchar **envp = g_get_environ(); + command[0]=(gchar *)g_strdup(g_environ_getenv(envp, "SHELL")); + command[1]=NULL; + char **env=new_arr(char*,2); + env[0]=""; + env[1]=NULL; + + GtkBuilder *builder=gtk_builder_new_from_file(glade_path); + widgets->TerminalBox = yon_gtk_builder_get_widget(builder, "TerminalBox"); + widgets->TerminalRevealer = yon_gtk_builder_get_widget(builder, "TerminalRevealer"); + widgets->TerminalMoreRevieler = yon_gtk_builder_get_widget(builder, "TerminalMoreRevieler"); + widgets->TerminalMoreButton = yon_gtk_builder_get_widget(builder, "TerminalMoreButton"); + widgets->TerminalScroll = yon_gtk_builder_get_widget(builder, "TerminalScroll"); + widgets->TerminalInfoLabel = yon_gtk_builder_get_widget(builder, "TerminalInfoLabel"); + + GtkWidget *terminal = yon_gtk_builder_get_widget(builder, "TerminalTerminal"); + // gtk_size_group_add_widget(GTK_SIZE_GROUP(gtk_builder_get_object(builder,"sgroup")),yon_gtk_builder_get_widget(builder,"TerminalFrame")); + // gtk_size_group_add_widget(GTK_SIZE_GROUP(gtk_builder_get_object(builder,"sgroup")),widgets->TerminalOverlay); + vte_terminal_set_size(VTE_TERMINAL(terminal),10,15); + 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),"workingbg"); + gtk_overlay_add_overlay(GTK_OVERLAY(widgets->TerminalOverlay),widgets->TerminalRevealer); + g_signal_connect(G_OBJECT(terminal), "child-exited", G_CALLBACK(on_terminal_done), widgets); + g_signal_connect(G_OBJECT(terminal), "contents-changed", G_CALLBACK(on_terminal_check_progress), widgets); + g_signal_connect(G_OBJECT(widgets->TerminalMoreButton), "clicked", G_CALLBACK(on_terminal_more), widgets); + g_signal_connect(G_OBJECT(terminal), "destroy", G_CALLBACK(on_terminal_destroy), widgets); + gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalRevealer),1); + VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL); + vte_terminal_set_pty(VTE_TERMINAL(terminal),pty); + char *install_command=yon_char_unite(usr_command," ;exit 0","\n",NULL); + vte_terminal_spawn_async(VTE_TERMINAL(terminal), + VTE_PTY_DEFAULT, + NULL, + command, + NULL, + 0, + NULL, NULL, + NULL, + -1, + NULL, + child_ready, + install_command); + vte_pty_spawn_async(pty, + NULL, + command, + NULL, + 0, + NULL, NULL, + NULL, + -1, + NULL, + NULL, + NULL); + vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), 100); + vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), TRUE); + vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), TRUE); + gtk_widget_show_all(widgets->TerminalRevealer); } void on_driver_pack_install(GtkWidget *self,widgets_dict *widgets){ @@ -85,6 +176,19 @@ void on_driver_pack_install(GtkWidget *self,widgets_dict *widgets){ GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->proprietaryTreeView)); 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,"virtualbox")); + + +} + +void on_driver_install(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)); + gtk_tree_selection_get_selected(selection,&list_s,&iter); + gtk_tree_model_get(list_s,&iter,1,&name,-1); pthread_t tid; char **command=new_arr(char*,2); gchar **envp = g_get_environ(); @@ -95,11 +199,11 @@ void on_driver_pack_install(GtkWidget *self,widgets_dict *widgets){ env[1]=NULL; GtkWidget *terminal = vte_terminal_new(); - // vte_terminal_set_size(VTE_TERMINAL(terminal),50,100); gtk_box_pack_start(GTK_BOX(widgets->TerminalBox),terminal,1,1,0); VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL); // VtePty *pty = vte_terminal_pty_new_sync(VTE_TERMINAL(terminal),VTE_PTY_DEFAULT,NULL,NULL); vte_terminal_set_pty(VTE_TERMINAL(terminal),pty); + char *install_command=yon_char_unite(install_proprietary_command,name,"\n",NULL); vte_terminal_spawn_async(VTE_TERMINAL(terminal), VTE_PTY_DEFAULT, NULL, /* working directory */ @@ -111,7 +215,7 @@ void on_driver_pack_install(GtkWidget *self,widgets_dict *widgets){ -1, /* timeout */ NULL, /* cancellable */ child_ready, /* callback */ - NULL); /* user_data */ + install_command); /* user_data */ vte_pty_spawn_async(pty, NULL, /* working directory */ command, /* command */ @@ -123,25 +227,10 @@ void on_driver_pack_install(GtkWidget *self,widgets_dict *widgets){ NULL, /* cancellable */ NULL, /* callback */ NULL); /* user_data */ - char *install_command=yon_char_unite(install_proprietary_command,name,"\n",NULL); - vte_terminal_feed_child(VTE_TERMINAL(terminal),install_command,strlen(install_command)); - vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), 0); vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), FALSE); - vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), TRUE); - gtk_widget_show_all(widgets->TerminalWindow); - // pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(install_proprietary_command,name)); - -} - -void on_driver_install(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)); - gtk_tree_selection_get_selected(selection,&list_s,&iter); - gtk_tree_model_get(list_s,&iter,1,&name,-1); - pthread_t tid; + vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), FALSE); + vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal),100); + gtk_widget_show_all(widgets->TerminalRevealer); // pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(install_proprietary_command,name)); } @@ -155,6 +244,48 @@ void on_driver_pack_delete(GtkWidget *self,widgets_dict *widgets){ gtk_tree_selection_get_selected(selection,&list_s,&iter); gtk_tree_model_get(list_s,&iter,1,&name,-1); pthread_t tid; + char **command=new_arr(char*,2); + gchar **envp = g_get_environ(); + command[0]=(gchar *)g_strdup(g_environ_getenv(envp, "SHELL")); + command[1]=NULL; + char **env=new_arr(char*,2); + env[0]=""; + env[1]=NULL; + + GtkWidget *terminal = vte_terminal_new(); + // vte_terminal_set_size(VTE_TERMINAL(terminal),50,100); + gtk_box_pack_start(GTK_BOX(widgets->TerminalBox),terminal,1,1,0); + VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL); + // VtePty *pty = vte_terminal_pty_new_sync(VTE_TERMINAL(terminal),VTE_PTY_DEFAULT,NULL,NULL); + vte_terminal_set_pty(VTE_TERMINAL(terminal),pty); + char *install_command=yon_char_unite(delete_proprietary_command,name,"\n",NULL); + vte_terminal_spawn_async(VTE_TERMINAL(terminal), + VTE_PTY_DEFAULT, + NULL, /* working directory */ + command, /* command */ + NULL, /* environment */ + 0, /* spawn flags */ + NULL, NULL, /* child setup */ + NULL, /* child pid */ + -1, /* timeout */ + NULL, /* cancellable */ + child_ready, /* callback */ + install_command); /* user_data */ + vte_pty_spawn_async(pty, + NULL, /* working directory */ + command, /* command */ + NULL, /* environment */ + 0, /* spawn flags */ + NULL, NULL, /* child setup */ + NULL, /* child pid */ + -1, /* timeout */ + NULL, /* cancellable */ + NULL, /* callback */ + NULL); /* user_data */ + vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), 0); + vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), FALSE); + vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), TRUE); + gtk_widget_show_all(widgets->TerminalRevealer); // pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name)); } @@ -168,6 +299,48 @@ void on_driver_delete(GtkWidget *self,widgets_dict *widgets){ gtk_tree_selection_get_selected(selection,&list_s,&iter); gtk_tree_model_get(list_s,&iter,1,&name,-1); pthread_t tid; + char **command=new_arr(char*,2); + gchar **envp = g_get_environ(); + command[0]=(gchar *)g_strdup(g_environ_getenv(envp, "SHELL")); + command[1]=NULL; + char **env=new_arr(char*,2); + env[0]=""; + env[1]=NULL; + + GtkWidget *terminal = vte_terminal_new(); + // vte_terminal_set_size(VTE_TERMINAL(terminal),50,100); + gtk_box_pack_start(GTK_BOX(widgets->TerminalBox),terminal,1,1,0); + VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL); + // VtePty *pty = vte_terminal_pty_new_sync(VTE_TERMINAL(terminal),VTE_PTY_DEFAULT,NULL,NULL); + vte_terminal_set_pty(VTE_TERMINAL(terminal),pty); + char *install_command=yon_char_unite(delete_proprietary_command,name,"\n",NULL); + vte_terminal_spawn_async(VTE_TERMINAL(terminal), + VTE_PTY_DEFAULT, + NULL, /* working directory */ + command, /* command */ + NULL, /* environment */ + 0, /* spawn flags */ + NULL, NULL, /* child setup */ + NULL, /* child pid */ + -1, /* timeout */ + NULL, /* cancellable */ + child_ready, /* callback */ + install_command); /* user_data */ + vte_pty_spawn_async(pty, + NULL, /* working directory */ + command, /* command */ + NULL, /* environment */ + 0, /* spawn flags */ + NULL, NULL, /* child setup */ + NULL, /* child pid */ + -1, /* timeout */ + NULL, /* cancellable */ + NULL, /* callback */ + NULL); /* user_data */ + vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), 0); + vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), FALSE); + vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), TRUE); + gtk_widget_show_all(widgets->TerminalRevealer); // pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name)); } @@ -349,7 +522,7 @@ void on_configuration_save_local(GtkWidget *self, widgets_dict *widgets) yon_config_save(delstr); } if (str){ - printf(str); + // printf(str); yon_config_save(str); videoconfig.status_render.text_to_render=LOCAL_SAVE_SUCCESS; @@ -384,7 +557,7 @@ void on_configuration_save_global(GtkWidget *self, widgets_dict *widgets) str = yon_char_get_augumented(str, yon_char_get_augumented(" ", videoconfig.optirun)); if (videoconfig.primusrun) str = yon_char_get_augumented(str, yon_char_get_augumented(" ", videoconfig.primusrun)); - printf(str); + // printf(str); yon_config_save(str); } @@ -1277,9 +1450,7 @@ void yon_setup_widgets(widgets_dict *widgets) widgets->driversInfoButton = yon_gtk_builder_get_widget(widgets->builder, "driversInfoButton"); widgets->driversDeleteButton = yon_gtk_builder_get_widget(widgets->builder, "driversDeleteButton"); widgets->driversInstallButton = yon_gtk_builder_get_widget(widgets->builder, "driversInstallButton"); - widgets->TerminalWindow = yon_gtk_builder_get_widget(widgets->builder, "TerminalWindow"); - widgets->TerminalBox = yon_gtk_builder_get_widget(widgets->builder, "TerminalBox"); - widgets->TerminalHeaderTitleLabel = yon_gtk_builder_get_widget(widgets->builder, "TerminalHeaderTitleLabel"); + widgets->TerminalOverlay = yon_gtk_builder_get_widget(widgets->builder, "TerminalOverlay"); widgets->driversTreeSelection = GTK_TREE_SELECTION(gtk_builder_get_object(widgets->builder, "driversTreeSelection")); widgets->proprietartInstalledColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "proprietartInstalledColumn")); diff --git a/source/ubl-settings-video.h b/source/ubl-settings-video.h index 9845eba..f3fda1a 100644 --- a/source/ubl-settings-video.h +++ b/source/ubl-settings-video.h @@ -53,7 +53,7 @@ #define remove_drivers_local_command "/usr/bin/ubconfig --target global remove video " -#define install_proprietary_command "pkexec pacman -Sy " +#define install_proprietary_command "tput cup 0 0 && tput ed; pkexec pacman -Sy " #define delete_proprietary_command "pkexec pacman -R --noconfirm " @@ -233,9 +233,13 @@ typedef struct GtkTreeViewColumn *driverDescriptionColumn; GtkTreeViewColumn *driverSupportedColumn; - GtkWidget *TerminalWindow; + GtkWidget *TerminalOverlay; GtkWidget *TerminalBox; - GtkWidget *TerminalHeaderTitleLabel; + GtkWidget *TerminalRevealer; + GtkWidget *TerminalInfoLabel; + GtkWidget *TerminalMoreButton; + GtkWidget *TerminalScroll; + GtkWidget *TerminalMoreRevieler; } widgets_dict; typedef struct diff --git a/source/ubl-utils.c b/source/ubl-utils.c index fb74917..92f05a4 100644 --- a/source/ubl-utils.c +++ b/source/ubl-utils.c @@ -401,6 +401,20 @@ char *yon_char_divide(char *source, int dividepos) return cut; } +int yon_char_find_count(char *source, char *find){ + char *working_string=yon_char_new(source); + int i=0; + int size=0; + int pos=0; + config_str rtn = yon_char_parse(working_string,&size,"\n"); + for (int j=0;j + @@ -99,7 +100,8 @@ - + + 800 400 False @@ -107,7 +109,7 @@ 400 com.ublinux.ubl-settings-video - + True False vertical @@ -152,7 +154,6 @@ - False О Программе @@ -199,6 +200,166 @@ + + 300 + 0.7299999937415127 + 1 + 10 + + + True + True + False + end + True + + + True + False + 0 + in + + + True + False + + + True + False + 5 + 5 + 5 + 5 + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + + + True + True + False + center + + + True + True + 0 + + + + + More + True + True + True + True + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + + + True + False + + + True + False + vertical + + + True + False + True + natural + adjustment1 + natural + UTF-8 + True + False + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + vertical + adjustment1 + True + False + 1 + 2 + + + False + True + 1 + + + + + + + False + True + 1 + + + + + + + + + True + False + + + + + + + True False @@ -326,189 +487,39 @@ False document-edit-symbolic - - True - False - open-menu-symbolic - - - - True + + 800 + 600 False - start - 3 - 3 - 10 - 20 - vertical - - - True - False - True - - - - - - - False - True - 0 - - - - - True - False - 5 - 5 - - - - - - - False - True - 1 - - + 800 + 600 + com.ublinux.ubl-settings-video - + True False - 15 - - - True - True - True - image14 - - - - False - True - 0 - - - - - True - True - True - image13 - - - - False - True - 1 - - - - - True - True - True - end - image3 - - - - False - True - end - 2 - - + True + vertical - - True - True - True - image15 - - - - False - True - 3 - - - - - False - True - 2 - - - - - True - False - process-stop-symbolic - - - True - False - emblem-ok-symbolic - - - False - True - com.ublinux.ubl-settings-video - - - True - False - vertical - - + True False - 5 - 5 - 5 - 5 vertical - + True False - 5 - - Enabled + True - True - False - True + False + 5 + 5 + 5 + 5 + 6 + 6 + 25 False @@ -516,11 +527,51 @@ 0 + + + True + True + + + True + False + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + + + + + + + + + + + + + True + True + 1 + + False True - 1 + 0 @@ -529,40 +580,18 @@ False vertical - + + 81 True False - end - 5 - True - - - Save - True - True - True - image5 - - - False - True - end - 0 - - - - Cancel + True - True - True - image4 + False + start - False - True - end - 1 + -1 @@ -576,723 +605,180 @@ False True - end - 2 + 1 - + True - False - vertical + True + 5 - + + 165 True - False - vertical - 5 - - - True - False - 5 - - - True - False - Port - - - False - True - 0 - - - - - True - False - 0 - - - True - True - 1 - - - - - Main display - True - True - False - True - - - False - True - 2 - - - - - False - True - 1 - - + True + 5 + 5 + 5 + 5 + external - + True False - 5 - - - True - False - Resolution (px): - - - False - True - 0 - - - + True False - 0 - - - True - True - 1 - - - - - Show unsupported - True - True - False - True - - - False - True - 2 - - - - - False - True - 2 - - - - - True - False - 5 - - - True - False - Frequency (Hz): - - - False - True - 0 - - - - - True - False - 0 - - - True - True - 1 - - - - - False - True - 3 - - - - - True - False - 5 - - - True - False - Rotation: - - - False - True - 0 - - - - - True - False - 0 - - - True - True - 1 - - - - - False - True - 4 - - - - - True - False - 5 - - - True - False - Position: - - - False - True - 0 - - - - - True - False - 5 - True + 5 + 5 + 5 + 5 + 5 + vertical - + True False - 0 + 0.019999999552965164 + in + + + True + False + 5 + 5 + 12 + 5 + + + True + False + vertical + + + Automatically choose and use driver + True + True + False + start + True + + + False + True + 0 + + + + + True + False + 5 + + + True + False + vertical + 5 + + + True + False + start + Failsafe driver nVidia: + 0 + + + False + True + 1 + + + + + True + False + start + Failsafe driver AMD/ATI: + 0 + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + + + False + True + 1 + + + + + True + False + + + False + True + 2 + + + + + True + True + 1 + + + + + False + True + 1 + + + + + + + + + True + False + Driver + + - True + False True 0 - - True - False - 0 - - - True - True - 1 - - - - - True - True - 1 - - - - - False - True - 5 - - - - - Do not switch off display - True - True - False - True - - - False - True - 6 - - - - - Create modeline for current resolution with CVT - True - True - False - True - - - False - True - 7 - - - - - Use "CVT Reduced Blanking"gshgrbehr - True - True - False - True - - - False - True - 8 - - - - - Create modeline for current resolution with GTF - True - True - False - True - - - False - True - 9 - - - - - True - False - - - False - True - 10 - - - - - False - True - 0 - - - - - True - False - 5 - 5 - vertical - 5 - - - Configure manually through parameter line: - True - True - False - True - - - False - True - 0 - - - - - True - False - True - center - 1920x1080 - - - True - True - 1 - - - - - False - True - 1 - - - - - False - True - 3 - - - - - True - True - 0 - - - - - - - True - False - go-bottom-symbolic - - - True - False - user-trash-symbolic - - - True - False - go-bottom-symbolic - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 800 - 600 - False - 800 - 600 - com.ublinux.ubl-settings-video - - - True - False - True - vertical - - - True - False - vertical - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - 25 - - - False - True - 0 - - - - - True - True - - - True - False - - - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - - - - - - - - - - - - - True - True - 1 - - - - - False - True - 0 - - - - - True - False - vertical - - - 81 - True - False - - - True - False - start - - - -1 - - - - - False - True - 0 - - - - - False - True - 1 - - - - - True - True - 5 - - - 165 - True - True - 5 - 5 - 5 - 5 - external - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 5 - vertical - - - True - False - 0.019999999552965164 - in - - - True - False - 5 - 5 - 12 - 5 - - - True - False - vertical - - - Automatically choose and use driver - True - True - False - start - True - - - False - True - 0 - - - - - True - False - 5 - - - True - False - vertical - 5 - - - True - False - start - Failsafe driver nVidia: - 0 - - - False - True - 1 - - - - - True - False - start - Failsafe driver AMD/ATI: - 0 - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - vertical - 5 - - - True - False - - - False - True - 1 - - - - - True - False - - - False - True - 2 - - - - - True - True - 1 - - - - - False - True - 1 - - - - - - - - - True - False - Driver - - - - - False - True - 0 - - - - + True False vertical @@ -1558,334 +1044,1163 @@ - - True - False - 5 - 5 - - - True - False - Fix frame gap (nVidia): - 0 - - - False - True - 0 - - - - - True - False - - - True - True - 1 - - - - - False - True - 1 - + + True + False + 5 + 5 + + + True + False + Fix frame gap (nVidia): + 0 + + + False + True + 0 + + + + + True + False + + + True + True + 1 + + + + + False + True + 1 + + + + + + + + + True + False + Extra + + + + + False + True + 3 + + + + + + + + + + + True + False + Main Settings + + + False + + + + + True + False + + + True + True + 5 + 5 + 5 + 5 + 5 + 5 + + + True + False + 5 + 5 + 5 + 5 + 5 + vertical + 5 + + + True + True + + + True + True + 5 + liststore6 + 1 + True + + + + + + Installed + + + + 0 + + + + + + + Package + + + + 1 + + + + + + + Driver + + + + 2 + + + + + + + Description + + + + 3 + + + + + + + Supported Devices + + + + 4 + + + + + + + + + True + True + 0 + + + + + True + False + center + 5 + + + Установить + True + True + True + image9 + + + False + True + end + 0 + + + + + Удалить + True + True + True + image11 + + + False + True + end + 1 + + + + + Подробнее + True + True + True + image10 + + + False + True + end + 2 + + + + + False + True + 1 + + + + + + + True + False + Driver Modules + + + False + + + + + True + False + 5 + 5 + 5 + 5 + 5 + vertical + 5 + + + True + True + + + True + True + 5 + liststore6 + 0 + vertical + True + 2 + + + + + + Installed + + + + 0 + + + + + + + Package + + + + 1 + + + + + + + Driver + + + + 2 + + + + + + + Description + + + + 3 + + + + + + + Supported Devices + + + + 4 + - - + + + True + True + 0 + + + + + True + False + center + 5 + + + Установить True - False - Extra + True + True + image6 + + + False + True + end + 0 + + + + + Удалить + True + True + True + image7 + + + False + True + end + 1 + + + + + Подробнее + True + True + True + image12 + + False + True + end + 2 + False True - 3 + 1 + + 1 + + + + + True + False + Drivers + + + 1 + False + + + + + + + + + + + -1 + + + + + 1 + + + + + True + False + Drivers + + + 1 + False + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 0 + none + + + True + False + 12 + + + True + False + + + + + + + + + + True + False + 5 + 5 + Devices and Drivers + + + + + 2 + + + + + True + False + Information + + + 2 + False + + + + + True + True + 2 + + + + + True + True + 0 + + + + + + + True + False + True + + + True + False + start + 5 + 5 + 5 + 5 + False + UBlinux Video Configuration + + + + + + + + True + False + 5 + 5 + 5 + 5 + 32 + com.ublinux.ubl-settings-video + + + + + True + False + + + True + True + False + True + LoadConfigurationMenu + none + + + True + False + + + True + False + 5 + 5 + 5 + 5 + Load + + + False + True + 0 + + + + + True + False + pan-down-symbolic + + + False + True + 1 + + + + + + + False + True + 0 + + + + + 1 + + + + + True + False + + + True + True + False + True + True + SaveConfigurationMenu + none + + + True + False + + + True + False + 5 + 5 + 5 + 5 + Save + + + + False + True + 0 + + + + + True + False + pan-down-symbolic + + + False + True + 1 + + + + + + + False + True + 0 + + + + + True + True + False + True + True + SettingsMenu + none + + + + + + False + True + 1 + + + + + end + 3 + + + + + + + vertical + + + + + + + + + + + + + + + + + + + + + + True + False + open-menu-symbolic + + + + True + False + start + 3 + 3 + 10 + 20 + vertical + + + True + False + True + + + + + + + False + True + 0 + + + + + True + False + 5 + 5 + + + + + + + False + True + 1 + + + + + True + False + 15 + + + True + True + True + image14 + + + + False + True + 0 + + + + + True + True + True + image13 + + + + False + True + 1 + + + + + True + True + True + end + image3 + + + + False + True + end + 2 + + + + + True + True + True + image15 + + + + False + True + 3 + + + + + False + True + 2 + + + + + True + False + process-stop-symbolic + + + True + False + emblem-ok-symbolic + + + False + True + com.ublinux.ubl-settings-video + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + vertical + + + True + False + 5 + + + Enabled + True + True + False + True + + False + True + 0 + - - + + + False + True + 1 + + + + + True + False + vertical + + True False - Main Settings + end + 5 + True + + + Save + True + True + True + image5 + + + False + True + end + 0 + + + + + Cancel + True + True + True + image4 + + + False + True + end + 1 + + - False + False + True + 0 + + + False + True + end + 2 + + + + + True + False + vertical - + True - True - 5 - 5 - 5 - 5 - 5 - 5 + False + vertical + 5 + + + True + False + 5 + + + True + False + Port + + + False + True + 0 + + + + + True + False + 0 + + + True + True + 1 + + + + + Main display + True + True + False + True + + + False + True + 2 + + + + + False + True + 1 + + + + + True + False + 5 + + + True + False + Resolution (px): + + + False + True + 0 + + + + + True + False + 0 + + + True + True + 1 + + + + + Show unsupported + True + True + False + True + + + False + True + 2 + + + + + False + True + 2 + + + + + True + False + 5 + + + True + False + Frequency (Hz): + + + False + True + 0 + + + + + True + False + 0 + + + True + True + 1 + + + + + False + True + 3 + + True False - 5 - 5 - 5 - 5 - 5 - vertical 5 - + True - True - - - True - True - 5 - liststore6 - 1 - True - - - - - - Installed - - - - 0 - - - - - - - Package - - - - 1 - - - - - - - Driver - - - - 2 - - - - - - - Description - - - - 3 - - - - - - - Supported Devices - - - - 4 - - - - - - + False + Rotation: - True + False True 0 - + True False - center - 5 - - - Установить - True - True - True - image9 - - - False - True - end - 0 - - - - - Удалить - True - True - True - image11 - - - False - True - end - 1 - - - - - Подробнее - True - True - True - image10 - - - False - True - end - 2 - - + 0 - False + True True 1 - - - - True - False - Driver Modules - - False + False + True + 4 True False - 5 - 5 - 5 - 5 - 5 - vertical 5 - + True - True - - - True - True - 5 - liststore6 - 0 - vertical - True - 2 - - - - - - Installed - - - - 0 - - - - - - - Package - - - - 1 - - - - - - - Driver - - - - 2 - - - - - - - Description - - - - 3 - - - - - - - Supported Devices - - - - 4 - - - - - - + False + Position: - True + False True 0 @@ -1894,290 +2209,135 @@ True False - center 5 + True - - Установить + True - True - True - image6 + False + 0 - False + True True - end 0 - - Удалить + True - True - True - image7 + False + 0 - False + True True - end 1 - - - Подробнее - True - True - True - image12 - - - False - True - end - 2 - - - False + True True 1 - 1 + False + True + 5 - - + + + Do not switch off display True - False - Drivers + True + False + True - 1 - False + False + True + 6 - - - - - - - - 1 - - - - - True - False - Drivers - - - 1 - False - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 0 - none - - + + Create modeline for current resolution with CVT True - False - 12 - - - True - False - - - - - - - - + True + False + True + + False + True + 7 + - - + + + Use "CVT Reduced Blanking"gshgrbehr True - False - 5 - 5 - Devices and Drivers + True + False + True + + False + True + 8 + - - - 2 - - - - - True - False - Information - - - 2 - False - - - - - True - True - 2 - - - - - True - True - 0 - - - - - - - True - False - True - - - True - False - start - 5 - 5 - 5 - 5 - False - UBlinux Video Configuration - - - - - - - - True - False - 5 - 5 - 5 - 5 - 32 - com.ublinux.ubl-settings-video - - - - - True - False - - - True - True - False - True - LoadConfigurationMenu - none - - - True - False - + + Create modeline for current resolution with GTF True - False - 5 - 5 - 5 - 5 - Load + True + False + True False True - 0 + 9 - + True False - pan-down-symbolic False True - 1 + 10 + + False + True + 0 + - - - False - True - 0 - - - - - 1 - - - - - True - False - - - True - True - False - True - True - SaveConfigurationMenu - none True False + 5 + 5 + vertical + 5 - + + Configure manually through parameter line: True - False - 5 - 5 - 5 - 5 - Save - + True + False + True False @@ -2186,75 +2346,88 @@ - + True - False - pan-down-symbolic + False + True + center + 1920x1080 - False + True True 1 + + False + True + 1 + False True - 0 - - - - - True - True - False - True - True - SettingsMenu - none - - - - - - False - True - 1 + 3 - end - 3 + True + True + 0 - - vertical - - - - - - - - - - - + + True + False + go-bottom-symbolic - - - - - - - + + True + False + user-trash-symbolic + + + True + False + go-bottom-symbolic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + both True From c42bb965a402648a8bc00536d9205326049719c2 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 3 May 2023 18:29:17 +0600 Subject: [PATCH 08/15] new output system for all driver actions implemented --- source/ubl-settings-video.c | 128 ++---------------------------------- source/ubl-settings-video.h | 2 +- 2 files changed, 6 insertions(+), 124 deletions(-) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index ac02960..2de0a92 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -125,8 +125,6 @@ void yon_terminal_start(widgets_dict *widgets, char *usr_command){ widgets->TerminalInfoLabel = yon_gtk_builder_get_widget(builder, "TerminalInfoLabel"); GtkWidget *terminal = yon_gtk_builder_get_widget(builder, "TerminalTerminal"); - // gtk_size_group_add_widget(GTK_SIZE_GROUP(gtk_builder_get_object(builder,"sgroup")),yon_gtk_builder_get_widget(builder,"TerminalFrame")); - // gtk_size_group_add_widget(GTK_SIZE_GROUP(gtk_builder_get_object(builder,"sgroup")),widgets->TerminalOverlay); vte_terminal_set_size(VTE_TERMINAL(terminal),10,15); gtk_widget_set_app_paintable(terminal,1); gtk_style_context_add_class(gtk_widget_get_style_context(terminal),"opacited"); @@ -139,7 +137,7 @@ void yon_terminal_start(widgets_dict *widgets, char *usr_command){ gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalRevealer),1); VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL); vte_terminal_set_pty(VTE_TERMINAL(terminal),pty); - char *install_command=yon_char_unite(usr_command," ;exit 0","\n",NULL); + char *install_command=yon_char_unite("tput cup 0 0 && tput ed; ",usr_command," ; sleep 5;exit 0","\n",NULL); vte_terminal_spawn_async(VTE_TERMINAL(terminal), VTE_PTY_DEFAULT, NULL, @@ -176,7 +174,7 @@ void on_driver_pack_install(GtkWidget *self,widgets_dict *widgets){ GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->proprietaryTreeView)); 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,"virtualbox")); + yon_terminal_start(widgets,yon_char_get_augumented(install_proprietary_command,name)); } @@ -189,50 +187,7 @@ void on_driver_install(GtkWidget *self,widgets_dict *widgets){ GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->driversTreeView)); gtk_tree_selection_get_selected(selection,&list_s,&iter); gtk_tree_model_get(list_s,&iter,1,&name,-1); - pthread_t tid; - char **command=new_arr(char*,2); - gchar **envp = g_get_environ(); - command[0]=(gchar *)g_strdup(g_environ_getenv(envp, "SHELL")); - command[1]=NULL; - char **env=new_arr(char*,2); - env[0]=""; - env[1]=NULL; - - GtkWidget *terminal = vte_terminal_new(); - gtk_box_pack_start(GTK_BOX(widgets->TerminalBox),terminal,1,1,0); - VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL); - // VtePty *pty = vte_terminal_pty_new_sync(VTE_TERMINAL(terminal),VTE_PTY_DEFAULT,NULL,NULL); - vte_terminal_set_pty(VTE_TERMINAL(terminal),pty); - char *install_command=yon_char_unite(install_proprietary_command,name,"\n",NULL); - vte_terminal_spawn_async(VTE_TERMINAL(terminal), - VTE_PTY_DEFAULT, - NULL, /* working directory */ - command, /* command */ - NULL, /* environment */ - 0, /* spawn flags */ - NULL, NULL, /* child setup */ - NULL, /* child pid */ - -1, /* timeout */ - NULL, /* cancellable */ - child_ready, /* callback */ - install_command); /* user_data */ - vte_pty_spawn_async(pty, - NULL, /* working directory */ - command, /* command */ - NULL, /* environment */ - 0, /* spawn flags */ - NULL, NULL, /* child setup */ - NULL, /* child pid */ - -1, /* timeout */ - NULL, /* cancellable */ - NULL, /* callback */ - NULL); /* user_data */ - vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), FALSE); - vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), FALSE); - vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal),100); - gtk_widget_show_all(widgets->TerminalRevealer); - // pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(install_proprietary_command,name)); - + yon_terminal_start(widgets,yon_char_get_augumented(install_proprietary_command,name)); } void on_driver_pack_delete(GtkWidget *self,widgets_dict *widgets){ @@ -258,36 +213,7 @@ void on_driver_pack_delete(GtkWidget *self,widgets_dict *widgets){ VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL); // VtePty *pty = vte_terminal_pty_new_sync(VTE_TERMINAL(terminal),VTE_PTY_DEFAULT,NULL,NULL); vte_terminal_set_pty(VTE_TERMINAL(terminal),pty); - char *install_command=yon_char_unite(delete_proprietary_command,name,"\n",NULL); - vte_terminal_spawn_async(VTE_TERMINAL(terminal), - VTE_PTY_DEFAULT, - NULL, /* working directory */ - command, /* command */ - NULL, /* environment */ - 0, /* spawn flags */ - NULL, NULL, /* child setup */ - NULL, /* child pid */ - -1, /* timeout */ - NULL, /* cancellable */ - child_ready, /* callback */ - install_command); /* user_data */ - vte_pty_spawn_async(pty, - NULL, /* working directory */ - command, /* command */ - NULL, /* environment */ - 0, /* spawn flags */ - NULL, NULL, /* child setup */ - NULL, /* child pid */ - -1, /* timeout */ - NULL, /* cancellable */ - NULL, /* callback */ - NULL); /* user_data */ - vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), 0); - vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), FALSE); - vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), TRUE); - gtk_widget_show_all(widgets->TerminalRevealer); - // pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name)); - + yon_terminal_start(widgets,yon_char_get_augumented(delete_proprietary_command,name)); } void on_driver_delete(GtkWidget *self,widgets_dict *widgets){ @@ -298,51 +224,7 @@ void on_driver_delete(GtkWidget *self,widgets_dict *widgets){ GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->driversTreeView)); gtk_tree_selection_get_selected(selection,&list_s,&iter); gtk_tree_model_get(list_s,&iter,1,&name,-1); - pthread_t tid; - char **command=new_arr(char*,2); - gchar **envp = g_get_environ(); - command[0]=(gchar *)g_strdup(g_environ_getenv(envp, "SHELL")); - command[1]=NULL; - char **env=new_arr(char*,2); - env[0]=""; - env[1]=NULL; - - GtkWidget *terminal = vte_terminal_new(); - // vte_terminal_set_size(VTE_TERMINAL(terminal),50,100); - gtk_box_pack_start(GTK_BOX(widgets->TerminalBox),terminal,1,1,0); - VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL); - // VtePty *pty = vte_terminal_pty_new_sync(VTE_TERMINAL(terminal),VTE_PTY_DEFAULT,NULL,NULL); - vte_terminal_set_pty(VTE_TERMINAL(terminal),pty); - char *install_command=yon_char_unite(delete_proprietary_command,name,"\n",NULL); - vte_terminal_spawn_async(VTE_TERMINAL(terminal), - VTE_PTY_DEFAULT, - NULL, /* working directory */ - command, /* command */ - NULL, /* environment */ - 0, /* spawn flags */ - NULL, NULL, /* child setup */ - NULL, /* child pid */ - -1, /* timeout */ - NULL, /* cancellable */ - child_ready, /* callback */ - install_command); /* user_data */ - vte_pty_spawn_async(pty, - NULL, /* working directory */ - command, /* command */ - NULL, /* environment */ - 0, /* spawn flags */ - NULL, NULL, /* child setup */ - NULL, /* child pid */ - -1, /* timeout */ - NULL, /* cancellable */ - NULL, /* callback */ - NULL); /* user_data */ - vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), 0); - vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), FALSE); - vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), TRUE); - gtk_widget_show_all(widgets->TerminalRevealer); - // pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name)); - + yon_terminal_start(widgets,yon_char_get_augumented(delete_proprietary_command,name)); } void on_driver_pack_info(GtkWidget *self, widgets_dict *widgets){ diff --git a/source/ubl-settings-video.h b/source/ubl-settings-video.h index f3fda1a..991c538 100644 --- a/source/ubl-settings-video.h +++ b/source/ubl-settings-video.h @@ -53,7 +53,7 @@ #define remove_drivers_local_command "/usr/bin/ubconfig --target global remove video " -#define install_proprietary_command "tput cup 0 0 && tput ed; pkexec pacman -Sy " +#define install_proprietary_command "pkexec pacman --quiet --needed --noconfirm -S " #define delete_proprietary_command "pkexec pacman -R --noconfirm " From ac5beb30defcd8f7d598cedf5f0fb3f6468c9ca2 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 4 May 2023 10:23:05 +0600 Subject: [PATCH 09/15] Small fixes, video-drivers.csv update, driver tabels changes --- source/ubl-settings-video.c | 15 - source/ubl-settings-video.h | 2 +- ubl-settings-video.glade | 3285 ++++++++++++++++++----------------- video-drivers.csv | 14 +- 4 files changed, 1660 insertions(+), 1656 deletions(-) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index 2de0a92..3c02b8a 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -198,21 +198,6 @@ void on_driver_pack_delete(GtkWidget *self,widgets_dict *widgets){ GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->proprietaryTreeView)); gtk_tree_selection_get_selected(selection,&list_s,&iter); gtk_tree_model_get(list_s,&iter,1,&name,-1); - pthread_t tid; - char **command=new_arr(char*,2); - gchar **envp = g_get_environ(); - command[0]=(gchar *)g_strdup(g_environ_getenv(envp, "SHELL")); - command[1]=NULL; - char **env=new_arr(char*,2); - env[0]=""; - env[1]=NULL; - - GtkWidget *terminal = vte_terminal_new(); - // vte_terminal_set_size(VTE_TERMINAL(terminal),50,100); - gtk_box_pack_start(GTK_BOX(widgets->TerminalBox),terminal,1,1,0); - VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL); - // VtePty *pty = vte_terminal_pty_new_sync(VTE_TERMINAL(terminal),VTE_PTY_DEFAULT,NULL,NULL); - vte_terminal_set_pty(VTE_TERMINAL(terminal),pty); yon_terminal_start(widgets,yon_char_get_augumented(delete_proprietary_command,name)); } diff --git a/source/ubl-settings-video.h b/source/ubl-settings-video.h index 991c538..7eb8e3a 100644 --- a/source/ubl-settings-video.h +++ b/source/ubl-settings-video.h @@ -53,7 +53,7 @@ #define remove_drivers_local_command "/usr/bin/ubconfig --target global remove video " -#define install_proprietary_command "pkexec pacman --quiet --needed --noconfirm -S " +#define install_proprietary_command "pkexec pacman --quiet --needed --noconfirm -Sy " #define delete_proprietary_command "pkexec pacman -R --noconfirm " diff --git a/ubl-settings-video.glade b/ubl-settings-video.glade index a3ee6a2..3f144d9 100644 --- a/ubl-settings-video.glade +++ b/ubl-settings-video.glade @@ -487,39 +487,189 @@ False document-edit-symbolic - - 800 - 600 + + True False - 800 - 600 + open-menu-symbolic + + + + True + False + start + 3 + 3 + 10 + 20 + vertical + + + True + False + True + + + + + + + False + True + 0 + + + + + True + False + 5 + 5 + + + + + + + False + True + 1 + + + + + True + False + 15 + + + True + True + True + image14 + + + + False + True + 0 + + + + + True + True + True + image13 + + + + False + True + 1 + + + + + True + True + True + end + image3 + + + + False + True + end + 2 + + + + + True + True + True + image15 + + + + False + True + 3 + + + + + False + True + 2 + + + + + True + False + process-stop-symbolic + + + True + False + emblem-ok-symbolic + + + False + True com.ublinux.ubl-settings-video - + True False - True vertical True False + 5 + 5 + 5 + 5 vertical - + True False + 5 - + + Enabled True - False - 5 - 5 - 5 - 5 - 6 - 6 - 25 + True + False + True False @@ -527,51 +677,11 @@ 0 - - - True - True - - - True - False - - - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - - - - - - - - - - - - - True - True - 1 - - False True - 0 + 1 @@ -580,256 +690,280 @@ False vertical - - 81 + True False + end + 5 + True - + + Save True - False - start + True + True + image5 - -1 + False + True + end + 0 - - - False - True - 0 - - - - - False - True - 1 + + + Cancel + True + True + True + image4 + + + False + True + end + 1 + + + + + False + True + 0 + + + + + False + True + end + 2 - + True - True - 5 + False + vertical - - 165 + True - True - 5 - 5 - 5 - 5 - external + False + vertical + 5 - + + True + False + 5 + + + True + False + Port + + + False + True + 0 + + + + + True + False + 0 + + + True + True + 1 + + + + + Main display + True + True + False + True + + + False + True + 2 + + + + + False + True + 1 + + + + + True + False + 5 + + + True + False + Resolution (px): + + + False + True + 0 + + + + + True + False + 0 + + + True + True + 1 + + + + + Show unsupported + True + True + False + True + + + False + True + 2 + + + + + False + True + 2 + + + + + True + False + 5 + + + True + False + Frequency (Hz): + + + False + True + 0 + + + + + True + False + 0 + + + True + True + 1 + + + + + False + True + 3 + + + + + True + False + 5 + + + True + False + Rotation: + + + False + True + 0 + + + + + True + False + 0 + + + True + True + 1 + + + + + False + True + 4 + + + + True False + 5 + + + True + False + Position: + + + False + True + 0 + + True False - 5 - 5 - 5 - 5 - 5 - vertical + 5 + True - + True False - 0.019999999552965164 - in - - - True - False - 5 - 5 - 12 - 5 - - - True - False - vertical - - - Automatically choose and use driver - True - True - False - start - True - - - False - True - 0 - - - - - True - False - 5 - - - True - False - vertical - 5 - - - True - False - start - Failsafe driver nVidia: - 0 - - - False - True - 1 - - - - - True - False - start - Failsafe driver AMD/ATI: - 0 - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - vertical - 5 - - - True - False - - - False - True - 1 - - - - - True - False - - - False - True - 2 - - - - - True - True - 1 - - - - - False - True - 1 - - - - - - - - - True - False - Driver - - + 0 - False + True True 0 - + True False - vertical - - - True - False - 0.019999999552965164 - in - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 10 - - - - - - False - True - 0 - - - - - - - True - False - Monitor configuration - - - - - True - True - 0 - - + 0 True @@ -837,1103 +971,230 @@ 1 - - - True - False - 0.019999999552965164 - in - - - True - False - 5 - 5 - 12 - 5 - - - True - False - - - discrete video only (AMD/ATI) - True - True - False - 5 - 5 - True - - - False - True - 1 - - - - - - - - - True - False - 0 - Hybrid graphics - - - - - False - True - 2 - - - - - True - False - 5 - 0.019999999552965164 - in - - - True - False - 5 - 5 - 12 - 5 - - - True - False - vertical - - - True - False - 5 - - - True - False - vertical - 5 - - - Launch programms through optirun (nVidia): - True - True - False - True - - - False - True - 0 - - - - - Launch programs through primusun (nVidia): - True - True - False - True - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - vertical - 5 - - - True - False - True - steam - - - True - True - 0 - - - - - True - False - True - steam - - - True - True - 1 - - - - - True - True - 1 - - - - - True - False - vertical - 5 - - - True - False - True - True - image1 - - - False - True - 0 - - - - - True - False - True - True - image2 - - - False - True - 1 - - - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - 5 - 5 - - - True - False - Fix frame gap (nVidia): - 0 - - - False - True - 0 - - - - - True - False - - - True - True - 1 - - - - - False - True - 1 - - - - - - - - - True - False - Extra - - - - - False - True - 3 - - + + True + True + 1 + + + False + True + 5 + - - - - - True - False - Main Settings - - - False - - - - - True - False - + + Do not switch off display True True - 5 - 5 - 5 - 5 - 5 - 5 - - - True - False - 5 - 5 - 5 - 5 - 5 - vertical - 5 - - - True - True - - - True - True - 5 - liststore6 - 1 - True - - - - - - Installed - - - - 0 - - - - - - - Package - - - - 1 - - - - - - - Driver - - - - 2 - - - - - - - Description - - - - 3 - - - - - - - Supported Devices - - - - 4 - - - - - - - - - True - True - 0 - - - - - True - False - center - 5 - - - Установить - True - True - True - image9 - - - False - True - end - 0 - - - - - Удалить - True - True - True - image11 - - - False - True - end - 1 - - - - - Подробнее - True - True - True - image10 - - - False - True - end - 2 - - - - - False - True - 1 - - - - - - - True - False - Driver Modules - - - False - - - - - True - False - 5 - 5 - 5 - 5 - 5 - vertical - 5 - - - True - True - - - True - True - 5 - liststore6 - 0 - vertical - True - 2 - - - - - - Installed - - - - 0 - - - - - - - Package - - - - 1 - - - - - - - Driver - - - - 2 - - - - - - - Description - - - - 3 - - - - - - - Supported Devices - - - - 4 - - - - - - - - - True - True - 0 - - - - - True - False - center - 5 - - - Установить - True - True - True - image6 - - - False - True - end - 0 - - - - - Удалить - True - True - True - image7 - - - False - True - end - 1 - - - - - Подробнее - True - True - True - image12 - - - False - True - end - 2 - - - - - False - True - 1 - - - - - 1 - - - - - True - False - Drivers - - - 1 - False - - - - - - - - + False + True - -1 + False + True + 6 - - - 1 - - - - - True - False - Drivers - - - 1 - False - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 0 - none - - True - False - 12 - - - True - False - - - - - - - - - - - - - True - False - 5 - 5 - Devices and Drivers - - - - - 2 - - - - - True - False - Information - - - 2 - False - - - - - True - True - 2 - - - - - True - True - 0 - - - - - - - True - False - True - - - True - False - start - 5 - 5 - 5 - 5 - False - UBlinux Video Configuration - - - - - - - - True - False - 5 - 5 - 5 - 5 - 32 - com.ublinux.ubl-settings-video - - - - - True - False - - - True - True - False - True - LoadConfigurationMenu - none - - - True - False - - + + Create modeline for current resolution with CVT True - False - 5 - 5 - 5 - 5 - Load + True + False + True False True - 0 + 7 - - True - False - pan-down-symbolic + + Use "CVT Reduced Blanking"gshgrbehr + True + True + False + True False True - 1 + 8 - - - - - False - True - 0 - - - - - 1 - - - - - True - False - - - True - True - False - True - True - SaveConfigurationMenu - none - - - True - False - + + Create modeline for current resolution with GTF True - False - 5 - 5 - 5 - 5 - Save - + True + False + True False True - 0 + 9 - + True False - pan-down-symbolic False True - 1 + 10 + + False + True + 0 + - - - False - True - 0 - - - - - True - True - False - True - True - SettingsMenu - none - - - - - False - True - 1 - - - - - end - 3 - - - - - - - vertical - - - - - - - - - - - - - - - - - - - - - - True - False - open-menu-symbolic - - - - True - False - start - 3 - 3 - 10 - 20 - vertical - - - True - False - True - - - - - - - False - True - 0 - - - - - True - False - 5 - 5 - - - - - - - False - True - 1 - - - - - True - False - 15 - - - True - True - True - image14 - - - - False - True - 0 - - - - - True - True - True - image13 - - - - False - True - 1 - - - - - True - True - True - end - image3 - - - - False - True - end - 2 - - - - - True - True - True - image15 - + + True + False + 5 + 5 + vertical + 5 + + + Configure manually through parameter line: + True + True + False + True + + + False + True + 0 + + + + + True + False + True + center + 1920x1080 + + + True + True + 1 + + + + + False + True + 1 + + + + + False + True + 3 + + - False + True True - 3 + 0 - - False - True - 2 - - + True False - process-stop-symbolic + go-bottom-symbolic - + True False - emblem-ok-symbolic + user-trash-symbolic - + + True False - True + go-bottom-symbolic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 800 + 600 + False + 800 + 600 com.ublinux.ubl-settings-video - + True False + True vertical True False - 5 - 5 - 5 - 5 vertical - + True False - 5 - - Enabled + True - True - False - True + False + 5 + 5 + 5 + 5 + 6 + 6 + 25 False @@ -1941,281 +1202,871 @@ 0 - - - False - True - 1 - - - - - True - False - vertical - + True - False - end - 5 - True - - - Save - True - True - True - image5 - - - False - True - end - 0 - - + True - - Cancel + True - True - True - image4 + False + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + + + + + + + - - False - True - end - 1 - + - False + True True - 0 + 1 False True - end - 2 + 0 - + True False vertical - + + 81 True False - vertical - 5 - - - True - False - 5 - - - True - False - Port - - - False - True - 0 - - - - - True - False - 0 - - - True - True - 1 - - - - - Main display - True - True - False - True - - - False - True - 2 - - - - - False - True - 1 - - - + True False - 5 - - - True - False - Resolution (px): - - - False - True - 0 - - - - - True - False - 0 - - - True - True - 1 - - - - - Show unsupported - True - True - False - True - - - False - True - 2 - - + start - False - True - 2 + -1 + + + False + True + 0 + + + + + False + True + 1 + + + + + True + True + 5 + + + 165 + True + True + 5 + 5 + 5 + 5 + external - + True False - 5 - - - True - False - Frequency (Hz): - - - False - True - 0 - - - + True False - 0 + 5 + 5 + 5 + 5 + 5 + vertical + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 12 + 5 + + + True + False + vertical + + + Automatically choose and use driver + True + True + False + start + True + + + False + True + 0 + + + + + True + False + 5 + + + True + False + vertical + 5 + + + True + False + start + Failsafe driver nVidia: + 0 + + + False + True + 1 + + + + + True + False + start + Failsafe driver AMD/ATI: + 0 + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + + + False + True + 1 + + + + + True + False + + + False + True + 2 + + + + + True + True + 1 + + + + + False + True + 1 + + + + + + + + + True + False + Driver + + + + + False + True + 0 + + + + + True + False + vertical + + + True + False + 0.019999999552965164 + in + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 10 + + + + + + False + True + 0 + + + + + + + True + False + Monitor configuration + + + + + True + True + 0 + + + + + True + True + 1 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 12 + 5 + + + True + False + + + discrete video only (AMD/ATI) + True + True + False + 5 + 5 + True + + + False + True + 1 + + + + + + + + + True + False + 0 + Hybrid graphics + + + + + False + True + 2 + + + + + True + False + 5 + 0.019999999552965164 + in + + + True + False + 5 + 5 + 12 + 5 + + + True + False + vertical + + + True + False + 5 + + + True + False + vertical + 5 + + + Launch programms through optirun (nVidia): + True + True + False + True + + + False + True + 0 + + + + + Launch programs through primusun (nVidia): + True + True + False + True + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + True + steam + + + True + True + 0 + + + + + True + False + True + steam + + + True + True + 1 + + + + + True + True + 1 + + + + + True + False + vertical + 5 + + + True + False + True + True + image1 + + + False + True + 0 + + + + + True + False + True + True + image2 + + + False + True + 1 + + + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + 5 + 5 + + + True + False + Fix frame gap (nVidia): + 0 + + + False + True + 0 + + + + + True + False + + + True + True + 1 + + + + + False + True + 1 + + + + + + + + + True + False + Extra + + + + + False + True + 3 + + - - True - True - 1 - - - False - True - 3 - + + + + + True + False + Main Settings + + + False + + + + + True + False - + True - False - 5 - - - True - False - Rotation: - - - False - True - 0 - - + True + 5 + 5 + 5 + 5 + 5 + 5 - + True False - 0 - - - True - True - 1 - - - - - False - True - 4 - - - - - True - False - 5 - - + 5 + 5 + 5 + 5 + 5 + vertical + 5 + + + True + True + external + + + True + True + 5 + liststore6 + 1 + vertical + True + + + + + + Installed + + + + 0 + + + + + + + Package + + + + 1 + + + + + + + Driver + + + + 2 + + + + + + + autosize + Description + + + word + 150 + + + 3 + + + + + + + autosize + Supported Devices + + + word + 220 + + + 4 + + + + + + + + + True + True + 0 + + + + + True + False + center + 5 + + + Установить + True + True + True + image9 + + + False + True + end + 0 + + + + + Удалить + True + True + True + image11 + + + False + True + end + 1 + + + + + Подробнее + True + True + True + image10 + + + False + True + end + 2 + + + + + False + True + 1 + + + + + + True False - Position: + Driver Modules - False - True - 0 + False True False + 5 + 5 + 5 + 5 + 5 + vertical 5 - True - + True - False - 0 + True + external + + + True + True + 5 + liststore6 + 0 + vertical + True + 2 + + + + + + Installed + + + + 0 + + + + + + + Package + + + + 1 + + + + + + + Driver + + + + 2 + + + + + + + autosize + Description + + + word + 150 + + + 3 + + + + + + + autosize + Supported Devices + + + word + 220 + + + 4 + + + + + + True @@ -2224,120 +2075,298 @@ - + True False - 0 + center + 5 + + + Установить + True + True + True + image6 + + + False + True + end + 0 + + + + + Удалить + True + True + True + image7 + + + False + True + end + 1 + + + + + Подробнее + True + True + True + image12 + + + False + True + end + 2 + + - True + False True 1 - True - True 1 + + + True + False + Drivers + + + 1 + False + + + + + + + + - False - True - 5 - - - - - Do not switch off display - True - True - False - True - - - False - True - 6 + -1 + + + 1 + + + + + True + False + Drivers + + + 1 + False + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 0 + none - - Create modeline for current resolution with CVT + True - True - False - True + False + 12 + + + True + False + + + + + + + + - - False - True - 7 - - - - Use "CVT Reduced Blanking"gshgrbehr + + True - True - False - True + False + 5 + 5 + Devices and Drivers - - False - True - 8 - + + + 2 + + + + + True + False + Information + + + 2 + False + + + + + True + True + 2 + + + + + True + True + 0 + + + + + + + True + False + True + + + True + False + start + 5 + 5 + 5 + 5 + False + UBlinux Video Configuration + + + + + + + + True + False + 5 + 5 + 5 + 5 + 32 + com.ublinux.ubl-settings-video + + + + + True + False + + + True + True + False + True + LoadConfigurationMenu + none + + + True + False - - Create modeline for current resolution with GTF + True - True - False - True + False + 5 + 5 + 5 + 5 + Load False True - 9 + 0 - + True False + pan-down-symbolic False True - 10 + 1 - - False - True - 0 - + + + False + True + 0 + + + + + 1 + + + + + True + False + + + True + True + False + True + True + SaveConfigurationMenu + none True False - 5 - 5 - vertical - 5 - - Configure manually through parameter line: + True - True - False - True + False + 5 + 5 + 5 + 5 + Save + False @@ -2346,85 +2375,75 @@ - + True - False - True - center - 1920x1080 + False + pan-down-symbolic - True + False True 1 - - False - True - 1 - False True - 3 + 0 + + + + + True + True + False + True + True + SettingsMenu + none + + + + + + False + True + 1 - True - True - 0 + end + 3 - - True - False - go-bottom-symbolic - - - True - False - user-trash-symbolic - - - True - False - go-bottom-symbolic - - - - - - - - - - - - - - + + vertical + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + both diff --git a/video-drivers.csv b/video-drivers.csv index e79c785..9fa002b 100644 --- a/video-drivers.csv +++ b/video-drivers.csv @@ -1,8 +1,8 @@ VERSION_ID:DRV_PAСKAGE:DRV_NAME:DRV_DESCRIPTION:DRV_SUPPORT -:ubm-nvidia-340:nvidia-340:Пакет с модулем драйвера и утилиты NVIDIA 340xx:Драйвер видеокарт nVidia серий 8XXX, 9XXX, 1XX, 2XX, 3XX, 4XX, 5XX, 6XX, 7XX -:ubm-nvidia-390:nvidia-390:Пакет с модулем драйвера и утилиты NVIDIA 390xx:Драйвер видеокарт nVidia серий 4XX, 5XX, 6XX, 7XX, 9XX, 10XX -:ubm-nvidia-430:nvidia-430:Пакет с модулем включает в себя драйвер NVIDIA 430xx и утилиты:Драйвер видеокарт nVidia серий 6XX, 7XX, 9XX, 10XX, 16XX -:ubm-nvidia-470:nvidia-470:Пакет с модулем драйвера и утилиты NVIDIA 470xx:Драйвер видеокарт nVidia серий NVS, Quadro Sync, Quadro NVS, Quadro Blade/Embedded, Quadro, Quadro RTX, NVIDIA RTX -:ubm-nvidia-510:nvidia-510:Пакет с модулем драйвера и утилиты NVIDIA 510xx:Драйвер видеокарт nVidia серий NVS, Quadro Sync, Quadro NVS, Quadro Blade/Embedded, Quadro, Quadro RTX, NVIDIA RTX -:ubm-nvidia-515:nvidia-515:Пакет с модулем драйвера и утилиты NVIDIA 515xx:Драйвер видеокарт nVidia серий NVS, Quadro Sync, Quadro NVS, Quadro Blade/Embedded, Quadro, Quadro RTX, NVIDIA RTX -:ubm-nvidia-optimus:nvidia-optimus:Пакет с модулем включает в себя NVIDIA Optimus: +2204:ubm-nvidia-340:nvidia-340:Пакет с модулем драйвера и утилиты NVIDIA 340xx:Драйвер видеокарт nVidia серий 8XXX, 9XXX, 1XX, 2XX, 3XX, 4XX, 5XX, 6XX, 7XX +2204:ubm-nvidia-390:nvidia-390:Пакет с модулем драйвера и утилиты NVIDIA 390xx:Драйвер видеокарт nVidia серий 4XX, 5XX, 6XX, 7XX, 9XX, 10XX +2204:ubm-nvidia-430:nvidia-430:Пакет с модулем включает в себя драйвер NVIDIA 430xx и утилиты:Драйвер видеокарт nVidia серий 6XX, 7XX, 9XX, 10XX, 16XX +2204:ubm-nvidia-470:nvidia-470:Пакет с модулем драйвера и утилиты NVIDIA 470xx:Драйвер видеокарт nVidia серий NVS, Quadro Sync, Quadro NVS, Quadro Blade/Embedded, Quadro, Quadro RTX, NVIDIA RTX +2204:ubm-nvidia-510:nvidia-510:Пакет с модулем драйвера и утилиты NVIDIA 510xx:Драйвер видеокарт nVidia серий NVS, Quadro Sync, Quadro NVS, Quadro Blade/Embedded, Quadro, Quadro RTX, NVIDIA RTX +2204:ubm-nvidia-515:nvidia-515:Пакет с модулем драйвера и утилиты NVIDIA 515xx:Драйвер видеокарт nVidia серий NVS, Quadro Sync, Quadro NVS, Quadro Blade/Embedded, Quadro, Quadro RTX, NVIDIA RTX +2204:ubm-nvidia-optimus:nvidia-optimus:Пакет с модулем включает в себя NVIDIA Optimus: From 0a423692b9cabcfbf03cea4fbf0a4846d9a89e13 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 5 May 2023 09:07:18 +0600 Subject: [PATCH 10/15] Done information menu; Localisation --- com.ublinux.ubl-settings-video.amd-logo.svg | 56 +++ com.ublinux.ubl-settings-video.intel-logo.svg | 43 +++ ...ublinux.ubl-settings-video.nvidia-logo.svg | 65 ++++ com.ublinux.ubl-settings-video.video-card.svg | 194 ++++++++++ source/ubl-settings-video-strings.h | 64 +++- source/ubl-settings-video.c | 189 ++++++---- source/ubl-settings-video.h | 13 +- source/ubl-utils.c | 1 + ubl-settings-video.glade | 68 +++- ubl-settings-video.pot | 296 +++++++++++---- ubl-settings-video_ru.po | 349 +++++++++++++----- 11 files changed, 1076 insertions(+), 262 deletions(-) create mode 100644 com.ublinux.ubl-settings-video.amd-logo.svg create mode 100644 com.ublinux.ubl-settings-video.intel-logo.svg create mode 100644 com.ublinux.ubl-settings-video.nvidia-logo.svg create mode 100644 com.ublinux.ubl-settings-video.video-card.svg diff --git a/com.ublinux.ubl-settings-video.amd-logo.svg b/com.ublinux.ubl-settings-video.amd-logo.svg new file mode 100644 index 0000000..c75c6d2 --- /dev/null +++ b/com.ublinux.ubl-settings-video.amd-logo.svg @@ -0,0 +1,56 @@ + + + + + + + AMD icon + + + + + AMD icon + + + + diff --git a/com.ublinux.ubl-settings-video.intel-logo.svg b/com.ublinux.ubl-settings-video.intel-logo.svg new file mode 100644 index 0000000..fa4fcb2 --- /dev/null +++ b/com.ublinux.ubl-settings-video.intel-logo.svg @@ -0,0 +1,43 @@ + + + + + + + + diff --git a/com.ublinux.ubl-settings-video.nvidia-logo.svg b/com.ublinux.ubl-settings-video.nvidia-logo.svg new file mode 100644 index 0000000..d4f2d8b --- /dev/null +++ b/com.ublinux.ubl-settings-video.nvidia-logo.svg @@ -0,0 +1,65 @@ + + + + + + + generated by pstoedit version:3.44 from NVBadge_2D.eps + + + + + + + + generated by pstoedit version:3.44 from NVBadge_2D.eps + + + + diff --git a/com.ublinux.ubl-settings-video.video-card.svg b/com.ublinux.ubl-settings-video.video-card.svg new file mode 100644 index 0000000..7c30d8b --- /dev/null +++ b/com.ublinux.ubl-settings-video.video-card.svg @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/ubl-settings-video-strings.h b/source/ubl-settings-video-strings.h index e0594d1..07a43af 100644 --- a/source/ubl-settings-video-strings.h +++ b/source/ubl-settings-video-strings.h @@ -25,19 +25,57 @@ #define MONITOR_SAVE_LABEL _("Save") #define MONITOR_CANCEL_LABEL _("Cancel") #define MONITOR_CHOOSE_PORT_LABEL _("Choose port to configure") +#define GAP_FIX_1_LABEL _("1st variant. May cause perfomance drops in video games") +#define GAP_FIX_2_LABEL _("2nd variant. May not work on specific video cards") +#define HEADER_LABEL _("Video output configuration") +#define FAILSAFE_NVIDIA_LABEL _("Failsafe driver nVidia: ") +#define FAILSAFE_ATI_LABEL _("Failsafe driver AMD/ATI: ") +#define DRIVER_LABEL _("Driver") +#define MONITOR_CONFIGURATION_LABEL _("Monitor configuration") +#define HYBRID_GRAPHICS_LABEL _("Hybrid graphics") +#define FIX_GAP_LABEL _("Fix frame gap (nVidia)") +#define EXTRA_LABEL _("Extra") +#define TITLE_LABEL _("UBlinux Video Configuration") +#define LOAD_LABEL _("Load") +#define SAVE_LABEL _("Save") +#define ON_LABEL _("On") +#define OFF_LABEL _("Off") +#define FBDEV_LABEL _("fbdev") +#define AUTO_CHOOSE_DRIVERS_LABEL _("Automatically choose and use driver") +#define LAUNCH_OPTIRUN_LABEL _("Launch programms through optirun (nVidia): ") +#define LAUNCH_PRIMUSRUN_LABEL _("Launch programs through primusrun (nVidia): ") +#define DISCRETE_ONLY_LABEL _("discrete video only (AMD/ATI)") +#define LOAD_GLOBAL_LABEL _("Load from global configuration") +#define LOAD_LOCAL_LABEL _("Load from local configuration") +#define SAVE_GLOBAL_LOCAL_LABEL _("Save to global an local configuration") +#define SAVE_GLOBAL_LABEL _("Save to global configuration") +#define SAVE_LOCAL_LABEL _("Save to local configuration") +#define DOCUMENTATION_LABEL _("Documentation") +#define ABOUT_LABEL _("About") +#define INSTALLED_LABEL _("Installed") +#define PACKAGE_LABEL _("Package") +#define SUPPORTED_LABEL _("Supported Devices") +#define CANCEL_LABEL _("Cancel") +#define ACCEPT_LABEL _("Accept") +#define INFORMATION_LABEL _("Information") +#define DRIVERS_LABEL _("Drivers") +#define MAIN_SETTINGS_LABEL _("Main settings") +#define DEVICES_DRIVERS_LABEL _("Devices and drivers") +#define DRIVER_MODULES_LABEL _("Driver modules") -#define MONITOR_POSITION_LEFT_PARAMETER _("lo:") -#define MONITOR_POSITION_RIGHT_PARAMETER _("ro:") -#define MONITOR_POSITION_ABOVE_PARAMETER _("ab:") -#define MONITOR_POSITION_BELOW_PARAMETER _("be:") +#define MONITOR_POSITION_LEFT_PARAMETER "lo:" +#define MONITOR_POSITION_RIGHT_PARAMETER "ro:" +#define MONITOR_POSITION_ABOVE_PARAMETER "ab:" +#define MONITOR_POSITION_BELOW_PARAMETER "be:" -#define MONITOR_ROTATE_PARAMETER _("rotate:") -#define MONITOR_ROTATE_NORMAL_PARAMETER _("normal") -#define MONITOR_ROTATE_LEFT_PARAMETER _("left") -#define MONITOR_ROTATE_RIGHT_PARAMETER _("right") -#define MONITOR_ROTATE_INVERTED_PARAMETER _("invert") + +#define MONITOR_ROTATE_PARAMETER "rotate:" +#define MONITOR_ROTATE_NORMAL_PARAMETER "normal" +#define MONITOR_ROTATE_LEFT_PARAMETER "left" +#define MONITOR_ROTATE_RIGHT_PARAMETER "right" +#define MONITOR_ROTATE_INVERTED_PARAMETER "invert" #define MONITOR_PORT_ERROR_LABEL _("Error: Port must be chosen to save") #define MONITOR_PORT_SUCCESS_LABEL _("Monitor configuration succeedeed") @@ -50,4 +88,10 @@ #define LOCAL_SAVE_SUCCESS _("Local configuration saving succseeded.") #define YES_LABEL _("Yes") -#define NO_LABEL _("No") \ No newline at end of file +#define NO_LABEL _("No") + +#define DESCRIPTION_LABEL _("Description") +#define VENDOR_LABEL _("Vendor") +#define MODEL_LABEL _("Model") +#define USED_KERNEL_DRIVER_LABEL _("Kernel driver in use") +#define AVALIABLE_KERNEL_DRIVERS_LABEL _("Kernel modules") \ No newline at end of file diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index 3c02b8a..380432f 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -76,9 +76,6 @@ void on_terminal_done(GtkWidget *terminal, int size, widgets_dict *widgets){ char *text=vte_terminal_get_text_range(VTE_TERMINAL(terminal),0,0,0,10,NULL,NULL,NULL); printf("\"%s\"\n",text); gtk_widget_destroy(terminal); - // vte_terminal_reset(VTE_TERMINAL(terminal),0,1); - // gtk_widget_destroy(terminal); - // gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalBox),0); } void on_terminal_more(GtkWidget *self, widgets_dict *widgets){ @@ -88,7 +85,6 @@ void on_terminal_more(GtkWidget *self, widgets_dict *widgets){ gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalMoreRevieler),active); } - void on_terminal_destroy(GtkWidget *self, widgets_dict *widgets){ gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalRevealer),0); gtk_widget_destroy(widgets->TerminalRevealer); @@ -312,11 +308,6 @@ void on_auto_choose_drivers(GtkWidget *self, widgets_dict *widgets) gtk_widget_set_sensitive(widgets->mainDriverFailsafeNvidiaCombo, !state); } -// void on_closed_configuration(GtkWidget *self, MonitorSettings *monitors) -// { -// gtk_widget_destroy(monitors->templateMonitorConfigurationWindow); -// } - char *yon_configuration_get_save_command(char *command){ char *str = NULL; char *dntus = NULL; @@ -329,15 +320,15 @@ char *yon_configuration_get_save_command(char *command){ str = yon_char_get_augumented(str, yon_char_get_augumented(" FAILSAFEATI=", videoconfig.failsafeATI)); } if (strcmp(videoconfig.optirun, dntus)!=0&&strcmp(videoconfig.optirun, "")!=0) - str = yon_char_get_augumented(str, yon_char_get_augumented(" OPTIRUN=", videoconfig.optirun)); + str = yon_char_get_augumented(str, yon_char_unite(" OPTIRUN=","\"",videoconfig.optirun,"\"",NULL)); if (strcmp(videoconfig.primusrun, dntus)!=0&&strcmp(videoconfig.primusrun, "")!=0) - str = yon_char_get_augumented(str, yon_char_get_augumented(" PRIMUSRUN=", videoconfig.primusrun)); + str = yon_char_get_augumented(str, yon_char_unite(" PRIMUSRUN=","\"", videoconfig.primusrun,"\"",NULL)); dictionary *dict=NULL; for_dictionaries(dict,videoconfig.monitors){ if (yon_dictionary_get_data(dict,monitorconfig*)->stringparameters){ - str=yon_char_get_augumented(str, yon_config_make_save_parameter_with_multiple_arguments(yon_dictionary_get_data(dict,monitorconfig*)->stringparameters,XORG_MONITOR(dict->key),",")); + str=yon_char_unite(str," XORG_MONITOR[",dict->key,"]=\"",yon_dictionary_get_data(dict,monitorconfig*)->stringparameters,"\"", NULL); } } @@ -371,7 +362,7 @@ char *yon_configuration_get_remove_command(char *command){ str = yon_char_get_augumented(str, " PRIMUSRUN"); dictionary *dict=NULL; for_dictionaries(dict,videoconfig.monitors){ - str = yon_char_get_augumented(str, yon_char_get_augumented(" XORG_MONITOR[", yon_char_get_augumented(dict->key, "]"))); + str = yon_char_get_augumented(str, yon_char_get_augumented(" ",XORG_MONITOR(dict->key))); } if (strcmp(str,command)!=0) return str; @@ -389,7 +380,6 @@ void on_configuration_save_local(GtkWidget *self, widgets_dict *widgets) yon_config_save(delstr); } if (str){ - // printf(str); yon_config_save(str); videoconfig.status_render.text_to_render=LOCAL_SAVE_SUCCESS; @@ -508,6 +498,22 @@ void on_monitor_add(GtkWidget *self,monitor_window *window){ } } +// void on_monitor_string_edit(GtkWidget *self,monitor_edit_window *monitor){ +// int size=0; +// config_str rtn = yon_char_parse((char*)gtk_entry_get_text(GTK_ENTRY(monitor->templateMonitorConfigurationParameterLineEntry)),&size,","); +// if (yon_char_parsed_check_exist(rtn,size,"enable")!=-1) GTK_CHECK_BUTTON(monitor->templateMonitorConfigurationEnableCheck)); +// if (yon_char_parsed_check_exist(rtn,size,"")!=-1) GTK_COMBO_BOX_TEXT(monitor->templateMonitorConfigurationResolutionCombo)); +// if (yon_char_parsed_check_exist(rtn,size,"")!=-1) GTK_COMBO_BOX_TEXT(monitor->templateMonitorConfigurationFrequencyCombo)); +// if (yon_char_parsed_check_exist(rtn,size,"rotate")!=-1) GTK_COMBO_BOX_TEXT(monitor->templateMonitorConfigurationRotationCombo)); +// if (yon_char_parsed_check_exist(rtn,size,"")!=-1) GTK_COMBO_BOX_TEXT(monitor->templateMonitorConfigurationPositionPosCombo)); +// if (yon_char_parsed_check_exist(rtn,size,"")!=-1) GTK_COMBO_BOX_TEXT(monitor->templateMonitorConfigurationPositionPortCombo)); +// if (yon_char_parsed_check_exist(rtn,size,"")!=-1) GTK_CHECK_BUTTON(monitor->templateMonitorConfigurationDoNotSwitchOffCheck)); +// if (yon_char_parsed_check_exist(rtn,size,"")!=-1) GTK_CHECK_BUTTON(monitor->templateMonitorConfigurationModelineCVTCheck)); +// if (yon_char_parsed_check_exist(rtn,size,"")!=-1) GTK_CHECK_BUTTON(monitor->templateMonitorConfigurationUseCVTReducedCheck)); +// if (yon_char_parsed_check_exist(rtn,size,"")!=-1) GTK_CHECK_BUTTON(monitor->templateMonitorConfigurationModelineGTFCheck)); +// if (yon_char_parsed_check_exist(rtn,size,"")!=-1) GTK_CHECK_BUTTON(monitor->templateMonitorConfigurationMainCheck)); +// } + void on_monitor_configure(GtkWidget *self,monitor_window *window){ if(window&&window->config){ monitor_edit_window *monitors = new(monitor_edit_window); @@ -525,7 +531,6 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){ monitors->templateMonitorConfigurationFrequencyLabel = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorConfigurationFrequencyLabel")); monitors->templateMonitorConfigurationFrequencyCombo = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorConfigurationFrequencyCombo")); monitors->templateMonitorConfigurationRotationLabel = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorConfigurationRotationLabel")); - // monitors->templateMonitorConfigurationDoNotSwitchOffLabel = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorConfigurationDoNotSwitchOffLabel")); monitors->templateMonitorConfigurationRotationCombo = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorConfigurationRotationCombo")); monitors->templateMonitorConfigurationPositionLabel = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorConfigurationPositionLabel")); monitors->templateMonitorConfigurationPositionPosCombo = GTK_WIDGET(gtk_builder_get_object(builder, "templateMonitorConfigurationPositionPosCombo")); @@ -573,7 +578,7 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){ dictionary *dict=NULL; for (int i=0;istringparameters) + if (!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]); } @@ -1052,14 +1057,14 @@ driver_window *on_driver_window_open(GtkWidget *self, GtkWidget *comboe) videoconfig.list = GTK_LIST_STORE(gtk_builder_get_object(builder, "liststore6")); gtk_list_store_clear(videoconfig.list); yon_gtk_list_store_fill_with_proprietaries(videoconfig.list); - gtk_button_set_label(GTK_BUTTON(widgets->ProprietaryCloseButton), _("Cancel")); - gtk_button_set_label(GTK_BUTTON(widgets->ProprietaryAcceptButton), _("Accept")); + gtk_button_set_label(GTK_BUTTON(widgets->ProprietaryCloseButton), CANCEL_LABEL); + gtk_button_set_label(GTK_BUTTON(widgets->ProprietaryAcceptButton), ACCEPT_LABEL); gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->propriearyTreeView),GTK_TREE_MODEL(videoconfig.list)); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Installed")); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Package")); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Supported Devices")); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Driver")); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDescriptionColumn), _("Description")); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), INSTALLED_LABEL); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), PACKAGE_LABEL); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), SUPPORTED_LABEL); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), DRIVER_LABEL); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDescriptionColumn), DESCRIPTION_LABEL); gtk_widget_show(widgets->window); g_signal_connect(G_OBJECT(widgets->ProprietaryCloseButton), "clicked", G_CALLBACK(on_subwindow_close), NULL); combo_tree *trcm=NULL; @@ -1235,6 +1240,42 @@ void yon_monitor_set_resolutions(){ } +void yon_adapter_window_setup(widgets_dict *widgets){ + int size=0; + gtk_overlay_add_overlay(GTK_OVERLAY(widgets->InformationOverlay),widgets->InformationCompanyLogoImage); + config_str rtn=yon_config_load(get_adapter_info,&size); + char *desc = yon_config_get_parameter(rtn,size,"description"); + yon_char_divide_search(desc,"=",-1); + char *product = yon_config_get_parameter(rtn,size,"product"); + yon_char_divide_search(product,"=",-1); + char *vendor = yon_config_get_parameter(rtn,size,"vendor"); + yon_char_divide_search(vendor,"=",-1); + char *driver_use = yon_config_get_parameter(rtn,size,"Kernel_driver_in_use"); + yon_char_divide_search(driver_use,"=",-1); + char *driver_all = yon_config_get_parameter(rtn,size,"Kernel_modules"); + yon_char_divide_search(driver_all,"=",-1); + char *final_text = yon_char_unite("",DESCRIPTION_LABEL,": ",_(desc), + "\n",VENDOR_LABEL,": ",vendor, + "\n",MODEL_LABEL,": ",product, + "\n",USED_KERNEL_DRIVER_LABEL,": ",driver_use, + "\n",AVALIABLE_KERNEL_DRIVERS_LABEL,": ",driver_all,"",NULL); + gtk_label_set_markup(GTK_LABEL(gtk_builder_get_object(widgets->builder,"InformationLabel")),final_text); + if (strcmp(vendor,"Intel Corporation")==0){ + 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 (strcmp(vendor,"NVidia Corporation")==0){ + 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)); + } + else if (strcmp(vendor,"AMD Corporation")==0){ + 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.amd-logo",64,1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); + } + else { + gtk_widget_destroy(widgets->InformationCompanyLogoImage); + } +} /** void yon_setup_widgets(widgets_dict *widgets) * [EN] * Sets up every element on main window @@ -1326,6 +1367,15 @@ void yon_setup_widgets(widgets_dict *widgets) widgets->ProprietaryDescriptionColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "ProprietaryDescriptionColumn")); widgets->ProprietarySupportedColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "ProprietarySupportedColumn")); + widgets->DriverModulesTab = GTK_WIDGET(gtk_builder_get_object(widgets->builder, "DriverModulesTab")); + widgets->DriversTab = GTK_WIDGET(gtk_builder_get_object(widgets->builder, "DriversTab")); + widgets->MainTabLabel = GTK_WIDGET(gtk_builder_get_object(widgets->builder, "MainTabLabel")); + widgets->DriversTabLabel = GTK_WIDGET(gtk_builder_get_object(widgets->builder, "DriversTabLabel")); + widgets->InformationTabLabel = GTK_WIDGET(gtk_builder_get_object(widgets->builder, "InformationTabLabel")); + widgets->InformationFrameLabel = GTK_WIDGET(gtk_builder_get_object(widgets->builder, "InformationFrameLabel")); + widgets->InformationOverlay = GTK_WIDGET(gtk_builder_get_object(widgets->builder, "InformationOverlay")); + widgets->InformationCompanyLogoImage = GTK_WIDGET(gtk_builder_get_object(widgets->builder, "InformationCompanyLogoImage")); + widgets->driverInstalledColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "driverInstalledColumn")); widgets->driverPackageColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "driverPackageColumn")); widgets->driverDriverColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder, "driverDriverColumn")); @@ -1367,60 +1417,60 @@ void yon_setup_widgets(widgets_dict *widgets) g_signal_connect(G_OBJECT(widgets->mainHeaderSaveGlobalMenuItem), "activate", G_CALLBACK(on_configuration_save_global), widgets); g_signal_connect(G_OBJECT(widgets->mainHeaderSaveLocalMenuItem), "activate", G_CALLBACK(on_configuration_save_local), widgets); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), _("Off")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), _("fbdev")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), _("Off")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), _("fbdev")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), OFF_LABEL); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), FBDEV_LABEL); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->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->mainExtraFixGapCombo), GAP_FIX_1_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_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->mainDriverFrameLabel), DRIVER_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->mainMonitorConfigurationFrameLabel), MONITOR_CONFIGURATION_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->mainExtraFrameLabel), EXTRA_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->mainHeaderTitleLabel), TITLE_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->mainHeaderConfigLoadLabel), LOAD_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->mainHeaderSaveConfigurationLabel), SAVE_LABEL); + + gtk_button_set_label(GTK_BUTTON(widgets->mainHybridGraphicsDiscreteCheck), ON_LABEL); + gtk_button_set_label(GTK_BUTTON(widgets->mainDriverAutomaticallyChooseCheck), AUTO_CHOOSE_DRIVERS_LABEL); + gtk_button_set_label(GTK_BUTTON(widgets->mainExtraLaunchOptirunCheck), LAUNCH_OPTIRUN_LABEL); + gtk_button_set_label(GTK_BUTTON(widgets->mainExtraLaunchPrismusunCheck), LAUNCH_PRIMUSRUN_LABEL); + gtk_button_set_label(GTK_BUTTON(widgets->mainHybridGraphicsDiscreteCheck), DISCRETE_ONLY_LABEL); + + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderLoadGlobalMenuItem), LOAD_GLOBAL_LABEL); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderLoadLocalMenuItem), LOAD_LOCAL_LABEL); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSaveGlobalLocalMenuItem), SAVE_GLOBAL_LOCAL_LABEL); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSaveGlobalMenuItem), SAVE_GLOBAL_LABEL); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSaveLocalMenuItem), SAVE_LOCAL_LABEL); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSettingsDocumentationMenuItem), DOCUMENTATION_LABEL); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSettingsAboutMenuItem), ABOUT_LABEL); + + + gtk_label_set_text(GTK_LABEL(widgets->DriverModulesTab), DRIVER_MODULES_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->DriversTab), DRIVERS_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->MainTabLabel), MAIN_SETTINGS_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->DriversTabLabel), DRIVERS_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->InformationTabLabel), INFORMATION_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->InformationFrameLabel), DEVICES_DRIVERS_LABEL); + + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), INSTALLED_LABEL); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), PACKAGE_LABEL); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), SUPPORTED_LABEL); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), DRIVER_LABEL); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDescriptionColumn), DESCRIPTION_LABEL); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainExtraFixGapCombo), _("1st variant. May cause perfomance drops in video games")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainExtraFixGapCombo), _("2nd variant. May not work on specific video cards")); - gtk_label_set_text(GTK_LABEL(widgets->headInfoLabel), _("Video output configuration")); - gtk_label_set_text(GTK_LABEL(widgets->mainDriverFailsafeNvidiaLabel), _("Failsafe driver nVidia: ")); - gtk_label_set_text(GTK_LABEL(widgets->mainDriverFailsafeAMDLabel), _("Failsafe driver AMD/ATI: ")); - gtk_label_set_text(GTK_LABEL(widgets->mainDriverFrameLabel), _("Driver")); - // gtk_label_set_text(GTK_LABEL(widgets->monitorConfigurationMethodLabel),_("Configuration method")); - gtk_label_set_text(GTK_LABEL(widgets->mainMonitorConfigurationFrameLabel), _("Monitor configuration")); - gtk_label_set_text(GTK_LABEL(widgets->mainHybridGraphicsFrameLabel), _("Hybrid graphics")); - gtk_label_set_text(GTK_LABEL(widgets->mainExtraFixGapLabel), _("Fix frame gap (nVidia)")); - gtk_label_set_text(GTK_LABEL(widgets->mainExtraFrameLabel), _("Extra")); - gtk_label_set_text(GTK_LABEL(widgets->mainHeaderTitleLabel), _("UBlinux Video Configuration")); - gtk_label_set_text(GTK_LABEL(widgets->mainHeaderConfigLoadLabel), _("Load")); - gtk_label_set_text(GTK_LABEL(widgets->mainHeaderSaveConfigurationLabel), _("Save")); - - gtk_button_set_label(GTK_BUTTON(widgets->mainHybridGraphicsDiscreteCheck), _("On")); - gtk_button_set_label(GTK_BUTTON(widgets->mainDriverAutomaticallyChooseCheck), _("Automatically choose and use driver")); - gtk_button_set_label(GTK_BUTTON(widgets->mainExtraLaunchOptirunCheck), _("Launch programms through optirun (nVidia): ")); - gtk_button_set_label(GTK_BUTTON(widgets->mainExtraLaunchPrismusunCheck), _("Launch programs through primusun (nVidia): ")); - gtk_button_set_label(GTK_BUTTON(widgets->mainHybridGraphicsDiscreteCheck), _("discrete video only (AMD/ATI)")); - - gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderLoadGlobalMenuItem), _("Load from global configuration")); - gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderLoadLocalMenuItem), _("Load from local configuration")); - gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSaveGlobalLocalMenuItem), _("Save to global an local configuration")); - gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSaveGlobalMenuItem), _("Save to global configuration")); - gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSaveLocalMenuItem), _("Save to local configuration")); - gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSettingsDocumentationMenuItem), _("Documentation")); - gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->mainHeaderSettingsAboutMenuItem), _("About")); - - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Installed")); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Package")); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Supported Devices")); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), _("Driver")); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDescriptionColumn), _("Description")); - // gtk_button_set_label(GTK_BUTTON(widgets->mainExtraLaunchThroughButton),_("Change")); yon_ubl_header_setup(widgets->mainHeadOverlay, widgets->headBox, widgets->mainHeadBackgroundImage, banner_path); - // gtk_overlay_add_overlay(GTK_OVERLAY(widgets->mainHeadOverlay),widgets->headBox); yon_monitor_view_setup(widgets->mainMonitorVisualConfigurationBox); yon_monitor_view_update(); videoconfig.status_render.icon=widgets->mainStatusIcon; videoconfig.status_render.label=widgets->mainStatusLabel; videoconfig.status_render.box=widgets->mainStatusBox; - // gtk_image_set_from_file(GTK_IMAGE(widgets->mainHeadBackgroundImage),banner_path); - // MonitorSettings *monitors = yon_setup_monitor_settings(); - // videoconfig.monitors=yon_dictionary_pack_monitors(monitors,yon_check_for_monitors()); - // widgets->overlays = yon_dictionary_pack_overlays(monitors); - // yon_dictionary_gtk_pack_start_multiple_widgets(widgets->overlays, widgets->mainMonitorVisualConfigurationBox, 0, 0, 0); - // yon_dictionary_gtk_pack_start_multiple_widgets(widgets->monitors,widgets->mainMonitorConfigurationBox,0,0,0); } int main(int argc, char *argv[]) @@ -1442,6 +1492,7 @@ int main(int argc, char *argv[]) yon_ubl_status_box_render(&videoconfig.status_render); on_config_fill_interface(&widgets); yon_monitor_set_resolutions(); + yon_adapter_window_setup(&widgets); GtkCssProvider *css = gtk_css_provider_new(); gtk_css_provider_load_from_path(css, CssPath, NULL); gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), diff --git a/source/ubl-settings-video.h b/source/ubl-settings-video.h index 7eb8e3a..350f77c 100644 --- a/source/ubl-settings-video.h +++ b/source/ubl-settings-video.h @@ -51,7 +51,7 @@ #define remove_drivers_global_command "/usr/bin/ubconfig --target system remove video " -#define remove_drivers_local_command "/usr/bin/ubconfig --target global remove video " +#define remove_drivers_local_command "/usr/bin/ubconfig --target system remove video " #define install_proprietary_command "pkexec pacman --quiet --needed --noconfirm -Sy " @@ -61,6 +61,8 @@ #define get_version_proprietary_command "grep \"VERSION_ID=\" /etc/os-release | cut -d= -f2" +#define get_adapter_info "lshw -c display -quiet |grep -oE \"vendor:[0-9a-zA-Z ]{1,}|description:[0-9a-zA-Z ]{1,}|product:[]0-9a-zA-Z [-]{1,}\"|sed 's/: /=/g';lspci | grep -E ' VGA | Display ' | cut -d\" \" -f 1 | xargs -i lspci -v -s {} |grep -oE \"Kernel[:a-zA-Z0-9: ]{1,}\"|sed 's/: /=/g'|sed 's/ /_/g'" + #define XORG_MONITOR(port) yon_char_get_augumented(" XORG_MONITOR[",yon_char_get_augumented(port,"] ")) @@ -233,6 +235,15 @@ typedef struct GtkTreeViewColumn *driverDescriptionColumn; GtkTreeViewColumn *driverSupportedColumn; + GtkWidget *DriverModulesTab; + GtkWidget *DriversTab; + GtkWidget *MainTabLabel; + GtkWidget *DriversTabLabel; + GtkWidget *InformationTabLabel; + GtkWidget *InformationFrameLabel; + GtkWidget *InformationOverlay; + GtkWidget *InformationCompanyLogoImage; + GtkWidget *TerminalOverlay; GtkWidget *TerminalBox; GtkWidget *TerminalRevealer; diff --git a/source/ubl-utils.c b/source/ubl-utils.c index 92f05a4..dd761cd 100644 --- a/source/ubl-utils.c +++ b/source/ubl-utils.c @@ -526,6 +526,7 @@ int yon_char_parsed_check_exist(char **parameters, int size, char *param){ return -1; } + // parsing functions apps *yon_apps_scan_and_parse_desktops(int *sizef) diff --git a/ubl-settings-video.glade b/ubl-settings-video.glade index 3f144d9..0bf2e87 100644 --- a/ubl-settings-video.glade +++ b/ubl-settings-video.glade @@ -7,6 +7,13 @@ + + True + False + end + start + 64 + True False @@ -1287,7 +1294,6 @@ True True - 5 165 @@ -1297,6 +1303,7 @@ 5 5 5 + 5 external @@ -1678,7 +1685,6 @@ 5 - True False True True @@ -1692,7 +1698,6 @@ - True False True True @@ -1780,7 +1785,7 @@ - + True False Main Settings @@ -1964,7 +1969,7 @@ - + True False Driver Modules @@ -2138,7 +2143,7 @@ - + True False Drivers @@ -2165,7 +2170,7 @@ - + True False Drivers @@ -2196,18 +2201,59 @@ True False + 15 + 15 + 20 - + + 177 + 159 + True + False + start + start + + + True + False + start + end + 128 + com.ublinux.ubl-settings-video.video-card + + + -1 + + + + + False + True + 0 + - + + True + False + start + <span size='15pt'><span color='#1a5fb4'>sdrtjhsrtjh:</span> dfuykdftytdykkdfty</span> + True + 0 + 0 + + + False + True + 1 + - + True False 5 @@ -2221,7 +2267,7 @@ - + True False Information diff --git a/ubl-settings-video.pot b/ubl-settings-video.pot index 3bc82af..292b5f6 100644 --- a/ubl-settings-video.pot +++ b/ubl-settings-video.pot @@ -11,194 +11,348 @@ msgstr "" "POT-Creation-Date: 2023-04-21 12:33+0000\n" "PO-Revision-Date: 2023-01-01 00:00+0600\n" "Last-Translator: UBLinux Team \n" -"Language-Team: Russian - UBLinux Team \n" -"Language: Russian\n" +"Language-Team: UBLinux Team \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: source/ubl-settings-video.c:26 source/ubl-settings-video.c:223 -msgid "Cancel" +#: source/ubl-settings-video.c:323 source/ubl-settings-video.c:366 +#: source/ubl-settings-video.c:923 source/ubl-settings-video.c:934 +msgid "Don't use" msgstr "" -#: source/ubl-settings-video.c:27 -msgid "Accept" +#: source/ubl-settings-video.c:615 source/ubl-settings-video-strings.h:38 +msgid "UBlinux Video Configuration" msgstr "" -#: source/ubl-settings-video.c:28 source/ubl-settings-video.c:386 -msgid "Driver" +#: source/ubl-settings-video.c:617 +msgid "Progect Home Page" msgstr "" -#: source/ubl-settings-video.c:29 -msgid "Description" +#: source/ubl-settings-video.c:618 +msgid "Videocard and monitor configuration manager" msgstr "" -#: source/ubl-settings-video.c:87 source/ubl-settings-video.c:392 -msgid "UBlinux Video Configuration" +#: source/ubl-settings-video.c:924 source/ubl-settings-video.c:935 +#: source/ubl-settings-video-strings.h:43 +msgid "fbdev" msgstr "" -#: source/ubl-settings-video.c:89 -msgid "Progect Home Page" +#: source/ubl-settings-video-strings.h:1 +msgid "Default settings" msgstr "" -#: source/ubl-settings-video.c:90 -msgid "Videocard and monitor configuration manager" +#: source/ubl-settings-video-strings.h:2 +msgid "Monitor " +msgstr "" + +#: source/ubl-settings-video-strings.h:3 +msgid "Video adapter and display settings" msgstr "" -#: source/ubl-settings-video.c:215 -msgid "Monitor: " +#: source/ubl-settings-video-strings.h:4 +msgid "Port: " msgstr "" -#: source/ubl-settings-video.c:216 +#: source/ubl-settings-video-strings.h:5 msgid "Resolution (px): " msgstr "" -#: source/ubl-settings-video.c:217 +#: source/ubl-settings-video-strings.h:6 msgid "Frequency (Hz): " msgstr "" -#: source/ubl-settings-video.c:218 +#: source/ubl-settings-video-strings.h:7 msgid "Rotation: " msgstr "" -#: source/ubl-settings-video.c:220 -msgid "Main monitor" +#: source/ubl-settings-video-strings.h:8 +msgid "Position: " msgstr "" -#: source/ubl-settings-video.c:221 -msgid "through parameter line:" +#: source/ubl-settings-video-strings.h:9 +msgid "Do not switch off display" msgstr "" -#: source/ubl-settings-video.c:226 source/ubl-settings-video.c:231 -#: source/ubl-settings-video.c:233 source/ubl-settings-video.c:236 -#: source/ubl-settings-video.c:238 source/ubl-settings-video.c:258 -msgid "Default settings" +#: source/ubl-settings-video-strings.h:10 +msgid "Create modeline for current resolution with CVT" msgstr "" -#: source/ubl-settings-video.c:374 -msgid "Don't use" +#: source/ubl-settings-video-strings.h:11 +msgid "Use \"CVT Reduced Blanking\"" msgstr "" -#: source/ubl-settings-video.c:375 source/ubl-settings-video.c:377 -msgid "Off" +#: source/ubl-settings-video-strings.h:12 +msgid "Create modeline for current resolution with GTF" msgstr "" -#: source/ubl-settings-video.c:376 source/ubl-settings-video.c:378 -msgid "fbdev" +#: source/ubl-settings-video-strings.h:13 +msgid "Configure manually through parameter line: " +msgstr "" + +#: source/ubl-settings-video-strings.h:14 +msgid "Main display" msgstr "" -#: source/ubl-settings-video.c:380 +#: source/ubl-settings-video-strings.h:15 +msgid "Show unsupported" +msgstr "" + +#: source/ubl-settings-video-strings.h:16 +msgid "Enabled" +msgstr "" + +#: source/ubl-settings-video-strings.h:17 +msgid "Left" +msgstr "" + +#: source/ubl-settings-video-strings.h:18 +msgid "Right" +msgstr "" + +#: source/ubl-settings-video-strings.h:19 +msgid "Inverted" +msgstr "" + +#: source/ubl-settings-video-strings.h:20 +msgid "Left of" +msgstr "" + +#: source/ubl-settings-video-strings.h:21 +msgid "Right of" +msgstr "" + +#: source/ubl-settings-video-strings.h:22 +msgid "Above" +msgstr "" + +#: source/ubl-settings-video-strings.h:23 +msgid "Below " +msgstr "" + +#: source/ubl-settings-video-strings.h:24 +msgid "No rotation" +msgstr "" + +#: source/ubl-settings-video-strings.h:25 +#: source/ubl-settings-video-strings.h:40 +msgid "Save" +msgstr "" + +#: source/ubl-settings-video-strings.h:26 +#: source/ubl-settings-video-strings.h:58 +msgid "Cancel" +msgstr "" + +#: source/ubl-settings-video-strings.h:27 +msgid "Choose port to configure" +msgstr "" + +#: source/ubl-settings-video-strings.h:28 msgid "1st variant. May cause perfomance drops in video games" msgstr "" -#: source/ubl-settings-video.c:381 +#: source/ubl-settings-video-strings.h:29 msgid "2nd variant. May not work on specific video cards" msgstr "" -#: source/ubl-settings-video.c:382 +#: source/ubl-settings-video-strings.h:30 msgid "Video output configuration" msgstr "" -#: source/ubl-settings-video.c:383 -msgid "Proprietary driver: " -msgstr "" - -#: source/ubl-settings-video.c:384 +#: source/ubl-settings-video-strings.h:31 msgid "Failsafe driver nVidia: " msgstr "" -#: source/ubl-settings-video.c:385 +#: source/ubl-settings-video-strings.h:32 msgid "Failsafe driver AMD/ATI: " msgstr "" -#: source/ubl-settings-video.c:388 +#: source/ubl-settings-video-strings.h:33 +msgid "Driver" +msgstr "" + +#: source/ubl-settings-video-strings.h:34 msgid "Monitor configuration" msgstr "" -#: source/ubl-settings-video.c:389 +#: source/ubl-settings-video-strings.h:35 msgid "Hybrid graphics" msgstr "" -#: source/ubl-settings-video.c:390 +#: source/ubl-settings-video-strings.h:36 msgid "Fix frame gap (nVidia)" msgstr "" -#: source/ubl-settings-video.c:391 +#: source/ubl-settings-video-strings.h:37 msgid "Extra" msgstr "" -#: source/ubl-settings-video.c:393 +#: source/ubl-settings-video-strings.h:39 msgid "Load" msgstr "" -#: source/ubl-settings-video.c:394 -msgid "Save" +#: source/ubl-settings-video-strings.h:41 +msgid "On" msgstr "" -#: source/ubl-settings-video.c:396 -msgid "On" +#: source/ubl-settings-video-strings.h:42 +msgid "Off" msgstr "" -#: source/ubl-settings-video.c:397 +#: source/ubl-settings-video-strings.h:44 msgid "Automatically choose and use driver" msgstr "" -#: source/ubl-settings-video.c:398 +#: source/ubl-settings-video-strings.h:45 msgid "Launch programms through optirun (nVidia): " msgstr "" -#: source/ubl-settings-video.c:399 -msgid "Launch programs through primusun (nVidia): " +#: source/ubl-settings-video-strings.h:46 +msgid "Launch programs through primusrun (nVidia): " msgstr "" -#: source/ubl-settings-video.c:400 +#: source/ubl-settings-video-strings.h:47 msgid "discrete video only (AMD/ATI)" msgstr "" -#: source/ubl-settings-video.c:402 +#: source/ubl-settings-video-strings.h:48 msgid "Load from global configuration" msgstr "" -#: source/ubl-settings-video.c:403 +#: source/ubl-settings-video-strings.h:49 msgid "Load from local configuration" msgstr "" -#: source/ubl-settings-video.c:404 +#: source/ubl-settings-video-strings.h:50 msgid "Save to global an local configuration" msgstr "" -#: source/ubl-settings-video.c:405 +#: source/ubl-settings-video-strings.h:51 msgid "Save to global configuration" msgstr "" -#: source/ubl-settings-video.c:406 +#: source/ubl-settings-video-strings.h:52 msgid "Save to local configuration" msgstr "" -#: source/ubl-settings-video.c:407 +#: source/ubl-settings-video-strings.h:53 msgid "Documentation" msgstr "" -#: source/ubl-settings-video.c:408 +#: source/ubl-settings-video-strings.h:54 msgid "About" msgstr "" -#: source/ubl-settings-video.c:438 -msgid "Configuration has been loaded" +#: source/ubl-settings-video-strings.h:55 +msgid "Installed" +msgstr "" + +#: source/ubl-settings-video-strings.h:56 +msgid "Package" +msgstr "" + +#: source/ubl-settings-video-strings.h:57 +msgid "Supported Devices" +msgstr "" + +#: source/ubl-settings-video-strings.h:59 +msgid "Accept" +msgstr "" + +#: source/ubl-settings-video-strings.h:61 +msgid "Information" +msgstr "" + +#: source/ubl-settings-video-strings.h:62 +msgid "Drivers" +msgstr "" + +#: source/ubl-settings-video-strings.h:63 +msgid "Main settings" +msgstr "" + +#: source/ubl-settings-video-strings.h:64 +msgid "Devices and drivers" +msgstr "" + +#: source/ubl-settings-video-strings.h:65 +msgid "Driver modules" +msgstr "" + +#: source/ubl-settings-video-strings.h:80 +msgid "Error: Port must be chosen to save" +msgstr "" + +#: source/ubl-settings-video-strings.h:81 +msgid "Monitor configuration succeedeed" +msgstr "" + +#: source/ubl-settings-video-strings.h:83 +msgid "Global configuration loading succseeded." +msgstr "" + +#: source/ubl-settings-video-strings.h:84 +msgid "Local configuration loading succseeded." msgstr "" -#: source/ubl-settings-video.h:22 +#: source/ubl-settings-video-strings.h:86 +msgid "Local and global configuration saving succseeded." +msgstr "" + +#: source/ubl-settings-video-strings.h:87 +msgid "Global configuration saving succseeded." +msgstr "" + +#: source/ubl-settings-video-strings.h:88 +msgid "Local configuration saving succseeded." +msgstr "" + +#: source/ubl-settings-video-strings.h:90 +msgid "Yes" +msgstr "" + +#: source/ubl-settings-video-strings.h:91 +msgid "No" +msgstr "" + +#: source/ubl-settings-video-strings.h:93 +msgid "Description" +msgstr "" + +#: source/ubl-settings-video-strings.h:94 +msgid "Vendor" +msgstr "" + +#: source/ubl-settings-video-strings.h:95 +msgid "Model" +msgstr "" + +#: source/ubl-settings-video-strings.h:96 +msgid "Kernel driver in use" +msgstr "" + +#: source/ubl-settings-video-strings.h:97 +msgid "Kernel modules" +msgstr "" + +#: source/ubl-settings-video.h:25 msgid "Failed to load global configuration" msgstr "" -#: source/ubl-settings-video.h:23 +#: source/ubl-settings-video.h:26 msgid "Failed to load local configuration" msgstr "" -#: source/ubl-settings-video.h:25 +#: source/ubl-settings-video.h:28 msgid "Saving to global configuration Succeeded" msgstr "" -#: source/ubl-settings-video.h:26 +#: source/ubl-settings-video.h:29 msgid "Saving to local configuration Succeeded" msgstr "" + + +msgid "VGA compitable controller" +msgstr "" \ No newline at end of file diff --git a/ubl-settings-video_ru.po b/ubl-settings-video_ru.po index c4ea148..685a775 100644 --- a/ubl-settings-video_ru.po +++ b/ubl-settings-video_ru.po @@ -17,208 +17,357 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: source/ubl-settings-video.c:26 source/ubl-settings-video.c:223 -msgid "Cancel" -msgstr "Отмена" - -#: source/ubl-settings-video.c:27 -msgid "Accept" -msgstr "Принять" - -#: source/ubl-settings-video.c:28 source/ubl-settings-video.c:386 -msgid "Driver" -msgstr "Драйвер" - -#: source/ubl-settings-video.c:29 -msgid "Description" -msgstr "Описание" +#: source/ubl-settings-video.c:323 source/ubl-settings-video.c:366 +#: source/ubl-settings-video.c:923 source/ubl-settings-video.c:934 +msgid "Don't use" +msgstr "Не использовать" -#: source/ubl-settings-video.c:87 source/ubl-settings-video.c:392 +#: source/ubl-settings-video.c:615 source/ubl-settings-video-strings.h:38 msgid "UBlinux Video Configuration" msgstr "Видеокарта/Экран" -#: source/ubl-settings-video.c:89 +#: source/ubl-settings-video.c:617 msgid "Progect Home Page" msgstr "Домашняя страница проекта" -#: source/ubl-settings-video.c:90 -#, fuzzy +#: source/ubl-settings-video.c:618 msgid "Videocard and monitor configuration manager" msgstr "Настройка вывода изображения" -#: source/ubl-settings-video.c:215 -msgid "Monitor: " +#: source/ubl-settings-video.c:924 source/ubl-settings-video.c:935 +#: source/ubl-settings-video-strings.h:43 +msgid "fbdev" +msgstr "fbdev" + +#: source/ubl-settings-video-strings.h:1 +msgid "Default settings" +msgstr "По умолчанию" + +#: source/ubl-settings-video-strings.h:2 +msgid "Monitor " msgstr "Монитор: " -#: source/ubl-settings-video.c:216 +#: source/ubl-settings-video-strings.h:3 +msgid "Video adapter and display settings" +msgstr "Настройка вывода изображения и установка драйвера видеокарты" + +#: source/ubl-settings-video-strings.h:4 +msgid "Port: " +msgstr "Порт: " + +#: source/ubl-settings-video-strings.h:5 msgid "Resolution (px): " msgstr "Разрешение (px): " -#: source/ubl-settings-video.c:217 +#: source/ubl-settings-video-strings.h:6 msgid "Frequency (Hz): " msgstr "Обновления (Hz): " -#: source/ubl-settings-video.c:218 +#: source/ubl-settings-video-strings.h:7 msgid "Rotation: " msgstr "Вращение: " -#: source/ubl-settings-video.c:220 -#, fuzzy -msgid "Main monitor" -msgstr "Основной" +#: source/ubl-settings-video-strings.h:8 +msgid "Position: " +msgstr "Положение: " -#: source/ubl-settings-video.c:221 -msgid "through parameter line:" -msgstr "Через строку параметра: " +#: source/ubl-settings-video-strings.h:9 +msgid "Do not switch off display" +msgstr "Не выключать дисплей" -#: source/ubl-settings-video.c:226 source/ubl-settings-video.c:231 -#: source/ubl-settings-video.c:233 source/ubl-settings-video.c:236 -#: source/ubl-settings-video.c:238 source/ubl-settings-video.c:258 -msgid "Default settings" -msgstr "По умолчанию" +#: source/ubl-settings-video-strings.h:10 +msgid "Create modeline for current resolution with CVT" +msgstr "Создать modeline для укащанного разрешения с помощью CVT" -#: source/ubl-settings-video.c:374 -msgid "Don't use" -msgstr "Не использовать" +#: source/ubl-settings-video-strings.h:11 +msgid "Use \"CVT Reduced Blanking\"" +msgstr "" +"Использовать \"CVT Reduced Blanking\" уменьшения пропускной способности\n" +"для дисплеев с высоким разрешением" -#: source/ubl-settings-video.c:375 source/ubl-settings-video.c:377 -msgid "Off" -msgstr "Выключить" +#: source/ubl-settings-video-strings.h:12 +msgid "Create modeline for current resolution with GTF" +msgstr "Создать modeline для указанного разрешения с помощью GTF" -#: source/ubl-settings-video.c:376 source/ubl-settings-video.c:378 -msgid "fbdev" -msgstr "fbdev" +#: source/ubl-settings-video-strings.h:13 +msgid "Configure manually through parameter line: " +msgstr "Настроить вручную через строку параметра: " + +#: source/ubl-settings-video-strings.h:14 +msgid "Main display" +msgstr "Основной дисплей" + +#: source/ubl-settings-video-strings.h:15 +msgid "Show unsupported" +msgstr "Все видеорежимы" + +#: source/ubl-settings-video-strings.h:16 +msgid "Enabled" +msgstr "Включён" + +#: source/ubl-settings-video-strings.h:17 +msgid "Left" +msgstr "Влево" + +#: source/ubl-settings-video-strings.h:18 +msgid "Right" +msgstr "Вправо" + +#: source/ubl-settings-video-strings.h:19 +msgid "Inverted" +msgstr "Инвертирован" + +#: source/ubl-settings-video-strings.h:20 +msgid "Left of" +msgstr "Слева от" + +#: source/ubl-settings-video-strings.h:21 +msgid "Right of" +msgstr "Справа от" + +#: source/ubl-settings-video-strings.h:22 +msgid "Above" +msgstr "Над" + +#: source/ubl-settings-video-strings.h:23 +msgid "Below " +msgstr "Под " -#: source/ubl-settings-video.c:380 +#: source/ubl-settings-video-strings.h:24 +msgid "No rotation" +msgstr "Не поворачивать" + +#: source/ubl-settings-video-strings.h:25 +#: source/ubl-settings-video-strings.h:40 +msgid "Save" +msgstr "Сохранить" + +#: source/ubl-settings-video-strings.h:26 +#: source/ubl-settings-video-strings.h:58 +msgid "Cancel" +msgstr "Отмена" + +#: source/ubl-settings-video-strings.h:27 +msgid "Choose port to configure" +msgstr "Выбрать порт для настройки" + +#: source/ubl-settings-video-strings.h:28 msgid "1st variant. May cause perfomance drops in video games" msgstr "1 вариант. Может снизить производительность в играх" -#: source/ubl-settings-video.c:381 +#: source/ubl-settings-video-strings.h:29 msgid "2nd variant. May not work on specific video cards" msgstr "2 вариант. Не на каждой карте может сработать" -#: source/ubl-settings-video.c:382 +#: source/ubl-settings-video-strings.h:30 msgid "Video output configuration" msgstr "Настройка вывода изображения" -#: source/ubl-settings-video.c:383 -#, fuzzy -msgid "Proprietary driver: " -msgstr "Проприетарный драйвер: " - -#: source/ubl-settings-video.c:384 -#, fuzzy +#: source/ubl-settings-video-strings.h:31 msgid "Failsafe driver nVidia: " msgstr "Отказоучтойчивый драйвер nVidia: " -#: source/ubl-settings-video.c:385 -#, fuzzy +#: source/ubl-settings-video-strings.h:32 msgid "Failsafe driver AMD/ATI: " msgstr "Отказоустойчивый драйвер AMD/ATI: " -#: source/ubl-settings-video.c:388 +#: source/ubl-settings-video-strings.h:33 +msgid "Driver" +msgstr "Драйвер" + +#: source/ubl-settings-video-strings.h:34 msgid "Monitor configuration" msgstr "Настройка экрана" -#: source/ubl-settings-video.c:389 +#: source/ubl-settings-video-strings.h:35 msgid "Hybrid graphics" msgstr "Гибридная графика" -#: source/ubl-settings-video.c:390 +#: source/ubl-settings-video-strings.h:36 msgid "Fix frame gap (nVidia)" msgstr "Исправить разрыв кадров (nVidia)" -#: source/ubl-settings-video.c:391 +#: source/ubl-settings-video-strings.h:37 msgid "Extra" msgstr "Дополнительно" -#: source/ubl-settings-video.c:393 +#: source/ubl-settings-video-strings.h:39 msgid "Load" msgstr "Загрузить" -#: source/ubl-settings-video.c:394 -msgid "Save" -msgstr "Сохранить" - -#: source/ubl-settings-video.c:396 +#: source/ubl-settings-video-strings.h:41 msgid "On" msgstr "Включить" -#: source/ubl-settings-video.c:397 +#: source/ubl-settings-video-strings.h:42 +msgid "Off" +msgstr "Выключить" + +#: source/ubl-settings-video-strings.h:44 msgid "Automatically choose and use driver" msgstr "Автоматический выбор и использование драйвера" -#: source/ubl-settings-video.c:398 -#, fuzzy +#: source/ubl-settings-video-strings.h:45 msgid "Launch programms through optirun (nVidia): " -msgstr "Запуск программ через (nVidia)" +msgstr "Запуск программ через optirun (nVidia)" -#: source/ubl-settings-video.c:399 -#, fuzzy -msgid "Launch programs through primusun (nVidia): " -msgstr "Запуск программ через (nVidia)" +#: source/ubl-settings-video-strings.h:46 +msgid "Launch programs through primusrun (nVidia): " +msgstr "Запуск программ через primusrun (nVidia)" -#: source/ubl-settings-video.c:400 +#: source/ubl-settings-video-strings.h:47 msgid "discrete video only (AMD/ATI)" msgstr "Только дискретное видео (AMD/ATI)" -#: source/ubl-settings-video.c:402 -#, fuzzy +#: source/ubl-settings-video-strings.h:48 msgid "Load from global configuration" msgstr "Загрузить глобальную конфигурацию" -#: source/ubl-settings-video.c:403 -#, fuzzy +#: source/ubl-settings-video-strings.h:49 msgid "Load from local configuration" msgstr "Загрузить локальную конфигуруцию" -#: source/ubl-settings-video.c:404 -#, fuzzy +#: source/ubl-settings-video-strings.h:50 msgid "Save to global an local configuration" msgstr "Сохранить в глобальную и локальную конфигурацию" -#: source/ubl-settings-video.c:405 -#, fuzzy +#: source/ubl-settings-video-strings.h:51 msgid "Save to global configuration" msgstr "Сохранить в глобальную конфигурацию" -#: source/ubl-settings-video.c:406 -#, fuzzy +#: source/ubl-settings-video-strings.h:52 msgid "Save to local configuration" msgstr "Схоранить в локальную конфигурацию" -#: source/ubl-settings-video.c:407 -#, fuzzy +#: source/ubl-settings-video-strings.h:53 msgid "Documentation" msgstr "Справка" -#: source/ubl-settings-video.c:408 +#: source/ubl-settings-video-strings.h:54 msgid "About" msgstr "О программе" -#: source/ubl-settings-video.c:438 -msgid "Configuration has been loaded" -msgstr "Конфигурация была загружена" +#: source/ubl-settings-video-strings.h:55 +msgid "Installed" +msgstr "Установлено" -#: source/ubl-settings-video.h:22 -#, fuzzy +#: source/ubl-settings-video-strings.h:56 +msgid "Package" +msgstr "Пакет" + +#: source/ubl-settings-video-strings.h:57 +msgid "Supported Devices" +msgstr "Устройства" + +#: source/ubl-settings-video-strings.h:59 +msgid "Accept" +msgstr "Принять" + +#: source/ubl-settings-video-strings.h:61 +msgid "Information" +msgstr "Информация" + +#: source/ubl-settings-video-strings.h:62 +msgid "Drivers" +msgstr "Драйвера" + +#: source/ubl-settings-video-strings.h:63 +msgid "Main settings" +msgstr "Основные настройки" + +#: source/ubl-settings-video-strings.h:64 +msgid "Devices and drivers" +msgstr "Устройства и драйвера" + +#: source/ubl-settings-video-strings.h:65 +msgid "Driver modules" +msgstr "Модули ядра" + +#: source/ubl-settings-video-strings.h:80 +msgid "Error: Port must be chosen to save" +msgstr "Ошибка: Выберите порт для сохранения" + +#: source/ubl-settings-video-strings.h:81 +msgid "Monitor configuration succeedeed" +msgstr "Настройки экрана сохранены" + +#: source/ubl-settings-video-strings.h:83 +msgid "Global configuration loading succseeded." +msgstr "Успешная загрузка глобальной конфигурации" + +#: source/ubl-settings-video-strings.h:84 +msgid "Local configuration loading succseeded." +msgstr "Успешная загрузка локальной конфигурации" + +#: source/ubl-settings-video-strings.h:86 +msgid "Local and global configuration saving succseeded." +msgstr "Успешное сохранение глобальной и локальной конфигурации" + +#: source/ubl-settings-video-strings.h:87 +msgid "Global configuration saving succseeded." +msgstr "Успешное сохранение глобальной конфигурации" + +#: source/ubl-settings-video-strings.h:88 +msgid "Local configuration saving succseeded." +msgstr "Успешная загрузка локальной конфигурации" + +#: source/ubl-settings-video-strings.h:90 +msgid "Yes" +msgstr "Да" + +#: source/ubl-settings-video-strings.h:91 +msgid "No" +msgstr "Нет" + +#: source/ubl-settings-video-strings.h:93 +msgid "Description" +msgstr "Описание" + +#: source/ubl-settings-video-strings.h:94 +msgid "Vendor" +msgstr "Производитель" + +#: source/ubl-settings-video-strings.h:95 +msgid "Model" +msgstr "Модель" + +#: source/ubl-settings-video-strings.h:96 +msgid "Kernel driver in use" +msgstr "Используемый драйвер ядра" + +#: source/ubl-settings-video-strings.h:97 +msgid "Kernel modules" +msgstr "Модули ядра" + +#: source/ubl-settings-video.h:25 msgid "Failed to load global configuration" msgstr "Ошибка загрузки глобальной конфигурации" -#: source/ubl-settings-video.h:23 -#, fuzzy +#: source/ubl-settings-video.h:26 msgid "Failed to load local configuration" msgstr "Ошибка загрузки локальной конфигурации" -#: source/ubl-settings-video.h:25 -#, fuzzy +#: source/ubl-settings-video.h:28 msgid "Saving to global configuration Succeeded" msgstr "Успешное сохранение глобальной конфигурации" -#: source/ubl-settings-video.h:26 -#, fuzzy +#: source/ubl-settings-video.h:29 msgid "Saving to local configuration Succeeded" msgstr "Успешное сохранение локальной конфигурации" + +msgid "VGA compitable controller" +msgstr "VGA-совместимый адаптер" +#~ msgid "Configuration has been loaded" +#~ msgstr "Конфигурация была загружена" + +#, fuzzy +#~ msgid "Main monitor" +#~ msgstr "Основной" + +#, fuzzy +#~ msgid "Proprietary driver: " +#~ msgstr "Проприетарный драйвер: " + #~ msgid "DPMS off" #~ msgstr "DMPS выключен" From 203e95c3fbce40bf1bb2e2f6440394ed41dd89b8 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 5 May 2023 11:45:54 +0600 Subject: [PATCH 11/15] Translatable strings was edited --- source/ubl-settings-video-strings.h | 1 + 1 file changed, 1 insertion(+) diff --git a/source/ubl-settings-video-strings.h b/source/ubl-settings-video-strings.h index 07a43af..a1bef55 100644 --- a/source/ubl-settings-video-strings.h +++ b/source/ubl-settings-video-strings.h @@ -57,6 +57,7 @@ #define SUPPORTED_LABEL _("Supported Devices") #define CANCEL_LABEL _("Cancel") #define ACCEPT_LABEL _("Accept") +#define DONT_USE_LABEL _("Don't use") #define INFORMATION_LABEL _("Information") #define DRIVERS_LABEL _("Drivers") From ad1a874f0ecbd5cd1913fc15f52b4d55d0ec4d07 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 5 May 2023 11:46:40 +0600 Subject: [PATCH 12/15] New commands added --- source/ubl-settings-video.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-video.h b/source/ubl-settings-video.h index 350f77c..7e193e5 100644 --- a/source/ubl-settings-video.h +++ b/source/ubl-settings-video.h @@ -33,7 +33,7 @@ #define get_resolutions_command "xrandr |grep -noP \"\\d+x+\\d+\"" #define get_resolution_ports_command "xrandr |grep -nwP \"connected\" |grep -oE \"[0-9a-zA-Z:]{1,10} connected\" |grep -oE \"[0-9a-zA-Z:]{1,10} \"" -#define get_proprietary_drivers_command "cut -d, -f1- /usr/share/ubl-settings-video/csv/video-drivers.csv | grep -E \"-\"" +#define get_proprietary_drivers_info_command "cut -d: -f2- /usr/share/ubl-settings-video/csv/video-drivers.csv | grep -E \"-\"" #define get_resolutions_supportable_command "cut -d, -f1- /usr/share/ubl-settings-video/csv/resolutions.csv |sed 's/,/ /g'" @@ -61,6 +61,8 @@ #define get_version_proprietary_command "grep \"VERSION_ID=\" /etc/os-release | cut -d= -f2" +#define get_proprietary_drivers_command "LC_ALL=C pacman -Ss ubm-nvidia-.* |grep -oE \"[a-zA-Z-]{1,}-nvidia-[a-zA-Z0-9-]{1,}|installed\"|sed ':a;N;$!ba;s/\\ninstalled/ installed/g'" + #define get_adapter_info "lshw -c display -quiet |grep -oE \"vendor:[0-9a-zA-Z ]{1,}|description:[0-9a-zA-Z ]{1,}|product:[]0-9a-zA-Z [-]{1,}\"|sed 's/: /=/g';lspci | grep -E ' VGA | Display ' | cut -d\" \" -f 1 | xargs -i lspci -v -s {} |grep -oE \"Kernel[:a-zA-Z0-9: ]{1,}\"|sed 's/: /=/g'|sed 's/ /_/g'" #define XORG_MONITOR(port) yon_char_get_augumented(" XORG_MONITOR[",yon_char_get_augumented(port,"] ")) @@ -320,7 +322,7 @@ void on_configuration_save_global(GtkWidget *self, widgets_dict *widgets); void on_configuration_save__local_global(GtkWidget *self, widgets_dict *widgets); void on_configuration_save__local(GtkWidget *self, widgets_dict *widgets); void yon_config_monitor_string_parse(char *parameters, int *size); -int yon_char_get_if_resolution(char *parsed_string); +char *yon_char_parsed_get_resolution(config_str parsed_string, int size); void yon_monitor_set_resolutions(); monitor_config yon_monitor_config_new(char *port); void yon_monitor_config_update(monitorconfig* monitor, char *port, char *config_string); From 9c8eb57afc6c84207bf6459a1073478791f66167 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 5 May 2023 11:48:24 +0600 Subject: [PATCH 13/15] configuration saving/loading done, checkbox now show what driver is installed on driver menu --- source/ubl-settings-video.c | 192 +++++++++++++++--------------------- source/ubl-settings-video.h | 2 + source/ubl-utils.c | 2 +- ubl-settings-video.glade | 3 +- 4 files changed, 83 insertions(+), 116 deletions(-) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index 380432f..37f2ad7 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -52,14 +52,13 @@ void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){ config->position_port = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationPositionPortCombo)); } - config->resolution=yon_char_divide_search(gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationResolutionCombo))," ",-1); + if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationResolutionCombo))!=0) { + config->resolution = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationResolutionCombo)); int rotation = gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationRotationCombo)); if (rotation==1) config->rotation=rotation; else if (rotation==2) config->rotation=rotation; else if (rotation==3) config->rotation=rotation; else config->rotation=0; - if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationResolutionCombo))!=0) { - char *resolution = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationResolutionCombo)); } if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationResolutionCombo))!=0) { char *frequency = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationFrequencyCombo)); @@ -88,6 +87,8 @@ gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalMoreRevieler),active void on_terminal_destroy(GtkWidget *self, widgets_dict *widgets){ gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalRevealer),0); gtk_widget_destroy(widgets->TerminalRevealer); + yon_proprieary_get(); + yon_gtk_list_store_fill_with_proprietaries(videoconfig.list); } static void child_ready(VteTerminal *terminal, GPid pid, GError *error, gpointer user_data) @@ -270,20 +271,6 @@ void on_port_chosen_changed(GtkWidget *self, monitor_edit_window *window){ } } -void on_save_driver_configuration(GtkWidget *self,combo_tree *widgets){ - GtkTreeIter iter; - char *name; - GtkTreeModel *list_s=GTK_TREE_MODEL(videoconfig.list); - GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->tree)); - gtk_tree_selection_get_selected(selection,&list_s,&iter); - gtk_tree_model_get(list_s,&iter,0,&name,-1); - int ret = yon_gtk_combo_box_text_find(widgets->combo,name); - if (ret!=-1) - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->combo),ret); - - on_subwindow_close(self); -} - void on_sensitive_change(GtkWidget *self, GtkWidget *toggle) { int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self)); @@ -578,7 +565,7 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){ dictionary *dict=NULL; for (int i=0;istringparameters&&check_if_exists!=monitors->config) + 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]); } @@ -652,37 +639,6 @@ void yon_monitor_window_update(monitor_edit_window *window){ } -void yon_popen(thread_input *input){ - *(FILE**)input->data=popen(input->command,"r"); -} - -// void yon_launch_with_output(char *command){ -// pthread_t tid; -// FILE *output =NULL; -// FILE **output_file=&output; -// thread_input input; -// input.command=command; -// input.data=output_file; -// pthread_create(&tid,NULL,(void*)yon_popen,&input); -// char *output_strings = ""; -// int i = 0; -// char str[1000]; -// memset(str, 0, 1000); -// while (1){ -// clock(); -// if (output){ -// if (fgets(str, 1000, output)){ -// output_strings=yon_char_get_augumented(output_strings,str); -// videoconfig.status_render.text_to_render=output_strings; -// videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE; -// _yon_ubl_status_box_render(&videoconfig.status_render); -// } -// } -// float passed = clock(); -// if ((passed=passed/_SC_CLK_TCK)<0.5) -// sleep(passed); -// } -// } /**void yon_monitor_view_draw_all(GtkWidget *cnt) * [EN] @@ -704,7 +660,9 @@ void yon_monitor_view_draw_all(GtkWidget *cnt){ for_dictionaries(dict,videoconfig.monitor_visuals){ monitor_window *window = yon_dictionary_get_data(dict,monitor_window*); if(dict->first==dict) {} - else gtk_box_pack_start(GTK_BOX(container),window->templateMonitorscreenOverlay,0,0,0); + else { + gtk_box_pack_start(GTK_BOX(container),window->templateMonitorscreenOverlay,0,0,0); + } } 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); @@ -742,8 +700,20 @@ void yon_monitor_view_update(){ gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoNameLabel),yon_char_get_augumented(MONITOR_LABEL,monitor->config->key)); else gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoNameLabel),yon_char_get_augumented(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) gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoResolutionLabel),config->resolution); + else if (params->stringparameters){ + int size=0; + config_str rtn=yon_char_parse(params->stringparameters,&size,","); + char *res=yon_char_parsed_get_resolution(rtn,size); + if (res&&strcmp(res,"")!=0) + gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoResolutionLabel),res); + else + gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoResolutionLabel),PARAMETER_DEFAULT_LABEL); + + } else gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoResolutionLabel),PARAMETER_DEFAULT_LABEL); } @@ -926,8 +896,8 @@ void on_config_fill_interface(widgets_dict *widgets) gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo)); str = videoconfig.failsafenVidia; - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), _("Don't use")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), _("fbdev")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), DONT_USE_LABEL); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), FBDEV_LABEL); if (str) { gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->mainDriverFailsafeNvidiaCombo), 1); @@ -937,8 +907,8 @@ void on_config_fill_interface(widgets_dict *widgets) gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo)); str = videoconfig.failsafeATI; - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), _("Don't use")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), _("fbdev")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), DONT_USE_LABEL); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), FBDEV_LABEL); if (str) { gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->mainDriverFailsafeAMDCombo), 1); @@ -952,17 +922,24 @@ void on_config_fill_interface(widgets_dict *widgets) * [EN] */ dictionary *yon_proprieary_get(){ + videoconfig.proprietary=NULL; + int drivers_size=0; + config_str drivers=yon_config_load(get_proprietary_drivers_command,&drivers_size); int size=0; - char **rtn = yon_config_load(get_proprietary_drivers_command,&size); - - for (int i=0;idata,&size,":"); gtk_list_store_append(list,&iter); - gtk_list_store_set(list,&iter,1,str[1],2,str[2],3,str[3],4,str[4],-1); + gtk_list_store_set(list,&iter,1,str[0],2,str[1],3,str[2],4,str[3],-1); + if (strstr(dict->key," installed")) + gtk_list_store_set(list,&iter,0,1,-1); + } +} + +char *yon_char_remove_brackets(char* source){ + if (source){ + char *src=yon_char_new(source); + if (src[0]=='\"') yon_char_divide_search(src,"\"",-1); + if (src[strlen(src)-1]=='\"') src=yon_char_divide_search(src,"\"",-1); + return src; } + return NULL; } /**void yon_setup_config(char *configcommand) @@ -1014,20 +1004,20 @@ void yon_setup_config(char *configcommand) param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,"OPTIRUN"); if (param){ yon_char_divide_search(param,"=",-1); - videoconfig.optirun=yon_char_new(param); + videoconfig.optirun=yon_char_remove_brackets(yon_char_new(param)); } param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,"PRIMUSRUN"); if (param){ yon_char_divide_search(param,"=",-1); - videoconfig.primusrun=yon_char_new(param); + videoconfig.primusrun=yon_char_remove_brackets(yon_char_new(param)); } for (int i=0;ipropriearyTreeView = yon_gtk_builder_get_widget(builder, "propriearyTreeView"); - widgets->ProprietaryDriverColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder, "ProprietaryDriverColumn")); - widgets->ProprietaryDescriptionColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder, "ProprietaryDescriptionColumn")); - - widgets->ProprietaryCloseButton = yon_gtk_builder_get_widget(builder, "ProprietaryCloseButton"); - widgets->ProprietaryAcceptButton = yon_gtk_builder_get_widget(builder, "ProprietaryAcceptButton"); - if(!videoconfig.list) - videoconfig.list = GTK_LIST_STORE(gtk_builder_get_object(builder, "liststore6")); - gtk_list_store_clear(videoconfig.list); - yon_gtk_list_store_fill_with_proprietaries(videoconfig.list); - gtk_button_set_label(GTK_BUTTON(widgets->ProprietaryCloseButton), CANCEL_LABEL); - gtk_button_set_label(GTK_BUTTON(widgets->ProprietaryAcceptButton), ACCEPT_LABEL); - gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->propriearyTreeView),GTK_TREE_MODEL(videoconfig.list)); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), INSTALLED_LABEL); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), PACKAGE_LABEL); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), SUPPORTED_LABEL); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), DRIVER_LABEL); - gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDescriptionColumn), DESCRIPTION_LABEL); - gtk_widget_show(widgets->window); - g_signal_connect(G_OBJECT(widgets->ProprietaryCloseButton), "clicked", G_CALLBACK(on_subwindow_close), NULL); - combo_tree *trcm=NULL; - trcm=malloc(sizeof(combo_tree)); - trcm->combo=comboe; - trcm->tree=widgets->propriearyTreeView; - g_signal_connect(G_OBJECT(widgets->ProprietaryAcceptButton), "clicked", G_CALLBACK(on_save_driver_configuration), trcm); -} - /** monitor_config yon_monitor_config_new(char *port) * [EN] */ @@ -1135,8 +1091,12 @@ void yon_monitor_config_update(monitorconfig* monitor, char *port, char *config_ monitor->position=3; if (yon_char_parsed_check_exist(cnf,size,"ab:")!=-1) monitor->position=3; - if (yon_char_parsed_check_exist(cnf,size,"rotate:")!=-1) - monitor->rotation=0; + if (yon_char_parsed_check_exist(cnf,size,"rotate:left")!=-1) + monitor->rotation=1; + if (yon_char_parsed_check_exist(cnf,size,"rotate:right")!=-1) + monitor->rotation=2; + if (yon_char_parsed_check_exist(cnf,size,"rotate:invert")!=-1) + monitor->rotation=3; if (yon_char_parsed_check_exist(cnf,size,"dpms")!=-1) monitor->dpms=1; if (yon_char_parsed_check_exist(cnf,size,"nodpms")!=-1) @@ -1145,21 +1105,25 @@ void yon_monitor_config_update(monitorconfig* monitor, char *port, char *config_ monitor->cvt=1; if (yon_char_parsed_check_exist(cnf,size,"reduced")!=-1) monitor->reduced=1; - if (yon_char_parsed_check_exist(cnf,size,"r")!=-1) + if (yon_char_parsed_check_exist(cnf,size,"r,")!=-1) monitor->reduced=1; if (yon_char_parsed_check_exist(cnf,size,"gtf")!=-1) monitor->gtf=1; } } -int yon_char_get_if_resolution(char *parsed_string){ - char *left=NULL, *right=NULL; - right=yon_char_new(parsed_string); - left=yon_char_divide_search(right,"x",1); - if (left&&right) - if (atoi(left)&&atoi(right)) - return 1; - return 0; +char *yon_char_parsed_get_resolution(config_str parsed_string, int size){ + char *left=NULL, *right=NULL, *freq=NULL; + for (int i=0;imainHeadOverlay, widgets->headBox, widgets->mainHeadBackgroundImage, banner_path); yon_monitor_view_setup(widgets->mainMonitorVisualConfigurationBox); - yon_monitor_view_update(); videoconfig.status_render.icon=widgets->mainStatusIcon; videoconfig.status_render.label=widgets->mainStatusLabel; @@ -1498,6 +1461,7 @@ int main(int argc, char *argv[]) gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), GTK_STYLE_PROVIDER(css), -1); + yon_monitor_view_update(); gtk_main(); return 0; } \ No newline at end of file diff --git a/source/ubl-settings-video.h b/source/ubl-settings-video.h index 7e193e5..dcae947 100644 --- a/source/ubl-settings-video.h +++ b/source/ubl-settings-video.h @@ -337,4 +337,6 @@ void yon_monitor_view_update(); void yon_monitor_window_update(monitor_edit_window *window); char *yon_monitor_make_string(monitorconfig* config); void yon_launch_with_output(char *command); +dictionary *yon_proprieary_get(); +void yon_gtk_list_store_fill_with_proprietaries(GtkListStore *list); #endif \ No newline at end of file diff --git a/source/ubl-utils.c b/source/ubl-utils.c index dd761cd..151d208 100644 --- a/source/ubl-utils.c +++ b/source/ubl-utils.c @@ -518,7 +518,7 @@ int yon_char_parsed_check_exist(char **parameters, int size, char *param){ for (int i=0;i True False - True + True @@ -537,6 +537,7 @@ False 5 5 + True From 0a07cc40882c64dafe5ac0f1039814b29564ab88 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 5 May 2023 13:56:19 +0600 Subject: [PATCH 14/15] Added categories to desktop file --- ubl-settings-video.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubl-settings-video.desktop b/ubl-settings-video.desktop index f12dc01..96c5448 100644 --- a/ubl-settings-video.desktop +++ b/ubl-settings-video.desktop @@ -12,4 +12,4 @@ Icon=com.ublinux.ubl-settings-video Terminal=false X-XfcePluggable=true X-UBLPluggable=true -Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings; +Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;X-UBL-SettingsManager;X-UBL-HardwareSettings; From 60a7245d5c8d02da10aa954fc8d08555603a2347 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 5 May 2023 16:39:11 +0600 Subject: [PATCH 15/15] Fixed configuration loading bugs, changed wiki links --- source/ubl-settings-video.c | 57 +++++++++++++++++++++++++++++-------- source/ubl-settings-video.h | 7 +++-- source/ubl-utils.c | 3 +- ubl-settings-video.glade | 7 ++--- 4 files changed, 55 insertions(+), 19 deletions(-) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index 37f2ad7..3108062 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -288,7 +288,7 @@ void on_sensitive_change_reversed(GtkWidget *self, GtkWidget *toggle) void on_auto_choose_drivers(GtkWidget *self, widgets_dict *widgets) { int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self)); - + videoconfig.autoChooseDrivers=state; gtk_widget_set_sensitive(widgets->mainDriverFailsafeNvidiaLabel, !state); gtk_widget_set_sensitive(widgets->mainDriverFailsafeAMDCombo, !state); gtk_widget_set_sensitive(widgets->mainDriverFailsafeAMDLabel, !state); @@ -303,21 +303,34 @@ char *yon_configuration_get_save_command(char *command){ if (videoconfig.autoChooseDrivers==0){ if (strcmp(videoconfig.failsafenVidia, dntus)!=0) str = yon_char_get_augumented(str, yon_char_get_augumented(" FAILSAFENVIDIA=", videoconfig.failsafenVidia)); + else + str = yon_char_get_augumented(str," FAILSAFENVIDIA=\"\""); if (strcmp(videoconfig.failsafeATI, dntus)!=0) str = yon_char_get_augumented(str, yon_char_get_augumented(" FAILSAFEATI=", videoconfig.failsafeATI)); + else + str = yon_char_get_augumented(str," FAILSAFEATI=\"\""); + str=yon_char_get_augumented(str," VGADRV_AUTO=NO"); + } else { + str = yon_char_unite(str, " FAILSAFENVIDIA=\"\" FAILSAFEATI=\"\" VGADRV_AUTO=YES", NULL); + } if (strcmp(videoconfig.optirun, dntus)!=0&&strcmp(videoconfig.optirun, "")!=0) str = yon_char_get_augumented(str, yon_char_unite(" OPTIRUN=","\"",videoconfig.optirun,"\"",NULL)); + else + str = yon_char_get_augumented(str, yon_char_unite(" OPTIRUN=\"\"",NULL)); if (strcmp(videoconfig.primusrun, dntus)!=0&&strcmp(videoconfig.primusrun, "")!=0) str = yon_char_get_augumented(str, yon_char_unite(" PRIMUSRUN=","\"", videoconfig.primusrun,"\"",NULL)); + else + str = yon_char_get_augumented(str, yon_char_unite(" PRIMUSRUN=\"\"",NULL)); dictionary *dict=NULL; + for (int i=0;istringparameters){ - str=yon_char_unite(str," XORG_MONITOR[",dict->key,"]=\"",yon_dictionary_get_data(dict,monitorconfig*)->stringparameters,"\"", NULL); - - } + } } if (strcmp(str,command)!=0) @@ -348,8 +361,8 @@ char *yon_configuration_get_remove_command(char *command){ str = yon_char_get_augumented(str, " OPTIRUN"); str = yon_char_get_augumented(str, " PRIMUSRUN"); dictionary *dict=NULL; - for_dictionaries(dict,videoconfig.monitors){ - str = yon_char_get_augumented(str, yon_char_get_augumented(" ",XORG_MONITOR(dict->key))); + for(int i=0;iconfig){ gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(window->templateMonitorscreenOverlay)),window->templateMonitorscreenOverlay); - yon_dictionary_rip(windowd); + videoconfig.monitor_visuals = yon_dictionary_rip(windowd); gtk_widget_destroy(window->templateMonitorscreenOverlay); - yon_dictionary_rip(window->config); + videoconfig.monitors = yon_dictionary_rip(window->config); free(window); } } @@ -898,7 +913,7 @@ void on_config_fill_interface(widgets_dict *widgets) str = videoconfig.failsafenVidia; gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), DONT_USE_LABEL); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), FBDEV_LABEL); - if (str) + if (str&&videoconfig.autoChooseDrivers==0) { gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->mainDriverFailsafeNvidiaCombo), 1); } @@ -909,12 +924,15 @@ void on_config_fill_interface(widgets_dict *widgets) str = videoconfig.failsafeATI; gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), DONT_USE_LABEL); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), FBDEV_LABEL); - if (str) + if (str&&videoconfig.autoChooseDrivers==0) { gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->mainDriverFailsafeAMDCombo), 1); } else gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->mainDriverFailsafeAMDCombo), 0); + if (videoconfig.autoChooseDrivers==1){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->mainDriverAutomaticallyChooseCheck),1); + } dictionary *dict = NULL; } @@ -943,6 +961,7 @@ dictionary *yon_proprieary_get(){ } } + /**void yon_gtk_list_store_fill_with_proprietaries(GtkListStore *list) * [EN] */ @@ -989,15 +1008,24 @@ void yon_setup_config(char *configcommand) videoconfig.configsize=0; videoconfig.loaded_config = yon_ubl_load_global_config(command, &videoconfig.configsize); char *param = NULL; + param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,"VGADRV_AUTO"); + if (param){ + yon_char_divide_search(param,"=",-1); + if (strcmp(param,"")!=0) + videoconfig.autoChooseDrivers=1; + + } param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,"FAILSAFENVIDIA"); if (param){ yon_char_divide_search(param,"=",-1); + if (strcmp(param,"")!=0) videoconfig.failsafenVidia=yon_char_new(param); } param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,"FAILSAFEATI"); if (param){ yon_char_divide_search(param,"=",-1); + if (strcmp(param,"")!=0) videoconfig.failsafeATI=yon_char_new(param); } @@ -1005,18 +1033,22 @@ void yon_setup_config(char *configcommand) if (param){ yon_char_divide_search(param,"=",-1); videoconfig.optirun=yon_char_remove_brackets(yon_char_new(param)); + if (strcmp(videoconfig.optirun,"")==0) videoconfig.optirun=NULL; } param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,"PRIMUSRUN"); if (param){ yon_char_divide_search(param,"=",-1); videoconfig.primusrun=yon_char_remove_brackets(yon_char_new(param)); + if (strcmp(videoconfig.primusrun,"")==0) videoconfig.primusrun=NULL; } for (int i=0;i",DESCRIPTION_LABEL,": ",_(desc), + char *final_text = yon_char_unite("",DESCRIPTION_LABEL,": ",_(desc), "\n",VENDOR_LABEL,": ",vendor, "\n",MODEL_LABEL,": ",product, "\n",USED_KERNEL_DRIVER_LABEL,": ",driver_use, @@ -1448,6 +1480,7 @@ int main(int argc, char *argv[]) widgets_dict widgets; yon_setup_widgets(&widgets); yon_gtk_list_store_fill_with_proprietaries(videoconfig.list); + yon_gtk_list_store_fill_with_proprietaries(videoconfig.modulelist); gtk_widget_show(widgets.MainWindow); // yon_fill_ui(&widgets); videoconfig.status_render.text_to_render=LOCAL_LOAD_SUCCESS; diff --git a/source/ubl-settings-video.h b/source/ubl-settings-video.h index dcae947..5bd5184 100644 --- a/source/ubl-settings-video.h +++ b/source/ubl-settings-video.h @@ -41,11 +41,11 @@ #define load_drivers_command "/usr/bin/ubconfig --default --source " -#define load_drivers_global_command "/usr/bin/ubconfig --default --source global get video FAILSAFENVIDIA FAILSAFEATI OPTIRUN PRIMUSRUN " +#define load_drivers_global_command "/usr/bin/ubconfig --default --source global get video FAILSAFENVIDIA FAILSAFEATI OPTIRUN PRIMUSRUN VGADRV_AUTO " #define save_drivers_global_command "/usr/bin/ubconfig --target global set video " -#define load_drivers_local_command "/usr/bin/ubconfig --default --source system get video FAILSAFENVIDIA FAILSAFEATI OPTIRUN PRIMUSRUN " +#define load_drivers_local_command "/usr/bin/ubconfig --default --source system get video FAILSAFENVIDIA FAILSAFEATI OPTIRUN PRIMUSRUN VGADRV_AUTO " #define save_drivers_local_command "pkexec /usr/bin/ubconfig --target system set video " @@ -63,6 +63,8 @@ #define get_proprietary_drivers_command "LC_ALL=C pacman -Ss ubm-nvidia-.* |grep -oE \"[a-zA-Z-]{1,}-nvidia-[a-zA-Z0-9-]{1,}|installed\"|sed ':a;N;$!ba;s/\\ninstalled/ installed/g'" +#define get_proprietary_drivers_command "LC_ALL=C pacman -Ss ubm-nvidia-.* |grep -oE \"[a-zA-Z-]{1,}nvidia-[a-zA-Z0-9-]{1,}|installed\"|sed ':a;N;$!ba;s/\\ninstalled/ installed/g'" + #define get_adapter_info "lshw -c display -quiet |grep -oE \"vendor:[0-9a-zA-Z ]{1,}|description:[0-9a-zA-Z ]{1,}|product:[]0-9a-zA-Z [-]{1,}\"|sed 's/: /=/g';lspci | grep -E ' VGA | Display ' | cut -d\" \" -f 1 | xargs -i lspci -v -s {} |grep -oE \"Kernel[:a-zA-Z0-9: ]{1,}\"|sed 's/: /=/g'|sed 's/ /_/g'" #define XORG_MONITOR(port) yon_char_get_augumented(" XORG_MONITOR[",yon_char_get_augumented(port,"] ")) @@ -103,6 +105,7 @@ typedef struct proprietary_config proprietary; dictionary *supported_resolutions; GtkListStore *list; + GtkListStore *modulelist; char *failsafenVidia; char *failsafeATI; int descreteOnly; diff --git a/source/ubl-utils.c b/source/ubl-utils.c index 151d208..5784a10 100644 --- a/source/ubl-utils.c +++ b/source/ubl-utils.c @@ -266,7 +266,8 @@ dictionary *yon_dictionary_find(dictionary **dict, char *key) dictionary *yon_dictionary_rip(dictionary *dict) { - if (!dict->next) + if (!dict->next&&!dict->prev) return NULL; + else if (!dict->next) { dictionary *prev = dict->prev; if (prev) diff --git a/ubl-settings-video.glade b/ubl-settings-video.glade index 9981421..e379c61 100644 --- a/ubl-settings-video.glade +++ b/ubl-settings-video.glade @@ -174,7 +174,7 @@ 1.2 Copyright © 2023 - UBSoft Software LLC Settings for video output - https://ublinux.ru/ + https://wiki.ublinux.ru/ru/Программное_обеспечение/Программы_и_утилиты/Все/ubl-settings-video Project Home Page Это приложение распространяется без каких-либо гарантий. Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. @@ -1532,7 +1532,7 @@ False 5 5 - 12 + 5 5 @@ -1545,7 +1545,6 @@ True False 5 - 5 True @@ -1586,7 +1585,7 @@ False 5 5 - 12 + 5 5