From ff35f6f5a65e3bf80516ebd8ef55cad2290584a8 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 6 Dec 2024 11:58:35 +0600 Subject: [PATCH] Initramfs window changes --- source/ubl-settings-kernel.c | 14 +++- source/ubl-settings-kernel.h | 5 ++ source/ubl-strings.h | 11 ++-- ubl-settings-kernel-install.glade | 106 +++++++++++++++++++++--------- ubl-settings-kernel.css | 5 +- ubl-settings-kernel.pot | 19 +++++- ubl-settings-kernel_ru.po | 20 +++++- 7 files changed, 134 insertions(+), 46 deletions(-) diff --git a/source/ubl-settings-kernel.c b/source/ubl-settings-kernel.c index c69db14..fa8aeb8 100644 --- a/source/ubl-settings-kernel.c +++ b/source/ubl-settings-kernel.c @@ -420,6 +420,12 @@ info_window *yon_info_window_new(){ return window; } +void on_basic_toggled(GtkSwitch *,int state, install_window *window){ + gtk_menu_button_set_direction(GTK_MENU_BUTTON(window->ArrowButton),state?GTK_ARROW_UP:GTK_ARROW_DOWN); + gtk_revealer_set_transition_type(GTK_REVEALER(window->ShowRevealer),state?GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN:GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP); + gtk_revealer_set_reveal_child(GTK_REVEALER(window->ShowRevealer), state); +} + install_window *yon_install_window_new(){ install_window *window = malloc(sizeof(install_window)); @@ -438,8 +444,12 @@ install_window *yon_install_window_new(){ window->BasicCurrentSwitch = yon_gtk_builder_get_widget(builder,"BasicCurrentSwitch"); window->DebugSwitch = yon_gtk_builder_get_widget(builder,"DebugSwitch"); window->UniversalSwitch = yon_gtk_builder_get_widget(builder,"UniversalSwitch"); + window->BackgroundFrame = yon_gtk_builder_get_widget(builder,"BackgroundFrame"); + window->ArrowButton = yon_gtk_builder_get_widget(builder,"ArrowButton"); + window->ShowRevealer = yon_gtk_builder_get_widget(builder,"ShowRevealer"); g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); + g_signal_connect(G_OBJECT(window->BasicSwitch),"state-set",G_CALLBACK(on_basic_toggled),window); return window; } @@ -1303,10 +1313,10 @@ void on_changelog_clicked(GtkWidget *, kernels_tab *tab){ void on_build_execute(GtkWidget *, dictionary *dict){ main_window *widgets = yon_dictionary_get_data(dict->first,main_window*); install_window *window = yon_dictionary_get_data(dict->first->next,install_window*); - int basic = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->BasicSwitch)); + // int basic = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->BasicSwitch)); int drivers = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->BasicCurrentSwitch)); int debug = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->DebugSwitch)); - int universal = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UniversalSwitch)); + // int universal = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UniversalSwitch)); char *target = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->KernelVersionCombo)); char *filename = (char*)gtk_entry_get_text(GTK_ENTRY(window->FilenameEntry)); char *command = build_command(target,filename,debug,drivers); diff --git a/source/ubl-settings-kernel.h b/source/ubl-settings-kernel.h index b5dc13d..43605ed 100644 --- a/source/ubl-settings-kernel.h +++ b/source/ubl-settings-kernel.h @@ -141,6 +141,9 @@ typedef struct { GtkWidget *BasicCurrentSwitch; GtkWidget *DebugSwitch; GtkWidget *UniversalSwitch; + GtkWidget *BackgroundFrame; + GtkWidget *ShowRevealer; + GtkWidget *ArrowButton; }install_window; typedef struct { @@ -284,5 +287,7 @@ void on_boot_toggled(GtkWidget *, char *path, main_window *widgets); void on_terminal_revealer_open(GtkWidget *, main_window *widgets); +void on_basic_toggled(GtkSwitch *self,int state, install_window *window); + info_window *yon_info_window_new(); install_window *yon_install_window_new(); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index a4620be..8f31399 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -24,7 +24,11 @@ #define KERNEL_VERSION_LABEL _("Kernel version:") #define IMAGE_FILE_LABEL _("Image file:") #define ADD_DEBUG_LABEL _("Add debug components") -#define ADD_DRIVERS_LABEL _("Add drivers for current hardware components only") +#define BUILD_BASIC_LABEL _("Build basic image") +#define BUILD_BASIC_CURRENT_LABEL _("Build basic image with drivers for current hardware components only") +#define BUILD_UNIVERSAL_LABEL _("Build universal drivers for hardware components") +#define BUILD_SUCCESS_STATUS_LABEL _("Building has succeeded") +#define BUILD_FAILED_STATUS_LABEL _("Building has failed") #define INSTALL_MODULE_LABEL _("Install module") #define REMOVE_MODULE_LABEL _("Remove module") @@ -90,7 +94,4 @@ #define REMOVE_ADDITION_PACKAGE_TITLE_LABEL _("Remove addition package") #define UPDATE_ADDITION_MODULE_TITLE_LABEL _("Update addition module") #define UPDATE_ADDITION_PACKAGE_TITLE_LABEL _("Update addition package") -#define BUILD_SUCCESS_STATUS_LABEL _("Building has succeeded") -#define BUILD_FAILED_STATUS_LABEL _("Building has failed") -#define KERNEL_PACKAGE_INSTALL_ATTENTION_LABEL _("Attention! If you work in sandbox mode, you must install the package with the module!") -#define DEPENDS_LABEL(target) yon_char_unite(_("Some of chosen dependent packages have been in dependences for another packages"),": ",target,_(". Do you really want to remove them?"),NULL) \ No newline at end of file +#define KERNEL_PACKAGE_INSTALL_ATTENTION_LABEL _("Attention! If you work in sandbox mode, you must install the package with the module!") \ No newline at end of file diff --git a/ubl-settings-kernel-install.glade b/ubl-settings-kernel-install.glade index b9fe623..5783758 100644 --- a/ubl-settings-kernel-install.glade +++ b/ubl-settings-kernel-install.glade @@ -1,5 +1,5 @@ - + @@ -115,7 +115,7 @@ - + True False 0 @@ -152,9 +152,19 @@ - + True True + False + True + + + + False @@ -163,6 +173,18 @@ 1 + + + True + True + + + False + True + end + 2 + + False @@ -171,55 +193,79 @@ - + True - True - True - True - True + False + vertical True False - 5 - + True False - Build basic image with drivers for current hardware components only - True + center - False + True True 0 - - - True - True - - - False - True - end - 1 - - + + False + True + 0 + - - + + True False - <s>--------------------------------------------------------------</s> - True + + + True + False + 5 + + + True + False + Build basic image with drivers for current hardware components only + True + + + False + True + 0 + + + + + True + True + + + False + True + end + 1 + + + + + + False + True + 1 + - True + False True 1 diff --git a/ubl-settings-kernel.css b/ubl-settings-kernel.css index 05d9330..2c2a5de 100644 --- a/ubl-settings-kernel.css +++ b/ubl-settings-kernel.css @@ -56,12 +56,11 @@ background:transparent; background:@theme_base_color; } .bggrey{ - background-color: @insensitive_fg_color; border-radius:5px; border-color:@theme_text_color; border-style:solid; - border-width:0.55px; - color:@theme_bg_color; + border-width:0.3px; + box-shadow: 1px 4px 4px rgba(0, 0, 0, 0.3); } .menuitembottom{ margin-top:0px; diff --git a/ubl-settings-kernel.pot b/ubl-settings-kernel.pot index e9ddf1b..8353c85 100644 --- a/ubl-settings-kernel.pot +++ b/ubl-settings-kernel.pot @@ -247,7 +247,7 @@ msgstr "" msgid "Are you sure want to install module with addition package" msgstr "" -source/ubl-strings.h:72 +#: source/ubl-strings.h:72 msgid "Are you sure want to install addition package" msgstr "" @@ -335,15 +335,28 @@ msgid "Update addition package" msgstr "" #: source/ubl-strings.h:93 -msgid "Building has succeeded" +msgid "Build basic image" msgstr "" #: source/ubl-strings.h:94 -msgid "Building has failed" +msgid "Build basic image with drivers for current hardware components only" msgstr "" #: source/ubl-strings.h:95 +msgid "Build universal drivers for hardware components" +msgstr "" + +#: source/ubl-strings.h:96 +msgid "Building has succeeded" +msgstr "" + +#: source/ubl-strings.h:97 +msgid "Building has failed" +msgstr "" + +#: source/ubl-strings.h:98 msgid "" "Attention! If you work in sandbox mode, you must install the package with " "the module!" msgstr "" + diff --git a/ubl-settings-kernel_ru.po b/ubl-settings-kernel_ru.po index dda5b43..dd85158 100644 --- a/ubl-settings-kernel_ru.po +++ b/ubl-settings-kernel_ru.po @@ -346,15 +346,29 @@ msgid "Update addition package" msgstr "Обновить пакет с дополнением" #: source/ubl-strings.h:93 +msgid "Build basic image" +msgstr "Собрать базовый образ" + +#: source/ubl-strings.h:94 +msgid "Build basic image with drivers for current hardware components only" +msgstr "Собрать базовый образ только с текущими драйверами аппаратных компонентов" + +#: source/ubl-strings.h:95 +msgid "Build universal drivers for hardware components" +msgstr "Собрать универсальные драйвера аппаратных компонентов" + +#: source/ubl-strings.h:96 msgid "Building has succeeded" msgstr "Сборка прошла успешно" -#: source/ubl-strings.h:94 +#: source/ubl-strings.h:97 msgid "Building has failed" msgstr "Ошибка сборки ядра" -#: source/ubl-strings.h:95 +#: source/ubl-strings.h:98 msgid "" "Attention! If you work in sandbox mode, you must install the package with " "the module!" -msgstr "Внимание! Если вы работаете в режиме песочницы, необходимо установить пакет с модулем!" +msgstr "" +"Внимание! Если вы работаете в режиме песочницы, необходимо установить пакет " +"с модулем!"