From 379d62271e31c654e9532d9a98a3ec899ea7e61c Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 15 May 2023 11:58:09 +0600 Subject: [PATCH 01/52] Strings edits --- source/ubl-settings-video-strings.h | 2 +- ubl-settings-video.pot | 4 ++-- ubl-settings-video_ru.po | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/ubl-settings-video-strings.h b/source/ubl-settings-video-strings.h index d400317..24457f9 100644 --- a/source/ubl-settings-video-strings.h +++ b/source/ubl-settings-video-strings.h @@ -69,7 +69,7 @@ #define PROPRIETARY_USE_LOCAL_LABEL _("Failed to load available drivers for your system... Installed driver list is shown.") #define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?") -#define HELP_INFO_LABEL _("You will be redirected to documentation website where documentation is translated and supported by community.") +#define HELP_INFO_LABEL _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.") #define HELP_ALWAYS_OPEN_LABEL _("Always redirect to online documentation") #define INFORMATION_LABEL _("Information") #define DRIVERS_LABEL _("Drivers") diff --git a/ubl-settings-video.pot b/ubl-settings-video.pot index d718735..e296d34 100644 --- a/ubl-settings-video.pot +++ b/ubl-settings-video.pot @@ -1,4 +1,4 @@ -# Language translations for ubl-settings-manager package. +# Language translations for ubl-settings-video package. # Copyright (C) 2022, UBTech LLC # This file is distributed under the same license as the ubl-settings-manager package. # UBLinux Team , 2022 @@ -364,7 +364,7 @@ msgstr "" #: source/ubl-settings-video-strings.h:72 msgid "" -"You will be redirected to documentation website where documentation is " +"You will be redirected to documentation website where documentation is\n" "translated and supported by community." msgstr "" diff --git a/ubl-settings-video_ru.po b/ubl-settings-video_ru.po index 86d8bad..876d1d6 100644 --- a/ubl-settings-video_ru.po +++ b/ubl-settings-video_ru.po @@ -373,10 +373,10 @@ msgstr "Вы хотите прочитать справку в Сети?" #: source/ubl-settings-video-strings.h:72 msgid "" -"You will be redirected to documentation website where documentation is " +"You will be redirected to documentation website where documentation is\n" "translated and supported by community." msgstr "" -"Вы будете перенаправлены на сайт с документацией где страницы помощи " +"Вы будете перенаправлены на сайт с документацией где страницы помощи\n" "переводятся и поддерживаются сообществом." #: source/ubl-settings-video-strings.h:73 -- 2.35.1 From fc46dfd57994178f49590cc049ebd967a33cea54 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 15 May 2023 11:59:08 +0600 Subject: [PATCH 02/52] Standard lib edits for plugs function --- source/ubl-utils.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/source/ubl-utils.c b/source/ubl-utils.c index 1f6e44d..7d5bcdc 100644 --- a/source/ubl-utils.c +++ b/source/ubl-utils.c @@ -871,7 +871,7 @@ int yon_gtk_combo_box_text_find(GtkWidget *combo_box, char *text_to_find){ gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box),i); str=gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(combo_box)); if (!str) return -1; - if (strcmp(text_to_find,str)==0) return i; + if (strstr(str,text_to_find)) return i; } } return -1; } @@ -955,6 +955,7 @@ void yon_ubl_setup_sockets(GtkWidget *main_window, GtkWidget *left_window, GtkWi GtkWidget *plug_main=gtk_plug_new(socket_main_id); GtkWidget *plug_left=NULL; GtkWidget *plug_right=NULL; + GtkWidget *box=NULL; g_signal_connect(G_OBJECT(plug_main), "destroy", G_CALLBACK(gtk_main_quit),NULL); if (socket_left_id>-1&&left_window){ plug_left=gtk_plug_new(socket_left_id); @@ -968,6 +969,17 @@ void yon_ubl_setup_sockets(GtkWidget *main_window, GtkWidget *left_window, GtkWi gtk_style_context_add_class(gtk_widget_get_style_context(plug_left),"noborder"); gtk_widget_show(plug_left); } + else if (left_window){ + if (box==NULL){ + box=gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); + gtk_box_pack_start(GTK_BOX(main_window),box,0,0,5); + gtk_box_reorder_child(GTK_BOX(main_window),box,0); + gtk_widget_show(box); + } + gtk_style_context_add_class(gtk_widget_get_style_context(left_window),"inherited"); + gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(left_window)),left_window); + gtk_box_pack_end(GTK_BOX(box),left_window,0,0,5); + } if (socket_right_id>-1&&right_window){ plug_right=gtk_plug_new(socket_right_id); g_object_ref(right_window); @@ -980,6 +992,17 @@ void yon_ubl_setup_sockets(GtkWidget *main_window, GtkWidget *left_window, GtkWi gtk_style_context_add_class(gtk_widget_get_style_context(plug_right),"noborder"); gtk_widget_show(plug_right); } + else if (right_window){ + if (box==NULL){ + box=gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); + gtk_box_pack_start(GTK_BOX(main_window),box,0,0,5); + gtk_box_reorder_child(GTK_BOX(main_window),box,0); + gtk_widget_show(box); + } + gtk_style_context_add_class(gtk_widget_get_style_context(right_window),"inherited"); + gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(right_window)),right_window); + gtk_box_pack_start(GTK_BOX(box),right_window,0,0,5); + } g_object_ref(main_window); gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(main_window)),main_window); gtk_container_add(GTK_CONTAINER(plug_main),main_window); -- 2.35.1 From 11d0384ac55463a0a91e7a81dc5b616efb8d2ef4 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 15 May 2023 12:00:11 +0600 Subject: [PATCH 03/52] Minor fixes --- source/ubl-settings-video.c | 50 ++++++++++++++++++------------------- source/ubl-settings-video.h | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index bb58c32..1894224 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -2,14 +2,6 @@ config videoconfig; -void yon_on_plug_added(GtkSocket *self, gpointer user_data) -{ -} - -void yon_on_plug_removed(GtkSocket *self, gpointer user_data) -{ -} - void on_subwindow_close(GtkWidget *self) { gtk_widget_destroy(gtk_widget_get_toplevel(self)); @@ -257,9 +249,11 @@ void on_port_chosen_changed(GtkWidget *self, monitor_edit_window *window){ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationResolutionCombo),PARAMETER_DEFAULT_LABEL); gtk_combo_box_set_active(GTK_COMBO_BOX(window->templateMonitorConfigurationResolutionCombo),0); char *combo_text=yon_char_new((char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationPortCombo))); - char *resolution = yon_char_divide_search(combo_text," ",-1); + char *resolution = yon_char_divide_search(yon_char_new(combo_text)," ",-1); if (combo_text) - if (strcmp(combo_text,MONITOR_CHOOSE_PORT_LABEL)!=0){ + if (strcmp(combo_text,MONITOR_CHOOSE_PORT_LABEL)==0) + return; + else{ dict=yon_dictionary_find(&videoconfig.supported_resolutions,resolution); if (dict){ resolution_supported *res = yon_dictionary_get_data(dict,resolution_supported*); @@ -387,10 +381,6 @@ void on_configuration_save_local(GtkWidget *self, widgets_dict *widgets) char *str=NULL; char *delstr=NULL; str=yon_configuration_get_save_command(save_drivers_local_command); - // delstr=yon_configuration_get_remove_command(remove_drivers_local_command); - // if (delstr){ - // yon_config_save(delstr); - // } if (str){ yon_config_save(str); yon_ubl_status_box_render(videoconfig.status_render,LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE); @@ -421,10 +411,6 @@ void on_configuration_save_global(GtkWidget *self, widgets_dict *widgets) char *str=NULL; char *delstr=NULL; str=yon_configuration_get_save_command(save_drivers_global_command); - // delstr=yon_configuration_get_remove_command(remove_drivers_global_command); - // if (delstr){ - // yon_config_save(delstr); - // } if (str){ yon_config_save(str); yon_ubl_status_box_render(videoconfig.status_render,LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE); @@ -436,6 +422,7 @@ void yon_update_config(widgets_dict *widgets) if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->mainExtraLaunchOptirunCheck))==1) videoconfig.optirun = yon_char_new( (char *)gtk_entry_get_text(GTK_ENTRY(widgets->mainExtraLaunchOptirunEntry))); else videoconfig.optirun = NULL; + videoconfig.descreteOnly=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->mainHybridGraphicsDiscreteCheck)); if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->mainExtraLaunchPrismusunCheck))==1) videoconfig.primusrun = yon_char_new( (char *)gtk_entry_get_text(GTK_ENTRY(widgets->mainExtraLaunchPrismusunEntry))); else videoconfig.primusrun = NULL; @@ -542,7 +529,7 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){ g_signal_connect(G_OBJECT(monitors->templateMonitorConfigurationParameterLineCheck), "toggled", G_CALLBACK(on_sensitive_change_reversed), monitors->templateMonitorConfigurationBox); g_signal_connect(G_OBJECT(monitors->templateMonitorConfigurationParameterLineCheck), "toggled", G_CALLBACK(on_sensitive_change), monitors->templateMonitorConfigurationParameterLineEntry); g_signal_connect(G_OBJECT(monitors->templateMonitorConfigurationShowUnsupportedCheck), "toggled", G_CALLBACK(on_resolutions_unsupported_show),monitors); - g_signal_connect(G_OBJECT(monitors->templateMonitorConfigurationPortCombo), "changed", G_CALLBACK(on_port_chosen_changed),monitors); + g_signal_connect(G_OBJECT(monitors->templateMonitorConfigurationPortCombo), "popup", G_CALLBACK(on_port_chosen_changed),monitors); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(monitors->templateMonitorConfigurationEnableCheck),yon_dictionary_get_data(monitors->config,monitorconfig*)->enable==1); @@ -602,7 +589,8 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){ } void on_read_documentation(GtkWidget *self,gpointer user_data){ - yon_ubl_browser_window_open(UBLINUX_WIKI_LINK,WEB_VIEW_TITLE_LABEL); + yon_ubl_browser_window_open(user_data,WEB_VIEW_TITLE_LABEL); + free(user_data); } @@ -624,7 +612,7 @@ void on_link(GtkWidget *self, char* link, gpointer user_data){ GtkWidget *textLabel=yon_gtk_builder_get_widget(builder,"helpText"); GtkWidget *alwaysOpenCheck=yon_gtk_builder_get_widget(builder,"AlwaysOpenHelpCheckbox"); - g_signal_connect(G_OBJECT(readButton),"clicked",G_CALLBACK(on_read_documentation),NULL); + g_signal_connect(G_OBJECT(readButton),"clicked",G_CALLBACK(on_read_documentation),yon_char_new(link)); g_signal_connect(G_OBJECT(readButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); g_signal_connect(G_OBJECT(cancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); g_signal_connect(G_OBJECT(alwaysOpenCheck),"toggled",G_CALLBACK(on_toggle),&videoconfig.alwaysredirect); @@ -638,7 +626,7 @@ void on_link(GtkWidget *self, char* link, gpointer user_data){ gtk_widget_show(sureWindow); }else { - on_read_documentation(NULL,NULL); + on_read_documentation(NULL,link); } } @@ -665,6 +653,16 @@ void yon_monitor_window_update(monitor_edit_window *window){ if (found==-1) found=0; gtk_combo_box_set_active(GTK_COMBO_BOX(window->templateMonitorConfigurationPortCombo),found); + on_resolutions_unsupported_show(window->templateMonitorConfigurationShowUnsupportedCheck,window); + if (((monitorconfig*)window->config->data)->resolutionCapabilities){ + // printf("%s\n",((monitorconfig*)window->config->data)->resolution); + found = yon_gtk_combo_box_text_find(window->templateMonitorConfigurationResolutionCombo, ((monitorconfig*)window->config->data)->resolution); + }else{ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->templateMonitorConfigurationShowUnsupportedCheck),1); + found = yon_gtk_combo_box_text_find(window->templateMonitorConfigurationResolutionCombo, ((monitorconfig*)window->config->data)->resolution); + } + if (found==-1) + found=0; gtk_combo_box_set_active(GTK_COMBO_BOX(window->templateMonitorConfigurationResolutionCombo),found); gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationFrequencyCombo)); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationFrequencyCombo),PARAMETER_DEFAULT_LABEL); @@ -689,7 +687,6 @@ void yon_monitor_window_update(monitor_edit_window *window){ } - /**void yon_monitor_view_draw_all(GtkWidget *cnt) * [EN] */ @@ -1371,7 +1368,7 @@ void yon_adapter_window_setup(widgets_dict *widgets){ GtkIconTheme *icthm=gtk_icon_theme_get_default(); gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->InformationCompanyLogoImage),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, "com.ublinux.ubl-settings-video.intel-logo",64,1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); } - else if (strstr(vendor,"NVidia")){ + else if (strstr(vendor,"NVVIDIA")){ GtkIconTheme *icthm=gtk_icon_theme_get_default(); gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->InformationCompanyLogoImage),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, "com.ublinux.ubl-settings-video.nvidia-logo",64,1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); } @@ -1675,7 +1672,10 @@ int main(int argc, char *argv[]) } if (getuid()!=0){ - system("/usr/bin/pkexec ubl-settings-video"); + char *args=""; + for (int i=0;i Date: Mon, 15 May 2023 12:00:44 +0600 Subject: [PATCH 04/52] Minor designs etits --- ubl-settings-video.css | 4 ++++ ubl-settings-video.glade | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ubl-settings-video.css b/ubl-settings-video.css index 6ee85b9..5ca43e9 100644 --- a/ubl-settings-video.css +++ b/ubl-settings-video.css @@ -9,6 +9,10 @@ margin:0px; padding:0px; } +.inherited>* { + border:none; + background:inherit; +} .opacited { opacity:0.98; } diff --git a/ubl-settings-video.glade b/ubl-settings-video.glade index 20af17d..19e236e 100644 --- a/ubl-settings-video.glade +++ b/ubl-settings-video.glade @@ -11,7 +11,6 @@ False False 450 - 250 dialog-question-symbolic @@ -74,7 +73,8 @@ start 10 10 - You will be redirected to documentation website where documentation is translated and supported by community. + You will be redirected to documentation website where documentation is +translated and supported by community. True 0 - True + False True 1 @@ -103,6 +103,7 @@ False True + end 2 @@ -183,6 +184,7 @@ True False + True True @@ -195,7 +197,6 @@ - True False 32 dialog-question-symbolic @@ -1951,6 +1952,7 @@ True False + False True -- 2.35.1 From 754b5cb659bfd6f2d42c59cd0f353a8e8403ca26 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 16 May 2023 12:06:48 +0600 Subject: [PATCH 05/52] New translatable strings --- source/ubl-settings-video-strings.h | 5 +++++ ubl-settings-video.pot | 4 ++++ ubl-settings-video_ru.po | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/source/ubl-settings-video-strings.h b/source/ubl-settings-video-strings.h index 24457f9..3e28b64 100644 --- a/source/ubl-settings-video-strings.h +++ b/source/ubl-settings-video-strings.h @@ -55,6 +55,7 @@ #define DOCUMENTATION_LABEL _("Documentation") #define ABOUT_LABEL _("About") #define INSTALLED_LABEL _("Installed") +#define INSTALLED_LOW_LABEL _("installed") #define PACKAGE_LABEL _("Package") #define SUPPORTED_LABEL _("Supported Devices") #define CANCEL_LABEL _("Cancel") @@ -67,6 +68,10 @@ #define PROPRIETARY_OPETAION_DONE_LABEL _("Driver operation is done.") #define PROPRIETARY_NOTHING_SELECTED_LABEL _("Nothing was selected.") #define PROPRIETARY_USE_LOCAL_LABEL _("Failed to load available drivers for your system... Installed driver list is shown.") +#define CONFIGURE_LABEL _("Configure monitor") +#define DELETE_LABEL _("Delete monitor configuration") +#define ADD_LABEL _("Add monitor configuration") +#define SWITCH_LABEL _("Switch monitor") #define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?") #define HELP_INFO_LABEL _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.") diff --git a/ubl-settings-video.pot b/ubl-settings-video.pot index e296d34..5ef7876 100644 --- a/ubl-settings-video.pot +++ b/ubl-settings-video.pot @@ -316,6 +316,10 @@ msgstr "" msgid "Installed" msgstr "" +#: source/ubl-settings-video-strings.h:58 +msgid "installed" +msgstr "установлено" + #: source/ubl-settings-video-strings.h:58 msgid "Package" msgstr "" diff --git a/ubl-settings-video_ru.po b/ubl-settings-video_ru.po index 876d1d6..5b60347 100644 --- a/ubl-settings-video_ru.po +++ b/ubl-settings-video_ru.po @@ -327,6 +327,11 @@ msgstr "Установлено" msgid "Package" msgstr "Пакет" + +#: source/ubl-settings-video-strings.h:58 +msgid "installed" +msgstr "установлен" + #: source/ubl-settings-video-strings.h:59 msgid "Supported Devices" msgstr "Устройства" -- 2.35.1 From 035611074ad12cc700fc90e1cf913fa63e3360bc Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 16 May 2023 12:07:14 +0600 Subject: [PATCH 06/52] minor design changes --- ubl-settings-video.glade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ubl-settings-video.glade b/ubl-settings-video.glade index 19e236e..341e371 100644 --- a/ubl-settings-video.glade +++ b/ubl-settings-video.glade @@ -694,11 +694,13 @@ translated and supported by community. True False + Switch system-shutdown-symbolic True False + Delete user-trash-symbolic @@ -713,6 +715,7 @@ translated and supported by community. True False + Configure open-menu-symbolic