From 4fc5a5521f7fa1ea7e860a2e65f1ac27a876fd7c Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 13 Mar 2023 12:19:59 +0600 Subject: [PATCH] version_application implementation, auto remove version value from files after building --- Makefile | 12 ++++++++++++ VERSION.md | 1 + source/ubl-settings-info.c | 4 ++++ source/ubl-util-standard.c | 2 ++ ubl-settings-info.css | 9 +++++++++ 5 files changed, 28 insertions(+) create mode 100644 VERSION.md diff --git a/Makefile b/Makefile index f3223e2..27656a1 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,12 @@ all: init build init: @echo "Initialize ..."; \ + version="$$(cat VERSION.md)"; \ + version=$${version:8}; \ + search="s/string version_application.*$&"; \ + echo $$search; \ + replace="string version_application = \"$${version}\";"; \ + sed -i -e "$$search/$$replace/gi" source/ubl-settings-info.c; \ echo "-- Build path: ${CMAKE_BUILD_DIR}" depend: @@ -123,6 +129,12 @@ clean: else \ echo "Clean: OK"; \ fi + @version="$$(cat VERSION.md)"; \ + version=$${version:8}; \ + search="s/string version_application.*$&"; \ + echo $$search; \ + replace="string version_application = ;"; \ + sed -i -e "$$search/$$replace/gi" source/ubl-settings-info.c; \ help: @echo "The following are some of the valid targets for this Makefile:" diff --git a/VERSION.md b/VERSION.md new file mode 100644 index 0000000..f3d572a --- /dev/null +++ b/VERSION.md @@ -0,0 +1 @@ +VERSION 1.2 \ No newline at end of file diff --git a/source/ubl-settings-info.c b/source/ubl-settings-info.c index e372b07..04d8485 100644 --- a/source/ubl-settings-info.c +++ b/source/ubl-settings-info.c @@ -11,6 +11,9 @@ #define LocaleName "ubl-settings-info" #define LocalePath "/usr/share/locale" +typedef char* string; +string version_application = ; + #define _(String) gettext(String) @@ -34,6 +37,7 @@ void on_about(GtkWidget *button){ GtkWidget *AboutButtons = GTK_WIDGET(gtk_builder_get_object(builder,"AboutButtons")); GtkWidget *About = GTK_WIDGET(gtk_builder_get_object(builder, "About")); GtkWidget *HeaderAboutTopic = GTK_WIDGET(gtk_builder_get_object(builder, "headerAboutTopic")); + gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(About),version_application); gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(About),_("Sum up system information")); gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(About),_("UBLinux System Info")); gtk_widget_show(GTK_WIDGET(gtk_builder_get_object(builder,"About"))); diff --git a/source/ubl-util-standard.c b/source/ubl-util-standard.c index 95f5ad9..74e9108 100644 --- a/source/ubl-util-standard.c +++ b/source/ubl-util-standard.c @@ -21,6 +21,7 @@ inline returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidge GtkStyleContext *context = gtk_widget_get_style_context(plug); gtk_style_context_add_class(context,"primary-toolbar"); + gtk_style_context_add_class(gtk_widget_get_style_context(toplug),"button"); } if (right_plug_id>0&&RightWidget){ GtkWidget *plug=gtk_plug_new(right_plug_id); @@ -37,6 +38,7 @@ inline returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidge GtkStyleContext *context = gtk_widget_get_style_context(plug); gtk_style_context_add_class(context,"primary-toolbar"); + gtk_style_context_add_class(gtk_widget_get_style_context(toplug),"button"); } return ret; } diff --git a/ubl-settings-info.css b/ubl-settings-info.css index 8de2c77..c332ad9 100644 --- a/ubl-settings-info.css +++ b/ubl-settings-info.css @@ -4,6 +4,15 @@ .textHead{ text-shadow: 1px 1px #ffffff; } + +.button { + background-image: -gtk-gradient(linear, + left top, left bottom, + from(@entry_background_a), + color-stop(0.20, @entry_background_b), + color-stop(0.85, @entry_background_c), + to(@entry_background_d)); +} .menuitemsolo { border-color:alpha(@theme_text_color, 0.4); border-style:solid;