diff --git a/source/ubl-settings-kernel.c b/source/ubl-settings-kernel.c index 18865c5..e8083f7 100644 --- a/source/ubl-settings-kernel.c +++ b/source/ubl-settings-kernel.c @@ -200,7 +200,7 @@ void *yon_tab_set_installed(kernels_tab *tab){ } void *yon_interface_update(main_window *widgets){ - gdk_threads_add_idle((GSourceFunc)yon_clear_interface,widgets); + yon_clear_interface(widgets); int kernels_size; config_str kernels = yon_resource_open_file(kernels_path, &kernels_size); @@ -328,6 +328,7 @@ gboolean yon_terminal_get_progress(main_window *widgets){ for (i=0;target[i];i++){ target[i][strlen(target[i])-1]='\0'; percentage = atof(target[i]); + yon_debug_output("%s\n",target[i]); } gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress),percentage/i/100); } @@ -508,6 +509,14 @@ void on_package_install_clicked(GtkWidget *self,dictionary *dict){ } } +void on_module_remove_done(GtkWidget *self, int state, kernels_tab *tab){ + char *command = get_package_is_installed_command(tab->module); + if (!state&&!system(command)){ + yon_ubl_status_box_render(PACKAGE_REMOVED_BUT_NOT_DISABLED_LABEL,BACKGROUND_IMAGE_INFO_TYPE); + } + g_signal_handlers_disconnect_by_func(G_OBJECT(self),on_module_remove_done,tab); +} + void on_module_remove_clicked(GtkWidget *self,dictionary *dict){ main_window *widgets = yon_dictionary_get_data(dict->first,main_window*); kernels_tab *tab = yon_dictionary_get_data(dict->first->next,kernels_tab*); @@ -517,6 +526,7 @@ void on_module_remove_clicked(GtkWidget *self,dictionary *dict){ data->data = NULL; if (yon_confirmation_dialog_call(self,data) == GTK_RESPONSE_ACCEPT){ char *command = remove_command(tab->module); + g_signal_connect(G_OBJECT(widgets->InstallTerminal),"child-exited",G_CALLBACK(on_module_remove_done),tab); yon_command_execute_async(command,widgets); tab->module_installed=0; } diff --git a/source/ubl-settings-kernel.h b/source/ubl-settings-kernel.h index 0f383d2..9eab431 100644 --- a/source/ubl-settings-kernel.h +++ b/source/ubl-settings-kernel.h @@ -241,6 +241,7 @@ dialog_window *yon_dialog_window_new(); void on_module_install_accept(GtkWidget *, dictionary *dict); void on_package_install_accept(GtkWidget *, dictionary *dict); +void on_module_remove_done(GtkWidget *self, int state, kernels_tab *tab); void on_module_install_clicked(GtkWidget *,dictionary *dict); void on_package_install_clicked(GtkWidget *,dictionary *dict); void on_module_remove_clicked(GtkWidget *,dictionary *dict); diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 618fa80..4f48900 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -56,6 +56,7 @@ #define OPERATION_SUCCESS_LABEL _("Terminal operation success") #define OPERATION_ERROR_LABEL _("Terminal operation failed") #define OPERATION_IN_PROGRESS_LABEL _("Terminal operation in process") +#define PACKAGE_REMOVED_BUT_NOT_DISABLED_LABEL _("The package with the module has been removed, but the module is not disabled from the system, as it is used by other system programs. After rebooting, the module will be disabled and removed.") #define MODULE_INSTALL_CONFIRMATION_LABEL(target) yon_char_unite(_("Are you sure want to install kernel")," ",target,"?",NULL) #define PACKAGE_INSTALL_CONFIRMATION_LABEL(target) yon_char_unite(_("Are you sure want to install package")," ",target,"?",NULL) diff --git a/ubl-settings-kernel-additions-table-row.glade b/ubl-settings-kernel-additions-table-row.glade index 66e758e..40c673c 100644 --- a/ubl-settings-kernel-additions-table-row.glade +++ b/ubl-settings-kernel-additions-table-row.glade @@ -14,7 +14,6 @@ com.ublinux.libublsettingsui-gtk.update-cloud-symbolic - True False 5 5 diff --git a/ubl-settings-kernel-table-row.glade b/ubl-settings-kernel-table-row.glade index 29369e1..96ae99f 100644 --- a/ubl-settings-kernel-table-row.glade +++ b/ubl-settings-kernel-table-row.glade @@ -14,7 +14,6 @@ com.ublinux.libublsettingsui-gtk.update-cloud-symbolic - True False 5 5 diff --git a/ubl-settings-kernel.pot b/ubl-settings-kernel.pot index 2dd1815..b2621d6 100644 --- a/ubl-settings-kernel.pot +++ b/ubl-settings-kernel.pot @@ -198,6 +198,10 @@ msgstr "" msgid "Terminal operation in process" msgstr "" +#: source/ubl-strings.h:58 +msgid "The package with the module has been removed, but the module is not disabled from the system, as it is used by other system programs. After rebooting, the module will be disabled and removed." +msgstr "" + #: source/ubl-strings.h:60 msgid "Are you sure want to install kernel" msgstr "" diff --git a/ubl-settings-kernel_ru.po b/ubl-settings-kernel_ru.po index 7ebd11d..5a3311e 100644 --- a/ubl-settings-kernel_ru.po +++ b/ubl-settings-kernel_ru.po @@ -199,6 +199,10 @@ msgstr "Операция терминала завершена с ошибкой msgid "Terminal operation in process" msgstr "Операция терминала в процессе выполнения" +#: source/ubl-strings.h:58 +msgid "The package with the module has been removed, but the module is not disabled from the system, as it is used by other system programs. After rebooting, the module will be disabled and removed." +msgstr "Пакет с модулем удалён, но модуль не отключен от системы, так как используется другими системными программами. После перезагрузки модуль будет отключен и удалён." + #: source/ubl-strings.h:60 msgid "Are you sure want to install kernel" msgstr "Вы хотите установить в систему ядро"