From 387c58e48fd2b77810768c60c57e939292df5b40 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 4 Jul 2025 11:42:09 +0600 Subject: [PATCH 1/3] included video-drivers.csv into binary --- gresource.xml | 3 +++ source/CMakeLists.txt | 1 + source/ubl-settings-video.c | 11 ++++++++--- source/ubl-settings-video.h | 3 ++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gresource.xml b/gresource.xml index 78ff5f5..63fef9d 100644 --- a/gresource.xml +++ b/gresource.xml @@ -9,4 +9,7 @@ ubl-settings-video.css + + video-drivers.csv + \ No newline at end of file diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 7569c83..0ee3544 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -42,6 +42,7 @@ set(DEPENDFILES ../ubl-settings-video-configuration.glade ../gresource.xml ../ubl-settings-video.css + ../video-drivers.csv ) file(COPY ${DEPENDFILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index 02dfb51..242df4b 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -1035,6 +1035,12 @@ gboolean yon_proprietary_clear(main_window *widgets){ return G_SOURCE_REMOVE; } +gboolean yon_proprietary_set(main_window *widgets){ + gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->DriversTree),GTK_TREE_MODEL(main_config.list)); + gtk_widget_set_sensitive(widgets->LoadDriversButton,1); + return G_SOURCE_REMOVE; +} + gboolean yon_proprietary_append(struct proprietary_struct *target){ GtkTreeIter iter; @@ -1083,7 +1089,7 @@ void *yon_proprietary_local_get(main_window *widgets){ int size; config_str rtn=NULL; - rtn = yon_file_open(get_proprietary_drivers_info_path,&size); + rtn = yon_resource_open_file(get_proprietary_drivers_info_path,&size); for (int i=1;iDriversTree),GTK_TREE_MODEL(main_config.list)); - gtk_widget_set_sensitive(widgets->LoadDriversButton,1); + g_idle_add((GSourceFunc)yon_proprietary_set,widgets); g_thread_exit (NULL); } diff --git a/source/ubl-settings-video.h b/source/ubl-settings-video.h index ecf0041..729f56b 100644 --- a/source/ubl-settings-video.h +++ b/source/ubl-settings-video.h @@ -43,7 +43,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,} connected\" |grep -oE \"[-0-9a-zA-Z:]{1,} \"" -#define get_proprietary_drivers_info_path "/usr/share/ubl-settings-video/csv/video-drivers.csv" +#define get_proprietary_drivers_info_path "resource:///com/ublinux/csv/video-drivers.csv" #define get_resolutions_supportable_command "/usr/share/ubl-settings-video/csv/resolutions.csv" @@ -400,5 +400,6 @@ gboolean yon_proprietary_connect(main_window *widgets); void on_app_chooser_open(GtkWidget *self, main_window *widgets); gpointer yon_driver_info_launch(void *command); void on_command_cancel(GtkWidget *,main_window *widgets); +gboolean yon_proprietary_set(main_window *widgets); #endif \ No newline at end of file -- 2.35.1 From 6f465e0aee8348e305d14c06cbfe206dffe523aa Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 4 Jul 2025 11:59:10 +0600 Subject: [PATCH 2/3] Resolutions file fix --- gresource.xml | 1 + resolutions.csv | 4 ++-- source/CMakeLists.txt | 1 + source/ubl-settings-video.c | 4 ++-- source/ubl-settings-video.h | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gresource.xml b/gresource.xml index 63fef9d..4522480 100644 --- a/gresource.xml +++ b/gresource.xml @@ -11,5 +11,6 @@ video-drivers.csv + resolutions.csv \ No newline at end of file diff --git a/resolutions.csv b/resolutions.csv index ec81494..d1c5411 100644 --- a/resolutions.csv +++ b/resolutions.csv @@ -1,4 +1,4 @@ -RESOLUTION;ASPECT_RATIO;DESC +RESOLUTION;ASPECT_RATIO;DESCRIPTION 640x480 ;4:3;VGA 800x480 ;5:3;WVGA 800x600 ;4:3;SVGA @@ -23,7 +23,7 @@ RESOLUTION;ASPECT_RATIO;DESC 1920x1080;16:9;FHD 1920x1200;16:10;WUXGA 2048x1080;19:10;2K DCI -2048x1152;16:9;,QWXGA +2048x1152;16:9;QWXGA 2560x1080;21:9;UWHD 2560x1440;16:9;QHD 2560х1600;16:10;WQXGA diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 0ee3544..18c4c79 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -43,6 +43,7 @@ set(DEPENDFILES ../gresource.xml ../ubl-settings-video.css ../video-drivers.csv + ../resolutions.csv ) file(COPY ${DEPENDFILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index 242df4b..c1f5331 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -306,7 +306,7 @@ void on_port_chosen_changed(GtkWidget *, monitor_edit_window *window){ dict=yon_dictionary_get(&main_config.supported_resolutions,port_name); if (dict){ int size; - config_str resolutions = yon_file_open(get_resolutions_supportable_command,&size); + config_str resolutions = yon_resource_open_file(get_resolutions_supportable_command,&size); resolutions = yon_char_parsed_rip(resolutions,&size,0); for (int i=0;iResolutionCombo),0); if (gtk_toggle_button_get_active(self)){ int size; - config_str resolutions = yon_file_open(get_resolutions_supportable_command,&size); + config_str resolutions = yon_resource_open(get_resolutions_supportable_command,&size); for (int i=1;i Date: Fri, 4 Jul 2025 12:00:04 +0600 Subject: [PATCH 3/3] Build fix --- source/ubl-settings-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index c1f5331..ff8ea05 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -366,7 +366,7 @@ void on_resolutions_unsupported_show(GtkToggleButton *self, monitor_edit_window gtk_combo_box_set_active(GTK_COMBO_BOX(window->ResolutionCombo),0); if (gtk_toggle_button_get_active(self)){ int size; - config_str resolutions = yon_resource_open(get_resolutions_supportable_command,&size); + config_str resolutions = yon_resource_open_file(get_resolutions_supportable_command,&size); for (int i=1;i