diff --git a/source/ubl-settings-kernel.c b/source/ubl-settings-kernel.c index ab9f8f6..9de6081 100644 --- a/source/ubl-settings-kernel.c +++ b/source/ubl-settings-kernel.c @@ -130,11 +130,9 @@ gboolean yon_tab_create_tags(kernels_tab *tab){ gtk_image_set_from_icon_name(GTK_IMAGE(tab->module_icon),module_icon_path,GTK_ICON_SIZE_BUTTON); gtk_widget_show(tab->remove_module_button); - gtk_widget_show(tab->remove_package_button); gtk_widget_show(tab->update_module_button); - gtk_widget_show(tab->update_package_button); + gtk_widget_hide(tab->install_module_button); - gtk_widget_hide(tab->install_package_button); } { if (tab->package_installed){ @@ -144,6 +142,40 @@ gboolean yon_tab_create_tags(kernels_tab *tab){ gtk_widget_show(tab->remove_package_button); gtk_widget_show(tab->update_package_button); } + } + if (tab->package_installed||tab->module_installed){ + if (tab->launch_button){ + char *launched = config(KERNEL_BOOT_parameter); + int boot_size; + config_str boot_run = yon_config_load(get_active_kernel_command,&boot_size); + yon_char_remove_last_symbol(boot_run[0],'\n'); + + if ((!(launched&&!strcmp(tab->package,launched))&&(strcmp(tab->package,boot_run[0])))){ + gtk_widget_show(tab->launch_button); + } else { + gtk_widget_hide(tab->launch_button); + if(!getuid()){ + if (boot_run&&!strcmp(boot_run[0],tab->package)){ + yon_tag_add(GTK_BOX(tab->install_tags_box),RUNNING_LABEL,"tag_green",NULL); + gtk_widget_hide(tab->remove_module_button); + gtk_widget_hide(tab->remove_package_button); + gtk_widget_hide(tab->update_module_button); + gtk_widget_hide(tab->update_package_button); + gtk_widget_hide(tab->launch_button); + } else if (!yon_char_is_empty(launched)&&!strcmp(launched,tab->package)){ + yon_tag_add(GTK_BOX(tab->install_tags_box),BOOT_RUN_LABEL,"tag_orange",NULL); + gtk_widget_hide(tab->launch_button); + gtk_widget_hide(tab->remove_module_button); + gtk_widget_hide(tab->remove_package_button); + gtk_widget_hide(tab->update_module_button); + gtk_widget_hide(tab->update_package_button); + } + } + } + } + if (tab->changelog_button){ + gtk_widget_show(tab->changelog_button); + } } gtk_widget_set_sensitive(tab->update_module_button,!tab->module_updated); gtk_widget_set_sensitive(tab->update_package_button,!tab->package_updated); @@ -193,6 +225,7 @@ void *yon_tab_set_installed(kernels_tab *tab){ } void *yon_interface_update(main_window *widgets){ + yon_ubl_status_box_render(LOADING_LABEL,BACKGROUND_IMAGE_INFO_TYPE); if (!main_config.kernel_tabs){ GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->KernelsPackageBox)); for (guint i=0;iKernelsPackageBox),kernels[i],widgets); @@ -229,19 +253,6 @@ void *yon_interface_update(main_window *widgets){ gtk_widget_destroy(g_list_nth_data(list,i)); } g_list_free(list);} - if(!getuid()){ - if (boot_run&&!strcmp(boot_run[0],tab->package)){ - yon_tag_add(GTK_BOX(tab->run_tags_box),RUNNING_LABEL,"tag_green",NULL); - gtk_widget_hide(tab->remove_module_button); - gtk_widget_hide(tab->remove_package_button); - gtk_widget_hide(tab->launch_button); - } else if (!yon_char_is_empty(boot_config_run)&&!strcmp(boot_config_run,tab->package)){ - yon_tag_add(GTK_BOX(tab->run_tags_box),BOOT_RUN_LABEL,"tag_orange",NULL); - gtk_widget_hide(tab->launch_button); - gtk_widget_hide(tab->remove_module_button); - gtk_widget_hide(tab->remove_package_button); - } - } gtk_widget_set_can_focus(gtk_widget_get_parent(tab->main_box),0); } yon_char_parsed_free(kernels,kernels_size); @@ -251,6 +262,16 @@ void *yon_interface_update(main_window *widgets){ g_thread_new("tags_install_tread",(GThreadFunc)yon_tab_set_installed,tab); gtk_widget_set_can_focus(gtk_widget_get_parent(tab->main_box),0); } + textdomain(template_ui_LocaleName); + switch (main_config.load_mode){ + case 0: yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + break; + case 1: yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + break; + case 3: yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + break; + } + textdomain(LocaleName); return NULL; } @@ -325,7 +346,7 @@ gboolean on_command_execute_success(GtkWidget *,gint status,main_window *widgets gboolean yon_terminal_get_progress(main_window *widgets){ char *text = vte_terminal_get_text_format(VTE_TERMINAL(widgets->InstallTerminal),VTE_FORMAT_TEXT); - GRegex *regex = g_regex_new("\\d?\\d?\\d%",0,0,NULL); + GRegex *regex = g_regex_new("\\d?\\d%",0,0,NULL); GMatchInfo *match = NULL; g_regex_match(regex,text,0,&match); @@ -770,6 +791,10 @@ additions_kernels_tab *yon_additions_tab_row_new(GtkListBox *target, char *targe tab->install_package_button = yon_gtk_builder_get_widget(builder,"InstallPackageButton"); tab->update_module_button = yon_gtk_builder_get_widget(builder,"ModuleUpdateButton"); tab->update_package_button = yon_gtk_builder_get_widget(builder,"PackageUpdateButton"); + tab->changelog_button = NULL; + tab->launch_button = NULL; + tab->run_tags_box = NULL; + tab->tags_box = NULL; dictionary *dict = NULL; yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets); diff --git a/source/ubl-settings-kernel.h b/source/ubl-settings-kernel.h index cb9f76a..85bb6c5 100644 --- a/source/ubl-settings-kernel.h +++ b/source/ubl-settings-kernel.h @@ -194,6 +194,10 @@ typedef struct { GtkWidget *update_package_button; GtkWidget *install_module_button; GtkWidget *install_package_button; + GtkWidget *changelog_button; + GtkWidget *launch_button; + GtkWidget *run_tags_box; + GtkWidget *tags_box; } additions_kernels_tab; diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 4f48900..ceb7e3f 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -53,6 +53,8 @@ #define PACKAGE_TAB_LABEL _("Package") #define DESCTIPTION_TAB_LABEL _("Description") +#define LOADING_LABEL _("Kernel and additions listst are loading") + #define OPERATION_SUCCESS_LABEL _("Terminal operation success") #define OPERATION_ERROR_LABEL _("Terminal operation failed") #define OPERATION_IN_PROGRESS_LABEL _("Terminal operation in process") diff --git a/ubl-settings-kernel-additions-table-row.glade b/ubl-settings-kernel-additions-table-row.glade index 14a339a..050cd4e 100644 --- a/ubl-settings-kernel-additions-table-row.glade +++ b/ubl-settings-kernel-additions-table-row.glade @@ -1,5 +1,5 @@ - + @@ -15,27 +15,54 @@ False - 5 - 5 - 5 - 15 + 1 + vertical True False - center 5 - vertical - 1 + 15 True False - 5 + center + 5 + 5 + 5 + vertical + 1 - + True False + 5 + + + True + False + + + False + True + 0 + + + + + True + False + Name + False + 0 + + + True + True + 1 + + False @@ -44,54 +71,83 @@ - + True False - Name - False - 0 + 5 + + + True + False + + + + False + True + 0 + + + + + True + False + Module + True + 0 + + + True + True + 1 + + - True + False True 1 - - - False - True - 0 - - - - - True - False - 5 - + True False + 5 + + + True + False + + + + False + True + 0 + + + + + True + False + Package + True + 0 + + + True + True + 1 + + False True - 0 - - - - - True - False - Module - True - 0 - - - True - True - 1 + 2 @@ -102,103 +158,39 @@ - + True False - 5 - - - True - False - - - False - True - 0 - - + 5 + 5 + vertical + 2 - - True - False - Package - True - 0 - - - True - True - 1 - + False True - 2 - - - - - False - True - 1 - - - - - True - False - 5 - vertical - 2 - - - - - - False - True - 3 - - - - - True - False - center - 5 - vertical - 5 - - - Install module - True - True - True - - - - False - True - 0 + 3 True False - 5 + center + 5 + 5 + vertical - + + Install module + True True True - image1 + 5 @@ -209,107 +201,146 @@ - - Remove module - True - True - + + True + False + 5 + + + True + True + 5 + image1 + + + + False + True + 0 + + + + + Remove module + True + True + 5 + + + + True + True + 2 + + - True + False True - 2 + 1 - - - False - True - 1 - - - - - Install package - True - True - True - - - - False - True - 2 - - - - - True - False - 5 - + + Install package + True True True - image2 + 5 False True - 0 + 2 - - Remove package - True - True - + + True + False + 5 + + + True + True + 5 + image2 + + + + False + True + 0 + + + + + Remove package + True + True + 5 + + + + True + True + 2 + + - True + False True - 2 + 3 False True - 3 + end + 4 + + + True + False + 5 + 5 + True + 0 + + + True + True + end + 6 + + + False True - end - 4 - - - - - True - False - True - 0 - - - True - True - end - 6 + 0 + + + False + True + 0 + + + + + True + False + Module + 0 + + + True + True + 1 + + - True + False True 1 - - - False - True - 0 - - - - - True - False - 5 - + True False + 5 + + + True + False + + + + False + True + 0 + + + + + True + False + Package + 0 + + + True + True + 1 + + False True - 0 - - - - - True - False - Module - 0 - - - True - True - 1 + 2 @@ -102,33 +156,15 @@ - + True False - 5 + 5 + 5 + vertical + 2 - - True - False - - - False - True - 0 - - - - - True - False - Package - 0 - - - True - True - 1 - + @@ -137,102 +173,57 @@ 2 - - - False - True - 1 - - - - - True - False - 5 - vertical - 2 - - - - - False - True - 2 - - - - - True - False - 5 - vertical - 2 - - - - - - False - True - 3 - - - - - True - False - 5 - vertical - 2 - - + + True + False + 5 + 5 + vertical + 2 + + + + + + False + True + 3 + - - - False - True - 4 - - - - - True - False - center - 3 - 5 - vertical - 5 - - Install module - True - True - True - + + False + 5 + 5 + vertical + 2 + + + False True - 0 + 4 True False - 5 + center + 5 + 5 + vertical - + + Install module + True True True - image1 + 5 @@ -243,138 +234,177 @@ - - Remove module + + True + False + 5 + + + True + True + 5 + image1 + + + + False + True + 0 + + + + + Remove module + True + True + 5 + + + + True + True + 2 + + + + + False + True + 1 + + + + + Install package + True True True + 5 - True + False True 2 - - - False - True - 1 - - - - - Install package - True - True - True - - - - False - True - 2 - - - - - True - False - 5 - + + True + False + 5 + + + True + True + 5 + image2 + + + + False + True + 0 + + + + + Remove package + True + True + 5 + + + + True + True + 2 + + + + + False + True + 3 + + + + + Changelog True True - image2 + 5 False True - 0 + 4 - - Remove package + + Launch True True + 5 - True + False True - 2 + 5 False True - 3 - - - - - Changelog - True - True - - - - False - True + end 4 - - Launch - True - True - + + True + False + 5 + True + 0 - False + True True - 5 + end + 6 + False True - end - 4 - - - - - True - False - 5 - True - 0 - - - True - True - end - 6 + 0