diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index 80d4e26..2ead469 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1915,6 +1915,18 @@ msgstr "" msgid "About" msgstr "" +msgid "Local system" +msgstr "" + +msgid "Source:" +msgstr "" + +msgid "Version:" +msgstr "" + +msgid "Size:" +msgstr "" + msgid "Documentation" msgstr "" diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index e0d518b..5e1fee9 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -1056,10 +1056,6 @@ msgstr "\"/ublinux-data/\" раздел данных пользователя" msgid "\"/ublinux/\" system section" msgstr "\"/ublinux/\" раздел системы" -#: source/ubl-strings.h:299 -msgid "Size:" -msgstr "Размер:" - #: source/ubl-strings.h:300 msgid "Part label:" msgstr "Метка раздела:" @@ -2047,6 +2043,18 @@ msgstr "" msgid "About" msgstr "О программе" +msgid "Local system" +msgstr "Локальная система" + +msgid "Source:" +msgstr "Источник:" + +msgid "Version:" +msgstr "Версия:" + +msgid "Size:" +msgstr "Размер:" + msgid "File system label" msgstr "Метка файловой системы" diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index 1bd2324..ddcde4b 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -85,6 +85,8 @@ os_row *yon_os_row_new(){ row->TagsBox = yon_gtk_builder_get_widget(builder,"TagsBox"); row->VersionLabel = yon_gtk_builder_get_widget(builder,"VersionLabel"); row->DescriptionLabel = yon_gtk_builder_get_widget(builder,"DescriptionLabel"); + row->SourceLabel = yon_gtk_builder_get_widget(builder,"SourceLabel"); + row->SizeLabel = yon_gtk_builder_get_widget(builder,"SizeLabel"); row->name=NULL; row->modules=NULL; row->version=NULL; @@ -99,21 +101,50 @@ os_row *yon_os_row_new(){ return row; } -void yon_os_row_setup(os_row *row, char *name, char *version,char *tags, char *description){ + +void *yon_modules_list_load(main_window *widgets){ + int size; + config_str modules = yon_config_load(yon_debug_output("%s\n",get_modules_command),&size); + for(int i=1;iversion = parsed[3]; + row->name = parsed[1]; + row->tags = yon_char_replace(parsed[2]," ",", "); + row->description = parsed[5]; + row->widgets=widgets; + row->source = parsed[0]; + + char sizemod; + char *temp = yon_char_from_double(yon_size_long_convert_automatic(atol(parsed[4]),&sizemod)); + char *size_str = yon_size_get_name_from_letter(sizemod); + row->size = yon_char_unite(temp," ", size_str,NULL); + free(temp); + g_idle_add((GSourceFunc)yon_os_component_insert,row); + } + g_idle_add((GSourceFunc)yon_spinner_switch_off,widgets->OSSpinner); + g_thread_exit(NULL); +} + +void yon_os_row_setup(os_row *row, char *name, char *version,char *tags, char *description,char *source, char *size){ row->name = yon_char_new(name); char *description_full = yon_char_new(description); - // if (strlen(description)>100){ - // guint size; - // config_str description_wrapped = yon_char_wrap_to_lines(description,2,&size); - // description_full = yon_char_parsed_to_string(description_wrapped,size,"\n"); - // yon_char_parsed_free(description_wrapped,size); - // } + if (yon_char_is_empty(source)||yon_char_check_begins_with(source,"(local)/")){ + gtk_widget_hide(gtk_widget_get_parent(row->SourceLabel)); + } else { + gtk_label_set_text(GTK_LABEL(row->SourceLabel),source); + } + gtk_label_set_label(GTK_LABEL(row->NameLabel),name); gtk_label_set_label(GTK_LABEL(row->VersionLabel),version); gtk_label_set_label(GTK_LABEL(row->DescriptionLabel),description_full); + gtk_label_set_label(GTK_LABEL(row->SizeLabel),size); yon_kernel_row_setup_tags((kernel_row*)row,tags); + free(size); free(description_full); } @@ -122,7 +153,7 @@ gboolean yon_os_component_insert(struct row_data *row_input){ main_window *widgets = row_input->widgets; gtk_list_box_insert(GTK_LIST_BOX(widgets->OSSoftwareListBox),row->row,-1); - yon_os_row_setup(row,row_input->name,row_input->version,row_input->tags,_(row_input->description)); + yon_os_row_setup(row,row_input->name,row_input->version,row_input->tags,_(row_input->description), row_input->source, row_input->size); char *modules = config(modules_parameter); if (yon_char_is_empty(modules)||yon_char_check_element(modules,row_input->name,",")||!strcmp(modules,"auto")){ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(row->InstallCheck),1); @@ -168,7 +199,7 @@ void yon_os_components_init(main_window *widgets){ gtk_overlay_add_overlay(GTK_OVERLAY(widgets->OSOverlay),widgets->OSSpinner); gtk_spinner_start(GTK_SPINNER(widgets->OSSpinner)); gtk_widget_show(widgets->OSSpinner); - g_thread_new("geag",(GThreadFunc)yon_os_components_setup,widgets); + g_thread_new("geag",(GThreadFunc)yon_modules_list_load,widgets); while(gtk_events_pending()) gtk_main_iteration(); list = gtk_container_get_children(GTK_CONTAINER(widgets->OSSoftwareListBox)); for(iter = list;iter;iter=iter->next){ @@ -226,7 +257,7 @@ gboolean yon_software_insert(struct row_data *row_input){ main_window *widgets = row_input->widgets; gtk_list_box_insert(GTK_LIST_BOX(widgets->AdditionalComponentsList),row->row,-1); - yon_os_row_setup(row,row_input->name,row_input->version,row_input->tags,_(row_input->description)); + yon_os_row_setup(row,row_input->name,row_input->version,row_input->tags,_(row_input->description),NULL,NULL); char *modules = config(modules_extra_parameter); if (yon_char_check_element(modules,row_input->name,",")){ diff --git a/source/ubinstall-gtk-source.c b/source/ubinstall-gtk-source.c index 17dd8b2..1179c12 100644 --- a/source/ubinstall-gtk-source.c +++ b/source/ubinstall-gtk-source.c @@ -2,15 +2,25 @@ void on_source_changed(GtkComboBox *self){ source_element *element = g_object_get_data(G_OBJECT(self),"source_element"); - if (gtk_combo_box_get_active(self)){ - gtk_widget_show(element->PathButton); - gtk_widget_show(element->PathEntry); - gtk_widget_hide(element->DeviceCombo); - } else{ - gtk_widget_hide(element->PathButton); - gtk_widget_hide(element->PathEntry); - gtk_widget_show(element->DeviceCombo); - } + switch (gtk_combo_box_get_active(self)){ + case 0:{ + gtk_widget_hide(element->PathButton); + gtk_widget_hide(element->PathEntry); + gtk_widget_show(element->DeviceCombo); + } break; + case 1: + case 2:{ + gtk_widget_show(element->PathButton); + gtk_widget_show(element->PathEntry); + gtk_widget_hide(element->DeviceCombo); + + } break; + case 3: { + gtk_widget_hide(element->PathButton); + gtk_widget_hide(element->PathEntry); + gtk_widget_hide(element->DeviceCombo); + } + } } void yon_source_update(source_window *window){ @@ -26,6 +36,7 @@ void yon_source_update(source_window *window){ gtk_style_context_add_class(gtk_widget_get_style_context(button),"thin"); gtk_style_context_add_class(gtk_widget_get_style_context(button),"instant"); gtk_widget_show(button); + gtk_box_reorder_child(GTK_BOX(element->MainBox),button,0); } else if (iter->next){ if (element->AddButton) { gtk_widget_destroy(element->AddButton); @@ -95,6 +106,8 @@ void yon_source_element_add(char *key,void*,source_window *window){ } else if (g_regex_match_simple(".*\\.iso",key,G_REGEX_DEFAULT,G_REGEX_MATCH_DEFAULT)){ gtk_entry_set_text(GTK_ENTRY(element->PathEntry),key); gtk_combo_box_set_active(GTK_COMBO_BOX(element->TypeCombo),2); + } else if (!strcmp(key,"local")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(element->TypeCombo),3); } else { gtk_entry_set_text(GTK_ENTRY(element->PathEntry),key); gtk_combo_box_set_active(GTK_COMBO_BOX(element->TypeCombo),1); @@ -192,6 +205,15 @@ void on_source_accept(GtkWidget *,source_window *window){ if (!yon_char_is_empty(sources_list)) free(sources_list); sources_list = temp; } break; + case 3: { + if (yon_char_check_element(sources_list,"local",",")){ + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),VALUE_REPEAT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(element->TypeCombo); + return; + } + char *temp = yon_char_append_element(sources_list,"local",","); + sources_list = temp; + } } } if (!yon_char_is_empty(sources_list)){ diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index c6a8824..72f43f8 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -105,7 +105,7 @@ "/com/ublinux/images/slide-12.png", \ NULL -#define get_modules_command "pacman --color never -Qs ^ubm- | sed -Enr -e 'N;s/\\n/ ;/' -e \"s/^([^\\/]+)\\/([^[:blank:]]+)[[:blank:]]+([^[:blank:]]+)[[:blank:]]+(\\(([^\\)]+)\\)[^\\;]+|[^\\;]*);[[:blank:]]*(.*)/\\2;\\3;\\5;\\6/p\"" +// #define get_modules_command "pacman --color never -Qs ^ubm- | sed -Enr -e 'N;s/\\n/ ;/' -e \"s/^([^\\/]+)\\/([^[:blank:]]+)[[:blank:]]+([^[:blank:]]+)[[:blank:]]+(\\(([^\\)]+)\\)[^\\;]+|[^\\;]*);[[:blank:]]*(.*)/\\2;\\3;\\5;\\6/p\"" #define get_available_modules_command "pacman --color never -Ss ^ubm- | sed -Enr -e 'N;s/\\n/ ;/' -e \"s/^([^\\/]+)\\/([^[:blank:]]+)[[:blank:]]+([^[:blank:]]+)[[:blank:]]+(\\(([^\\)]+)\\)[^\\;]+|[^\\;]*);[[:blank:]]*(.*)/\\2;\\3;\\5;\\6/p\"" #define get_local_module_info_command(target) yon_char_unite("pacman --color never -Sp $(pacman -Ssq '", target, "') --print-format '%n;%v;%d' | grep -v \"^::\"", NULL); @@ -265,6 +265,7 @@ layout && /description:/ {\ #define SYSTEM_LANG_parameter "AUTOINSTALL['ubconfig set [locale] LANG']" #define SYSTEM_LANG_parameter_command "ubconfig --source global get autoinstall AUTOINSTALL['ubconfig set [locale] LANG']" + #define get_localisation_command "ubconfig -ea --source global get [autoinstall] AUTOINSTALL[installer_locale] -- get [autoinstall] AUTOINSTALL['ubconfig set [locale] LANG'] -- get [locale] LANG" #define save_config_command(parameters) yon_char_unite("ubconfig --target system set [autoinstall] AUTOINSTALL[log]=yes ", parameters, "; nice ubinstall2 --debug autoinstall", NULL) @@ -290,6 +291,7 @@ layout && /description:/ {\ #define get_devices_command "ubinstall show --lsdevices" #define get_parts_for_device_command "ubinstall show --lsparts" +#define get_modules_command "ubinstall show --lsmodules" #define config_get_command(target) yon_char_unite("ubconfig -ea --conarg --source ", target, " get [autoinstall] AUTOINSTALL[*] -- get [locale] LANG", NULL) @@ -990,6 +992,8 @@ typedef struct GtkWidget *DescriptionLabel; GtkWidget *VersionLabel; GtkWidget *TagsBox; + GtkWidget *SourceLabel; + GtkWidget *SizeLabel; char *name; char *modules; @@ -1101,6 +1105,8 @@ struct row_data char *name; char *tags; char *description; + char *source; + char *size; }; typedef struct @@ -1348,7 +1354,7 @@ advanced_partition *yon_advanced_partition_new(); void on_advanced_part_remove(GtkWidget *self, main_window *widgets); int yon_advanced_get_part_size(main_window *widgets); void yon_advanced_partition_clear(main_window *widgets); -void yon_os_row_setup(os_row *row, char *name, char *version, char *tags, char *description); +void yon_os_row_setup(os_row *row, char *name, char *version, char *tags, char *description, char *source, char *size); os_row *yon_os_row_new(); void yon_quick_install(GtkWidget *, main_window *widgets); void on_keyboard_layout_chosen(GtkCellRenderer *self, gchar *path, main_window *widgets); @@ -1502,4 +1508,5 @@ gboolean on_time_zone_status_hover(GtkWidget *, GdkEvent *, main_window *widgets gboolean on_time_zone_status_hover_end(GtkWidget *, GdkEvent *, main_window *widgets); void yon_map_update(main_window *widgets, const char *timezone); void on_partition_size_changed(GtkWidget *self, main_window *widgets); -void *yon_partitions_list_load(main_window *widgets); \ No newline at end of file +void *yon_partitions_list_load(main_window *widgets); +void *yon_modules_list_load(main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index f458a96..7a91c44 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -458,9 +458,14 @@ NULL) // #define _LABEL _("Packager") // #define _LABEL _("Build Date") // #define _LABEL _("Validated By") -// #define REBOOT_LABEL _("File system label") -// #define REBOOT_LABEL _("Flags") -// #define REBOOT_LABEL _("Mount point") +// #define _LABEL _("File system label") +// #define _LABEL _("Flags") +// #define _LABEL _("Mount point") +// #define _LABEL _("Local system") +// #define _LABEL _("Local system") +// #define _LABEL _("Source:") +// #define _LABEL _("Version:") +// #define _LABEL _("Size:") #define slide_1_title _("Product ecosystem") #define slide_1_text _("Developed by a team of professionals and successfully presented on the market.\n\ diff --git a/ubinstall-gtk-os-row.glade b/ubinstall-gtk-os-row.glade index e1f0660..87ca83a 100644 --- a/ubinstall-gtk-os-row.glade +++ b/ubinstall-gtk-os-row.glade @@ -17,6 +17,9 @@ True False + 5 + 5 + 5 5 @@ -24,7 +27,7 @@ False 1 vertical - 1 + 5 True @@ -49,19 +52,23 @@ - + True False - Version - True - 15 - False - 0 + center + start + 3 + 5 + 2 + + + False True - 1 + end + 2 diff --git a/ubinstall-gtk-source-element.glade b/ubinstall-gtk-source-element.glade index 3db4218..6e62fea 100644 --- a/ubinstall-gtk-source-element.glade +++ b/ubinstall-gtk-source-element.glade @@ -26,6 +26,7 @@ Device Folder ISO-image + Local system @@ -57,10 +58,11 @@ - + + True True True - image1 + image2 @@ -68,15 +70,15 @@ False True + end 3 - - True + True True - image2 + image1 @@ -84,6 +86,7 @@ False True + end 4 diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 898ae6a..d7ff9c1 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -918,6 +918,7 @@ agreement True False left + False True